mirror of https://github.com/luizdepra/hugo-coder.git

Bobby
27.46.2020 be94b5fd052b910d0b3704bea22d26214136f060
Add an optional featured image (#252)

* Make MathJax version 3 work

* Change my contributor link

* Add an optional featured image and table of contents

* Add an optional featured image and table of contents

* Add example of a featured image in post along with table of contents

* Remove word count criteria

* Fix formatting

* Add table of contents options

* Remove toc feature due to markdown bug

* Removing markup configuration

Co-authored-by: Luiz F. A. de PrĂ¡ <luizdepra@users.noreply.github.com>
2 files modified
5 ■■■■■ changed files
exampleSite/content/posts/hugoisforlovers.md 1 ●●●● patch | view | raw | blame | history
layouts/posts/single.html 4 ●●●● patch | view | raw | blame | history
exampleSite/content/posts/hugoisforlovers.md
@@ -12,6 +12,7 @@
    "golang",
]
series = ["Getting Started", "Hugo"]
featured_image = "https://imgs.xkcd.com/comics/angular_momentum.jpg"
+++
## Step 1. Install Hugo
layouts/posts/single.html
@@ -27,9 +27,13 @@
      </header>
      <div>
        {{ if .Params.featured_image }}
          <img src='{{ .Params.featured_image }}' alt="Featured image"/>
        {{ end }}
        {{ .Content }}
      </div>
      <footer>
        {{ partial "posts/series.html" . }}
        {{ partial "posts/disqus.html" . }}