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

github.com/zwbetz-gh/minimal-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Betz <zwbetz@gmail.com>2018-12-06 08:41:08 +0300
committerZachary Betz <zwbetz@gmail.com>2018-12-06 08:41:08 +0300
commit372ee6b37d8bbbe19abc2c8bc36709b4889fc2ed (patch)
tree553098ec12037286b87930bf28dd82939b053e7c
parent74322e9842342f0610e004cd4d7b5414bc54cde4 (diff)
Add support for tags
-rw-r--r--README.md15
-rw-r--r--archetypes/post.md1
-rw-r--r--dev-notes.md4
-rw-r--r--exampleSite/config.toml11
-rw-r--r--exampleSite/content/about.md12
-rw-r--r--exampleSite/content/contact.md6
-rw-r--r--exampleSite/content/post/creating-a-new-theme.md1
-rw-r--r--exampleSite/content/post/goisforlovers.md1
-rw-r--r--exampleSite/content/post/hugoisforlovers.md1
-rw-r--r--exampleSite/content/post/migrate-from-jekyll.md1
-rw-r--r--exampleSite/content/post/script-to-add-a-page-level-variable-to-content-front-matter-in-hugo.md1
-rw-r--r--exampleSite/content/post/use-snap-to-install-the-hugo-edge-version-on-fedora-and-ubuntu.md1
-rw-r--r--layouts/404.html0
-rw-r--r--layouts/index.html14
-rw-r--r--layouts/partials/post-list.html16
-rw-r--r--layouts/post/single.html15
-rw-r--r--layouts/taxonomy/taxonomy.html7
-rw-r--r--layouts/taxonomy/terms.html14
18 files changed, 87 insertions, 34 deletions
diff --git a/README.md b/README.md
index 9e7f934..e001b4b 100644
--- a/README.md
+++ b/README.md
@@ -116,6 +116,9 @@ title = "Some Title"
theme = "minimal-bootstrap-hugo-theme"
enableGitInfo = false
+[taxonomies]
+ tag = "tags"
+
pygmentsCodefences = true
pygmentsCodefencesGuessSyntax = true
pygmentsStyle = "pygments"
@@ -151,13 +154,17 @@ pygmentsStyle = "pygments"
url = "/"
weight = 1
[[menu.nav]]
- name = "About"
- url = "/about/"
+ name = "Tags"
+ url = "/tags/"
weight = 2
[[menu.nav]]
- name = "Some Page"
- url = "#"
+ name = "About"
+ url = "/about/"
weight = 3
+ [[menu.nav]]
+ name = "RSS"
+ url = "/index.xml"
+ weight = 4
```
## config.toml Options
diff --git a/archetypes/post.md b/archetypes/post.md
index d0c80e6..67ec913 100644
--- a/archetypes/post.md
+++ b/archetypes/post.md
@@ -4,4 +4,5 @@ date: {{ .Date }}
publishdate: {{ now.Format "2006-01-02" }}
lastmod: {{ now.Format "2006-01-02" }}
draft: true
+tags: []
---
diff --git a/dev-notes.md b/dev-notes.md
index d7855c7..581ebd0 100644
--- a/dev-notes.md
+++ b/dev-notes.md
@@ -4,8 +4,10 @@ To build the example site against the theme locally:
```
hugo server \
+--gc \
--source exampleSite \
--config exampleSite/config.toml \
--themesDir ../.. \
---theme minimal-bootstrap-hugo-theme
+--theme minimal-bootstrap-hugo-theme \
+--renderToDisk
``` \ No newline at end of file
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 5cc51e9..dc0410f 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -3,6 +3,9 @@ languageCode = "en-us"
title = "Some Title"
enableGitInfo = false
+[taxonomies]
+ tag = "tags"
+
[permalinks]
post = "/:filename/"
@@ -34,12 +37,12 @@ enableGitInfo = false
url = "/"
weight = 1
[[menu.nav]]
- name = "About"
- url = "/about/"
+ name = "Tags"
+ url = "/tags/"
weight = 2
[[menu.nav]]
- name = "Contact"
- url = "/contact/"
+ name = "About"
+ url = "/about/"
weight = 3
[[menu.nav]]
name = "RSS"
diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md
index e2dd6c6..a9933bf 100644
--- a/exampleSite/content/about.md
+++ b/exampleSite/content/about.md
@@ -1,8 +1,14 @@
+++
-title = "About Hugo"
+title = "About"
date = "2014-04-09"
+++
+## This Theme
+
+Thanks for visiting this theme demo. If you're interested, checkout my other stuff over at <https://zwbetz.com>
+
+## Hugo
+
Hugo is the **world’s fastest framework for building websites**. It is written in Go.
It makes use of a variety of open source projects including:
@@ -15,4 +21,8 @@ It makes use of a variety of open source projects including:
Learn more and contribute on [GitHub](https://github.com/gohugoio).
+---
+
+<small>
_Favicon made by [Freepik](https://www.freepik.com/), from [Flaticon](https://www.flaticon.com/), licensed by [CC 3.0](http://creativecommons.org/licenses/by/3.0/)._
+</small>
diff --git a/exampleSite/content/contact.md b/exampleSite/content/contact.md
deleted file mode 100644
index ff98cab..0000000
--- a/exampleSite/content/contact.md
+++ /dev/null
@@ -1,6 +0,0 @@
-+++
-title = "Contact"
-date = "2014-04-09"
-+++
-
-Thanks for visiting this theme demo. If you're interested, checkout my other stuff over at <https://zwbetz.com> \ No newline at end of file
diff --git a/exampleSite/content/post/creating-a-new-theme.md b/exampleSite/content/post/creating-a-new-theme.md
index 9708182..d467834 100644
--- a/exampleSite/content/post/creating-a-new-theme.md
+++ b/exampleSite/content/post/creating-a-new-theme.md
@@ -4,6 +4,7 @@ date: 2014-09-28
publishdate: 2014-09-28
lastmod: 2014-09-28
draft: false
+tags: ["hugo", "theme", "command-line"]
---
diff --git a/exampleSite/content/post/goisforlovers.md b/exampleSite/content/post/goisforlovers.md
index 47e8be5..59e6f8d 100644
--- a/exampleSite/content/post/goisforlovers.md
+++ b/exampleSite/content/post/goisforlovers.md
@@ -4,6 +4,7 @@ date = "2014-04-02"
publishdate = "2014-04-02"
lastmod = "2014-04-02"
draft = false
+tags = ["go", "templates", "hugo"]
+++
Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for
diff --git a/exampleSite/content/post/hugoisforlovers.md b/exampleSite/content/post/hugoisforlovers.md
index 17aa245..baaa7b1 100644
--- a/exampleSite/content/post/hugoisforlovers.md
+++ b/exampleSite/content/post/hugoisforlovers.md
@@ -4,6 +4,7 @@ date = "2014-04-02"
publishdate = "2014-04-02"
lastmod = "2014-04-02"
draft = false
+tags = ["hugo", "git", "fun"]
+++
## Step 1. Install Hugo
diff --git a/exampleSite/content/post/migrate-from-jekyll.md b/exampleSite/content/post/migrate-from-jekyll.md
index 962f959..2ac95b8 100644
--- a/exampleSite/content/post/migrate-from-jekyll.md
+++ b/exampleSite/content/post/migrate-from-jekyll.md
@@ -4,6 +4,7 @@ date: 2014-03-10
publishdate: 2014-03-10
lastmod: 2014-03-10
draft: false
+tags: ["hugo", "jekyll", "migration", "git", "templates"]
---
## Move static content to `static`
diff --git a/exampleSite/content/post/script-to-add-a-page-level-variable-to-content-front-matter-in-hugo.md b/exampleSite/content/post/script-to-add-a-page-level-variable-to-content-front-matter-in-hugo.md
index 5387ccf..f9ea6ce 100644
--- a/exampleSite/content/post/script-to-add-a-page-level-variable-to-content-front-matter-in-hugo.md
+++ b/exampleSite/content/post/script-to-add-a-page-level-variable-to-content-front-matter-in-hugo.md
@@ -4,6 +4,7 @@ date: 2018-10-10T12:43:20-05:00
publishdate: 2018-10-10
lastmod: 2018-10-11
draft: false
+tags: ["hugo", "command-line", "awk"]
---
This was originally a question posed on the [hugo discussion forums](https://discourse.gohugo.io/t/set-frontmatter-params-in-list-template/14645).
diff --git a/exampleSite/content/post/use-snap-to-install-the-hugo-edge-version-on-fedora-and-ubuntu.md b/exampleSite/content/post/use-snap-to-install-the-hugo-edge-version-on-fedora-and-ubuntu.md
index 2c93514..b9f49c4 100644
--- a/exampleSite/content/post/use-snap-to-install-the-hugo-edge-version-on-fedora-and-ubuntu.md
+++ b/exampleSite/content/post/use-snap-to-install-the-hugo-edge-version-on-fedora-and-ubuntu.md
@@ -6,6 +6,7 @@ lastmod: 2018-10-26
draft: false
aliases:
- /use-snap-to-install-the-hugo-edge-version-on-fedora/
+tags: ["hugo", "snap", "fedora", "ubuntu"]
---
If you are using the Fedora or Ubuntu Linux distributions -- I'm currently on Fedora 28 -- and would like to [help test the latest development version of Hugo](https://discourse.gohugo.io/t/help-test-upcoming-hugo-0-50/14880), or if you just want to be on the bleeding-edge of things, this post is for you.
diff --git a/layouts/404.html b/layouts/404.html
deleted file mode 100644
index e69de29..0000000
--- a/layouts/404.html
+++ /dev/null
diff --git a/layouts/index.html b/layouts/index.html
index 4254c90..7043173 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -3,18 +3,6 @@
{{ $homepage := "" }}{{ range first 1 .Site.Menus.nav }}{{ $homepage = .Name }}{{ end }}
<h1>{{ $homepage }}</h1>
-{{ range where .Pages.ByPublishDate.Reverse "Section" "post" }}
- <p>
- <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
- {{ $customDateFormat := "January 2, 2006" }}
- {{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
- <br>
- <small class="text-secondary">{{ .PublishDate.Format $customDateFormat }}</small>
- {{ if eq .Site.Params.showPostSummary true }}
- <br>
- {{ .Summary }}
- {{ end }}
- </p>
-{{ end }}
+{{ partial "post-list" . }}
{{- end -}} \ No newline at end of file
diff --git a/layouts/partials/post-list.html b/layouts/partials/post-list.html
new file mode 100644
index 0000000..9a8b0a3
--- /dev/null
+++ b/layouts/partials/post-list.html
@@ -0,0 +1,16 @@
+{{ range where .Pages.ByPublishDate.Reverse "Section" "post" }}
+ <p>
+ <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
+ {{ $customDateFormat := "January 2, 2006" }}
+ {{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
+ <br>
+ <small class="text-secondary">{{ .PublishDate.Format $customDateFormat }}</small>
+ {{ range .Params.tags }}
+ <small><code><a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a></code></small>
+ {{ end }}
+ {{ if eq .Site.Params.showPostSummary true }}
+ <br>
+ {{ .Summary }}
+ {{ end }}
+ </p>
+{{ end }} \ No newline at end of file
diff --git a/layouts/post/single.html b/layouts/post/single.html
index 9e70fe5..933925f 100644
--- a/layouts/post/single.html
+++ b/layouts/post/single.html
@@ -1,11 +1,16 @@
{{- define "main" -}}
<h1>{{ .Title | markdownify }}</h1>
-<p><small class="text-secondary">
-{{ $customDateFormat := "January 2, 2006" }}
-{{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
-{{ .PublishDate.Format $customDateFormat }}{{ if gt .Lastmod .PublishDate }}, updated {{ .Lastmod.Format $customDateFormat }}{{ end }}
-</small></p>
+<p>
+ <small class="text-secondary">
+ {{ $customDateFormat := "January 2, 2006" }}
+ {{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
+ {{ .PublishDate.Format $customDateFormat }}{{ if gt .Lastmod .PublishDate }}, updated {{ .Lastmod.Format $customDateFormat }}{{ end }}
+ </small>
+ {{ range .Params.tags }}
+ <small><code><a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a></code></small>
+ {{ end }}
+</p>
{{ .Content }}
{{- end -}} \ No newline at end of file
diff --git a/layouts/taxonomy/taxonomy.html b/layouts/taxonomy/taxonomy.html
new file mode 100644
index 0000000..5a0de4d
--- /dev/null
+++ b/layouts/taxonomy/taxonomy.html
@@ -0,0 +1,7 @@
+{{- define "main" -}}
+
+<h1>{{ .Title }}</h1>
+
+{{ partial "post-list" . }}
+
+{{- end -}} \ No newline at end of file
diff --git a/layouts/taxonomy/terms.html b/layouts/taxonomy/terms.html
new file mode 100644
index 0000000..8216a5d
--- /dev/null
+++ b/layouts/taxonomy/terms.html
@@ -0,0 +1,14 @@
+{{- define "main" -}}
+
+<h1>{{ .Title }}</h1>
+
+{{ $type := .Type }}
+{{ range $key, $value := .Data.Terms.ByCount }}
+ {{ $name := .Name }}
+ {{ $count := .Count }}
+ {{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
+ <p><a href="{{ .Permalink }}"><code>{{ $name }}</code></a> {{ $count }}</p>
+ {{ end }}
+{{ end }}
+
+{{- end -}} \ No newline at end of file