Skip to content

Commit 794e99c

Browse files
authored
Merge pull request #65 from thathoff/release-4
Release Version 4
2 parents acb6593 + 680c0dd commit 794e99c

File tree

7 files changed

+150
-113
lines changed

7 files changed

+150
-113
lines changed

CHANGELOG.md

Lines changed: 60 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
<a name="4.0.0"></a>
2+
# [4.0.0](https://github.com/thathoff/kirby-git-content/compare/v3.0.3...v4.0.0) (2020-10-25)
3+
4+
### Features
5+
- finalize Maintainer switch (see Breaking Changes)
6+
- finalize rename to GitContent (see Breaking Changes)
7+
- Allow POST request to webhooks (thanks to @graphichavoc)
8+
- Install into plugins folder (thanks to @s3ththompson)
9+
- Switch to `coyl/git` PHP git library
10+
- allow configuration of commit message (thanks to @JonasDoebertin)
11+
12+
### BREAKING CHANGES:
13+
- Name Changed to Git Content
14+
- Config options changed (`blankogmbh.gcapc` to `thathoff.git-content`)
15+
- Webhook-URLS changed: `/gcapc/(push|pull)` changed to `/git-content/(push|pull)
16+
17+
118
<a name="3.0.3"></a>
2-
# [3.0.3](https://github.com/blankogmbh/kirby-git-commit-and-push-content/compare/v3.0.2...v3.0.3) (2020-07-12)
19+
# [3.0.3](https://github.com/thathoff/kirby-git-content/compare/v3.0.2...v3.0.3) (2020-07-12)
320

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

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

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

1330
### Bug Fixes
1431

1532
* Only handle files attached to pages
1633

1734

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

2138
### Bug Fixes
2239

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

2643

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

3047

3148
### Features
3249

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

3956

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

4764

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

5168

5269
### Bug Fixes
5370

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

5673

5774

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

6178

6279

6380

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

6784

6885
### Features
6986

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

7289

7390

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

7794

7895
### Bug Fixes
7996

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

8299
### Features
83100

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

86103

87104

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

91108

92109
### Bug Fixes
93110

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

96113
### Features
97114

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

100117

101118

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

105122

106123
### Bug Fixes
107124

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

110127

111128

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

115132

116133
### Bug Fixes
117134

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

120137
### Features
121138

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

124141

125142
### BREAKING CHANGES
126143

127144
* the default branch is not the master anymore
128145

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

132149

133150
### Features
134151

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

138155

139156

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

143160

144161

145162

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

149166

150167
### Bug Fixes
151168

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

155172

156173

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

160177

161178
### Features
162179

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

165182

166183

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

170187

171188
### Features
172189

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

175192

176193

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

180197

181198
### Features
182199

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

185202

186203

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

190207

191208
### Bug Fixes
192209

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

195212

196213

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

200217

201218
### Features
202219

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

205222

206223

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

210227

211228

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ To install this plugin without composer (not recommended):
4242

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

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

5049
### Options
5150

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

5655
This plugin is configurable via [Kirby Options](https://getkirby.com/docs/guide/configuration). Add the
@@ -59,8 +58,8 @@ following entires to your `config.php`.
5958
```php
6059
return [
6160
// other configuration options
62-
'blankogmbh' => [
63-
'gcapc' => [
61+
'thathoff' => [
62+
'git-content' => [
6463
'commit' => true,
6564
],
6665
],
@@ -70,19 +69,27 @@ return [
7069
#### Configuration Options
7170

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

82+
#### Custom Commit Message
83+
84+
By default the commit message is composed from the template `:action:(:item:): :url:`. So for example a change to
85+
the page `example` will be committed with the message `update(page): example`. If you would like to change that
86+
message you can use the `thathoff.git-content.commitMessageTemplate` option to overwrite the template.
87+
88+
#### Configuration Options
8289

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

8895
```

composer.json

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@
44
"type": "kirby-plugin",
55
"license": "MIT",
66
"require": {
7-
"pascalmh/git.php": "^1.0",
8-
"php": ">=7.1.0",
9-
"getkirby/cms": "^3.0.0"
7+
"coyl/git": "^0.1.7",
8+
"getkirby/composer-installer": "^1.1"
109
},
1110
"autoload": {
12-
"files": ["config.php"],
1311
"psr-4": {
14-
"Blanko\\Kirby\\GCAPC\\": "src/"
12+
"Thathoff\\GitContent\\": "src/"
1513
}
1614
},
17-
"repositories": [
18-
{
19-
"type": "vcs",
20-
"url": "https://github.com/thathoff/kirby-git-content"
21-
}
22-
]
15+
"extra": {
16+
"installer-name": "git-content"
17+
}
2318
}

config.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

index.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
<?php
22

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

5-
require_once __DIR__ . '/vendor/autoload.php';
6+
$kirbyGit = new Thathoff\GitContent\KirbyGit();
7+
8+
Kirby::plugin('thathoff/git-content', [
9+
'hooks' => $kirbyGit->getHooks(),
10+
'routes' => $kirbyGit->getRoutes(),
11+
'options' => [
12+
'path' => null,
13+
'branch' => null,
14+
'pull' => null,
15+
'push' => null,
16+
'commit' => null,
17+
'cronHooksEnabled' => null,
18+
'commitMessage' => ':action:(:item:): :url:',
19+
'windowsMode' => null,
20+
'gitBin' => null,
21+
'displayErrors' => null,
22+
]
23+
]);

0 commit comments

Comments
 (0)