From 3db404c9f99684d746040bdaf6f4208080656306 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Sat, 4 Aug 2018 13:15:01 +0200 Subject: [PATCH] Update themes docs --- .../documentation/themes/creating-a-theme.md | 4 ++- docs/content/themes/_index.md | 1 + docs/content/themes/after-dark/index.md | 26 +++++++++++++++++-- docs/content/themes/book/index.md | 21 ++++++++++++++- docs/content/themes/even/index.md | 15 ++++++++++- docs/content/themes/feather/index.md | 3 ++- docs/content/themes/hyde/index.md | 3 ++- docs/templates/theme.html | 4 +-- 8 files changed, 68 insertions(+), 9 deletions(-) diff --git a/docs/content/documentation/themes/creating-a-theme.md b/docs/content/documentation/themes/creating-a-theme.md index 793fe796..8ddd237e 100644 --- a/docs/content/documentation/themes/creating-a-theme.md +++ b/docs/content/documentation/themes/creating-a-theme.md @@ -19,7 +19,9 @@ description = "A classic blog theme" license = "MIT" homepage = "https://github.com/Keats/gutenberg-hyde" # The minimum version of Gutenberg required -min_version = "0.3" +min_version = "0.4.0" +# An optional live demo URL +demo = "" # Any variable there can be overriden in the end user `config.toml` # You don't need to prefix variables by the theme name but as this will diff --git a/docs/content/themes/_index.md b/docs/content/themes/_index.md index b88365b3..5aa2e7b5 100644 --- a/docs/content/themes/_index.md +++ b/docs/content/themes/_index.md @@ -3,3 +3,4 @@ template = "themes.html" sort_by = "date" +++ + \ No newline at end of file diff --git a/docs/content/themes/after-dark/index.md b/docs/content/themes/after-dark/index.md index 8b75931b..dd4e8880 100644 --- a/docs/content/themes/after-dark/index.md +++ b/docs/content/themes/after-dark/index.md @@ -10,8 +10,9 @@ created = 2018-02-22T19:13:36+01:00 updated = 2017-11-07T17:39:37+01:00 repository = "https://github.com/Keats/after-dark" homepage = "https://github.com/Keats/after-dark" -minimum_version = "0.2" +minimum_version = "0.4.0" license = "MIT" +demo = "https://gutenberg-after-dark.netlify.com" [extra.author] name = "Vincent Prouillet" @@ -42,6 +43,27 @@ and then enable it in your `config.toml`: theme = "after-dark" ``` +This theme requires your index section (`content/_index.md`) to be paginated to work: + +```toml +paginate_by = 5 +``` + +The posts should therefore be in directly under the `content` folder. + +The theme requires tags and categories taxonomies to be enabled in your `config.toml`: + +```toml +taxonomies = [ + # You can enable/disable RSS + {name = "categories", rss = true}, + {name = "tags", rss = true}, +] +``` +If you want to paginate taxonomies pages, you will need to overwrite the templates +as it only works for non-paginated taxonomies by default. + + ## Options ### Top-menu @@ -67,4 +89,4 @@ instead. ## Original This template is based on the Hugo template https://github.com/comfusion/after-dark - + \ No newline at end of file diff --git a/docs/content/themes/book/index.md b/docs/content/themes/book/index.md index 7edd3ad1..a6a643c7 100644 --- a/docs/content/themes/book/index.md +++ b/docs/content/themes/book/index.md @@ -10,8 +10,9 @@ created = 2018-02-22T19:13:36+01:00 updated = 2018-01-28T10:53:19+01:00 repository = "https://github.com/Keats/book" homepage = "https://github.com/Keats/book" -minimum_version = "0.2" +minimum_version = "0.4.0" license = "MIT" +demo = "https://gutenberg-book.netlify.com" [extra.author] name = "Vincent Prouillet" @@ -43,8 +44,26 @@ and then enable it in your `config.toml`: ```toml theme = "book" +# Optional, if you want search +build_search_index = true ``` +## Usage +Book will generate a book from the files you place in the `content` directory. Your book +can have two levels of hierarchy: chapters and subchapters. + +Each chapter should be a `section` within the Gutenberg site and should have an `_index.md` +file that sets its `weight` front-matter variable to its chapter number. For example, +chapter 2 should have `weight = 2`. Additionally, each chapter should also set the +`sort_by = "weight"` in its front matter. + +Each subchapter should be a `page` and should have its `weight` variable set to the subchapter +number. For example, subchapter 3.4 should have `weight = 4`. + +Finally, you should create an `_index.md` file and set the `redirect_to` front-matter variable +to redirect to the first section of your content. For example, if your first section has the +slug `introduction`, then you would set `redirect_to = "introduction"`. + ## Options ### Numbered chapters diff --git a/docs/content/themes/even/index.md b/docs/content/themes/even/index.md index 6e83d0e8..c43ba07b 100644 --- a/docs/content/themes/even/index.md +++ b/docs/content/themes/even/index.md @@ -10,8 +10,9 @@ created = 2018-02-22T19:13:36+01:00 updated = 2018-01-25T18:44:44+01:00 repository = "https://github.com/Keats/even" homepage = "https://github.com/Keats/even" -minimum_version = "0.3" +minimum_version = "0.4.0" license = "MIT" +demo = "https://gutenberg-even.netlify.com" [extra.author] name = "Vincent Prouillet" @@ -43,6 +44,18 @@ and then enable it in your `config.toml`: theme = "even" ``` +The theme requires tags and categories taxonomies to be enabled in your `config.toml`: + +```toml +taxonomies = [ + # You can enable/disable RSS + {name = "categories", rss = true}, + {name = "tags", rss = true}, +] +``` +If you want to paginate taxonomies pages, you will need to overwrite the templates +as it only works for non-paginated taxonomies by default. + ## Options ### Top-menu diff --git a/docs/content/themes/feather/index.md b/docs/content/themes/feather/index.md index 31557273..2fe59d7a 100644 --- a/docs/content/themes/feather/index.md +++ b/docs/content/themes/feather/index.md @@ -10,8 +10,9 @@ created = 2018-01-21T04:35:36-05:00 updated = 2018-01-21T04:35:36-05:00 repository = "https://github.com/piedoom/feather" homepage = "https://github.com/piedoom/feather" -minimum_version = "0.2" +minimum_version = "0.3.4" license = "MIT" +demo = "" [extra.author] name = "doomy" diff --git a/docs/content/themes/hyde/index.md b/docs/content/themes/hyde/index.md index a0db1930..3634bb88 100644 --- a/docs/content/themes/hyde/index.md +++ b/docs/content/themes/hyde/index.md @@ -12,6 +12,7 @@ repository = "https://github.com/Keats/hyde" homepage = "https://github.com/Keats/gutenberg-hyde" minimum_version = "0.2" license = "MIT" +demo = "" [extra.author] name = "Vincent Prouillet" @@ -84,6 +85,6 @@ To create your own theme, look to the Themes section of [included CSS file](http ![Hyde with reverse layout](https://f.cloud.github.com/assets/98681/1831230/42b0d3ac-7384-11e3-8d54-2065afd03f9e.png) -Hyde's page orientation can be reversed by setting `hyde_reversed` to `true` in the `config.toml`. +Hyde's page orientation can be reversed by setting `hyde_reverse` to `true` in the `config.toml`. \ No newline at end of file diff --git a/docs/templates/theme.html b/docs/templates/theme.html index 344e5244..e3d323a6 100644 --- a/docs/templates/theme.html +++ b/docs/templates/theme.html @@ -10,8 +10,8 @@

Author: {{page.extra.author.name}}

License: {{page.extra.license}}

Homepage: {{page.extra.homepage}}

- {% if page.extra.live_demo%} -

Live Demo: {{page.extra.live_demo}}

+ {% if page.extra.demo %} +

Live Demo: {{page.extra.demo}}

{% endif %}

Last updated: {{page.extra.updated }}