diff options
author | mms <michal@sapka.me> | 2024-04-09 16:25:51 +0200 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-04-09 16:25:51 +0200 |
commit | 18591bdb1f6964d72f345c32ebf685860dccb8db (patch) | |
tree | 662966ce2696bc6b6db8f6dd07c7a477f1f67cfb /layouts/partials | |
parent | c5d55f14f99c4595b18c1fbed77a6be52c162814 (diff) |
feat: trek to hp:
:
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/homepage/emacs.html | 2 | ||||
-rw-r--r-- | layouts/partials/homepage/startrek.html | 23 | ||||
-rw-r--r-- | layouts/partials/menu.html | 34 |
3 files changed, 46 insertions, 13 deletions
diff --git a/layouts/partials/homepage/emacs.html b/layouts/partials/homepage/emacs.html index 52c9ea2..0b5f42e 100644 --- a/layouts/partials/homepage/emacs.html +++ b/layouts/partials/homepage/emacs.html @@ -5,7 +5,7 @@ {{- $img2x := $img.Resize "100x webp" }} <section class="emacs"> - <h2>Emacs</h2> + <h2 id="emacs">Emacs</h2> <div style="display: flow-root; vertical-align: middle;"> <img style="float: left; max-width: 20%; margin-right: 10px;" diff --git a/layouts/partials/homepage/startrek.html b/layouts/partials/homepage/startrek.html new file mode 100644 index 0000000..296be4b --- /dev/null +++ b/layouts/partials/homepage/startrek.html @@ -0,0 +1,23 @@ +{{- $file := "star-trek-voyager-transparent.png" }} +{{- $path := printf "content_images/%s" $file}} +{{- $img := resources.Get $path }} +{{- $img1x := $img.Resize "150x webp" }} +{{- $img2x := $img.Resize "300x webp" }} + +<section class="star-trek" style="display: flow-root"> + <h2 id="star-trek">Star Trek</h2> + <img + class="vert-move" + style="float: right; max-width: 20%;" + src="{{ $img1x.Permalink }}" + srcset=" + {{ $img1x.Permalink }} 1x, + {{ $img2x.Permalink }} 2x + " + width="{{ $img1x.Width }}" + height="{{ $img1x.Height }}" + > + + {{ partial "menu.html" (dict "menuID" "star-trek" "page" .) }} +</section> + diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 0773944..b88272b 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -14,21 +14,31 @@ {{- range .menuEntries }} - {{ if .Params.nonpage }} - <li>{{.Name }} - {{else if .Params.placeholder }} - <li class="placeholder">{{.Name }} - {{else}} - <li><b><a href="{{ .URL }}">{{ .Name }}</b></a> - {{end}} + {{- if .Params.nonpage }} + <li>{{.Name }} + {{- else if .Params.placeholder }} + <li class="placeholder">{{.Name }} + {{- else}} + <li><b><a href="{{ .URL }}">{{ .Name }}</a></b> + {{- end}} + {{- if .Params.inlineChildren}} + {{- with .Children }} + - {{- partial "inline/menu/inline.html" (dict "page" $page "menuEntries" .) }} + {{- end}} - {{- with .Children }} - <ul> - {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }} - </ul> - {{- end }} + {{- else}} + {{- with .Children }} + <ul>{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}</ul> + {{- end }} </li> + {{- end}} {{- end }} {{- end }} +{{- define "partials/inline/menu/inline.html" }} + {{- $page := .page }} + {{- range .menuEntries }} + <a href="{{ .URL }}"> {{ .Name }}</a>, + {{- end }} +{{- end }} |