From 6e5c552d9d623c32293d6b43e279f2ac092f506d Mon Sep 17 00:00:00 2001 From: Nick Gracilla Date: Sat, 1 Feb 2020 12:04:02 -0600 Subject: update templates with readingtime --- layouts/partials/article/hero.html | 4 ++-- layouts/partials/article/next.html | 4 ++-- layouts/partials/articles/list.html | 8 ++++---- layouts/partials/author/articles_list.html | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/layouts/partials/article/hero.html b/layouts/partials/article/hero.html index 16be937..f17f860 100644 --- a/layouts/partials/article/hero.html +++ b/layouts/partials/article/hero.html @@ -6,7 +6,7 @@
{{ partial "article/authors.html" . }} {{ .Page.Date.Format "January 2, 2006" }} - {{ with .Page.Params.timetoread }} • {{ . }} min read{{ end }} + • {{ .ReadingTime }} min read
@@ -16,4 +16,4 @@ {{ end }} - \ No newline at end of file + diff --git a/layouts/partials/article/next.html b/layouts/partials/article/next.html index 5b5a895..fafb9ca 100644 --- a/layouts/partials/article/next.html +++ b/layouts/partials/article/next.html @@ -37,7 +37,7 @@ of the whole section and append them to our $next slice. */}} {{ if not $index}} id="article-link-bigger"{{ end }}>
- +

@@ -47,7 +47,7 @@ of the whole section and append them to our $next slice. */}} {{ $article.Params.excerpt }}

diff --git a/layouts/partials/articles/list.html b/layouts/partials/articles/list.html index 39ff17b..0ab9aa4 100644 --- a/layouts/partials/articles/list.html +++ b/layouts/partials/articles/list.html @@ -9,7 +9,7 @@ {{ if not $counter }}
{{ end }} -
- +

@@ -33,7 +33,7 @@ {{ $article.Params.excerpt }}

@@ -52,4 +52,4 @@ {{ end }}
{{ partial "paginator/paginator.html" . }} - \ No newline at end of file + diff --git a/layouts/partials/author/articles_list.html b/layouts/partials/author/articles_list.html index 604950d..ec25b09 100644 --- a/layouts/partials/author/articles_list.html +++ b/layouts/partials/author/articles_list.html @@ -10,7 +10,7 @@
- +

@@ -20,7 +20,7 @@ {{ .Params.excerpt }}

@@ -36,4 +36,4 @@ {{ $script := resources.Get "js/toggleBorder.js" }} - \ No newline at end of file + -- cgit v1.2.3 From e97641fda3cb28d0df7efeb24519f0ec95f36cfd Mon Sep 17 00:00:00 2001 From: Nick Gracilla Date: Sat, 1 Feb 2020 12:05:51 -0600 Subject: remove timetoread from sample data and forestry config --- .forestry/front_matter/templates/post.yml | 14 ++------------ exampleSite/content/post/emoji-support.md | 7 +++---- exampleSite/content/post/markdown-syntax.md | 4 +--- exampleSite/content/post/math-typesetting.mmark | 8 +++----- exampleSite/content/post/placeholder-text.md | 1 - 5 files changed, 9 insertions(+), 25 deletions(-) diff --git a/.forestry/front_matter/templates/post.yml b/.forestry/front_matter/templates/post.yml index 1fa6fcd..dd1b254 100644 --- a/.forestry/front_matter/templates/post.yml +++ b/.forestry/front_matter/templates/post.yml @@ -18,19 +18,9 @@ fields: description: '' config: required: false - date_format: - time_format: + date_format: + time_format: display_utc: false -- name: timeToRead - type: number - label: Read Time - description: The time it takes to read the post (in minutes) - default: 0 - config: - required: true - min: - max: - step: - name: hero type: file config: diff --git a/exampleSite/content/post/emoji-support.md b/exampleSite/content/post/emoji-support.md index ab97b3a..1c6774c 100644 --- a/exampleSite/content/post/emoji-support.md +++ b/exampleSite/content/post/emoji-support.md @@ -3,15 +3,14 @@ title: Emoji Support date: 2019-03-05 hero: "/images/hero-3.jpg" excerpt: Guide to emoji usage in Hugo -timeToRead: 8 authors: - Hugo Authors --- -Emoji can be enabled in a Hugo project in a number of ways. +Emoji can be enabled in a Hugo project in a number of ways. -The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). +The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. @@ -45,4 +44,4 @@ font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,And } } -{{< /css.inline >}} \ No newline at end of file +{{< /css.inline >}} diff --git a/exampleSite/content/post/markdown-syntax.md b/exampleSite/content/post/markdown-syntax.md index c322865..f9b3b4e 100644 --- a/exampleSite/content/post/markdown-syntax.md +++ b/exampleSite/content/post/markdown-syntax.md @@ -3,7 +3,6 @@ title: Markdown Syntax Guide date: 2019-03-11 hero: "/images/hero-2.jpg" excerpt: Sample article showcasing basic Markdown syntax and formatting for HTML elements. -timeToRead: 10 authors: - Hugo Authors @@ -40,7 +39,7 @@ The blockquote element represents content that is quoted from another source, op #### Blockquote with attribution -> Don't communicate by sharing memory, share memory by communicating. +> Don't communicate by sharing memory, share memory by communicating. > — Rob Pike[^1] @@ -124,4 +123,3 @@ Xn + Yn = Zn Press CTRL+ALT+Delete to end the session. Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. - diff --git a/exampleSite/content/post/math-typesetting.mmark b/exampleSite/content/post/math-typesetting.mmark index 5f83130..2c1f412 100644 --- a/exampleSite/content/post/math-typesetting.mmark +++ b/exampleSite/content/post/math-typesetting.mmark @@ -3,7 +3,6 @@ title: Math Typesetting date: 2019-03-08 hero: /images/hero-6.jpg excerpt: A brief guide to setup KaTeX -timeToRead: 8 authors: - Hugo Authors @@ -16,13 +15,13 @@ In this example we will be using [KaTeX](https://katex.org/) - Create a partial under `/layouts/partials/math.html` - Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. -- Include the partial in your templates like so: +- Include the partial in your templates like so: ```go {{ if or .Params.math .Site.Params.math }} {{ partial "math.html" . }} {{ end }} -``` +``` - To enable KaTex globally set the parameter `math` to `true` in a project's configuration - To enable KaTex on a per page basis include the parameter `math: true` in content files. @@ -43,6 +42,5 @@ Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$ Block math: $$ - \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } $$ - diff --git a/exampleSite/content/post/placeholder-text.md b/exampleSite/content/post/placeholder-text.md index 579e441..8e8a710 100644 --- a/exampleSite/content/post/placeholder-text.md +++ b/exampleSite/content/post/placeholder-text.md @@ -3,7 +3,6 @@ title: Placeholder Text date: 2019-03-09 hero: /images/hero-4.jpg excerpt: Lorem Ipsum Dolor Si Amet -timeToRead: 5 authors: - Hugo Authors -- cgit v1.2.3 From f81c6e966231bbe190d82c73b0ce5c2f60e16a2d Mon Sep 17 00:00:00 2001 From: Nick Gracilla Date: Sat, 1 Feb 2020 15:36:16 -0600 Subject: remove forgotten test content --- layouts/partials/author/articles_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/author/articles_list.html b/layouts/partials/author/articles_list.html index ec25b09..58f5795 100644 --- a/layouts/partials/author/articles_list.html +++ b/layouts/partials/author/articles_list.html @@ -20,7 +20,7 @@ {{ .Params.excerpt }}

-- cgit v1.2.3