single.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {{ define "title" }}
  2. {{ .Site.Title }}
  3. {{ end }}
  4. {{ define "nav" }}
  5. <!-- silence is golden -->
  6. {{ end }}
  7. {{ define "main" }}
  8. <main id="main">
  9. <nav id="toc" class="toc patterns" aria-labelledby="toc-heading">
  10. <h2 id="toc-heading">Table of contents</h2>
  11. {{ $current := . }}
  12. {{ range $.Site.Home.Sections }}
  13. <ul id="patterns-list">
  14. {{ range .Pages.ByWeight }}
  15. <li class="pattern">
  16. <a href="#{{ .Title | urlize }}" {{ if eq $current.Title .Title }}aria-current="page"{{ end }}>
  17. <svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50"><use xlink:href="#bookmark"></use></svg>
  18. <span class="text">{{ .Title }}</span>
  19. </a>
  20. </li>
  21. {{ end }}
  22. {{ range .Sections.ByWeight }}
  23. <li>
  24. <h3>{{ .Title }}</h3>
  25. <ul>
  26. {{ range .Pages.ByWeight }}
  27. <li class="pattern">
  28. <a href="#{{ .Title | urlize }}" {{ if eq $current.Title .Title }}aria-current="page"{{ end }}>
  29. <svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50"><use xlink:href="#bookmark"></use></svg>
  30. <span class="text">{{ .Title }}</span>
  31. </a>
  32. </li>
  33. {{ end }}
  34. </ul>
  35. </li>
  36. {{ end }}
  37. </ul>
  38. {{ end }}
  39. </nav>
  40. {{ $current := . }}
  41. {{ range $.Site.Home.Sections }}
  42. {{ range .Pages.ByWeight }}
  43. <div class="pattern-section">
  44. <h1 id="{{ .Title | urlize }}" tabindex="-1">
  45. <svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50"><use xlink:href="#bookmark"></use></svg>
  46. {{ .Title }}
  47. </h1>
  48. {{ .Content }}
  49. </div>
  50. {{ end }}
  51. {{ range .Sections.ByWeight }}
  52. {{ range .Pages.ByWeight }}
  53. <div class="pattern-section">
  54. <h1 id="{{ .Title | urlize }}" tabindex="-1">
  55. <svg class="bookmark-icon" aria-hidden="true" viewBox="0 0 40 50"><use xlink:href="#bookmark"></use></svg>
  56. {{ .Title }}
  57. </h1>
  58. {{ .Content }}
  59. </div>
  60. {{ end }}
  61. {{ end }}
  62. {{ end }}
  63. </main>
  64. {{ end }}