diff options
Diffstat (limited to 'themes/hugo-xmag/layouts/partials/header.html')
| -rw-r--r-- | themes/hugo-xmag/layouts/partials/header.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/themes/hugo-xmag/layouts/partials/header.html b/themes/hugo-xmag/layouts/partials/header.html new file mode 100644 index 0000000..1d3b190 --- /dev/null +++ b/themes/hugo-xmag/layouts/partials/header.html @@ -0,0 +1,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> |
