Skip to content

Commit 7c33939

Browse files
authored
Merge pull request #194 from kakawait/develop
Release 0.4.0-BETA
2 parents b287442 + 5fd0df9 commit 7c33939

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2624
-453
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,47 @@
22

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

5+
## [0.4.0-BETA](https://github.com/kakawait/hugo-tranquilpeak-theme/milestone/4) - 10 sep 2017
6+
7+
- Fix menu ordering ([#149](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/149), [#150](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/150))
8+
- Synch from Hexo Tranquilpeak theme 1.10 ([#147](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/147), [#132](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/132))
9+
- Italian translation
10+
- `showMeta` & `showActions` (see user doc for more details)
11+
- Extensible _Sharing options_ (see user doc for more details)
12+
- XLG side bar bug on Edge
13+
- _OLDER POSTS_ Button Overlaps Sidebar
14+
- Print media queries
15+
- Load external resources using SRI ([#159](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/159))
16+
- revamp HLjs usage to fix highligthing bugs ([#154](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/154), [#160](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/160))
17+
- Improve `customJS` and `customCSS`
18+
- Now support both abs and rel url ([#155](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/155))
19+
- Add more customization than just url ([#163](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/163))
20+
- Add theme version on meta tag ([#140](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/140))
21+
22+
### Breaking changes
23+
24+
In order to fix menu ordering, you have to upgrade you `config.toml` to avoid any menu weight equals to `0`. See https://github.com/kakawait/hugo-tranquilpeak-theme/commit/f4feb3261381bd9a77be4da66d8466322886eb22#diff-991d2a2fe208cdee83955ad6e9a323a7 to get an full example.
25+
26+
With new _Sharing options_ that allow extensible list of sharing options, there is no more hardcoded sharing option inside template. Thus sharing options: Facebook, Twitter and Google plus should be reported inside your `config.toml` (you can checkout `exampleSite/config.toml` to see sample):
27+
28+
```toml
29+
[params]
30+
[[params.sharingOptions]]
31+
name = "Facebook"
32+
icon = "fa-facebook-official"
33+
url = "https://www.facebook.com/sharer/sharer.php?u=%s"
34+
35+
[[params.sharingOptions]]
36+
name = "Twitter"
37+
icon = "fa-twitter"
38+
url = "https://twitter.com/intent/tweet?text=%s"
39+
40+
[[params.sharingOptions]]
41+
name = "Google+"
42+
icon = "fa-google-plus"
43+
url = "https://plus.google.com/share?url=%s"
44+
```
45+
546
## [0.3.1-BETA](https://github.com/kakawait/hugo-tranquilpeak-theme/milestone/13) - 15 apr 2017
647

748
- Fix Merriweather font to support non latin chars ([#129](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/129), [#142](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/142), [#143](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/143))

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Please all the credit should be attributed to [original *Hexo* version](https://
3434
## General
3535

3636
- **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud Leprêtre (kakawait)](https://github.com/kakawait)
37-
- **Version**: 0.3.1-BETA (based on Hexo version 1.9.1)
37+
- **Version**: 0.4.0-BETA (based on Hexo version 1.10.0)
3838
- **Compatibility**: Hugo v0.20.1
3939

4040
## Features
@@ -72,7 +72,6 @@ Please all the credit should be attributed to [original *Hexo* version](https://
7272

7373
### Missing features from original *Hexo* version
7474

75-
- [ ] Duoshuo
7675
- [ ] Baidu analytics
7776
- [ ] Algolia (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/8)
7877
- [ ] Pagination customization `tagPagination`, `categoryPagination` and `archivePagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17)

archetypes/page.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ tags:
1010
keywords:
1111
- tech
1212
comments: false
13-
showDate: false
14-
showSocial: false
15-
showTags: false
16-
showPagination: false
13+
showMeta: false
14+
showActions: false
1715
#thumbnailImage: //example.com/image.jpg
1816
---
1917

docs/developer.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ If you want to report a bug or ask a question, [create an issue](https://github.
2828
## General ##
2929

3030
- **Author** : Thibaud Leprêtre
31-
- **Version** : 0.3.1-BETA (based on Hexo version 1.9.1)
31+
- **Version** : 0.4.0-BETA (based on Hexo version 1.10.0)
3232
- **Compatibility** : Hugo v0.20.1
3333

3434
## Requirements ##
3535

3636
1. **Hugo** : v0.16 or higher, see official documentation (https://gohugo.io/overview/installing/)
37-
3. **Grunt CLI** : v0.1.13 or higher. Run `npm install grunt-cli -g`
38-
4. **Bower** : v1.4.1 or higher. Run `npm install bower -g`
37+
2. **Grunt CLI** : v0.1.13 or higher. Run `npm install grunt-cli -g`
3938

4039
## Installation ##
4140

@@ -45,7 +44,6 @@ If you want to report a bug or ask a question, [create an issue](https://github.
4544
4. Go in `theme/tranquilpeak` folder with `cd themes/tranquilpeak`
4645
5. Install [requirements](#requirements)
4746
6. Run `npm install` to install [NPM dependencies](#npm-dependencies)
48-
7. Run `bower install` to install [Bower dependencies](#bower-dependencies)
4947

5048
If you want to configure the theme, please follow the [user documentation](https://github.com/kakawait/hugo-tranquilpeak-theme/blob/master/docs/user.md)
5149

@@ -160,7 +158,7 @@ Use `npm run <script_name>` to run one of these scripts. E.g : `npm run start`
160158
|`npm run ...`|Description|
161159
|---|---|
162160
|`start`|Build the theme once and rebuild after each change|
163-
|`prod`|Build the theme for production. (synchronize bower dependencies, images, fonts, compile assets (css and js) with some optimization (concat and minify) and link it to views)|
161+
|`prod`|Build the theme for production. (synchronize images, fonts, compile assets (css and js) with some optimization (concat and minify) and link it to views)|
164162
|`lint`|Check code style with [ESLint](http://eslint.org)|
165163

166164
## Grunt tasks ##
@@ -209,7 +207,6 @@ On production environment, these javascript and stylesheets files are concatenat
209207

210208
|Task|Description|
211209
|---|---|
212-
|bower|Copy all needed files by types from bower dependencies|
213210
|clean|Delete `src/assets` folder|
214211
|concat|<ul><li>devJs : Concat all javascript files located in `src/js/` into 1 file : `src/assets/js/tranquilpeak.js`</li><li>prodCss : Concat all stylesheets files located in `src/assets/css/` into 1 file : `src/assets/css/style.css`</li><li>prodJs : Concat all javascript listed in `tasks/pipeline.js` in 1 file : `src/assets/js/script.js`</li></ul>|
215212
|cssmin|Minify `src/assets/cssstyle.css` file in : `src/assets/cssstyle.min.css`|
@@ -223,8 +220,8 @@ On production environment, these javascript and stylesheets files are concatenat
223220

224221
|Task|Description|
225222
|---|---|
226-
|build|Synchronize bower dependencies, images, fonts, compile assets (css and js) and link it to views|
227-
|buildProd|Synchronize bower dependencies, images, fonts, compile assets (css and js) with some optimization (concat and minify) and link it to views|
223+
|build|Synchronize images, fonts, compile assets (css and js) and link it to views|
224+
|buildProd|Synchronize images, fonts, compile assets (css and js) with some optimization (concat and minify) and link it to views|
228225
|default|Build the theme once and rebuild after each change|
229226
|eslint|Check code style with ESLint|
230227
|compileAssets|Compile scss files and concat js files|

docs/user.md

Lines changed: 83 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ If you want to report a bug or ask a question, [create an issue](https://github.
2828
* [Author](#author)
2929
* [Customization](#customization)
3030
* [Integrated services](#integrated-services)
31+
* [Sharing options](#sharing-options)
3132
* [Enable pages](#enable-pages)
3233
- [Integrated services configuration](#integrated-services-configuration)
3334
* [Google Analytics](#google-analytics)
@@ -53,7 +54,7 @@ If you want to report a bug or ask a question, [create an issue](https://github.
5354
## General
5455

5556
- **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud Leprêtre (kakawait)](https://github.com/kakawait)
56-
- **Version**: 0.3.1-BETA (based on Hexo version 1.9.1)
57+
- **Version**: 0.4.0-BETA (based on Hexo version 1.10.0)
5758
- **Compatibility**: Hugo v0.20.1
5859

5960
## Features
@@ -91,7 +92,6 @@ If you want to report a bug or ask a question, [create an issue](https://github.
9192

9293
### Missing features from original *Hexo* version
9394

94-
- [ ] Duoshuo
9595
- [ ] Baidu analytics
9696
- [ ] Algolia (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/8)
9797
- [ ] Pagination custumization `tagPagination`, `categoryPagination` and `archivePagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17)
@@ -360,8 +360,8 @@ E.g to display a shortcut to open algolia search window :
360360
| favicon | Your favicon path (Default: `/favicon.png`) |
361361
| imageGallery | Display an image gallery at the end of a post which have `photos` variables. (false: disabled, true: enabled) |
362362
| 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. |
363-
| customCSS | Define files with css that override or extend the theme css; they are expected in `static` folder: `customCSS` = ["css/mystyles.css"]. |
364-
| customJS | Define files with js that override or extend the theme js; they are expected in `static` folder: `customJS` = ["js/myscripts.js"]. |
363+
| customCSS (_DEPRECATED see [Add custom JS or CSS using configuration](#add-custom-js-or-css-using-configuration)_) | Define files with css that override or extend the theme css: `customCSS` = ["css/mystyles.css"]. |
364+
| customJS (_DEPRECATED see [Add custom JS or CSS using configuration](#add-custom-js-or-css-using-configuration)_) | Define files with js that override or extend the theme js: `customJS` = ["js/myscripts.js"]. |
365365

366366
E.g :
367367
A category page look like this with `hierarchicalCategories = true` :
@@ -370,6 +370,37 @@ A category page look like this with `hierarchicalCategories = true` :
370370
The same page with `hierarchicalCategories = false`:
371371
![hierarchicalCategories false](img/without_hierarchical_categories.png)
372372

373+
##### Add custom JS or CSS using configuration
374+
375+
If you need to add some additionnal javascript or css files to your blog without forking or overriding theme itself you could use following configuration:
376+
377+
```toml
378+
[params]
379+
[[params.customJS]]
380+
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/go.min.js"
381+
integrity = "sha256-LVuWfOU0rWFMCJNl1xb3K2HSWfxtK4IPbqEerP1P83M="
382+
crossorigin = "anonymous"
383+
async = true
384+
defer = true
385+
386+
[[params.customJS]]
387+
src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/dockerfile.min.js"
388+
integrity = "sha256-putofyQv7OB569xAldpyBnHJ0Uc+7VGp5Us05IgDGss="
389+
crossorigin = "anonymous"
390+
async = true
391+
defer = true
392+
393+
[[params.customJS]]
394+
src = "js/myscript.js"
395+
396+
[[params.customCSS]]
397+
href = "css/mystyle.css"
398+
```
399+
400+
**ATTENTION** there is no limitation on key structures and each keys will be converted as tag attributes.
401+
402+
Futhermore, even if previous syntax is still supported (`customJS = ["js/myscripts.js"]`), you can't mix both new and old syntax.
403+
373404
#### Integrated services
374405

375406
```toml
@@ -396,7 +427,43 @@ googleAnalytics =
396427
| 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. |
397428
| 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. |
398429

399-
### Enable pages ###
430+
#### Sharing options
431+
432+
``` toml
433+
[params]
434+
[[params.sharingOptions]]
435+
name = "Facebook"
436+
icon = "fa-facebook-official"
437+
url = "https://www.facebook.com/sharer/sharer.php?u=%s"
438+
439+
[[params.sharingOptions]]
440+
name = "Twitter"
441+
icon = "fa-twitter"
442+
url = "https://twitter.com/intent/tweet?text=%s"
443+
444+
[[params.sharingOptions]]
445+
name = "Google+"
446+
icon = "fa-google-plus"
447+
url = "https://plus.google.com/share?url=%s"
448+
```
449+
450+
You can comment and uncomment to enable or disable sharing options. If your own sharing options, simply add new sharing options on your configuration. E.g with **foo_bar** social network:
451+
452+
```toml
453+
[params]
454+
[[params.sharingOptions]]
455+
name = "Foo bar"
456+
icon = "fa-foo-bar"
457+
url = "https://www.foo-bar.com/sharer/sharer.php?u=%s"
458+
```
459+
460+
|Variable|Description|
461+
|---|---|
462+
|name| Name of your sharing site.|
463+
|icon|Name of the fontawesome icon class (Go to [font-awesome icons](http://fontawesome.io/icons/) to find class name of icon)|
464+
|url|URL of the link. use %s to specify where to put the permalink.|
465+
466+
#### Enable pages
400467

401468
Tranquilpeak provides you 2 pages to display all posts title and date by tags, by categories, by date and an about page. To enable one of this pages simply add following [taxonomies](https://gohugo.io/taxonomies/overview/):
402469

@@ -426,15 +493,15 @@ Follow these steps, to add new filter :
426493
7. Select **Custom filter**, **Filter Field** : `Hostname`, **Filter Pattern** : `(.*?localhost.*?)`
427494
8. Click on **Save** button
428495

429-
## Quick & easy modifications ##
496+
## Quick & easy modifications
430497

431-
### Prerequisites ###
498+
### Prerequisites
432499

433500
Since you are going to edit the theme, you have to install all the necessary to build it after changes : [Installation](https://github.com/LouisBarranqueiro/hexo-theme-tranquilpeak/blob/master/docs/developer.md#installation)
434501

435502
**Run command in theme folder : `hexo-blog/themes/tranquilpeak`**
436503

437-
### Change global style ###
504+
### Change global style
438505

439506
If you want to change font families, font size, sidebar color, things like that, take a look at `source/scss/utils/_variables.scss` file. This file contains global variables used in this theme. **Build the theme after changes to see changes.**
440507

@@ -502,11 +569,13 @@ showDate: true
502569
|coverCaption|Add a caption under the cover image : [Cover caption demo](https://tranquilpeak.kakawait.com/2015/05/cover-image-showcase/)|
503570
|coverMeta|`in`: display post meta (title, date and categories) on cover image, `out`: display meta (title, date and categories) under cover image as usual. Default behavior : `in`|
504571
|gallery|Images displayed in an image gallery (with fancybox) at the end of the post. If thumbnail image is not configured and cover image too, the first photo is used as thumbnail image. format: `original url [thumbnail url] [caption]`, E.g : `https://example.com/original.jpg https://example.com/thumbnail.jpg "New York"`|
505-
|comments|Disable the comment of the post.
572+
|comments|`true`: Show the comment of the post.|
506573
|showDate|`true`: Show the date when `true` (default)|
507-
|showTags|`true`: show tags of this page. Default behavior: `true`
508-
|showPagination|`true`: show pagination. Default behavior: `true`
509-
|showSocial|`true`: show social button such as share on Twitter, Facebook... Default behavior: `true`
574+
|showTags|`true`: show tags of this page.|
575+
|showPagination|`true`: show pagination.|
576+
|showSocial|`true`: show social button such as share on Twitter, Facebook...|
577+
|showMeta|`true`: Show post meta (date, categories).|
578+
|showActions|`true`: Show post actions (navigation, share links).|
510579

511580
Example:
512581
A post on index page will look like this with :`thumbnailImagePosition` set to `bottom`:
@@ -696,10 +765,8 @@ tags:
696765
keywords:
697766
- tech
698767
comments: false
699-
showDate: false
700-
showSocial: false
701-
showTags: false
702-
showPagination: false
768+
showMeta: false
769+
showActions: false
703770
#thumbnailImage: //example.com/image.jpg
704771
---
705772

exampleSite/config.toml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Tranquilpeak
2-
# Version : 0.3.1-BETA
2+
# Version : 0.4.0-BETA
33
# Author : Thibaud Leprêtre
44

55
# I STRONGLY recommend you to use a CDN to speed up loading of pages.
@@ -47,51 +47,51 @@ canonifyurls = true
4747

4848
# Menu Configuration
4949
[[menu.main]]
50-
weight = 0
50+
weight = 1
5151
identifier = "home"
5252
name = "Home"
5353
pre = "<i class=\"sidebar-button-icon fa fa-lg fa-home\"></i>"
5454
url = "/"
5555
[[menu.main]]
56-
weight = 1
56+
weight = 2
5757
identifier = "categories"
5858
name = "Categories"
5959
pre = "<i class=\"sidebar-button-icon fa fa-lg fa-bookmark\"></i>"
6060
url = "/categories"
6161
[[menu.main]]
62-
weight = 2
62+
weight = 3
6363
identifier = "tags"
6464
name = "Tags"
6565
pre = "<i class=\"sidebar-button-icon fa fa-lg fa-tags\"></i>"
6666
url = "/tags"
6767
[[menu.main]]
68-
weight = 3
68+
weight = 4
6969
identifier = "archives"
7070
name = "Archives"
7171
pre = "<i class=\"sidebar-button-icon fa fa-lg fa-archive\"></i>"
7272
url = "/archives"
7373
[[menu.main]]
74-
weight = 4
74+
weight = 5
7575
identifier = "about"
7676
name = "About"
7777
pre = "<i class=\"sidebar-button-icon fa fa-lg fa-question\"></i>"
7878
url = "/#about"
7979

8080
[[menu.links]]
81-
weight = 0
81+
weight = 1
8282
identifier = "github"
8383
name = "GitHub"
8484
pre = "<i class=\"sidebar-button-icon fa fa-lg fa-github\"></i>"
8585
url = "https://github.com/kakawait"
8686
[[menu.links]]
87-
weight = 1
87+
weight = 2
8888
identifier = "stackoverflow"
8989
name = "Stack Overflow"
9090
pre = "<i class=\"sidebar-button-icon fa fa-lg fa-stack-overflow\"></i>"
9191
url = "https://stackoverflow.com/users/636472/kakawait"
9292

9393
[[menu.misc]]
94-
weight = 0
94+
weight = 1
9595
identifier = "rss"
9696
name = "RSS"
9797
pre = "<i class=\"sidebar-button-icon fa fa-lg fa-rss\"></i>"
@@ -172,6 +172,25 @@ canonifyurls = true
172172
# they have to be referred from static root. Example
173173
# customJS = ["js/foo.js"]
174174

175+
# Sharing options
176+
# Comment and uncomment to enable or disable sharing options
177+
# If you wanna add a sharing option, read user documentation :
178+
# Tranquilpeak configuration > Theme configuration > sharing-options
179+
[[params.sharingOptions]]
180+
name = "Facebook"
181+
icon = "fa-facebook-official"
182+
url = "https://www.facebook.com/sharer/sharer.php?u=%s"
183+
184+
[[params.sharingOptions]]
185+
name = "Twitter"
186+
icon = "fa-twitter"
187+
url = "https://twitter.com/intent/tweet?text=%s"
188+
189+
[[params.sharingOptions]]
190+
name = "Google+"
191+
icon = "fa-google-plus"
192+
url = "https://plus.google.com/share?url=%s"
193+
175194
[params.header.rightLink]
176195
class = ""
177196
icon = ""

0 commit comments

Comments
 (0)