index.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="{{ .Site.Language.Lang }}">
  3. <head>
  4. <title>{{- .Site.Title -}}</title>
  5. {{ $siteDescription := .Site.Params.description }}
  6. {{ if (index .Site.Data .Site.Language.Lang).site }}
  7. {{ $siteConfig := (index .Site.Data .Site.Language.Lang).site }}
  8. {{ if $siteConfig.description }}
  9. {{ $siteDescription = $siteConfig.description }}
  10. {{ end }}
  11. {{ end }}
  12. <meta name="description" content="{{ $siteDescription }}" />
  13. <!-- import common headers -->
  14. {{- partial "header.html" . -}}
  15. {{- partial "opengraph.html" . -}}
  16. <!--================= add analytics if enabled =========================-->
  17. {{- partial "analytics.html" . -}}
  18. <script>
  19. theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light';
  20. if (theme == 'system') {
  21. if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
  22. theme = 'dark';
  23. } else {
  24. theme = 'light';
  25. }
  26. }
  27. document.documentElement.setAttribute('data-theme', theme);
  28. </script>
  29. </head>
  30. <body data-bs-spy="scroll" data-bs-target="#top-navbar" data-bs-offset="100">
  31. <!--- NAVBAR ------------------------->
  32. {{- partial "navigators/navbar.html" . -}}
  33. <!--- ADD HOME SECTION ---------------->
  34. {{- partial "sections/home.html" . -}}
  35. <!--- ADD OPTIONAL SECTIONS ----------->
  36. {{ $sections:= site.Data.sections }}
  37. {{ if (index site.Data site.Language.Lang).sections }}
  38. {{ $sections = (index site.Data site.Language.Lang).sections }}
  39. {{ end }}
  40. {{ if $sections }}
  41. {{ $background:= "bg-primary"}}
  42. {{ range sort $sections "section.weight" }}
  43. {{ if .section.enable }}
  44. <div class="container-fluid section-holder d-flex {{ $background }}">
  45. {{ if .section.template }}
  46. {{- partial .section.template . -}}
  47. {{ else }}
  48. {{- partial (printf "sections/%s.html" (replace (lower .section.id) " " "-")) . -}}
  49. {{ end }}
  50. </div>
  51. <!--- alter background color for next section --->
  52. {{ if eq $background "bg-primary" }}
  53. {{ $background = "bg-secondary" }}
  54. {{ else }}
  55. {{ $background = "bg-primary" }}
  56. {{end}}
  57. {{ end }}
  58. {{ end }}
  59. {{ end }}
  60. <!--- ADD FOOTER ----------------------->
  61. {{ $footerTemplate:= site.Params.footer.template | default "footer.html" }}
  62. {{- partial $footerTemplate . -}}
  63. <!--- ADD COMMON SCRIPTS --------------->
  64. {{ partial "scripts.html" . }}
  65. <!------ ADD SUPPORT LINKS -------->
  66. {{- partial "misc/support.html" . -}}
  67. </body>
  68. </html>