Skip to content

Commit 5efc7fc

Browse files
authored
Merge pull request #74 from kakawait/refactor/config-keys
Uniformise config key case
2 parents 433f93d + 8d0833d commit 5efc7fc

File tree

13 files changed

+159
-90
lines changed

13 files changed

+159
-90
lines changed

CHANGELOG.md

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,76 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.2.0-ALPHA](https://github.com/kakawait/hugo-tranquilpeak-theme/milestone/2) - TBD
6+
7+
### Breaking changes
8+
9+
Replace
10+
11+
```toml
12+
[author]
13+
gravatar_email = "[email protected]"
14+
google_plus = "+YourGooglePlus"
15+
```
16+
17+
to
18+
19+
```toml
20+
[author]
21+
gravatarEmail = "[email protected]"
22+
googlePlus = "+YourGooglePlus"
23+
```
24+
25+
Replace
26+
27+
```toml
28+
[params]
29+
clear_reading = ...
30+
hierarchical_categories = ...
31+
sidebar_behavior = ...
32+
cover_image = ...
33+
image_gallery = ...
34+
thumbnail_image = ...
35+
thumbnail_image_position = ...
36+
auto_thumbnail_image = ...
37+
fb_admin_ids = ...
38+
fb_app_id = ...
39+
category_pagination = ...
40+
archive_pagination = ...
41+
tag_pagination = ...
42+
```
43+
44+
to
45+
46+
```toml
47+
[params]
48+
clearReading = ...
49+
hierarchicalCategories = ...
50+
sidebarBehavior = ...
51+
coverImage = ...
52+
imageGallery = ...
53+
thumbnailImage = ...
54+
thumbnailImagePosition = ...
55+
autoThumbnailImage = ...
56+
fbAdminIds = ...
57+
fbAppId = ...
58+
categoryPagination = ...
59+
archivePagination = ...
60+
tagPagination = ...
61+
```
62+
63+
Replace
64+
65+
```
66+
[params.header.right_link]
67+
```
68+
69+
to
70+
71+
```
72+
[params.header.rightLink]
73+
```
74+
575
## [0.1.4-ALPHA](https://github.com/kakawait/hugo-tranquilpeak-theme/milestone/9) - 16 nov 2016
676

777
- Remove migration scripts ([#45](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/45))
@@ -15,15 +85,15 @@ All notable changes to this project will be documented in this file.
1585
- Fix *archives* pages generation by creating `archive` taxonomy ([#31](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/31))
1686
- Use `slug` instead of `title` for *permalink* urls ([#33](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/33))
1787

18-
### Migration
88+
### Breaking changes
1989

2090
- [archive page return 404](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/31)
2191

2292
Add
2393

2494
```toml
2595
[taxonomies]
26-
archive = "archives"
96+
archive = "archives"
2797
```
2898

2999
## [0.1.1-ALPHA](https://github.com/kakawait/hugo-tranquilpeak-theme/milestone/6) - 13 nov 2016
@@ -32,15 +102,15 @@ Add
32102
- **[Breaking changes]** Changes *Google Analytics* config key from `params.google_analytics_id` to official `googleAnalytics` ([#21](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/21))
33103
- Add parameter to choose between sync/async loading of *Google Analytics* `params.ga.async` ([#21](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/21))
34104

35-
### Migration
105+
### Breaking changes
36106

37107
- [Migrate google analytics](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/21)
38108

39109
Replace
40110

41111
```toml
42112
[params]
43-
google_analytics_id = "UA-XXX-X"
113+
google_analytics_id = "UA-XXX-X"
44114
```
45115

46116
to (top level)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Please all the credit should be attributed to [original *Hexo* version](https://
7575
- [ ] Duoshuo
7676
- [ ] Baidu analytics
7777
- [ ] Algolia (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/8)
78-
- [ ] Pagination custumization `tag_pagination`, `category_pagination` and `archive_pagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17)
78+
- [ ] Pagination custumization `tagPagination`, `categoryPagination` and `archivePagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17)
7979

8080
**ATTENTION** following features will not be possible due to *Hugo* limitations
8181

docs/user.md

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ If you want to report a bug or ask a question, [create an issue](https://github.
9393
- [ ] Duoshuo
9494
- [ ] Baidu analytics
9595
- [ ] Algolia (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/8)
96-
- [ ] Pagination custumization `tag_pagination`, `category_pagination` and `archive_pagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17)
96+
- [ ] Pagination custumization `tagPagination`, `categoryPagination` and `archivePagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17)
9797

9898
**ATTENTION** following features will not be possible due to *Hugo* limitations
9999

@@ -290,7 +290,7 @@ The right link of the header is customizable. You can add a link (as an icon) at
290290
E.g to display a shortcut to open algolia search window :
291291

292292
```toml
293-
[params.header.right_link]
293+
[params.header.rightLink]
294294
class = "open-algolia-search"
295295
icon = "search"
296296
url = "/#search"
@@ -311,64 +311,61 @@ E.g to display a shortcut to open algolia search window :
311311
job = "Java backend developer"
312312
location = "France"
313313
# Your Gravatar email. Overwrite `author.picture` everywhere in the blog
314-
gravatar_email = "[email protected]"
314+
gravatarEmail = "[email protected]"
315315
# Your profile picture
316-
# Overwritten by your gravatar image if `author.gravatar` is filled
316+
# Overwritten by your gravatar image if `author.gravatarEmail` is filled
317317
picture = "https://cdn1.iconfinder.com/data/icons/ninja-things-1/1772/ninja-simple-512.png"
318318
# Your Twitter username without the @. E.g : tranquilpeak
319319
twitter = "thibaudlepretre"
320320
# Your google plus profile id. E.g : +ThibaudLepretre or 114625208755123718311
321-
google_plus = "+ThibaudLepretre"
321+
googlePlus = "+ThibaudLepretre"
322322
```
323323

324-
| Variable | Description |
325-
|----------------|--------------------------------------------------------------------------------------|
326-
| name | Your name |
327-
| gravatar_email | This address will be used to get your gravatar image if you activate gravatar option |
328-
| bio | Your biography (Markdown and HTML supported) |
329-
| job | Your job |
330-
| location | Your location |
331-
| picture | Your profile picture. Overwritten by your gravatar image if gravatar email is filled |
332-
| twitter | Your Twitter username without the @. E.g : `thibaudlepretre` |
333-
| google_plus | Your google plus profile id. E.g : `+ThibaudLepretre` or `114625208755123718311` |
324+
| Variable | Description |
325+
|-----------------|--------------------------------------------------------------------------------------|
326+
| name | Your name |
327+
| gravatarEmail | This address will be used to get your gravatar image if you activate gravatar option |
328+
| bio | Your biography (Markdown and HTML supported) |
329+
| job | Your job |
330+
| location | Your location |
331+
| picture | Your profile picture. Overwritten by your gravatar image if gravatar email is filled |
332+
| twitter | Your Twitter username without the @. E.g : `thibaudlepretre` |
333+
| googlePlus | Your google plus profile id. E.g : `+ThibaudLepretre` or `114625208755123718311` |
334334

335335
#### Customization
336336

337337
**ATTENTION** not all customizations are documented here, you may checkout [sample config.toml](https://github.com/kakawait/hugo-tranquilpeak-theme/blob/master/exampleSite/config.toml).
338338

339339
```toml
340340
[params]
341-
sidebar_behavior = 1
342-
thumbnail_image = true
343-
thumbnail_image_position = "right"
344-
auto_thumbnail_image = true
345-
cover_image = "cover.jpg"
341+
sidebarBehavior = 1
342+
thumbnailImage = true
343+
thumbnailImagePosition = "right"
344+
autoThumbnailImage = true
345+
coverImage = "cover.jpg"
346346
favicon =
347-
image_gallery = true
348-
archive_pagination = true
349-
category_pagination = true
350-
tag_pagination = true
351-
hierarchical_categories = true
347+
imageGallery = true
348+
hierarchicalCategories = true
352349
```
353350

354351
| Variable | Description |
355352
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
356-
| sidebar_behavior | Define the behavior of the header and sidebar :<ul><li>1: Display extra large sidebar on extra large screen, large sidebar on large screen, medium sidebar on medium screen and header bar on small screen and extra large sidebar is swiped on extra large screen and large sidebar on all lower screens when open button is clicked (default)</li><li>2: Display large sidebar on extra large & large screen, medium sidebar on medium screen and header bar on small screen and large sidebar is swiped when open button is clicked</li><li>3: Display medium sidebar on large and medium screen and header bar on small screen and medium sidebar is swiped when open button is clicked</li><li>4: Display header bar on all screens, extra large sidebar is swiped on extra large screen and large sidebar is swiped on all lower screens</li><li>5: Display header bar on all screens and large sidebar is swiped on large screen</li><li>6: isplay header bar on all screens and medium sidebar is swiped</li></ul> |
357-
| clear_reading | Hide sidebar on all article page to let article take full width to improve reading, and enjoy wide images and cover images. Useless if `sidebar_behavior` is equal to `3` or `4`. (true: enable, false: disable). Default behavior : `theme.clear_reading` value in theme configuration file. |
358-
| thumbnail_image | Display thumbnail image of each post on index pages |
359-
| thumbnail_image_position | Display thumbnail image at the right of title in index pages (`right`, `left` or `bottom`). Set this value to `right` if you have old posts to keep the old style on them and define `thumbnailImagePosition` on a post to overwrite this setting. (Default : `right`) |
360-
| auto_thumbnail_image | Automatically select the cover image or the first photo from the gallery of a post if there is no thumbnail image as the thumbnail image. Set this value to `true` if you have old posts that use the cover image or the first photo as the thumbnail image and set `autoThumbnailImage` to `false` on a post to overwrite this setting. (Default : `true`) |
361-
| cover_image | Your blog cover picture. **I STRONGLY recommend you to use a CDN to speed up loading of pages. There is many free CDN like Cloudinary or you can also use indirectly by using services like Google Photos.** |
353+
| sidebarBehavior | Define the behavior of the header and sidebar :<ul><li>1: Display extra large sidebar on extra large screen, large sidebar on large screen, medium sidebar on medium screen and header bar on small screen and extra large sidebar is swiped on extra large screen and large sidebar on all lower screens when open button is clicked (default)</li><li>2: Display large sidebar on extra large & large screen, medium sidebar on medium screen and header bar on small screen and large sidebar is swiped when open button is clicked</li><li>3: Display medium sidebar on large and medium screen and header bar on small screen and medium sidebar is swiped when open button is clicked</li><li>4: Display header bar on all screens, extra large sidebar is swiped on extra large screen and large sidebar is swiped on all lower screens</li><li>5: Display header bar on all screens and large sidebar is swiped on large screen</li><li>6: isplay header bar on all screens and medium sidebar is swiped</li></ul> |
354+
| clearReading | Hide sidebar on all article page to let article take full width to improve reading, and enjoy wide images and cover images. Useless if `sidebarBehavior` is equal to `3` or `4`. (true: enable, false: disable). Default behavior : `params.clearReading` value in theme configuration file. |
355+
| thumbnailImage | Display thumbnail image of each post on index pages |
356+
| thumbnailImagePosition | Display thumbnail image at the right of title in index pages (`right`, `left` or `bottom`). Set this value to `right` if you have old posts to keep the old style on them and define `thumbnailImagePosition` on a post to overwrite this setting. (Default : `right`) |
357+
| autoThumbnailImage | Automatically select the cover image or the first photo from the gallery of a post if there is no thumbnail image as the thumbnail image. Set this value to `true` if you have old posts that use the cover image or the first photo as the thumbnail image and set `autoThumbnailImage` to `false` on a post to overwrite this setting. (Default : `true`) |
358+
| coverImage | Your blog cover picture. **I STRONGLY recommend you to use a CDN to speed up loading of pages. There is many free CDN like Cloudinary or you can also use indirectly by using services like Google Photos.** |
362359
| favicon | Your favicon path |
363-
| image_gallery | Display an image gallery at the end of a post which have `photos` variables. (false: disabled, true: enabled) |
364-
| hierarchical_categories | Define categories will create hierarchy between parents: `categories = ["foo", "bar"]` will consider "bar" a sub-category of "foo". If false it will flat categories. |
360+
| imageGallery | Display an image gallery at the end of a post which have `photos` variables. (false: disabled, true: enabled) |
361+
| hierarchicalCategories | Define categories will create hierarchy between parents: `categories = ["foo", "bar"]` will consider "bar" a sub-category of "foo". If false it will flat categories. |
365362

366363
E.g :
367-
A category page look like this with `hierarchical_categories = true` :
368-
![hierarchical_categories true](img/with_hierarchical_categories.png)
364+
A category page look like this with `hierarchicalCategories = true` :
365+
![hierarchicalCategories true](img/with_hierarchical_categories.png)
369366

370-
The same page with `hierarchical_categories = false`:
371-
![hierarchical_categories false](img/without_hierarchical_categories.png)
367+
The same page with `hierarchicalCategories = false`:
368+
![hierarchicalCategories false](img/without_hierarchical_categories.png)
372369

373370
#### Integrated services
374371

@@ -379,22 +376,22 @@ googleAnalytics =
379376

380377
```toml
381378
[author]
382-
gravatar_email =
379+
gravatarEmail =
383380
```
384381

385382
```toml
386383
[params]
387-
fb_admin_ids =
388-
fb_app_id =
384+
fbAdminIds =
385+
fbAppId =
389386
```
390387

391388
| Variable | Description |
392389
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
393390
| disqusShortname | Your Disqus shortname. |
394-
| gravatar_email | Your gravatar email. Overwrite `author.picture` everywhere in the blog |
391+
| gravatarEmail | Your gravatar email. Overwrite `author.picture` everywhere in the blog |
395392
| googleAnalytics | Your Google analystics web property ID : UA-XXXXX-X |
396-
| fb_admin_ids | Your Facebook user ids used to connect your blog with your facebook user accounts (Facebook Insights). Separate ids with comma. E.g : `9830047,1003342`. Visit [Facebook docs](https://developers.facebook.com/docs/platforminsights/domains) for more information. |
397-
| fb_app_id | Your Facebook app id used to connect your blog with your facebook app account (Facebook Insights). E.g : `9841307`. Visit [Facebook docs](https://developers.facebook.com/docs/platforminsights/domains) for more information. |
393+
| fbAdminIds | Your Facebook user ids used to connect your blog with your facebook user accounts (Facebook Insights). Use array syntax. E.g : `[9830047, 1003342]`. Visit [Facebook docs](https://developers.facebook.com/docs/platforminsights/domains) for more information. |
394+
| fbAppId | Your Facebook app id used to connect your blog with your facebook app account (Facebook Insights). E.g : `9841307`. Visit [Facebook docs](https://developers.facebook.com/docs/platforminsights/domains) for more information. |
398395

399396
### Enable pages ###
400397

@@ -488,10 +485,10 @@ comments: false
488485
|---|---|
489486
|disqusIdentifier|Define a unique string which is used to look up a page's thread in the Disqus system.|
490487
|keywords|Define keywords for search engines. you can also define global keywords in Hugo configuration file.|
491-
|clearReading|Hide sidebar on all article page to let article take full width to improve reading, and enjoy wide images and cover images. Useless if `theme.sidebar_behavior` is equal to `3` or `4`. (true: enable, false: disable). Default behavior : `theme.clear_reading` value in theme configuration file.|
492-
|autoThumbnailImage|Automatically select the cover image or the first photo from the gallery of a post if there is no thumbnail image as the thumbnail image. `autoThumbnailImage` overwrite the setting `auto_thumbnail_image` in the theme configuration file|
488+
|clearReading|Hide sidebar on all article page to let article take full width to improve reading, and enjoy wide images and cover images. Useless if `params.sidebarBehavior` is equal to `3` or `4`. (true: enable, false: disable). Default behavior : `params.clearReading` value in theme configuration file.|
489+
|autoThumbnailImage|Automatically select the cover image or the first photo from the gallery of a post if there is no thumbnail image as the thumbnail image. `autoThumbnailImage` overwrite the setting `autoThumbnailImage` in the theme configuration file|
493490
|thumbnailImage|Image displayed in index view.|
494-
|thumbnailImagePosition|Display thumbnail image at the right of title in index pages (`right`, `left` or `bottom`). `thumbnailImagePosition` overwrite the setting `thumbnail_image_position` in the theme configuration file|
491+
|thumbnailImagePosition|Display thumbnail image at the right of title in index pages (`right`, `left` or `bottom`). `thumbnailImagePosition` overwrite the setting `thumbnailImagePosition` in the theme configuration file|
495492
|metaAlignment|Meta (title, date and categories) alignment (right, left or center). Default behavior : left|
496493
|coverImage|Image displayed in full size at the top of your post in post view. If thumbnail image is not configured, cover image is also used as thumbnail image. Check the beautiful demo here : [Cover image demo](https://tranquilpeak.kakawait.com/2015/05/cover-image-showcase/)|
497494
|coverSize|`partial`: cover image take a part of the screen height (60%), `full`: cover image take the entire screen height.|

0 commit comments

Comments
 (0)