diff options
author | Hidenori Matsuki <dev@mazgi.com> | 2020-11-01 11:51:13 +0300 |
---|---|---|
committer | Hidenori Matsuki <dev@mazgi.com> | 2020-11-01 11:51:13 +0300 |
commit | d20b438615bbaf28e6ebff688256bb3e3230fb44 (patch) | |
tree | f72212895a61a85bd01ff501e47affec3a6477f9 | |
parent | 8293c1c2a05b2c74080c12b509792687e54a36fd (diff) |
fix list terms
-rw-r--r-- | exampleSite/content/posts/2006.01/first-page.en.md | 3 | ||||
-rw-r--r-- | exampleSite/content/posts/2006.01/first-page.ja.md | 3 | ||||
-rw-r--r-- | exampleSite/content/posts/2006.01/second-page.en.md | 80 | ||||
-rw-r--r-- | exampleSite/content/posts/2006.01/second-page.ja.md | 80 | ||||
-rw-r--r-- | layouts/_default/list.html | 42 | ||||
-rw-r--r-- | layouts/index.html | 19 |
6 files changed, 212 insertions, 15 deletions
diff --git a/exampleSite/content/posts/2006.01/first-page.en.md b/exampleSite/content/posts/2006.01/first-page.en.md index ea82ffe..9c60a59 100644 --- a/exampleSite/content/posts/2006.01/first-page.en.md +++ b/exampleSite/content/posts/2006.01/first-page.en.md @@ -2,8 +2,9 @@ title: "First Page" date: 2018-10-04T05:12:12Z description: "My first post" -tags: ["hugo", "example"] authors: ["John", "Jugemu Jugemu Gokoh no Surikire"] +categories: ["example-category-a", "cat-b"] +tags: ["example-tag-a"] --- ## My first post diff --git a/exampleSite/content/posts/2006.01/first-page.ja.md b/exampleSite/content/posts/2006.01/first-page.ja.md index c4e0e6c..4f4a9f8 100644 --- a/exampleSite/content/posts/2006.01/first-page.ja.md +++ b/exampleSite/content/posts/2006.01/first-page.ja.md @@ -2,8 +2,9 @@ title: "最初のページ" date: 2018-10-04T05:12:12Z description: "私の最初のポスト" -tags: ["hugo", "example"] authors: ["John", "Jugemu Jugemu Gokoh no Surikire"] +categories: ["example-category-a", "cat-b"] +tags: ["example-tag-a"] --- ## 私の最初のポスト diff --git a/exampleSite/content/posts/2006.01/second-page.en.md b/exampleSite/content/posts/2006.01/second-page.en.md index 32efb78..b9b8b25 100644 --- a/exampleSite/content/posts/2006.01/second-page.en.md +++ b/exampleSite/content/posts/2006.01/second-page.en.md @@ -1,8 +1,9 @@ --- title: "Second Page" date: 2018-10-05T05:12:12Z -tags: ["example"] authors: ["John", "Smith"] +categories: ["cat-b"] +tags: ["example-tag-a", "tag-b"] --- ## My second post @@ -11,9 +12,86 @@ authors: ["John", "Smith"] The pretty cat photo from [here](https://www.pexels.com/photo/grey-and-white-short-fur-cat-104827/). +<!--more--> + | col1 | col2 | col3 | | ------ | ---------------- | ------ | | val1-1 | val2-1 | val3-1 | | val1-2 | val2-2 long text | val3-2 | | val1-3 | val2-3 | val3-3 | | val1-4 | val2-4 | val3-4 | + +```shellsession +$ hugo help +hugo is the main command, used to build your Hugo site. + +Hugo is a Fast and Flexible Static Site Generator +built with love by spf13 and friends in Go. + +Complete documentation is available at http://gohugo.io/. + +Usage: + hugo [flags] + hugo [command] + +Available Commands: + config Print the site configuration + convert Convert your content to different formats + deploy Deploy your site to a Cloud provider. + env Print Hugo version and environment info + gen A collection of several useful generators. + help Help about any command + import Import your site from others. + list Listing out various types of content + mod Various Hugo Modules helpers. + new Create new content for your site + server A high performance webserver + version Print the version number of Hugo + +Flags: + -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ + -D, --buildDrafts include content marked as draft + -E, --buildExpired include expired content + -F, --buildFuture include content with publishdate in the future + --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ + --cleanDestinationDir remove files from destination not found in static directories + --config string config file (default is path/config.yaml|json|toml) + --configDir string config dir (default "config") + -c, --contentDir string filesystem path to content directory + --debug debug output + -d, --destination string filesystem path to write files to + --disableKinds strings disable different kind of pages (home, RSS etc.) + --enableGitInfo add Git revision, date and author info to the pages + -e, --environment string build environment + --forceSyncStatic copy all files when static is changed. + --gc enable to run some cleanup tasks (remove unused cache files) after the build + -h, --help help for hugo + --i18n-warnings print missing translations + --ignoreCache ignores the cache directory + --ignoreVendor ignores any _vendor directory + --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern + -l, --layoutDir string filesystem path to layout directory + --log enable Logging + --logFile string log File path (if set, logging enabled automatically) + --minify minify any supported output format (HTML, XML etc.) + --noChmod don't sync permission mode of files + --noTimes don't sync modification time of files + --path-warnings print warnings on duplicate target paths etc. + --print-mem print memory usage to screen at intervals + --quiet build in quiet mode + --renderToMemory render to memory (only useful for benchmark testing) + -s, --source string filesystem path to read files relative from + --templateMetrics display metrics about template executions + --templateMetricsHints calculate some improvement hints when combined with --templateMetrics + -t, --theme strings themes to use (located in /themes/THEMENAME/) + --themesDir string filesystem path to themes directory + --trace file write trace to file (not useful in general) + -v, --verbose verbose output + --verboseLog verbose logging + -w, --watch watch filesystem for changes and recreate as needed + +Additional help topics: + hugo check Contains some verification checks + +Use "hugo [command] --help" for more information about a command. +``` diff --git a/exampleSite/content/posts/2006.01/second-page.ja.md b/exampleSite/content/posts/2006.01/second-page.ja.md index 73d2b2f..98cb3c5 100644 --- a/exampleSite/content/posts/2006.01/second-page.ja.md +++ b/exampleSite/content/posts/2006.01/second-page.ja.md @@ -1,8 +1,9 @@ --- title: "2番目のページ" date: 2018-10-05T05:12:12Z -tags: ["example"] authors: ["John", "Smith"] +categories: ["cat-b"] +tags: ["example-tag-a", "tag-b"] --- ## 私の 2 番目のポスト @@ -11,9 +12,86 @@ authors: ["John", "Smith"] かわいい猫の写真は[こちら](https://www.pexels.com/photo/grey-and-white-short-fur-cat-104827/)からお借りしました。 +<!--more--> + | col1 | col2 | col3 | | ------ | ------------------- | ------ | | val1-1 | val2-1 | val3-1 | | val1-2 | val2-2 長いテキスト | val3-2 | | val1-3 | val2-3 | val3-3 | | val1-4 | val2-4 | val3-4 | + +```shellsession +$ hugo help +hugo is the main command, used to build your Hugo site. + +Hugo is a Fast and Flexible Static Site Generator +built with love by spf13 and friends in Go. + +Complete documentation is available at http://gohugo.io/. + +Usage: + hugo [flags] + hugo [command] + +Available Commands: + config Print the site configuration + convert Convert your content to different formats + deploy Deploy your site to a Cloud provider. + env Print Hugo version and environment info + gen A collection of several useful generators. + help Help about any command + import Import your site from others. + list Listing out various types of content + mod Various Hugo Modules helpers. + new Create new content for your site + server A high performance webserver + version Print the version number of Hugo + +Flags: + -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ + -D, --buildDrafts include content marked as draft + -E, --buildExpired include expired content + -F, --buildFuture include content with publishdate in the future + --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ + --cleanDestinationDir remove files from destination not found in static directories + --config string config file (default is path/config.yaml|json|toml) + --configDir string config dir (default "config") + -c, --contentDir string filesystem path to content directory + --debug debug output + -d, --destination string filesystem path to write files to + --disableKinds strings disable different kind of pages (home, RSS etc.) + --enableGitInfo add Git revision, date and author info to the pages + -e, --environment string build environment + --forceSyncStatic copy all files when static is changed. + --gc enable to run some cleanup tasks (remove unused cache files) after the build + -h, --help help for hugo + --i18n-warnings print missing translations + --ignoreCache ignores the cache directory + --ignoreVendor ignores any _vendor directory + --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern + -l, --layoutDir string filesystem path to layout directory + --log enable Logging + --logFile string log File path (if set, logging enabled automatically) + --minify minify any supported output format (HTML, XML etc.) + --noChmod don't sync permission mode of files + --noTimes don't sync modification time of files + --path-warnings print warnings on duplicate target paths etc. + --print-mem print memory usage to screen at intervals + --quiet build in quiet mode + --renderToMemory render to memory (only useful for benchmark testing) + -s, --source string filesystem path to read files relative from + --templateMetrics display metrics about template executions + --templateMetricsHints calculate some improvement hints when combined with --templateMetrics + -t, --theme strings themes to use (located in /themes/THEMENAME/) + --themesDir string filesystem path to themes directory + --trace file write trace to file (not useful in general) + -v, --verbose verbose output + --verboseLog verbose logging + -w, --watch watch filesystem for changes and recreate as needed + +Additional help topics: + hugo check Contains some verification checks + +Use "hugo [command] --help" for more information about a command. +``` diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4061bed..908ac05 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,7 +1,11 @@ {{ partial "header.html" . }} <div class="row"> <div class="col-lg-9"> - {{ if and ( eq .Kind "taxonomy" ) ( eq .Type "authors" ) }} + + <!-- content header --> + + <!-- /authors/* --> + {{ if and ( eq .Kind "term" ) ( eq .Type "authors" ) }} <div class="row"> <h2>{{ .Name }}'s articles</h2> </div> @@ -11,14 +15,30 @@ </div> <hr/> {{ end }} - {{ end }} - {{ $paginator := .Paginate ( where .Site.RegularPages "Section" "ne" "profiles" ) }} + <!-- /categories/* --> + {{ else if and ( eq .Kind "term" ) ( eq .Type "categories" ) }} + <div class="row"> + <h2>{{ .Name }}</h2> + </div> + + <!-- /tags/* --> + {{ else if and ( eq .Kind "term" ) ( eq .Type "tags" ) }} + <div class="row"> + <h2>{{ .Name }}</h2> + </div> + + <!-- / --> + {{ else }} + {{ end }} + + <!-- contents --> + {{ $paginator := .Paginate ( where .Data.Pages "Section" "ne" "profiles" ) }} {{ range $idx, $page := $paginator.Pages }} {{ if $page.Section }} <article> <div class="row"> - <h3><a href="{{ .RelPermalink}}">{{ .Title }}</a></h3> + <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3> </div> <div class="row"> <span class="ml-1">Created At: {{ .Date.Format "2006.01.02" }}</span> @@ -28,10 +48,10 @@ {{ with .Params.Authors }} {{ range . }} <a class="ml-1 badge badge-pill badge-secondary" href="{{ "/authors/" | relLangURL }}{{ . | urlize }}/">{{ . }}</a> - {{ end }} - {{ end }} + {{ end }} <!-- end of range --> + {{ end }} <!-- end of with --> </span> - {{ end }} + {{ end }} <!-- end of if --> </div> <div class="row"> {{ .Summary }} @@ -40,13 +60,13 @@ {{ with .Params.Tags }} {{ range . }} <a class="ml-1 badge badge-pill badge-secondary" href="{{ "/tags/" | relLangURL }}{{ . | urlize }}/">{{ . }}</a> - {{ end }} - {{ end }} + {{ end }} <!-- end of range --> + {{ end }} <!-- end of with --> </div> </article> <hr/> - {{ end }} - {{ end }} + {{ end }} <!-- end of if --> + {{ end }} <!-- end of range --> {{ partial "pagination.html" . }} </div> diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..8659621 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,19 @@ +{{ partial "header.html" . }} +<div class="row"> + <div class="col-lg-9"> + {{ range ( .Paginate ( where .Site.RegularPages "Section" "posts" )).Pages }} + <article> + <div class="row"> + <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3> + </div> + <div class="row"> + {{ .Summary }} + </div> + </article> + {{ end }} + </div> + <div class="col-lg-3"> + {{ partial "sidebar.html" . }} + </div> +</div> +{{ partial "footer.html" . }} |