mirror of
https://github.com/magefile/mage.git
synced 2026-10-24 06:19:18 +03:00
Update site to build with newer hugo (#411)
* Update site to build with newer hugo
This commit is contained in:
2
site/content/_index.md
Normal file
2
site/content/_index.md
Normal file
@@ -0,0 +1,2 @@
|
||||
+++
|
||||
+++
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
{{ .Hugo.Generator }}
|
||||
{{ hugo.Generator }}
|
||||
{{ partial "meta.html" . }}
|
||||
{{ partial "favicon.html" . }}
|
||||
<title>{{ .Title }} :: {{ .Site.Title }}</title>
|
||||
@@ -90,9 +90,9 @@
|
||||
{{define "breadcrumb"}}
|
||||
{{$parent := .page.Parent }}
|
||||
{{ if $parent }}
|
||||
{{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.URL $parent.Title .value) }}
|
||||
{{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.RelPermalink $parent.Title .value) }}
|
||||
{{ template "breadcrumb" dict "page" $parent "value" $value }}
|
||||
{{else}}
|
||||
{{.value|safeHTML}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
{{ define "menu-nextprev" }}
|
||||
{{$currentNode := .currentnode }}
|
||||
{{ if ne .menu.Params.hidden true}}
|
||||
{{if hasPrefix $currentNode.URL .menu.URL }}
|
||||
{{ if ne .menu.Params.hidden true }}
|
||||
{{if hasPrefix $currentNode.RelPermalink .menu.RelPermalink }}
|
||||
{{ $currentNode.Scratch.Set "NextPageOK" "OK" }}
|
||||
{{ $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") }}
|
||||
{{else}}
|
||||
@@ -40,10 +40,10 @@
|
||||
|
||||
|
||||
{{with ($.Scratch.Get "prevPage")}}
|
||||
<a class="nav nav-prev" href="{{.URL}}" title="{{.Title}}"> <i class="fa fa-chevron-left"></i></a>
|
||||
<a class="nav nav-prev" href="{{.RelPermalink}}" title="{{.Title}}"> <i class="fa fa-chevron-left"></i></a>
|
||||
{{end}}
|
||||
{{with ($.Scratch.Get "nextPage")}}
|
||||
<a class="nav nav-next" href="{{.URL}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
|
||||
<a class="nav nav-next" href="{{.RelPermalink}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
{{ .Hugo.Generator }}
|
||||
{{ hugo.Generator }}
|
||||
{{ partial "meta.html" . }}
|
||||
{{ partial "favicon.html" . }}
|
||||
<title>{{ .Title }} :: {{ .Site.Title }}</title>
|
||||
@@ -87,9 +87,9 @@
|
||||
{{define "breadcrumb"}}
|
||||
{{$parent := .page.Parent }}
|
||||
{{ if $parent }}
|
||||
{{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.URL $parent.Title .value) }}
|
||||
{{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.RelPermalink $parent.Title .value) }}
|
||||
{{ template "breadcrumb" dict "page" $parent "value" $value }}
|
||||
{{else}}
|
||||
{{.value|safeHTML}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -57,9 +57,9 @@
|
||||
{{ if eq $translation.Lang .Lang }}
|
||||
{{ $selected := false }}
|
||||
{{ if eq $pageLang .Lang}}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.URL }}" selected>{{ .LanguageName }}</option>
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.RelPermalink }}" selected>{{ .LanguageName }}</option>
|
||||
{{ else }}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.URL }}">{{ .LanguageName }}</option>
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.RelPermalink }}">{{ .LanguageName }}</option>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -97,9 +97,9 @@
|
||||
{{with .sect}}
|
||||
{{if .IsSection}}
|
||||
{{safeHTML .Params.head}}
|
||||
<li data-nav-id="{{.URL}}" title="{{.Title}}" class="dd-item
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
|
||||
{{if .IsAncestor $currentNode }}parent{{end}}
|
||||
{{if eq .UniqueID $currentNode.UniqueID}}active{{end}}
|
||||
{{if eq .File.UniqueID $currentNode.File.UniqueID}}active{{end}}
|
||||
{{if .Params.alwaysopen}}parent{{end}}
|
||||
">
|
||||
<a href="{{.RelPermalink}}">
|
||||
@@ -137,7 +137,7 @@
|
||||
</li>
|
||||
{{else}}
|
||||
{{ if not .Params.Hidden }}
|
||||
<li data-nav-id="{{.URL}}" title="{{.Title}}" class="dd-item {{if eq .UniqueID $currentNode.UniqueID}}active{{end}}">
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item {{if eq .File.UniqueID $currentNode.File.UniqueID}}active{{end}}">
|
||||
<a href="{{ .RelPermalink}}">
|
||||
{{safeHTML .Params.Pre}}{{.Title}}{{safeHTML .Params.Post}}
|
||||
{{ if $showvisitedlinks}}<i class="fa fa-check read-icon"></i>{{end}}
|
||||
|
||||
@@ -40,12 +40,12 @@
|
||||
{{$numn := add $num $.count }}
|
||||
|
||||
{{(printf "<h%d>" $numn)|safeHTML}}
|
||||
<a href="{{.URL}}" >{{ .Title }}</a>
|
||||
<a href="{{.RelPermalink}}" >{{ .Title }}</a>
|
||||
{{(printf "</h%d>" $numn)|safeHTML}}
|
||||
|
||||
{{else}}
|
||||
{{(printf "<%s>" $.style)|safeHTML}}
|
||||
<a href="{{.URL}}" >{{ .Title }}</a>
|
||||
<a href="{{.RelPermalink}}" >{{ .Title }}</a>
|
||||
{{(printf "</%s>" $.style)|safeHTML}}
|
||||
{{end}}
|
||||
|
||||
@@ -93,4 +93,4 @@
|
||||
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{{- if in (.Get 0) "/_index.md" -}}
|
||||
{{- $path := (trim (.Get 0) "_index.md") -}}
|
||||
{{- with .Site.GetPage "section" (trim $path "/") -}}
|
||||
{{- .URL -}}
|
||||
{{- .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- with .Site.GetPage "section" (.Get 0) }}
|
||||
{{- .URL -}}
|
||||
{{- .RelPermalink -}}
|
||||
{{- else -}}
|
||||
{{- .Get 0 | relref .Page -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user