header for "local" editor..

master
Marcell Mars 3 years ago
parent 24cae4b7ed
commit c53a91870e

@ -40,6 +40,10 @@
{{ $editPage := $.Site.GetPage "/edit" }}
<div class="headiter" id="preview">
<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?edit={{ .File.UniqueID }}">EDIT_THIS</a>
{{ with $scratch.core }}<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?new={{ index . 0 }}">ADD_{{ index . 0 | upper }}</a>{{ end }}
{{ with $scratch.mantle }}<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?new={{ index . 0 }}">ADD_{{ index . 0 | upper }}</a>{{ end }}
{{ with $scratch.crust }}<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?new={{ index . 0 }}">ADD_{{ index . 0 | upper }}</a>{{ end }}
{{ if not $scratch.core }}<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?new={{ $currentDir }}">ADD_{{ substr $currentDir 0 -1 | upper }}</a>{{ end }}
</div>
{{ end }}

@ -40,6 +40,11 @@
{{ $editPage := $.Site.GetPage "/edit" }}
<div class="headiter" id="preview">
<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?edit={{ .File.UniqueID }}">EDIT_THIS</a>
{{ with $scratch.core }}<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?new={{ index . 0 }}">ADD_{{ index . 0 | upper }}</a>{{ end }}
{{ with $scratch.mantle }}<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?new={{ index . 0 }}">ADD_{{ index . 0 | upper }}</a>{{ end }}
{{ with $scratch.crust }}<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?new={{ index . 0 }}">ADD_{{ index . 0 | upper }}</a>{{ end }}
{{ if not $scratch.core }}<a class="edit-button" href="{{ $editPage.RelPermalink }}index.html?new={{ $currentDir }}">ADD_{{ substr $currentDir 0 -1 | upper }}</a>{{ end }}
</div>
</div>
{{ end }}

@ -101,5 +101,5 @@
{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}<div class="keywords"><span class="sup">keywords</span><a href="/keywords/{{ urlize $v }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{- $v -}}</a>{{- else -}},&nbsp;<a href="/keywords/{{ urlize $v }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{- $v -}}</a>{{- end -}}{{- end -}}{{- with $vld -}}</div>{{- end -}}
{{ $var := printf "repo={\"frontmatter\": %s, \"content\": %s, \"path\": \"%s\" }" (jsonify .Params) (jsonify .RawContent) .File.Path .RelPermalink | resources.FromString (printf "js/repo/%s.js" .File.UniqueID) }}
{{ $var := printf "repo={\"frontmatter\": %s, \"content\": %s, \"path\": \"%s\", \"relpermalink\": \"%s\" }" (jsonify .Params) (jsonify .RawContent) .File.Path .RelPermalink | resources.FromString (printf "js/repo/%s.js" .File.UniqueID) }}
{{ $dummy := $var.Permalink }}

Loading…
Cancel
Save