Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/apvarun/showcase-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun A P <8411309+apvarun@users.noreply.github.com>2021-06-19 14:23:25 +0300
committerGitHub <noreply@github.com>2021-06-19 14:23:25 +0300
commitfb025bee7617a5a8579d7535ff3ee73b834b5db6 (patch)
treea9766092b8f097870ef4ca33dc8369103458791a
parent6c03c85ee207d8747724e76e987e29f4e747fa31 (diff)
parent3bed73053426b78f563ecf438cc149226a51846e (diff)
Merge pull request #13 from apvarun/private-pages
Private pages
-rw-r--r--README.md6
-rw-r--r--exampleSite/content/books/_index.md4
-rw-r--r--layouts/partials/head.html7
-rw-r--r--layouts/partials/header.html2
4 files changed, 14 insertions, 5 deletions
diff --git a/README.md b/README.md
index 14d8164..fdab5eb 100644
--- a/README.md
+++ b/README.md
@@ -64,6 +64,12 @@ From `exampleSite/`, copy `config.toml` to the root folder of your Hugo site and
Menu in Showcase theme is auto-generated from the sections inside your content folder.
+### Exclude Sections from Menu
+
+It is possible to exclude sections from the auto-generated list. In order to exclude a section, create an `_index.md` file in that section and set the property `private` to `true`. Refer example [index file](https://github.com/apvarun/showcase-hugo-theme/blob/master/exampleSite/content/books/_index.md).
+
+### Custom Menu
+
You can also add a custom menu item using the `config.toml` and disable auto-generated sections if not required. Refer config in [exampleSite](https://github.com/apvarun/showcase-hugo-theme/blob/master/exampleSite/config.toml)
## Google Analytics
diff --git a/exampleSite/content/books/_index.md b/exampleSite/content/books/_index.md
new file mode 100644
index 0000000..9195d97
--- /dev/null
+++ b/exampleSite/content/books/_index.md
@@ -0,0 +1,4 @@
+---
+title: Books
+private: true
+---
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 5bc3fd6..c58f796 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -11,10 +11,9 @@
/>
{{ end }}
<title>{{ .Site.Title }}</title>
- <link
- href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
- rel="stylesheet"
- />
+ <!-- Tailwind CSS JIT CDN -->
+ <script src="https://unpkg.com/tailwindcss-jit-cdn@1.3.0/dist/tailwindcss-jit-cdn.umd.min.js"></script>
+
<style>
@font-face {
font-family: "Bree Serif";
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 3c603d3..ed022a9 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -16,7 +16,7 @@
class="mr-2 px-2 rounded cursor-pointer select-none hover:text-gray-900 show-all"
>All</a
>
- {{ range .Site.Sections }}
+ {{ range where .Site.Sections ".Params.private" "!=" true }}
<a
class="mr-2 px-2 rounded cursor-pointer select-none hover:text-gray-900 filter-{{lower .Title}}"
>{{.Title}}</a