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: 1d3b19053bfa76a4f90c40fe93e08f839966818c (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">
    {{ $.Scratch.Set "Title" (default .Title (index .Site.Params.text (print "title_" (lower .Title)))) }}
    <title>{{ if eq ($.Scratch.Get "Title") .Site.Title }}{{ .Site.Title }}{{ else }}{{ ($.Scratch.Get "Title") }} | {{ .Site.Title }}{{ end }}</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">
      {{ partial "banner.html" . }}
      <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 }}
        {{ $.Scratch.Set "FilePath" (replace ($.Scratch.Get "FilePath") "\\" "/") }}
        {{ 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>{{ $.Scratch.Get "Title" }}</span>
        <span>{{ .Site.Params.text.last_update }}{{ now.Format "2006-01-02" }}</span>
        {{ $pages := .Pages }}
        {{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
        {{ $paginator := .Paginate (where $pages "Section" "!=" "") }}
        <span>{{ with $paginator }}{{ if .TotalPages }}{{ .PageNumber }} / {{ .TotalPages }}{{ end }}{{ end }}</span>
      {{ end }}
      </div>
    </nav>