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

header.html « partials « layouts - github.com/yihui/hugo-xmag.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ebab0387d990c868803840a3ebbedb30daa6a50f (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
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ .Title }} | {{ .Site.Title }}</title>
    <link rel="stylesheet" href="{{ "/css/style.css" | relURL }}" />
    <link rel="stylesheet" href="{{ "/css/fonts.css" | relURL }}" />
    {{ partial "head_custom.html" . }}
  </head>

  <body{{if .IsPage}} class="page"{{ end }}>
    <nav class="header">
      <div class="banner"><a href="{{ relURL .Site.BaseURL }}"{{ if not .Site.Params.banner }} class="text"{{ end }}>
        {{ with .Site.Params.banner }}
        <img src="{{ relURL .src }}" alt="{{ .alt }}" />
        {{ else }}{{ (replaceRE "(&[A-Z]) (fr;)" "$1$2" (replaceRE "([A-Z])" "&$1 fr;" (upper .Site.Title))) | safeHTML }}
        {{ end }}</a></div>
      <div class="head-meta">
      {{ if .IsPage }}
        <span><a href="{{ relURL .Site.BaseURL }}">{{ (default "Back to Home" .Site.Params.text.back) | safeHTML }}</a></span>
        {{ if .Params.date }}<span class="date">{{ .Date.Format "2006/01/02" }}</span>{{ end }}
        {{ if .File.Path }}
        {{ $RmdFile := (print .File.BaseFileName ".Rmd") }}
        {{ if (where (readDir (print "content/" .File.Dir)) "Name" $RmdFile) }}
          {{ $.Scratch.Set "FilePath" (print .File.Dir $RmdFile) }}
        {{ else }}
          {{ $.Scratch.Set "FilePath" .File.Path }}
        {{ end }}
        {{ with .Site.Params.github_edit}}
        <span><a href="{{ . }}{{ $.Scratch.Get "FilePath" }}">{{ (default "Edit this page" $.Site.Params.text.edit) | safeHTML }}</a></span>
        {{ end }}
        {{ end }}
      {{ else }}
        <span>{{ .Title }}</span>
        <span>{{ now.Format "2006/01/02" }}</span>
        {{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }}
        {{ with $paginator }}<span>{{ .PageNumber }} / {{ .TotalPages }}</span>{{ end }}
      {{ end }}
      </div>
    </nav>