Skip to content

Commit

Permalink
Merge pull request #65 from thathoff/release-4
Browse files Browse the repository at this point in the history
Release Version 4
  • Loading branch information
thathoff authored Oct 25, 2020
2 parents acb6593 + 680c0dd commit 794e99c
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 113 deletions.
103 changes: 60 additions & 43 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<a name="4.0.0"></a>
# [4.0.0](https://github.com/thathoff/kirby-git-content/compare/v3.0.3...v4.0.0) (2020-10-25)

### Features
- finalize Maintainer switch (see Breaking Changes)
- finalize rename to GitContent (see Breaking Changes)
- Allow POST request to webhooks (thanks to @graphichavoc)
- Install into plugins folder (thanks to @s3ththompson)
- Switch to `coyl/git` PHP git library
- allow configuration of commit message (thanks to @JonasDoebertin)

### BREAKING CHANGES:
- Name Changed to Git Content
- Config options changed (`blankogmbh.gcapc` to `thathoff.git-content`)
- Webhook-URLS changed: `/gcapc/(push|pull)` changed to `/git-content/(push|pull)


<a name="3.0.3"></a>
# [3.0.3](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v3.0.2...v3.0.3) (2020-07-12)
# [3.0.3](https://github.com/thathoff/kirby-git-content/compare/v3.0.2...v3.0.3) (2020-07-12)

The maintainer has switched, be prepared for config option name changes in version 4 which will be released shortly.

Expand All @@ -8,15 +25,15 @@ The maintainer has switched, be prepared for config option name changes in versi
* Plugin works with Kirby 3.4 (#66)

<a name="3.0.2"></a>
# [3.0.2](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v3.0.1...v3.0.2) (2020-03-06)
# [3.0.2](https://github.com/thathoff/kirby-git-content/compare/v3.0.1...v3.0.2) (2020-03-06)

### Bug Fixes

* Only handle files attached to pages


<a name="3.0.1"></a>
# [3.0.1](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v3.0.0...v3.0.1) (2019-09-24)
# [3.0.1](https://github.com/thathoff/kirby-git-content/compare/v3.0.0...v3.0.1) (2019-09-24)

### Bug Fixes

Expand All @@ -25,16 +42,16 @@ The maintainer has switched, be prepared for config option name changes in versi


<a name="3.0.0"></a>
# [3.0.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v2.2.2...v3.0.0) (2019-09-24)
# [3.0.0](https://github.com/thathoff/kirby-git-content/compare/v2.2.2...v3.0.0) (2019-09-24)


### Features

* add support for kirby 3 ([f4393b8](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/f4393b8))
* commit by default when plugin is installed ([48cd099](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/48cd099))
* install Git.php with composer only ([6d1b9d3](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/6d1b9d3))
* only log errors by default ([3f4e771](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/3f4e771))
* use users email and name as commit author ([ebcba17](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/ebcba17))
* add support for kirby 3 ([f4393b8](https://github.com/thathoff/kirby-git-content/commit/f4393b8))
* commit by default when plugin is installed ([48cd099](https://github.com/thathoff/kirby-git-content/commit/48cd099))
* install Git.php with composer only ([6d1b9d3](https://github.com/thathoff/kirby-git-content/commit/6d1b9d3))
* only log errors by default ([3f4e771](https://github.com/thathoff/kirby-git-content/commit/3f4e771))
* use users email and name as commit author ([ebcba17](https://github.com/thathoff/kirby-git-content/commit/ebcba17))


### BREAKING CHANGES
Expand All @@ -46,166 +63,166 @@ The maintainer has switched, be prepared for config option name changes in versi


<a name="2.2.2"></a>
## [2.2.2](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v2.2.1...v2.2.2) (2018-01-24)
## [2.2.2](https://github.com/thathoff/kirby-git-content/compare/v2.2.1...v2.2.2) (2018-01-24)


### Bug Fixes

* rename main file tow work with new install method ([2e96543](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/2e96543))
* rename main file tow work with new install method ([2e96543](https://github.com/thathoff/kirby-git-content/commit/2e96543))



<a name="2.2.1"></a>
## [2.2.1](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v2.2.0...v2.2.1) (2018-01-24)
## [2.2.1](https://github.com/thathoff/kirby-git-content/compare/v2.2.0...v2.2.1) (2018-01-24)




<a name="2.2.0"></a>
# [2.2.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v2.1.0...v2.2.0) (2017-08-21)
# [2.2.0](https://github.com/thathoff/kirby-git-content/compare/v2.1.0...v2.2.0) (2017-08-21)


### Features

* track changes made to site.txt ([7aaf3be](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/7aaf3be))
* track changes made to site.txt ([7aaf3be](https://github.com/thathoff/kirby-git-content/commit/7aaf3be))



<a name="2.1.0"></a>
# [2.1.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v2.0.1...v2.1.0) (2017-03-29)
# [2.1.0](https://github.com/thathoff/kirby-git-content/compare/v2.0.1...v2.1.0) (2017-03-29)


### Bug Fixes

* init repo if no branch is specified ([f69515e](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/f69515e))
* init repo if no branch is specified ([f69515e](https://github.com/thathoff/kirby-git-content/commit/f69515e))

### Features

* do not initialise repository twice ([f32e90e](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/f32e90e))
* do not initialise repository twice ([f32e90e](https://github.com/thathoff/kirby-git-content/commit/f32e90e))



<a name="2.0.2"></a>
## [2.0.2](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v2.0.1...v2.0.2) (2017-03-29)
## [2.0.2](https://github.com/thathoff/kirby-git-content/compare/v2.0.1...v2.0.2) (2017-03-29)


### Bug Fixes

* init repo if no branch is specified ([f69515e](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/f69515e))
* init repo if no branch is specified ([f69515e](https://github.com/thathoff/kirby-git-content/commit/f69515e))

### Features

* do not initialise repository twice ([f32e90e](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/f32e90e))
* do not initialise repository twice ([f32e90e](https://github.com/thathoff/kirby-git-content/commit/f32e90e))



<a name="2.0.1"></a>
## [2.0.1](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/1.5.0...v2.0.1) (2017-03-29)
## [2.0.1](https://github.com/thathoff/kirby-git-content/compare/1.5.0...v2.0.1) (2017-03-29)


### Bug Fixes

* allow usage of currently checked out branch ([25b57a4](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/25b57a4))
* allow usage of currently checked out branch ([25b57a4](https://github.com/thathoff/kirby-git-content/commit/25b57a4))



<a name="2.0.0"></a>
# [2.0.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/1.4.2...v2.0.0) (2017-02-20)
# [2.0.0](https://github.com/thathoff/kirby-git-content/compare/1.4.2...v2.0.0) (2017-02-20)


### Bug Fixes

* use slashes for url, not DS ([d4e24b7](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/d4e24b7))
* use slashes for url, not DS ([d4e24b7](https://github.com/thathoff/kirby-git-content/commit/d4e24b7))

### Features

* allow usage of currently checked out branch ([033d10f](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/033d10f))
* allow usage of currently checked out branch ([033d10f](https://github.com/thathoff/kirby-git-content/commit/033d10f))


### BREAKING CHANGES

* the default branch is not the master anymore

<a name="1.5.0"></a>
# [1.5.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/1.4.2...v1.5.0) (2017-02-24)
# [1.5.0](https://github.com/thathoff/kirby-git-content/compare/1.4.2...v1.5.0) (2017-02-24)


### Features

* implemented `gcapc-path` configuration ([151e6d1](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/151e6d1))
* improved error handling ([ff36ea4](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/ff36ea4))
* implemented `gcapc-path` configuration ([151e6d1](https://github.com/thathoff/kirby-git-content/commit/151e6d1))
* improved error handling ([ff36ea4](https://github.com/thathoff/kirby-git-content/commit/ff36ea4))



<a name="1.4.2"></a>
## [1.4.2](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v1.4.1...v1.4.2) (2017-02-09)
## [1.4.2](https://github.com/thathoff/kirby-git-content/compare/v1.4.1...v1.4.2) (2017-02-09)




<a name="1.4.1"></a>
## [1.4.1](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v1.4.0...v1.4.1) (2017-02-08)
## [1.4.1](https://github.com/thathoff/kirby-git-content/compare/v1.4.0...v1.4.1) (2017-02-08)


### Bug Fixes

* push/pull success messages ([76bc9b9](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/76bc9b9))
* require Git.php ([d319cbd](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/d319cbd))
* push/pull success messages ([76bc9b9](https://github.com/thathoff/kirby-git-content/commit/76bc9b9))
* require Git.php ([d319cbd](https://github.com/thathoff/kirby-git-content/commit/d319cbd))



<a name="1.4.0"></a>
# [1.4.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v1.3.0...v1.4.0) (2017-01-17)
# [1.4.0](https://github.com/thathoff/kirby-git-content/compare/v1.3.0...v1.4.0) (2017-01-17)


### Features

* use composer dependency if applicable ([bd45077](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/bd45077))
* use composer dependency if applicable ([bd45077](https://github.com/thathoff/kirby-git-content/commit/bd45077))



<a name="1.3.0"></a>
# [1.3.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v1.2.0...v1.3.0) (2016-07-10)
# [1.3.0](https://github.com/thathoff/kirby-git-content/compare/v1.2.0...v1.3.0) (2016-07-10)


### Features

* add panel widget ([6a6e3fd](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/6a6e3fd))
* add panel widget ([6a6e3fd](https://github.com/thathoff/kirby-git-content/commit/6a6e3fd))



<a name="1.2.0"></a>
# [1.2.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v1.1.1...v1.2.0) (2016-06-27)
# [1.2.0](https://github.com/thathoff/kirby-git-content/compare/v1.1.1...v1.2.0) (2016-06-27)


### Features

* add cron-hooks-enabled option ([2118b28](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/2118b28))
* add cron-hooks-enabled option ([2118b28](https://github.com/thathoff/kirby-git-content/commit/2118b28))



<a name="1.1.1"></a>
## [1.1.1](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v1.1.0...v1.1.1) (2016-04-21)
## [1.1.1](https://github.com/thathoff/kirby-git-content/compare/v1.1.0...v1.1.1) (2016-04-21)


### Bug Fixes

* make branch available for git pull and git push ([d1e17c3](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/d1e17c3))
* make branch available for git pull and git push ([d1e17c3](https://github.com/thathoff/kirby-git-content/commit/d1e17c3))



<a name="1.1.0"></a>
# [1.1.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v1.0.0...v1.1.0) (2016-04-21)
# [1.1.0](https://github.com/thathoff/kirby-git-content/compare/v1.0.0...v1.1.0) (2016-04-21)


### Features

* add option to manually push and pull content ([833960f](https://github.com/blankogmbh/kirby-git-commit-and-push-content/commit/833960f))
* add option to manually push and pull content ([833960f](https://github.com/thathoff/kirby-git-content/commit/833960f))



<a name="1.0.0"></a>
# [1.0.0](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v0.0.7...v1.0.0) (2015-12-17)
# [1.0.0](https://github.com/thathoff/kirby-git-content/compare/v0.0.7...v1.0.0) (2015-12-17)



Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ To install this plugin without composer (not recommended):

- [download the source code](https://github.com/thathoff/kirby-git-content/archive/master.zip)
- run `composer install` locally
- run `composer remove getkirby/cms` (See https://github.com/getkirby/getkirby.com/issues/138)
- copy the folder to your site/plugins folder.

We might create downloadable releases in the future which will make the above steps unnecessary.

### Options

By default this plugin just commits changes to the content repository. It’s recommended to setup a cron job
which calls `yourdomain.com/gcapc/push`. This will push changes to the remote repository. By using a cron job
which calls `yourdomain.com/git-content/push`. This will push changes to the remote repository. By using a cron job
saving pages in panel is a lot faster then enabling the `push` option which will push changes after every commit.

This plugin is configurable via [Kirby Options](https://getkirby.com/docs/guide/configuration). Add the
Expand All @@ -59,8 +58,8 @@ following entires to your `config.php`.
```php
return [
// other configuration options
'blankogmbh' => [
'gcapc' => [
'thathoff' => [
'git-content' => [
'commit' => true,
],
],
Expand All @@ -70,19 +69,27 @@ return [
#### Configuration Options

- `path` (String): Path to the repository, (default: `kirby()->root("content")`)
- `branch` (String): branch name to be checked out (defaut: currently checked out branch)
- `branch` (String): branch name to be checked out (default: currently checked out branch)
- `pull` (Boolean): Pull remote changes first? (default: `false`)
- `commit` (Boolean): Commit your changes? (default: `true`)
- `push` (Boolean): Push your changes to remote? (default: `false`)
- `cronHooksEnabled` (Boolean): Whether `/gcapc/push` and `/gcapc/pull` endpoints are enabled or not. (default: `true`)
- `commitMessageTemplate` (String): Configure the template for the commit message (default: `:action:(:item:): :url:`)
- `cronHooksEnabled` (Boolean): Whether `/git-content/push` and `/git-content/pull` endpoints are enabled or not. (default: `true`)
- `displayErrors` (Boolean): Display git errors when saving pages (default: `false`)
- `gitBin` (String): Path to the `git` binary, [See Git.php](http://kbjr.github.io/Git.php/) `Git::set_bin(string $path)`
- `windowsMode` (Boolean): [See Git.php](http://kbjr.github.io/Git.php/) `Git::windows_mode()` (default: `false`)

#### Custom Commit Message

By default the commit message is composed from the template `:action:(:item:): :url:`. So for example a change to
the page `example` will be committed with the message `update(page): example`. If you would like to change that
message you can use the `thathoff.git-content.commitMessageTemplate` option to overwrite the template.

#### Configuration Options

## Git LFS
Your repository might increase over time, by adding Images, Audio, Video, Binaries, etc.
cloning and updating your content repostory can take a lot of time. If you are able to use
cloning and updating your content repository can take a lot of time. If you are able to use
[Git LFS](https://git-lfs.github.com/) you probably should. Here is what the .gitattributes-File could look like:

```
Expand Down
17 changes: 6 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,15 @@
"type": "kirby-plugin",
"license": "MIT",
"require": {
"pascalmh/git.php": "^1.0",
"php": ">=7.1.0",
"getkirby/cms": "^3.0.0"
"coyl/git": "^0.1.7",
"getkirby/composer-installer": "^1.1"
},
"autoload": {
"files": ["config.php"],
"psr-4": {
"Blanko\\Kirby\\GCAPC\\": "src/"
"Thathoff\\GitContent\\": "src/"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/thathoff/kirby-git-content"
}
]
"extra": {
"installer-name": "git-content"
}
}
19 changes: 0 additions & 19 deletions config.php

This file was deleted.

22 changes: 20 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
<?php

// Support manual installation inside kirby’s plugin directory
// support manual installation in plugins folder
@include_once __DIR__ . '/vendor/autoload.php';

require_once __DIR__ . '/vendor/autoload.php';
$kirbyGit = new Thathoff\GitContent\KirbyGit();

Kirby::plugin('thathoff/git-content', [
'hooks' => $kirbyGit->getHooks(),
'routes' => $kirbyGit->getRoutes(),
'options' => [
'path' => null,
'branch' => null,
'pull' => null,
'push' => null,
'commit' => null,
'cronHooksEnabled' => null,
'commitMessage' => ':action:(:item:): :url:',
'windowsMode' => null,
'gitBin' => null,
'displayErrors' => null,
]
]);
Loading

0 comments on commit 794e99c

Please sign in to comment.