diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/index.html | 5 | ||||
-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 |
4 files changed, 47 insertions, 17 deletions
diff --git a/layouts/_default/index.html b/layouts/_default/index.html index fcdcb25..7a3330d 100644 --- a/layouts/_default/index.html +++ b/layouts/_default/index.html @@ -30,15 +30,12 @@ Hey! I'm Michał Sapka, a computer programmer living in Kraków, Poland. This we {{ partial "partials/homepage/bsd.html" . }} {{ partial "partials/homepage/emacs.html" . }} - + {{ partial "partials/homepage/startrek.html" . }} <h2>Sections</h2> <nav> <P><a class="sec-link" href="/blog/"><b>Blog</b>: my shorter publications withount any theme. You can treat it as E/N site.</a> </p> <P><a class="sec-link" href="/articles/"><b>Articles</b>: longer publications that don't fit blog or any other category.</a> </p> - - - <P><a class="sec-link" href="/star-trek/"><b>Star Trek fan site</b>: my little shrine to the greatest american Sci-Fi that has ever graced our screens.</a> </p> <P><a class="sec-link" href="/funnies/"><b>Funnies</b>: A small, curated collection of things I found funny or ammusing.</a> </p> <p><a class="sec-link" href="/git/"><b>Version control system</b> : My little code repository. I don't expect to cooporate on any of those, so it's just stagit.</a></p> <p><a class="sec-link" href="/site/"><b>Site info</b> : you can find site updates, metrics, statics, and legal thingies here.</a></p> 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 }} |