~alanorth/hugo-theme-bootstrap4-blog

ref: 8da12539f30bd722e73a5bafb90ca41b25e3da33 hugo-theme-bootstrap4-blog/layouts/_default/baseof.html -rw-r--r-- 3.3 KiB
8da12539 — TommySprat Support baseurl without trailing slash 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="{{ .Lang }}" {{ if eq .Lang "ar" }}dir="rtl"{{ end }}>

  <head>
    {{ partial "head-meta.html" . }}

    {{ block "schema-dot-org" . }}
      <!-- schema.org metadata differs for Nodes and Pages -->
    {{ end }}

    <link rel="canonical" href="{{ .Permalink }}">

    <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>

    {{ if eq .Lang "ar" }}
    {{ "<!-- ar -->" | safeHTML }}
    <link href="{{ "css/style.rtl.css" | absURL }}" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.styleltr}}" crossorigin="anonymous"{{ end }}>
    {{ else }}
    {{ "<!-- combined, minified CSS -->" | safeHTML }}
    <link href="{{ "css/style.css" | absURL }}" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.style}}" crossorigin="anonymous"{{ end }}>
    {{ end }}

    {{ "<!-- RSS 2.0 feed -->" | safeHTML }}
    {{ with .OutputFormats.Get "rss" -}}
      {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
    {{ end -}}

    {{ template "_internal/google_analytics_async.html" . }}

    {{ if .Site.Params.cookie_consent_info_url }}
    {{ partial "cookie-consent.html" . }}
    {{ end }}

    {{ partial "head-custom.html" . }}
  </head>

  <body>

    {{ block "masthead" . }}
    <div class="blog-masthead">
      <div class="container">
        <nav class="nav blog-nav">
          <a class="nav-link {{ if .IsHome }}active{{ end }}" href="{{ .Site.BaseURL | absLangURL }}">{{ i18n "home" }}</a>
          {{- $currentPage := . -}}
          {{ range .Site.Menus.navbar }}
          {{ $menuURL := .URL | absLangURL }}
          <a class="nav-link{{ if or ($currentPage.IsMenuCurrent "navbar" .) ($currentPage.HasMenuCurrent "navbar" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
          {{ end }}
        </nav>
      </div>
    </div>
    {{ end }}

    {{ block "header" . }}
    {{ if (ne .Site.Params.header_visible false) }}
    <header class="blog-header">
      <div class="container">
        <h1 class="blog-title" dir="auto"><a href="{{ "/" | absURL }}" rel="home">{{ .Site.Title | safeHTML }}</a></h1>
        {{ if .Site.Params.description }}<p class="lead blog-description" dir="auto">{{ .Site.Params.description | markdownify }}</p>{{ end }}
      </div>
    </header>
    {{ end }}
    {{ end }}

    {{ block "body" . }}
    <div class="container">
      <div class="row">
        <div class="col-sm-8 blog-main">

          {{ block "main" . }}
          <!-- The part of the page that begins to differ between templates -->
          {{ end }}

        </div> {{ "<!-- /.blog-main -->" | safeHTML }}

        {{ partial "sidebar.html" . }}

      </div> {{ "<!-- /.row -->" | safeHTML }}
    </div> {{ "<!-- /.container -->" | safeHTML }}
    {{ end }}

    {{ block "footer" . }}
    <footer class="blog-footer">
      <p dir="auto">
      {{ if .Site.Copyright }}
      {{ .Site.Copyright | markdownify }}
      {{ else }}
      Blog template created by <a href="https://twitter.com/mdo">@mdo</a>, ported to Hugo by <a href='https://twitter.com/mralanorth'>@mralanorth</a>.
      {{ end }}
      </p>
      <p>
      <a href="#">{{ i18n "backToTop" }}</a>
      </p>
    </footer>
    {{ end }}

  </body>

</html>

{{- /* vim: set ts=2 sw=2 et: */}}