You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

single.html 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {{ define "header" }}
  2. {{/* We can override any block in the baseof file be defining it in the template */}}
  3. {{ partial "page-header.html" . }}
  4. {{ end }}
  5. {{ define "main" }}
  6. {{ $section := .Site.GetPage "section" .Section }}
  7. <article class="flex-l flex-wrap justify-between mw8 center ph3">
  8. <header class="mt4 w-100">
  9. <aside class="instapaper_ignoref b helvetica tracked">
  10. {{/*
  11. CurrentSection allows us to use the section title instead of inferring from the folder.
  12. https://gohugo.io/variables/page/#section-variables-and-methods
  13. */}}
  14. {{with .CurrentSection.Title }}{{. | upper }}{{end}}
  15. </aside>
  16. {{ partial "social-share.html" . }}
  17. <h1 class="f1 athelas mt3 mb1">
  18. {{- .Title -}}
  19. </h1>
  20. {{ with .Params.author }}
  21. <p class="tracked">
  22. By <strong>
  23. {{ if reflect.IsSlice . }}
  24. {{ delimit . ", " | markdownify }}
  25. {{else}}
  26. {{ . | markdownify }}
  27. {{ end }}
  28. </strong>
  29. </p>
  30. {{ end }}
  31. {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
  32. <time class="f6 mv4 dib tracked" {{ printf `datetime="%s"` (.Date.Format "2006-01-02T15:04:05Z07:00") | safeHTMLAttr }}>
  33. {{- .Date.Format "January 2, 2006" -}}
  34. </time>
  35. {{/*
  36. Show "reading time" and "word count" but only if one of the following are true:
  37. 1) A global config `params` value is set `show_reading_time = true`
  38. 2) A section front matter value is set `show_reading_time = true`
  39. 3) A page front matter value is set `show_reading_time = true`
  40. */}}
  41. {{ if (or (eq (.Param "show_reading_time") true) (eq $section.Params.show_reading_time true) )}}
  42. <span class="f6 mv4 dib tracked"> - {{ .ReadingTime}} minutes read</span>
  43. <span class="f6 mv4 dib tracked"> - {{ .WordCount}} words</span>
  44. {{ end }}
  45. </header>
  46. <div class="nested-copy-line-height lh-copy {{ $.Param "post_content_classes" | default "serif"}} f4 nested-links nested-img mid-gray pr4-l w-two-thirds-l">
  47. {{- .Content -}}
  48. {{- partial "tags.html" . -}}
  49. <div class="mt6 instapaper_ignoref">
  50. {{ if .Site.DisqusShortname }}
  51. {{ template "_internal/disqus.html" . }}
  52. {{ end }}
  53. {{ if .Site.Params.commentoEnable }}
  54. {{- partial "commento.html" . -}}
  55. {{ end }}
  56. </div>
  57. </div>
  58. <aside class="w-30-l mt6-l">
  59. {{- partial "menu-contextual.html" . -}}
  60. </aside>
  61. </article>
  62. {{ end }}