single.html 2.26 KB
Newer Older
Eugen Rochko's avatar
Eugen Rochko committed
1 2 3 4
{{/* Used to render all content pages other than the index. */}}
<html>
  <head>
    {{ partial "head.html" . }}
Eugen Rochko's avatar
Eugen Rochko committed
5
    <title>{{ .Page.Title }} - {{ .Site.Title }}</title>
Eugen Rochko's avatar
Eugen Rochko committed
6 7 8 9 10 11 12 13 14

    <meta property="og:title" content="{{ .Title }}" />
    <meta property="og:description" content="{{ .Summary }}" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="{{ .Permalink }}" />

    <meta name="twitter:card" content="summary_large_image" />

    {{ if isset .Params "hero" }}
Eugen Rochko's avatar
Eugen Rochko committed
15
      <meta name="og:image" content="{{ .Params.hero }}" />
Eugen Rochko's avatar
Eugen Rochko committed
16
      <meta name="twitter:image" content="{{ .Params.hero }}" />
Eugen Rochko's avatar
Eugen Rochko committed
17 18 19 20
    {{ else }}
      {{ $hero := .Page.Resources.GetMatch "hero" }}

      {{ if $hero }}
Eugen Rochko's avatar
Eugen Rochko committed
21 22
        {{ $hero := $hero.Resize "1200x" }}

Eugen Rochko's avatar
Eugen Rochko committed
23 24 25
        <meta name="og:image" content="{{ $hero.Permalink }}" />
        <meta name="twitter:image" content="{{ $hero.Permalink }}" />
      {{ end }}
Eugen Rochko's avatar
Eugen Rochko committed
26 27 28
    {{ end }}

    <meta name="twitter:site" content="@MastodonProject" />
Eugen Rochko's avatar
Eugen Rochko committed
29 30 31 32 33 34 35
  </head>
  <body>
    {{ partial "header.html" . }}

    <div class="article h-entry">
      <div class="container">
        <header class="article-header">
Eugen Rochko's avatar
Eugen Rochko committed
36
          <h1 class="p-name">{{ .Page.Title }}</h1>
Eugen Rochko's avatar
Eugen Rochko committed
37 38 39 40 41 42 43 44 45

          {{ if isset .Params "subtitle" }}
            <h2>{{ .Params.subtitle }}</h2>
          {{ end }}

          {{ if isset .Params "hero" }}
            <div class="image-large">
              <img src="{{ .Params.hero }}" alt="" />
            </div>
46 47 48 49
          {{ else }}
            {{ $hero := .Page.Resources.GetMatch "hero" }}

            {{ if $hero }}
50 51 52 53
              {{ if not $hero.Params.resize }}
              {{ else }}
                {{ $hero := $hero.Resize "800x" }}
              {{ end }}
Eugen Rochko's avatar
Eugen Rochko committed
54

55 56 57 58
              <div class="image-large">
                <img src="{{ $hero.RelPermalink }}" alt="" />
              </div>
            {{ end }}
Eugen Rochko's avatar
Eugen Rochko committed
59 60 61
          {{ end }}
        </header>

Eugen Rochko's avatar
Eugen Rochko committed
62
        <main class="e-content">
Eugen Rochko's avatar
Eugen Rochko committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
          {{ .Content }}
        </main>

        <footer class="article-footer">
          {{ partial "entry_nav.html" . }}
        </footer>
      </div>
    </div>

    <div class="container">
      {{ partial "cta.html" . }}
    </div>

    <div class="related-articles container">
      {{ partial "related.html" . }}
    </div>

    {{ partial "footer.html" . }}
  </body>
</html>