diff options
author | Stephen Siegert <stephen.siegert@sas.com> | 2019-02-17 04:42:11 +0300 |
---|---|---|
committer | Stephen Siegert <stephen.siegert@sas.com> | 2019-02-17 04:42:11 +0300 |
commit | 09c1ce1bcdd48b86ba6cdc6d07d37a7b7819e733 (patch) | |
tree | 4eb142135f04dbefff2c63f182bba2db63309e1b | |
parent | ab3165469c5a4c2f975e62b60088aea20591961c (diff) |
refactor to use post/ instead of blog/
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rwxr-xr-x | exampleSite/content/about.md (renamed from exampleSite/content/page/about-hugo.md) | 0 | ||||
-rwxr-xr-x | exampleSite/content/post/creating-a-new-theme.md (renamed from exampleSite/content/blog/creating-a-new-theme.md) | 0 | ||||
-rwxr-xr-x | exampleSite/content/post/goisforlovers.md (renamed from exampleSite/content/blog/goisforlovers.md) | 2 | ||||
-rwxr-xr-x | exampleSite/content/post/hugoisforlovers.md (renamed from exampleSite/content/blog/hugoisforlovers.md) | 2 | ||||
-rwxr-xr-x | exampleSite/content/post/migrate-from-jekyll.md (renamed from exampleSite/content/blog/migrate-from-jekyll.md) | 0 | ||||
-rwxr-xr-x | exampleSite/content/post/post-with-featured-image.md (renamed from exampleSite/content/blog/post-with-featured-image.md) | 2 | ||||
-rwxr-xr-x | exampleSite/content/post/the-figure-shortcode.md (renamed from exampleSite/content/blog/the-figure-shortcode.md) | 2 | ||||
-rwxr-xr-x | exampleSite/content/post/typography.md (renamed from exampleSite/content/blog/typography.md) | 2 | ||||
-rw-r--r-- | layouts/_default/single.html | 54 | ||||
-rw-r--r-- | layouts/page/single.html | 25 | ||||
-rw-r--r-- | layouts/post/single.html | 59 |
13 files changed, 78 insertions, 78 deletions
@@ -51,8 +51,8 @@ Check out the sample `config.toml`file located in the [`exampleSite`](https://gi | Type | Description | Command | | ----------- | ------------------------------------------------------------------------------------------- | ------------------------------------ | -| **Post** | Used for blog posts. Posts are listed on the `/blog` page. | `hugo new post/<post-name>.md` | -| **Page** | Used for site pages. | `hugo new page/<page-name>.md` | +| **Post** | Used for blog posts. Posts are listed on the `/post` page. | `hugo new post/<post-name>.md` | +| **Page** | Used for site pages. | `hugo new <page-name>.md` | | **Project** | Used for project pages. Extend project list by customizing `/layouts/section/project.html`. | `hugo new project/<project-name>.md` | ## Blog post series diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b9fe68e..1b41513 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -22,7 +22,7 @@ description = "Basic personal site theme styled with minimal tachyons, syntax hi [[params.menu]] name = "blog" - url = "blog/" + url = "post/" [[params.menu]] name = "post series" @@ -31,7 +31,7 @@ description = "Basic personal site theme styled with minimal tachyons, syntax hi [[params.menu]] name = "about" - url = "page/about-hugo" + url = "about/" [privacy] diff --git a/exampleSite/content/page/about-hugo.md b/exampleSite/content/about.md index b188b2a..b188b2a 100755 --- a/exampleSite/content/page/about-hugo.md +++ b/exampleSite/content/about.md diff --git a/exampleSite/content/blog/creating-a-new-theme.md b/exampleSite/content/post/creating-a-new-theme.md index dadebae..dadebae 100755 --- a/exampleSite/content/blog/creating-a-new-theme.md +++ b/exampleSite/content/post/creating-a-new-theme.md diff --git a/exampleSite/content/blog/goisforlovers.md b/exampleSite/content/post/goisforlovers.md index 41079d5..2c12651 100755 --- a/exampleSite/content/blog/goisforlovers.md +++ b/exampleSite/content/post/goisforlovers.md @@ -7,7 +7,7 @@ tags = [ "themes", "development", ] -date = "2014-04-02" +date = 2014-04-02 toc = true +++ diff --git a/exampleSite/content/blog/hugoisforlovers.md b/exampleSite/content/post/hugoisforlovers.md index b141af7..658a7d5 100755 --- a/exampleSite/content/blog/hugoisforlovers.md +++ b/exampleSite/content/post/hugoisforlovers.md @@ -6,7 +6,7 @@ tags = [ "hugo", "development", ] -date = "2014-04-02" +date = 2014-04-02 series = "Hugo 101" +++ diff --git a/exampleSite/content/blog/migrate-from-jekyll.md b/exampleSite/content/post/migrate-from-jekyll.md index 8dd03d5..8dd03d5 100755 --- a/exampleSite/content/blog/migrate-from-jekyll.md +++ b/exampleSite/content/post/migrate-from-jekyll.md diff --git a/exampleSite/content/blog/post-with-featured-image.md b/exampleSite/content/post/post-with-featured-image.md index 43fd10c..3c8fec4 100755 --- a/exampleSite/content/blog/post-with-featured-image.md +++ b/exampleSite/content/post/post-with-featured-image.md @@ -1,6 +1,6 @@ --- title: "Post With Featured Image" -date: 2018-10-01T16:15:09+08:00 +date: "2018-10-01T16:15:09+08:00" draft: false tags: - Demo diff --git a/exampleSite/content/blog/the-figure-shortcode.md b/exampleSite/content/post/the-figure-shortcode.md index e3e106f..d508f63 100755 --- a/exampleSite/content/blog/the-figure-shortcode.md +++ b/exampleSite/content/post/the-figure-shortcode.md @@ -1,6 +1,6 @@ --- title: 'The "figure" Shortcode' -date: 2018-12-24T12:29:41+08:00 +date: "2018-12-24T12:29:41+08:00" draft: false tags: - demo diff --git a/exampleSite/content/blog/typography.md b/exampleSite/content/post/typography.md index 29ffeba..4620f12 100755 --- a/exampleSite/content/blog/typography.md +++ b/exampleSite/content/post/typography.md @@ -1,6 +1,6 @@ --- title: "Typography" -date: 2018-09-29T11:36:33+08:00 +date: "2018-09-29T11:36:33+08:00" draft: false tags: - Demo diff --git a/layouts/_default/single.html b/layouts/_default/single.html index eb34eb1..4800a03 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,58 +1,24 @@ {{ partial "header.html" . }} <body lang="{{ .Site.LanguageCode }}" - class="sans-serif w-90 w-80-m w-60-ns center mv2 mv5-ns" + class="sans-serif w-90 w-60-ns center center-ns mv2 mv5-ns" itemscope itemtype="http://schema.org/Article" > - + {{ $baseurl := .Site.BaseURL }} <span class="b">/ </span> - <a href="{{ .Site.BaseURL }}" class="b bb bw1 pb1 no-underline black">{{ .Site.Title }}</a> - <span class="b"> / </span> - <a href="/blog" class="b bb bw1 pb1 no-underline black">blog</a> + <a + href="{{ .Site.BaseURL }}" + class="b bb bw1 pb1 no-underline black" + >{{ .Site.Title }}</a + > <section id="main" class="mt5"> <h1 itemprop="name" id="title">{{ .Title }}</h1> - <span class="f6 gray">{{ .Date.Format "January 2, 2006" }}</span> - <article itemprop="articleBody" id="content" class="w-90 lh-copy"> - {{ .Content }} - </article> - - {{ if and (.Site.Taxonomies.series) (isset .Params "series") }} - <section class="mt4"> - {{ $readMore := ":wave:" }} - {{ $series := .Params.series | urlize}} - <h3>{{ $readMore | emojify }} Related posts in the <a href="/series/{{ $series }}" class="b bb bw1 pb1 no-underline black">{{ .Params.Series }}</a> series...</h3> - - {{ $posts := index .Site.Taxonomies.series $series }} - - {{ if (gt ($posts | len) 1)}} - <ul class="list pl0"> - {{ range where $posts "Title" "!=" .Title }} - <li class="list pl0 lh-copy"> - <a - class="f4 b dib black no-underline" - href="{{ .Permalink}}" - >{{ .Title }}</a - > - <span class="f6 gray">{{ .Date.Format "January 2, 2006" }}</span> - </li> - {{ end }} - </ul> - {{ else }} - <div class="ph2 i"> - No follow up posts yet. Check back soon! - </div> - {{ end }} - </section> - {{ end }} - - <span class="f6 gray mt3" title="Lastmod: {{ .Lastmod.Format "January 2, 2006" }}. Published at: {{ .PublishDate.Format "2006-01-02" }}."> - {{ if ne .Lastmod .PublishDate }} - Modified : {{ dateFormat "January 2, 2006" .Lastmod }} - {{ end }} - </span> + <article itemprop="articleBody" id="content" class="w-90 lh-copy"> + {{ .Content }} + </article> </section> {{ partial "footer.html" . }} diff --git a/layouts/page/single.html b/layouts/page/single.html deleted file mode 100644 index 4800a03..0000000 --- a/layouts/page/single.html +++ /dev/null @@ -1,25 +0,0 @@ -{{ partial "header.html" . }} -<body - lang="{{ .Site.LanguageCode }}" - class="sans-serif w-90 w-60-ns center center-ns mv2 mv5-ns" - itemscope - itemtype="http://schema.org/Article" -> - {{ $baseurl := .Site.BaseURL }} - <span class="b">/ </span> - <a - href="{{ .Site.BaseURL }}" - class="b bb bw1 pb1 no-underline black" - >{{ .Site.Title }}</a - > - - <section id="main" class="mt5"> - <h1 itemprop="name" id="title">{{ .Title }}</h1> - - <article itemprop="articleBody" id="content" class="w-90 lh-copy"> - {{ .Content }} - </article> - </section> - - {{ partial "footer.html" . }} -</body> diff --git a/layouts/post/single.html b/layouts/post/single.html new file mode 100644 index 0000000..310f7cb --- /dev/null +++ b/layouts/post/single.html @@ -0,0 +1,59 @@ +{{ partial "header.html" . }} +<body + lang="{{ .Site.LanguageCode }}" + class="sans-serif w-90 w-80-m w-60-ns center mv2 mv5-ns" + itemscope + itemtype="http://schema.org/Article" +> + + <span class="b">/ </span> + <a href="{{ .Site.BaseURL }}" class="b bb bw1 pb1 no-underline black">{{ .Site.Title }}</a> + <span class="b"> / </span> + <a href="/post" class="b bb bw1 pb1 no-underline black">blog</a> + + <section id="main" class="mt5"> + <h1 itemprop="name" id="title">{{ .Title }}</h1> + <span class="f6 gray">{{ .Date.Format "January 2, 2006" }}</span> + + <article itemprop="articleBody" id="content" class="w-90 lh-copy"> + {{ .Content }} + </article> + + {{ if and (.Site.Taxonomies.series) (isset .Params "series") }} + <section class="mt4"> + {{ $readMore := ":wave:" }} + {{ $series := .Params.series | urlize}} + <h3>{{ $readMore | emojify }} Related posts in the <a href="/series/{{ $series }}" class="b bb bw1 pb1 no-underline black">{{ .Params.Series }}</a> series...</h3> + + {{ $posts := index .Site.Taxonomies.series $series }} + + {{ if (gt ($posts | len) 1)}} + <ul class="list pl0"> + {{ range where $posts "Title" "!=" .Title }} + <li class="list pl0 lh-copy"> + <a + class="f4 b dib black no-underline" + href="{{ .Permalink}}" + >{{ .Title }}</a + > + <span class="f6 gray">{{ .Date.Format "January 2, 2006" }}</span> + </li> + {{ end }} + </ul> + {{ else }} + <div class="ph2 i"> + No follow up posts yet. Check back soon! + </div> + {{ end }} + </section> + {{ end }} + + <span class="f6 gray mt3" title="Lastmod: {{ .Lastmod.Format "January 2, 2006" }}. Published at: {{ .PublishDate.Format "2006-01-02" }}."> + {{ if ne .Lastmod .PublishDate }} + Modified : {{ dateFormat "January 2, 2006" .Lastmod }} + {{ end }} + </span> + </section> + + {{ partial "footer.html" . }} +</body> |