From 24ec6b0d2d284bec8dbd310bb1d828a2389682a5 Mon Sep 17 00:00:00 2001 From: kentnek Date: Tue, 16 Jun 2020 03:24:12 +0800 Subject: [PATCH] add support for creating new sections --- README.md | 15 +++++++++++++++ exampleSite/config.toml | 19 ++++++++++--------- layouts/partials/nav.html | 6 +++--- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index dca6c78..3ff94f4 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,21 @@ Where `:blog-post.md` is the name of the file of your new post. The theme supports KaTeX which renders math typesetting in markdown document. Simply turn on by `math: true` in your post. +### Adding a new section menu + +In your site's `config.toml`, add a new menu definition for say, "photos": +```toml +# config.toml + +[[menu.main]] + identifier = "photos" + name = "photos" + title = "Photos" + url = "/photos" +``` + +Then, put your posts under "content/photos". + ### Tags Right now `hugo-theme-codex` uses the `tags` taxonomy for blog posts. You can view all the blog posts of a given tag by going to `/tags/:tag-name`, where `:tag-name` is the name of your tag. diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3625fe8..b555c94 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -30,15 +30,16 @@ themesDir = "../../" # Controls the navigation [[menu.main]] - identifier = "about" - name = "about" - title = "About" - url = "/" - [[menu.main]] - identifier = "blog" - name = "blog" - title = "Blog" - url = "/blog" + identifier = "about" + name = "about" + title = "About" + url = "/" + +[[menu.main]] + identifier = "blog" + name = "blog" + title = "Blog" + url = "/blog" diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index dc55a3f..7823e4c 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -1,10 +1,10 @@