summaryrefslogtreecommitdiff
path: root/templates/index.html
blob: b8af3c2e2accfbe6d00d212f292c92590a352e3f (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
{% import "macros.html" as macros %}

<!DOCTYPE html>

<html lang="{{ config.default_language }}">

  <head>

    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>

    {% set page_title = page.title | default(value=config.title) %}
    {% set page_description = page.description | default(value=config.description) %}
    {% set page_url = page.permalink | default(value=config.base_url) %}
    {% set page_image_src = page.extra.image_src | default(value=config.extra.meta.preview_image_src) %}
    {% set page_image_alt = page.extra.image_alt | default(value=config.extra.meta.preview_image_alt) %}

    <title>{{ page_title }}</title>

    {% set canonical_url = config.base_url %}
    {% if page %}
        {% set canonical_url = page.permalink %}
    {% elif section %}
        {% set canonical_url = section.permalink %}
    {% elif term %}
        {% set canonical_url = term.permalink %}
    {% endif %}
    <link rel="canonical" href="{{ canonical_url }}">

    <!-- Instructions for web crawlers -->
    <meta name="robots" content="index, follow">

    <!--- Below are the meta tags that are important for SEO \\ they are also important for social media sharing embeds --->
    <meta name="description" content="{{ page_description }}">
    <meta name="author" content="{{ config.extra.author.name }}">



    <!--- Many websites use Open Graph so it has become standard to include --->
    <meta property="og:title" content="{{ page_title }}">
    <meta property="og:site_name" content="{{ config.title }}">
    <meta property="og:description" content="{{ page_description }}">
    <meta property="og:image" content="{{ get_url(path=page_image_src) }}">
    <meta property="og:image:alt" content="{{ page_image_alt }}">

    <meta property="og:url" content="{{ page_url }}">
    <meta property="og:type" content="{% if page %}article{% else %}website{% endif %}">

    {# --- START: Add Rich Article Data (if it's a page) --- #}
    {% if page %}
        {# Published time in the required ISO 8601 format #}
        <meta property="article:published_time" content="{{ page.date | date(format="%+") }}">

        {# Author's name #}
        <meta property="article:author" content="{{ config.extra.author.name }}">

        {# Loop through all the tags for this page #}
        {% if page.taxonomies and page.taxonomies.tags %}
            {% for tag in page.taxonomies.tags %}
                <meta property="article:tag" content="{{ tag }}">
            {% endfor %}
        {% endif %}
    {% endif %}
    {# --- END: Rich Article Data --- #}



    <!--- Below is for twitter general info --->
    <meta name="twitter:domain" content="{{ config.base_url }}">
    <meta name="twitter:description" content="{{ page_description }}">
    <meta name="twitter:title" content="{{ page_title }}">

    <!--- Below is for twitter sharing previews \\ you can test this at https://threadcreator.com/tools/twitter-card-validator --->
    <meta name="twitter:card" content="{{ config.extra.meta.twitter_card }}">
    <meta name="twitter:image" content="{{ get_url(path=page_image_src) }}">
    <meta name="twitter:image:src" content="{{ get_url(path=page_image_src) }}">
    <meta name="twitter:image:alt" content="{{ page_image_alt }}">

    <!--- If you have accounts on twitter that are relevant to your site --->
    <meta name="twitter:site" content="{{ config.extra.meta.twitter_creator }}">
    <meta name="twitter:creator" content="{{ config.extra.meta.twitter_creator }}">



    <!-- Icons and Stylesheets -->
    <link rel="apple-touch-icon" sizes="180x180" href="{{ get_url(path="apple-touch-icon.png") }}"/>
    <link rel="icon" type="image/png" sizes="32x32" href="{{ get_url(path="favicon-32x32.png") }}"/>
    <link rel="icon" type="image/png" sizes="16x16" href="{{ get_url(path="favicon-16x16.png") }}"/>

    <link rel="shortcut icon" href="{{ get_url(path="favicon.ico") }}"/>

    <link rel="mask-icon" href="{{ get_url(path="safari-pinned-tab.svg") }}" color="#030303">
    <meta name="msapplication-TileColor" content="#603cba">

    <!--PWA + android manifest-->
    <link rel="manifest" href="{{ get_url(path="site.webmanifest") }}">

    <!--discord fancy ruler line on the left of link preview embeds-->
    <meta name="theme-color" content="#828ff9"> <!-- #ace6f0 #828ff9 #e94c80 -->



    <!-- Stylesheets -->
    <!--<link rel="stylesheet" href="{{ get_url(path="style.css") }}"/> old way of doing this, inefficient -->

    {# 1. Load our single combined critical CSS file. #}
    {% set critical_css = load_data(path="static/css/critical.css", required=false) %}

    {# 2. If it was found, inline it. #}
    {% if critical_css %}
      <style>{{ critical_css | safe }}</style>
    {% endif %}

    {# 3. Load the full stylesheet asynchronously (this part is the same). #}
    <link rel="stylesheet" href="{{ get_url(path='style.css') }}" media="print" onload="this.media='all'">

    {# 4. Provide a fallback for browsers without JavaScript. #}
    <noscript><link rel="stylesheet" href="{{ get_url(path='style.css') }}"></noscript>
    <!-- Stylesheets End -->



    {% if page.extra.math %}
    <!-- Math rendering with KaTeX -->
    <link rel="stylesheet" href="{{ get_url(path="katex/katex.min.css") }}">
    {% endif %}

    {% if config.generate_feeds %}
    <link rel="alternate" type="application/atom+xml" title="Atom Feed" href="{{ get_url(path=config.feed_filenames[0], trailing_slash=false) }}">
    {% endif %}

  </head>

  <body id="page">

    {% block header %}
    {% endblock header %}

    {% block title %}
    <div id="spotlight" class="">
      <div id="home-center">
        <h1 id="home-title">{{ config.title }}</h1>
        <p id="home-subtitle">{{ config.extra.home_subtitle }}</p>
        <div id="home-social">
          {{ macros::render_social_icons() }}
        </div>
        {% endblock title %}

        {% block main %}
        <nav id="home-nav" class="site-nav">
          {% for s in config.extra.hermit_menu %}
          <a href="{{ config.base_url ~ s.link }}">{{ s.name }}</a>
          {% endfor %}
        </nav>
        {% endblock main %}
      </div>

      {% block footer %}
      <div id="home-footer">
        <p>&copy; {{ now() | date(format="%Y") }}
          <a href="{{ config.base_url }}">{{ config.extra.author.name }}</a>

          {% if config.generate_feeds %}
          &#183;
          <a href="{{ get_url(path=config.feed_filenames[0], trailing_slash=false) }}" target="_blank" title="rss">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
              stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
              class="feather feather-rss">
              <path d="M4 11a9 9 0 0 1 9 9"></path>
              <path d="M4 4a16 16 0 0 1 16 16"></path>
              <circle cx="5" cy="19" r="1"></circle>
            </svg>
          </a>
          {% endif %}

        </p>
      </div>
      {% endblock footer %}
    </div>

    <script defer src="{{ get_url(path="js/main.js") }}"></script>

    {% if page.extra.math %}
    <!-- The loading of KaTeX is deferred to speed up page rendering -->
    <script defer src="{{ get_url(path="katex/katex.min.js") }}"></script>

    <!-- To automatically render math in text elements, include the auto-render extension -->
    <script defer src="{{ get_url(path="katex/auto-render.min.js") }}" onload="renderMathInElement(document.body, { delimiters: [ {left: '$$', right: '$$', display: true}, {left: '$', right: '$', display: false}, {left: '\\[', right: '\\]', display: true}, {left: '\\(', right: '\\)', display: false}]});"></script>
    {% endif %}

    {% if config.extra.google_analytics.enable %}
    <!-- Global Site Tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id={{ config.extra.google_analytics.id }}"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', '{{ config.extra.google_analytics.id }}');
    </script>
    {% endif %}

  </body>

</html>