From 1f77c0572b78ee354ab1680a2b4210297248fc1f Mon Sep 17 00:00:00 2001 From: George Cushen Date: Tue, 13 Sep 2016 03:46:26 +0100 Subject: [PATCH] Improve rendering of post summaries --- exampleSite/content/post/getting-started.md | 2 +- exampleSite/content/post/writing-markdown-latex.md | 2 +- layouts/index.html | 2 +- layouts/section/post.html | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/exampleSite/content/post/getting-started.md b/exampleSite/content/post/getting-started.md index 05e60d26..dc3d2c72 100644 --- a/exampleSite/content/post/getting-started.md +++ b/exampleSite/content/post/getting-started.md @@ -18,7 +18,7 @@ Key features: - Responsive and mobile friendly - Simple and refreshing one page design - Easy to customize - + ## Installation diff --git a/exampleSite/content/post/writing-markdown-latex.md b/exampleSite/content/post/writing-markdown-latex.md index 7cd6aed4..3d674b67 100644 --- a/exampleSite/content/post/writing-markdown-latex.md +++ b/exampleSite/content/post/writing-markdown-latex.md @@ -6,7 +6,7 @@ title = "Writing content with Markdown, LaTeX, and Shortcodes" math = true +++ -Content can be written using [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet), [LaTeX math](https://en.wikibooks.org/wiki/LaTeX/Mathematics), and [Hugo Shortcodes](http://gohugo.io/extras/shortcodes/). Additionally, HTML may be used for advanced formatting. +Content can be written using [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet), [LaTeX math](https://en.wikibooks.org/wiki/LaTeX/Mathematics), and [Hugo Shortcodes](http://gohugo.io/extras/shortcodes/). Additionally, HTML may be used for advanced formatting. ## Sub-headings diff --git a/layouts/index.html b/layouts/index.html index 9c31f788..4b43bee3 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -112,7 +112,7 @@ {{ partial "article_metadata" (dict "content" . "is_list" 1) }}

{{ if .Truncated }} - {{ .Summary }} + {{ printf "%s" .Summary | markdownify }} {{ else }} {{ .Content }} {{ end }} diff --git a/layouts/section/post.html b/layouts/section/post.html index 39e43399..f21564ee 100644 --- a/layouts/section/post.html +++ b/layouts/section/post.html @@ -14,7 +14,13 @@ {{end}}

{{ .Title }}

{{ partial "article_metadata" (dict "content" . "is_list" 1) }} -

{{ .Summary }}

+

+ {{ if .Truncated }} + {{ printf "%s" .Summary | markdownify }} + {{ else }} + {{ .Content }} + {{ end }} +

{{ end }}