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.

78 lines
1.8KB

  1. {{ define "header" }}
  2. {{ partial "masthead.html" . }}
  3. {{ end }}
  4. {{ define "main" }}
  5. <header>
  6. <h1>{{ .Title }}</h1>
  7. {{ if .Description }}
  8. <blockquote itemprop="description">{{ .Description }}</blockquote>
  9. {{ end }}
  10. </header>
  11. {{ .Content }}
  12. <style>
  13. dl {
  14. display: grid;
  15. grid-template-columns: repeat(1, 1fr 2fr);
  16. grid-gap: 1rem;
  17. }
  18. dt {
  19. text-align: right;
  20. }
  21. dd {
  22. margin-inline-start: unset;
  23. margin-bottom: 2rem;
  24. }
  25. .hack article:first-of-type h2 {
  26. margin-top: 30px;
  27. }
  28. .hack h2 {
  29. position: sticky;
  30. top: 20px;
  31. padding: 5px;
  32. background-color: #1976d215;
  33. margin: -20px 0 30px;
  34. }
  35. .hack h2:before {
  36. content: ">> ";
  37. }
  38. .hack h2:after {
  39. content: " <<";
  40. }
  41. @media screen and (min-width: 30em) {
  42. dl {
  43. grid-template-columns: repeat(2, 1fr 2fr);
  44. }
  45. .hack h2 {
  46. text-align: center;
  47. }
  48. }
  49. </style>
  50. {{ $scratch := newScratch }}
  51. {{ range .Paginator.Pages }}
  52. {{ $scratch.Add "categories" .Params.categories | first 1 }}
  53. {{ end }}
  54. {{ $categories := $scratch.Get "categories" | uniq }}
  55. <nav class="alert alert-info">
  56. <b>Category:</b>
  57. {{ range $categories }}
  58. <a href="#{{ . | anchorize }}">{{ . | title }}</a>
  59. {{ end }}
  60. </nav>
  61. {{ range $categories }}
  62. <article>
  63. <h2 id="{{ . | anchorize }}">{{ . | title }}</h2>
  64. <dl>
  65. {{ range where $.Paginator.Pages "Params.categories" "intersect" (slice .) }}
  66. <dt><a href="{{ .RelPermalink }}">{{ .Title }}</a>
  67. <dd>{{ .Description }}
  68. {{ end }}
  69. </dl>
  70. </article>
  71. {{ end }}
  72. {{ end }}
  73. {{ define "footer" }}
  74. {{ partial "pagination.html" . }}
  75. {{ partial "powered-by.html" . }}
  76. {{ partial "cookie-disclaimer.html" . }}
  77. {{ end }}