diff options
author | Thibaud Lepretre <thibaud.lepretre@gmail.com> | 2017-02-14 17:19:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-14 17:19:55 +0300 |
commit | 233b46aea2d015a448de6f1ae8d9c477a12caec1 (patch) | |
tree | 3a5cf97d0e4497bf8a5ac39736196ad55e002959 | |
parent | 6f3d8f4083bc4836a482061d49f4f7b69b3bcdb7 (diff) | |
parent | 01447633fba1e5c1ef342b0b8be5b5f7a3e8fdd7 (diff) |
Merge pull request #115 from kakawait/develop0.2.2-ALPHA
Releasing 0.2.2-ALPHA
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | archetypes/page.md | 18 | ||||
-rw-r--r-- | archetypes/post.md | 2 | ||||
-rw-r--r-- | docs/developer.md | 2 | ||||
-rw-r--r-- | docs/user.md | 51 | ||||
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md | 4 | ||||
-rw-r--r-- | i18n/pt-br.yaml | 26 | ||||
-rw-r--r-- | layouts/partials/head.html | 13 | ||||
-rw-r--r-- | layouts/partials/post/meta.html | 8 | ||||
-rw-r--r-- | package.json | 2 |
12 files changed, 109 insertions, 31 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 155ac74..9e9de19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.2.2-ALPHA](https://github.com/kakawait/hugo-tranquilpeak-theme/milestone/11) - 14 feb 2017 + +- Page archetype ([#106](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/106)) (thank you [@ebouchut](https://github.com/ebouchut)) +- Improve documentation ([#113](https://github.com/kakawait/hugo-tranquilpeak-theme/issues/113), [#105](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/105)) (thank you [@ebouchut](https://github.com/ebouchut)) +- Update brazilian translation ([#101](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/101)) (thank you [@italocegatta](https://github.com/italocegatta)) + ## [0.2.1-ALPHA](https://github.com/kakawait/hugo-tranquilpeak-theme/milestone/10) - 8 jan 2017 - Easy customization of head and foot via `/layouts/partials/(head|foot)_(start|end).html` ([#80](https://github.com/kakawait/hugo-tranquilpeak-theme/pull/80)) (thank you [@blaubaer](https://github.com/blaubaer)) @@ -34,7 +34,7 @@ Please all the credit should be attributed to [original *Hexo* version](https:// ## General - **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud Leprêtre (kakawait)](https://github.com/kakawait) -- **Version**: 0.2.1-ALPHA (based on Hexo version 1.9.1) +- **Version**: 0.2.2-ALPHA (based on Hexo version 1.9.1) - **Compatibility**: Hugo v0.17 ## Features @@ -75,7 +75,7 @@ Please all the credit should be attributed to [original *Hexo* version](https:// - [ ] Duoshuo - [ ] Baidu analytics - [ ] Algolia (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/8) -- [ ] Pagination custumization `tagPagination`, `categoryPagination` and `archivePagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17) +- [ ] Pagination customization `tagPagination`, `categoryPagination` and `archivePagination` (https://github.com/kakawait/hugo-tranquilpeak-theme/issues/17) **ATTENTION** following features will not be possible due to *Hugo* limitations @@ -147,7 +147,7 @@ As explained on [Credits](#credits): > *Hugo* version keeps every `.js` and `.css` files untouched from original *Hexo* version in order to enjoy futur original *Hexo* version updates or features! -That mean I would keep a stronge dependency with original *Hexo* theme. Thus if you want to suggest any modifications on `.css` or `.js` files **I will submit those changes to original *Hexo* theme** (except if it's really specific to *Hugo* bugs that is not present on *Hexo*). +That mean I would keep a strong dependency with original *Hexo* theme. Thus if you want to suggest any modifications on `.css` or `.js` files **I will submit those changes to original *Hexo* theme** (except if it's really specific to *Hugo* bugs that is not present on *Hexo*). ## License diff --git a/archetypes/page.md b/archetypes/page.md new file mode 100644 index 0000000..9d90a0c --- /dev/null +++ b/archetypes/page.md @@ -0,0 +1,18 @@ +--- +title: "New Page" +categories: +- category +- subcategory +tags: +- tag1 +- tag2 +keywords: +- tech +comments: false +showDate: false +showSocial: false +showTags: false +showPagination: false +#thumbnailImage: //example.com/image.jpg +--- + diff --git a/archetypes/post.md b/archetypes/post.md index 560f4ff..11ee897 100644 --- a/archetypes/post.md +++ b/archetypes/post.md @@ -12,4 +12,4 @@ keywords: #thumbnailImage: //example.com/image.jpg --- -<!-- more /-->
\ No newline at end of file +<!--more--> diff --git a/docs/developer.md b/docs/developer.md index 70e2581..baa61c1 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -28,7 +28,7 @@ If you want to report a bug or ask a question, [create an issue](https://github. ## General ## - **Author** : Thibaud Leprêtre -- **Version** : 0.2.1-ALPHA (based on Hexo version 1.9.1) +- **Version** : 0.2.2-ALPHA (based on Hexo version 1.9.1) - **Compatibility** : Hugo v0.17 ## Requirements ## diff --git a/docs/user.md b/docs/user.md index bf42420..657f50d 100644 --- a/docs/user.md +++ b/docs/user.md @@ -47,12 +47,13 @@ If you want to report a bug or ask a question, [create an issue](https://github. * [Tabbed code block](#tabbed-code-block) * [Wide image](#wide-image) * [Fancybox](#fancybox) +- [Writing pages](#writing-pages) - [Running](#running) ## General - **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud Leprêtre (kakawait)](https://github.com/kakawait) -- **Version**: 0.2.1-ALPHA (based on Hexo version 1.9.1) +- **Version**: 0.2.2-ALPHA (based on Hexo version 1.9.1) - **Compatibility**: Hugo v0.17 ## Features @@ -482,6 +483,7 @@ comments: false showTags: true showPagination: true showSocial: true +showDate: true ``` |Variable|Description| @@ -499,6 +501,7 @@ showSocial: true |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`| |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"`| |comments|Disable the comment of the post. +|showDate|`true`: Show the date when `true` (default)| |showTags|`true`: show tags of this page. Default behavior: `true` |showPagination|`true`: show pagination. Default behavior: `true` |showSocial|`true`: show social button such as share on Twitter, Facebook... Default behavior: `true` @@ -517,11 +520,11 @@ The same with : `thumbnailImagePosition` set to `left`: Use: -- `<!-- more -->` to define post excerpt and keep the post excerpt in the post content +- `<!--more-->` to define post excerpt and keep the post excerpt in the post content ### Display table of contents -As post excerpt feature enable with `<!-- more -->` comment, you can display the table of contents of a post with `<!-- toc -->`. Place this comment where you want to display the table of content. +As post excerpt feature enable with `<!--more-->` comment, you can display the table of contents of a post with `<!-- toc -->`. Place this comment where you want to display the table of content. Here is what looks like the table of contents generated: ![thumbnail-image-position-left](https://s3-ap-northeast-1.amazonaws.com/tranquilpeak-hexo-theme/docs/1.4.0/toc-400.png) @@ -660,6 +663,48 @@ E.g: |src|Path to the original image.| |title (optional)|Title of image displayed in a caption under image. `Alt` HTML attribute will use this title. E.g : `"A beautiful sunrise"`.| + +## Writing pages ## + +Sometimes you need to create a **page** that is **not** a **regular blog post**, +where you want to hide the date, social sharing buttons, tags, categories +and pagination. +This is the case for the blog pages _About_ or _Contact_ for instance which do +not need to be timestamped (nor tagged or categorized) nor provide +pagination and are not intended to be shared on social networks. + +In order to create such a page you can proceed like so: + +``` +hugo new page/contact.md +``` + +This creates the file `contact.md` in the directory `content/page` +pre-populated with the following front matter. + +```yaml +--- +title: "New Page" +categories: +- category +- subcategory +tags: +- tag1 +- tag2 +keywords: +- tech +comments: false +showDate: false +showSocial: false +showTags: false +showPagination: false +#thumbnailImage: //example.com/image.jpg +--- + +``` + +The rest is basically the same as for a regular _[post](#writing-posts)_. + ## Running ## Run `hugo server` and start writing! :) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 404273f..ab44bf5 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,5 +1,5 @@ # Tranquilpeak -# Version : 0.2.1-ALPHA +# Version : 0.2.2-ALPHA # Author : Thibaud Leprêtre # I STRONGLY recommend you to use a CDN to speed up loading of pages. diff --git a/exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md b/exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md index de487ff..7aa38e9 100644 --- a/exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md +++ b/exampleSite/content/post/Welcome-to-the-new-Tranquilpeak.md @@ -1,5 +1,5 @@ --- -title: "Welcome to Tranquilpeak 0.2.1" +title: "Welcome to Tranquilpeak 0.2.2" date: 2015-06-15 categories: - tranquilpeak @@ -65,7 +65,7 @@ Please all the credit should be attributed to [original *Hexo* version](https:// ## General - **Authors**: [Louis Barranqueiro (LouisBarranqueiro)](https://github.com/LouisBarranqueiro) and [Thibaud Leprêtre (kakawait)](https://github.com/kakawait) -- **Version**: 0.2.1-ALPHA (based on Hexo version 1.9.1) +- **Version**: 0.2.2-ALPHA (based on Hexo version 1.9.1) - **Compatibility**: Hugo v0.17 ## Features diff --git a/i18n/pt-br.yaml b/i18n/pt-br.yaml index dc19ea2..5514d8d 100644 --- a/i18n/pt-br.yaml +++ b/i18n/pt-br.yaml @@ -6,7 +6,7 @@ translation: "Categorias" - id: "global.category" - translation: "Category" + translation: "Categoria" - id: "global.tags" translation: "Tags" @@ -45,19 +45,19 @@ translation: "LinkedIn" - id: "global.mail" - translation: "Mail" + translation: "Email" - id: "global.rss" translation: "RSS" - id: "global.share_on_google_plus" - translation: "Partilhar no Google Plus" + translation: "Compartilhar no Google Plus" - id: "global.share_on_facebook" - translation: "Partilhar no Facebook" + translation: "Compartilhar no Facebook" - id: "global.share_on_twitter" - translation: "Partilhar no Twitter" + translation: "Compartilhar no Twitter" - id: "global.search_category" translation: "Pesquisar categoria" @@ -73,30 +73,30 @@ translation: "não foram encontrados artigos" - id: "global.post_found.one" - translation: "1 artigo encontrados" + translation: "1 artigo encontrado" - id: "global.post_found.other" translation: "{n} artigos encontrados" ## GLOBAL.CATEGORIES_FOUND ## - id: "global.categories_found.zero" - translation: "não foram encontrados categorias" + translation: "não foram encontradas categorias" - id: "global.categories_found.one" - translation: "1 category encontrados" + translation: "1 categoria encontrada" - id: "global.categories_found.other" - translation: "{n} categorias encontrados" + translation: "{n} categorias encontradas" ## GLOBAL.TAGS_FOUND ## - id: "global.tags_found.zero" - translation: "não foram encontrados tag" + translation: "não foram encontradas tags" - id: "global.tags_found.one" - translation: "1 tag encontrados" + translation: "1 tag encontrada" - id: "global.tags_found.other" - translation: "{n} tags encontrados" + translation: "{n} tags encontradas" ## PAGINATION ## - id: "pagination.page" @@ -128,7 +128,7 @@ translation: "ETIQUETADO em" - id: "post.toc" - translation: "Tabela de Conteúdos" + translation: "Conteúdo" - id: "post.read_more" translation: "Continuar leitura" diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a3b0435..6e95748 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -9,8 +9,15 @@ {{ else }} {{ .Scratch.Set "sidebarBehavior" .Site.Params.sidebarBehavior }} {{ end }} +<!-- Fix hugo 0.17 expects ".Site.Author.gravatarEmail" whereas hugo 0.18 expects ".Site.Author.gravataremail" --> +{{ if .Site.Author.gravatarEmail }} + {{ .Scratch.Set "gravatarEmail" .Site.Author.gravatarEmail }} +{{ end }} {{ if .Site.Author.gravataremail }} - {{ .Scratch.Set "authorPicture" (printf "//www.gravatar.com/avatar/%s" (urlize (md5 .Site.Author.gravataremail))) }} + {{ .Scratch.Set "gravatarEmail" .Site.Author.gravataremail }} +{{ end }} +{{ if .Scratch.Get "gravatarEmail" }} + {{ .Scratch.Set "authorPicture" (printf "//www.gravatar.com/avatar/%s" (urlize (md5 (.Scratch.Get "gravatarEmail")))) }} {{ else if .Site.Author.picture }} {{ .Scratch.Set "authorPicture" (absURL .Site.Author.picture) }} {{ end }} @@ -54,8 +61,8 @@ {{ end }} {{ end }} - {{ if .Site.Author.gravataremail }} - <meta property="og:image" content="//www.gravatar.com/avatar/{{ (md5 .Site.Author.gravataremail) | urlize }}?s=640"> + {{ if .Scratch.Get "gravatarEmail" }} + <meta property="og:image" content="//www.gravatar.com/avatar/{{ (md5 (.Scratch.Get "gravatarEmail")) | urlize }}?s=640"> {{ else if .Site.Author.picture }} <meta property="og:image" content="{{ .Site.Author.picture | absURL }}"> {{ end }} diff --git a/layouts/partials/post/meta.html b/layouts/partials/post/meta.html index 4dcd5ef..634ebbe 100644 --- a/layouts/partials/post/meta.html +++ b/layouts/partials/post/meta.html @@ -1,6 +1,8 @@ <div class="postShorten-meta post-meta"> - <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> - {{ partial "internal/date.html" . }} - </time> + {{ if not (eq .Params.showDate false) }} + <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> + {{ partial "internal/date.html" . }} + </time> + {{ end }} {{ partial "post/category.html" . }} </div> diff --git a/package.json b/package.json index 3c6920f..fa40887 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hugo-tranquilpeak-theme", - "version": "0.2.1-ALPHA", + "version": "0.2.2-ALPHA", "description": "A gorgeous responsive theme for Hugo blog framework", "main": "Gruntfile.js", "scripts": { |