footer.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {{ $author:= site.Data.author }}
  2. {{ if (index site.Data site.Language.Lang).author }}
  3. {{ $author = (index site.Data site.Language.Lang).author }}
  4. {{ end }}
  5. {{ $sections:= site.Data.sections }}
  6. {{ if (index site.Data site.Language.Lang).sections }}
  7. {{ $sections = (index site.Data site.Language.Lang).sections }}
  8. {{ end }}
  9. {{ $copyrightNotice := "© 2020 Copyright."}}
  10. {{ if (index site.Data site.Language.Lang).site }}
  11. {{ $siteConfig := (index site.Data site.Language.Lang).site }}
  12. {{ if $siteConfig.copyright }}
  13. {{ $copyrightNotice = $siteConfig.copyright }}
  14. {{ end }}
  15. {{ end }}
  16. {{/* footer logos */}}
  17. {{ $themeLogo := "/images/theme-logo.png" }}
  18. {{ $hugoLogo := "/images/hugo-logo.svg" }}
  19. {{/* resize the logos. don't resize svg because it is not supported */}}
  20. {{ $themeLogo:= resources.Get $themeLogo}}
  21. {{ if and $themeLogo (ne $themeLogo.MediaType.SubType "svg") }}
  22. {{ $themeLogo = $themeLogo.Resize "32x" }}
  23. {{ end }}
  24. {{ $themeLogo = $themeLogo.RelPermalink}}
  25. {{ $hugoLogo:= resources.Get $hugoLogo}}
  26. {{ if and $hugoLogo (ne $hugoLogo.MediaType.SubType "svg")}}
  27. {{ $hugoLogo = $hugoLogo.Resize "32x" }}
  28. {{ end }}
  29. {{ $hugoLogo = $hugoLogo.RelPermalink}}
  30. <footer class="container-fluid text-center align-content-center footer pb-2">
  31. <div class="container pt-5">
  32. <div class="row text-left">
  33. <div class="col-md-4 col-sm-12">
  34. <h5>{{ i18n "navigation" }}</h5>
  35. {{ if $sections }}
  36. <ul>
  37. {{- range sort $sections "section.weight" }}
  38. {{ if and (.section.enable) (.section.showOnNavbar)}}
  39. {{ $sectionID := replace (lower .section.name) " " "-" }}
  40. {{ if .section.id }}
  41. {{ $sectionID = .section.id }}
  42. {{ end }}
  43. <li class="nav-item">
  44. <a class="smooth-scroll" href="#{{ $sectionID }}">{{ .section.name }}</a>
  45. </li>
  46. {{ end }}
  47. {{- end }}
  48. </ul>
  49. {{ end }}
  50. </div>
  51. {{ if $author }}
  52. <div class="col-md-4 col-sm-12">
  53. <h5>{{ i18n "contact_me" }}</h5>
  54. <ul>
  55. {{ range $key,$value:= $author.contactInfo }}
  56. <li><span>{{ title $key }}: </span> <span>{{ $value }}</span></li>
  57. {{ end }}
  58. </ul>
  59. </div>
  60. {{ end }}
  61. {{ if site.Params.newsletter.enable }}
  62. <div class="col-md-4 col-sm-12">
  63. <!-- <h5>Newsletter</h5> -->
  64. <p>{{ i18n "newsletter_text" }}</p>
  65. <form>
  66. <div class="form-group">
  67. <input
  68. type="email"
  69. class="form-control"
  70. id="exampleInputEmail1"
  71. aria-describedby="emailHelp"
  72. placeholder="{{ i18n "newsletter_input_placeholder" }}"
  73. />
  74. <small id="emailHelp" class="form-text text-muted"
  75. >{{ i18n "newsletter_warning" }}</small
  76. >
  77. </div>
  78. <button type="submit" class="btn btn-info">{{ i18n "submit" }}</button>
  79. </form>
  80. </div>
  81. {{ end }}
  82. </div>
  83. </div>
  84. <hr />
  85. <div class="container">
  86. <div class="row text-left">
  87. <div class="col-md-4">
  88. <a id="theme" href="https://github.com/hossainemruz/toha" target="#">
  89. <img src="{{ $themeLogo }}">
  90. Toha
  91. </a>
  92. </div>
  93. <div class="col-md-4 text-center">{{ $copyrightNotice }}</div>
  94. <div class="col-md-4 text-right">
  95. <a id="hugo" href="https://gohugo.io/">{{ i18n "hugoAttributionText" }}
  96. <img
  97. src="{{ $hugoLogo }}"
  98. alt="Hugo Logo"
  99. height="18"
  100. />
  101. </a>
  102. </div>
  103. </div>
  104. </div>
  105. </footer>