From 75df39e05964a88f9125b76f8e4d9fee29d0606d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaud=20Lepr=C3=AAtre?= Date: Sun, 13 Nov 2016 12:28:38 +0100 Subject: [PATCH 1/5] Migrate old GA script to new - Upgrade *Google Analytics* script to do not use anymore `ga.js` which is now deprecated - Changes *Google Analytics* config key from `params.google_analytics_id` to official `googleAnalytics` - Add parameter to choose between sync/async loading of *Google Analytics* `params.ga.async` - Create migration 0.1.0-ALPHA -> 0.1.1-ALPHA fixes #21 --- .gitmodules | 3 +++ CHANGELOG.md | 9 +++++++++ README.md | 10 ++++++++++ docs/user.md | 8 ++++---- exampleSite/config.toml | 3 +++ layouts/partials/google-analytics.html | 12 ------------ layouts/partials/head.html | 6 +++++- migrators/src | 1 + 8 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 .gitmodules create mode 100644 CHANGELOG.md delete mode 100644 layouts/partials/google-analytics.html create mode 160000 migrators/src diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..ab203ce2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "migrators/src"] + path = migrators/src + url = git@github.com:kakawait/hugo-tranquilpeak-theme-migrators.git diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..eef37f21 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.1-ALPHA] 13 nov 2016 + +- Upgrade *Google Analytics* script to do not use anymore `ga.js` which is now deprecated (#21) +- **[Breaking changes]** Changes *Google Analytics* config key from `params.google_analytics_id` to official `googleAnalytics` (#21) +- Add parameter to choose between sync/async loading of *Google Analytics* `params.ga.async` (#21) \ No newline at end of file diff --git a/README.md b/README.md index 95bbb0ce..6df514c8 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,16 @@ A gorgeous responsive theme for Hugo blog framework. ![Tranquilpeak](https://raw.githubusercontent.com/kakawait/hugo-tranquilpeak-theme/master/showcase.png) +## Alpha/Beta versions + +**ATTENTION** during *alpha* or *beta* [versions (check [milestones]](https://github.com/kakawait/hugo-tranquilpeak-theme/milestones) breaking changes are possible on config file. + +You can track [breaking changes label](https://github.com/kakawait/hugo-tranquilpeak-theme/issues?q=is%3Aissue+is%3Aopen+label%3A%22breaking+changes%22) or simply read [CHANGELOG.md](https://github.com/kakawait/hugo-tranquilpeak-theme/CHANGELOG.md). + +Moreover you can use `migrators` from `migrators` folders. Migration scripts will produces a new config file with suffix `.new`, it will not override your current config. Indeed migration scripts will erase any comments and formating, that why migration scripts will not override your config. + +Any modifications are printed on output to allow you reproduce/replay migrations on your own config file manually. + ## Credits *Hugo* version of Tranquilpeak is a based on original *Hexo* version https://github.com/LouisBarranqueiro/hexo-theme-tranquilpeak. This version is simply a port to *Hugo* static site generator. diff --git a/docs/user.md b/docs/user.md index 22a6257a..3aa6637f 100644 --- a/docs/user.md +++ b/docs/user.md @@ -307,7 +307,8 @@ The same page with `hierarchical_categories = false`: #### Integrated services ```toml -DisqusShortname = +disqusShortname = +googleAnalytics = ``` ```toml @@ -319,14 +320,13 @@ DisqusShortname = [params] fb_admin_ids = fb_app_id = - google_analytics_id = ``` | Variable | Description | |---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| disqus_shortnam | Your Disqus shortname. | +| disqusShortname | Your Disqus shortname. | | gravatar_email | Your gravatar email. Overwrite `author.picture` everywhere in the blog | -| google_analytics_id | Your Google analystics web property ID : UA-XXXXX-X | +| googleAnalytics | Your Google analystics web property ID : UA-XXXXX-X | | 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. | | 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. | diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 0cde7609..f0689251 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -17,6 +17,7 @@ languageCode = "en-us" title = "Hugo tranquilpeak theme" theme = "hugo-tranquilpeak-theme" DisqusShortname = "hugo-tranquilpeak-theme" +# googleAnalytics = "UA-123-45" Paginate = 7 canonifyurls = true @@ -103,6 +104,8 @@ canonifyurls = true hierarchical_categories = true + description = "Hugo tranquilpeak theme demo" + # Customization # Define the behavior of the sidebar # 1: Display extra large sidebar on extra large screen, large sidebar on large screen, diff --git a/layouts/partials/google-analytics.html b/layouts/partials/google-analytics.html deleted file mode 100644 index b88d42c3..00000000 --- a/layouts/partials/google-analytics.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ with .Site.Params.google_analytics_id }} - -{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 564c024e..79e4c52e 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -88,5 +88,9 @@ - {{ partial "google-analytics.html" }} + {{ if .Params.ga.async }} + {{ template "_internal/google_analytics_async.html" . }} + {{ else }} + {{ template "_internal/google_analytics.html" . }} + {{ end }} diff --git a/migrators/src b/migrators/src new file mode 160000 index 00000000..49c107a9 --- /dev/null +++ b/migrators/src @@ -0,0 +1 @@ +Subproject commit 49c107a9e1a35f7ba293ef97b978aa8933c97cb9 From f75a5b03cb8f0992f4637ba4d61dc57fda71e74b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaud=20Lepr=C3=AAtre?= Date: Sun, 13 Nov 2016 20:33:13 +0100 Subject: [PATCH 2/5] remove submodule --- .gitmodules | 3 --- README.md | 2 +- migrators/src | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 .gitmodules delete mode 160000 migrators/src diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ab203ce2..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "migrators/src"] - path = migrators/src - url = git@github.com:kakawait/hugo-tranquilpeak-theme-migrators.git diff --git a/README.md b/README.md index 6df514c8..f86e3238 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A gorgeous responsive theme for Hugo blog framework. ## Alpha/Beta versions -**ATTENTION** during *alpha* or *beta* [versions (check [milestones]](https://github.com/kakawait/hugo-tranquilpeak-theme/milestones) breaking changes are possible on config file. +**ATTENTION** during *alpha* or *beta* [versions](https://github.com/kakawait/hugo-tranquilpeak-theme/milestones) breaking changes are possible on config file. You can track [breaking changes label](https://github.com/kakawait/hugo-tranquilpeak-theme/issues?q=is%3Aissue+is%3Aopen+label%3A%22breaking+changes%22) or simply read [CHANGELOG.md](https://github.com/kakawait/hugo-tranquilpeak-theme/CHANGELOG.md). diff --git a/migrators/src b/migrators/src deleted file mode 160000 index 49c107a9..00000000 --- a/migrators/src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 49c107a9e1a35f7ba293ef97b978aa8933c97cb9 From 33ecca8ea4dae3f4af3e0d9122ed8068a0c91f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaud=20Lepr=C3=AAtre?= Date: Sun, 13 Nov 2016 20:37:57 +0100 Subject: [PATCH 3/5] Add migrations README.md --- migrations/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 migrations/README.md diff --git a/migrations/README.md b/migrations/README.md new file mode 100644 index 00000000..df4641d2 --- /dev/null +++ b/migrations/README.md @@ -0,0 +1,26 @@ +# Migrations + +## 0.1.0-ALPHA to 0.1.1-ALPHA + +### Using migration script + +```bash +./0_1_0_to_0_1_1 /path/to/config.toml +``` + +Should works with `.toml`, `.yml` and `.json` + +### Manually + +Replace + +```toml +[params] + google_analytics_id = UA-XXX-X +``` + +to (top level) + +```toml +googleAnalytics = UA-XXX-X +``` \ No newline at end of file From c9da0a8e1fade2e8a565f30292113997c9d9b5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaud=20Lepr=C3=AAtre?= Date: Sun, 13 Nov 2016 20:38:47 +0100 Subject: [PATCH 4/5] fix typo --- migrations/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/README.md b/migrations/README.md index df4641d2..babee350 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -16,11 +16,11 @@ Replace ```toml [params] - google_analytics_id = UA-XXX-X + google_analytics_id = "UA-XXX-X" ``` to (top level) ```toml -googleAnalytics = UA-XXX-X +googleAnalytics = "UA-XXX-X" ``` \ No newline at end of file From 978d8c2a76f5c6ea591fa041df821c025c9289db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaud=20Lepr=C3=AAtre?= Date: Sun, 13 Nov 2016 20:54:01 +0100 Subject: [PATCH 5/5] Update Welcome to Tranquilpeak blog post --- README.md | 2 +- .../post/Welcome-to-the-new-Tranquilpeak.md | 58 ++++++++++++++++--- 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f86e3238..bc48e8fa 100644 --- a/README.md +++ b/README.md @@ -144,5 +144,5 @@ That mean I would keep a stronge dependency with original *Hexo* theme. Thus if ## License -hugo-tranquilpeak-theme is released under the terms of the [GNU General Public License v3.0](LICENSE). +hugo-tranquilpeak-theme is released under the terms of the [GNU General Public License v3.0](https://github.com/kakawait/hugo-tranquilpeak-theme/blob/master/LICENSE). diff --git a/exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md b/exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md index b981a7df..cd8e77cd 100644 --- a/exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md +++ b/exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md @@ -36,6 +36,16 @@ A gorgeous responsive theme for Hugo blog framework [![Tranquilpeak](/img/showcase.png)](https://tranquilpeak.kakawait.com) +## Alpha/Beta versions + +**ATTENTION** during *alpha* or *beta* [versions](https://github.com/kakawait/hugo-tranquilpeak-theme/milestones) breaking changes are possible on config file. + +You can track [breaking changes label](https://github.com/kakawait/hugo-tranquilpeak-theme/issues?q=is%3Aissue+is%3Aopen+label%3A%22breaking+changes%22) or simply read [CHANGELOG.md](https://github.com/kakawait/hugo-tranquilpeak-theme/CHANGELOG.md). + +Moreover you can use `migrators` from `migrators` folders. Migration scripts will produces a new config file with suffix `.new`, it will not override your current config. Indeed migration scripts will erase any comments and formating, that why migration scripts will not override your config. + +Any modifications are printed on output to allow you reproduce/replay migrations on your own config file manually. + ## Credits *Hugo* version of Tranquilpeak is a based on original *Hexo* version https://github.com/LouisBarranqueiro/hexo-theme-tranquilpeak. This version is simply a port to *Hugo* static site generator. @@ -59,7 +69,7 @@ Please all the credit should be attributed to [original *Hexo* version](https:// - **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud LeprĂȘtre (kakawait)](https://github.com/kakawait) - **Version**: 0.1.0-ALPHA (based on Hexo version 1.9.1) -- **Compatibility**: Hugo v0.16 +- **Compatibility**: Hugo v0.17 ## Features @@ -73,6 +83,7 @@ Please all the credit should be attributed to [original *Hexo* version](https:// - Beautiful about page - Support Open Graph protocol - Easily customizable (fonts, colors, layout elements, code coloration, etc..) +- Documentations **Posts features:** @@ -93,13 +104,13 @@ Please all the credit should be attributed to [original *Hexo* version](https:// - Gravatar - Facebook Insights -### Todo of missing features from original *Hexo* version +### Missing features from original *Hexo* version -- [ ] Support internationalization (i18) +- [ ] Support internationalization (i18) (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/9) - [ ] Duoshuo - [ ] Baidu analytics -- [ ] Algolia -- [ ] Documentations +- [ ] Algolia (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/8) +- [ ] Pagination custumization `tag_pagination`, `category_pagination` and `archive_pagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17) **ATTENTION** following features will not be possible due to *Hugo* limitations @@ -108,17 +119,47 @@ Please all the credit should be attributed to [original *Hexo* version](https:// ## Quick start -Coming soon (see https://github.com/kakawait/hugo-tranquilpeak-theme/issues/4) +**Please read [user documentation](https://github.com/kakawait/hugo-tranquilpeak-theme/blob/master/docs/user.md), it's short and useful to discover all features and possibilities of the theme, especially the [writing posts](https://github.com/kakawait/hugo-tranquilpeak-theme/blob/master/docs/user.md#writing-posts) section** + +##### For people who want to use the original version of Tranquilpeak without modifications (users) + +Go to the directory where you have your Hugo site and run: + +```shell +mkdir themes +cd themes +git clone https://github.com/kakawait/hugo-tranquilpeak-theme.git +``` + +After installing the Tranquilpeak theme successfully, we recommend you to take a look at the [exampleSite](exampleSite) directory. You will find a working Hugo site configured with the Universal theme that you can use as a starting point for your site. + +First, let's take a look at the [config.toml](exampleSite/config.tom). It will be useful to learn how to customize your site. Feel free to play around with the settings. + +More information on [user documentation](https://github.com/kakawait/hugo-tranquilpeak-theme/blob/master/docs/user.md) to install and configure the theme + +##### For people who want to create their own version of tranquilpeak (developers) + +1. Run `git clone https://github.com/kakawait/hugo-tranquilpeak-theme.git` +2. Follow [developer documentation](https://github.com/kakawait/hugo-tranquilpeak-theme/blob/master/docs/developer.md) to edit and build the theme ## Demo -Coming soon (see https://github.com/kakawait/hugo-tranquilpeak-theme/issues/3) +Check out Tranquilpeak theme in live : [hugo-tranquilpeak-theme demo](https://tranquilpeak.kakawait.com) ## Showcase -I would like to create a showcase with all blogs that use Tranquilpeak, please, add your blog into. +Checkout showcase https://github.com/kakawait/hugo-tranquilpeak-theme/wiki/Showcase + +### How can I add my site to the showcase + **Click [here](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/new?title=Add%20my%20blog%20into%20the%20showcase&body=Hey,%20add%20my%20blog%20into%20the%20showcase:) to add your blog into the showcase.** +Please fill the following information: + +1. public url +2. name (optional) +3. description (optional) + ## Documentation Coming soon (see https://github.com/kakawait/hugo-tranquilpeak-theme/issues/4) @@ -137,3 +178,4 @@ That mean I would keep a stronge dependency with original *Hexo* theme. Thus if hugo-tranquilpeak-theme is released under the terms of the [GNU General Public License v3.0](https://github.com/kakawait/hugo-tranquilpeak-theme/blob/master/LICENSE). +