Welcome to mirror list, hosted at ThFree Co, Russian Federation.

baseof.html « _default « layouts - github.com/Lednerb/bilberry-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dcca86671986352135a075676468ee5d7aa30864 (plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>

{{ if eq .Type "gallery" }}
    {{ $image := (index (.Resources.ByType "image") 0 ) }}
    {{ $imageUrl := "" }}

    {{ if and (.Site.Params.resizeImages | default true) (.Params.resizeImages | default true) }}
        {{ $imageUrl = ($image.Fill "700x350 q95").Permalink }}
    {{ else }}
        {{ $imageUrl = $image.Permalink }}
    {{ end }}

    {{ .Scratch.Set "image" $imageUrl }}

{{ else if .Resources.GetMatch "featuredImage.*" }}
    {{ $imageUrl := "" }}

    {{ if and (.Site.Params.resizeImages | default true) (.Params.resizeImages | default true) }}
         {{ $imageUrl = ((.Resources.GetMatch "featuredImage.*").Fill "700x350 q95").Permalink }}
    {{ else }}
        {{ $imageUrl = (.Resources.GetMatch "featuredImage.*").Permalink }}
    {{ end }}

    {{ .Scratch.Set "image" $imageUrl }}

{{ else if .Params.featuredImage }}
  {{ .Scratch.Set "image" (.Params.featuredImage | absURL) }}
{{ else if .Params.mp4videoImage }}
  {{ .Scratch.Set "image" (.Params.mp4videoImage | absURL) }}
{{ else }}
  {{ .Scratch.Set "image" (printf "https://www.gravatar.com/avatar/%s?size=200" (md5 .Site.Params.gravatarEMail)) }}
{{ end }}

{{- if ne .Description "" -}}
{{ .Scratch.Set "description" (.Description) }}
{{- else -}}
{{- if eq .Title .Site.Title -}}
{{ .Scratch.Set "description" (.Site.Params.description) }}
{{- else -}}
{{ .Scratch.Set "description" (printf "%s - %s" (.Title) (.Site.Params.description)) }}
{{- end -}}
{{- end -}}

{{- if eq .Site.Title .Title -}}
    {{ .Scratch.Set "title" (.Site.Params.subtitle) }}
{{- else -}}
    {{ .Scratch.Set "title" (.Title) }}
{{- end -}}

<html itemscope itemtype="https://schema.org/WebPage" class="no-js" lang="{{ .Site.Language.Lang }}">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="siteBaseUrl" content="{{ .Site.BaseURL }}">
    <meta name="author" content="{{ .Site.Params.author }}">
    <meta name="description" content="{{ .Site.Params.description }}">
    <meta name="keywords" content="{{ .Site.Params.keywords }}">
    {{ hugo.Generator }}
    <title>
        {{ block "title" . }}
           {{ if .Scratch.Get "title" }}
               {{ .Scratch.Get "title" }} &vert; {{ .Site.Title }}
           {{ else }}
               {{ .Site.Title }}
           {{ end }}
        {{ end }}
    </title>
    <meta itemprop="name" content="{{ .Scratch.Get "title" }}">
    <meta itemprop="description" content="{{ .Scratch.Get "description" }}">
    <meta property="og:title" content="{{ .Scratch.Get "title" }}">
    <meta property="og:description" content="{{ .Scratch.Get "description" }}">
    <meta property="og:image" content="{{ .Scratch.Get "image" | absURL }}">
    <meta property="og:url" content="{{ .Permalink | absURL }}">
    <meta property="og:site_name" content="{{ .Site.Title }}">
    {{- if .IsPage }}
    <meta property="og:type" content="article">
    {{- else -}}
    <meta property="og:type" content="website">
    {{- end }}

    {{ partial "favicon.html" . }}

    <script src="{{ "modernizr-simple.js" | relURL }}"></script>

    {{ if .RelPermalink }}
    <link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
    <link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
    {{ end }}

    {{ with .Params.original_url }}
    <link rel="canonical" href="{{ . }}" />
    {{ else }}
    <link rel="canonical" href="{{ .Permalink }}">
    {{ end }}

    <link rel="stylesheet" href="{{ "theme.css" | absURL }}">

    {{ partial "twitter-card.html" . }}

    {{ if isset .Site.Params "css_modules" }}
        {{ range .Site.Params.css_modules }}
            <link rel="stylesheet" href="{{ . | absURL }}">
        {{ end }}
    {{ end }}
</head>

<body class="bilberry-hugo-theme">

    {{ partial "topnav.html" . }}

    {{ partial "header.html" . }}

    <div class="main container">
        {{ block "main" . }}{{ end }}
    </div>

    {{ partial "footer.html" . }}

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

    {{ if and (isset .Site.Params "enable_mathjax") (eq .Site.Params.enable_mathjax true) }}
    {{ partial "mathjax.html" . }}
    {{ end }}


    <script src="{{ "theme.js" | absURL }}"></script>

    {{ if isset .Site.Params "js_modules" }}
    {{ range .Site.Params.js_modules }}
    <script src="{{ . | absURL }}" type="application/javascript"></script>
    {{ end }}
    {{ end }}

    {{ if and (isset .Site.Params "algolia_search") (eq .Site.Params.algolia_search true) }}
    {{ partial "algolia-search.html" . }}
    {{ end }}
</body>

</html>