first commit
This commit is contained in:
3
themes/roazhon/layouts/404.html
Normal file
3
themes/roazhon/layouts/404.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{ define "main" }}
|
||||
<strong>404 - Not Found</strong>
|
||||
{{ end }}
|
||||
22
themes/roazhon/layouts/_default/baseof.html
Normal file
22
themes/roazhon/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE HTML>
|
||||
{{- partial "lang.html" . }}
|
||||
<head>
|
||||
<title>
|
||||
{{- block "title" . }}
|
||||
{{- with .Title }}{{ . }} - {{ end }}{{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
</title>
|
||||
{{- partial "head.html" . }}
|
||||
</head>
|
||||
<body class="loading">
|
||||
<div id="wrapper">
|
||||
{{- partial "header.html" . }}
|
||||
<div id="main">
|
||||
{{ block "main" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- partial "footer.html" . }}
|
||||
</div>
|
||||
{{- partial "scripts.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
159
themes/roazhon/layouts/_default/list.html
Normal file
159
themes/roazhon/layouts/_default/list.html
Normal file
@@ -0,0 +1,159 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{- /* Things in site config */}}
|
||||
{{- $thumb_width := default 480 ($.Param "thumb_width") }}
|
||||
{{- $full_width := default 960 ($.Param "full_width") }}
|
||||
{{- $thumb_quality := default 50 ($.Param "thumb_quality") }}
|
||||
{{- $full_quality := default 90 ($.Param "full_quality") }}
|
||||
{{- $filename_as_phototitle := default false ($.Param "filename_as_phototitle") }}
|
||||
|
||||
{{- /* Calculate thumb_ and full_size from params, unless one is provided in the config. */}}
|
||||
{{- $thumb_size := default (printf "%dx q%d" $thumb_width $thumb_quality) ($.Param "thumb_size") }}
|
||||
{{- $full_resize_method := lower (default "resize" ($.Param "full_resize_method")) -}}
|
||||
{{- $full_size := default (printf "%dx q%d" $full_width $full_quality) ($.Param "full_size") }}
|
||||
|
||||
{{- /* Build the list of sections and thumbnails */}}
|
||||
{{- $.Scratch.Set "sections" (slice) }}
|
||||
{{- range .Sections.ByDate }}
|
||||
{{- $title := .Title }}
|
||||
{{- $link := .RelPermalink }}
|
||||
{{- $weight := default 0 (.Param "weight") }}
|
||||
|
||||
{{- partial "scratch_set_retalbumthumb.html" . }}
|
||||
{{- /* Note that the Scratch below must come from . context, not $ */}}
|
||||
{{- $image := .Scratch.Get "retalbumthumb" }}
|
||||
|
||||
{{- if not $image }}
|
||||
{{- errorf (printf "When processing '%s', no thumbnail image found for: %s" $.Page.File.Path $title) }}
|
||||
{{- else }}
|
||||
{{- $.Scratch.Set "orientation" 1 }}
|
||||
{{- with $image.Exif }}
|
||||
{{- $.Scratch.Set "orientation" .Tags.Orientation }}
|
||||
{{- end }}
|
||||
{{- $orientation := $.Scratch.Get "orientation" }}
|
||||
{{- /* TODO: handle flipped orientations */}}
|
||||
{{- $.Scratch.Set "rotation" "" }}
|
||||
{{- if (eq $orientation 1) }}
|
||||
{{- $.Scratch.Set "rotation" "" }}
|
||||
{{- else if (eq $orientation 8) }}
|
||||
{{- $.Scratch.Set "rotation" " r90" }}
|
||||
{{- else if (eq $orientation 3) }}
|
||||
{{- $.Scratch.Set "rotation" " r180" }}
|
||||
{{- else if (eq $orientation 6) }}
|
||||
{{- $.Scratch.Set "rotation" " r270" }}
|
||||
{{- end }}
|
||||
{{- $rotation := $.Scratch.Get "rotation" }}
|
||||
{{- $resize_cmd := printf "%s%s" $thumb_size $rotation }}
|
||||
{{- $thumb := $image.Resize $resize_cmd }}
|
||||
{{- $new_sect := dict "type" "link" "title" $title "link" $link "thumb" $thumb "weight" $weight }}
|
||||
|
||||
{{- $sections := $.Scratch.Get "sections" }}
|
||||
{{- $sections := $sections | append $new_sect }}
|
||||
{{- $.Scratch.Set "sections" $sections }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /* Section list is complete, now resort */}}
|
||||
{{- $.Scratch.Set "sections" (sort ($.Scratch.Get "sections") "weight") }}
|
||||
{{- $sections := $.Scratch.Get "sections" }}
|
||||
|
||||
{{- /* Get and reorder the list of images */}}
|
||||
{{- if .File }}
|
||||
{{- $imgglob := printf "%s" (path.Join .File.Dir "*") }}
|
||||
{{- $.Scratch.Set "imgglob" $imgglob }}
|
||||
{{- end }}
|
||||
{{- $imgglob := default "*" ($.Scratch.Get "imgglob") }}
|
||||
{{- $imageresources := where (resources.Match $imgglob) "ResourceType" "image" }}
|
||||
|
||||
{{- /* Build some image objects */}}
|
||||
{{- $.Scratch.Set "images" (slice) }}
|
||||
{{- range $elem_index, $elem_val := $imageresources }}
|
||||
|
||||
{{- /* Build some scratch for upcoming search... */}}
|
||||
{{- $img_dat := newScratch }}
|
||||
{{- $img_dat.Set "alt" "" }}
|
||||
{{- $img_dat.Set "description" "" }}
|
||||
{{- $img_dat.Set "weight" 0 }}
|
||||
{{- $img_dat.Set "taxonomies" dict }}
|
||||
|
||||
{{- if $filename_as_phototitle }}
|
||||
{{- $filename := replace (path.Base $elem_val.Name) (path.Ext $elem_val.Name) "" }}
|
||||
{{- $img_dat.Set "phototitle" (humanize $filename) }}
|
||||
{{- else }}
|
||||
{{- $img_dat.Set "phototitle" "" }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Search the resources for a matching image src, save off details */}}
|
||||
{{- $img_path := $elem_val.Name }}
|
||||
{{- with $.Params.resources }}
|
||||
{{- range first 1 (where . "src" $img_path) }}
|
||||
{{- $found := . }}
|
||||
{{- if isset . "alt" }}{{ $img_dat.Set "alt" .alt }}{{ end }}
|
||||
{{- if isset . "phototitle" }}{{ $img_dat.Set "phototitle" .phototitle }}{{ end }}
|
||||
{{- if isset . "description" }}{{ $img_dat.Set "description" .description }}{{ end }}
|
||||
{{- if isset . "weight" }}{{ $img_dat.Set "weight" .weight }}{{ end }}
|
||||
|
||||
{{- /* Build an dict of arrays - the keys are taxonomy name, values are an array of terms in that taxonomy */}}
|
||||
{{- range $taxname, $taxterms := $.Site.Taxonomies }}
|
||||
{{- if isset $found $taxname }}
|
||||
{{- $newentry := dict $taxname (index $found $taxname) }}
|
||||
{{- $newvals := merge ($img_dat.Get "taxonomies") $newentry }}
|
||||
{{- $img_dat.Set "taxonomies" $newvals }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $.Scratch.Set "orientation" 1 }}
|
||||
{{- with $elem_val.Exif }}
|
||||
{{- $.Scratch.Set "orientation" .Tags.Orientation }}
|
||||
{{- end }}
|
||||
{{- $orientation := $.Scratch.Get "orientation" }}
|
||||
{{- /* TODO: handle flipped orientations */}}
|
||||
{{- $.Scratch.Set "rotation" "" }}
|
||||
{{- if (eq $orientation 1) }}
|
||||
{{- $.Scratch.Set "rotation" "" }}
|
||||
{{- else if (eq $orientation 8) }}
|
||||
{{- $.Scratch.Set "rotation" " r90" }}
|
||||
{{- else if (eq $orientation 3) }}
|
||||
{{- $.Scratch.Set "rotation" " r180" }}
|
||||
{{- else if (eq $orientation 6) }}
|
||||
{{- $.Scratch.Set "rotation" " r270" }}
|
||||
{{- end }}
|
||||
{{- $rotation := $.Scratch.Get "rotation" }}
|
||||
{{- $thumb_resize_cmd := printf "%s%s" $thumb_size $rotation }}
|
||||
{{- $full_resize_cmd := printf "%s%s" $full_size $rotation }}
|
||||
|
||||
{{- /* Save off the image object */}}
|
||||
{{- $alt := $img_dat.Get "alt" }}
|
||||
{{- $phototitle := $img_dat.Get "phototitle" }}
|
||||
{{- $description := $img_dat.Get "description" }}
|
||||
{{- $weight := $img_dat.Get "weight" }}
|
||||
{{- $taxonomies := $img_dat.Get "taxonomies" }}
|
||||
{{- $thumb := $elem_val.Resize $thumb_resize_cmd }}
|
||||
|
||||
{{- $.Scratch.Set "full_resized" $thumb }}
|
||||
{{- if (eq $full_resize_method "resize") }}
|
||||
{{- $.Scratch.Set "full_resized" ($elem_val.Resize $full_resize_cmd) }}
|
||||
{{- else if (eq $full_resize_method "fit") }}
|
||||
{{- $.Scratch.Set "full_resized" ($elem_val.Fit $full_resize_cmd) }}
|
||||
{{- else if (eq $full_resize_method "none") }}
|
||||
{{- $.Scratch.Set "full_resized" $elem_val }}
|
||||
{{- else }}
|
||||
{{- errorf "Invalid 'full_resize_method' specified! Must be resize or fit." }}
|
||||
{{- end }}
|
||||
{{- $full := $.Scratch.Get "full_resized" }}
|
||||
|
||||
{{- $new_img := dict "type" "image" "image" $elem_val "thumb" $thumb "full" $full "alt" $alt "phototitle" $phototitle "description" $description "weight" $weight "orig" $elem_val "taxonomies" $taxonomies }}
|
||||
|
||||
{{- $images := $.Scratch.Get "images" }}
|
||||
{{- $images := $images | append $new_img }}
|
||||
{{- $.Scratch.Set "images" $images }}
|
||||
{{- end }}
|
||||
{{- /* Image list is complete, now resort */}}
|
||||
{{- $.Scratch.Set "images" (sort ($.Scratch.Get "images") "weight") }}
|
||||
{{- $images := $.Scratch.Get "images" }}
|
||||
|
||||
{{- $.Scratch.Set "content" ($sections | append $images) }}
|
||||
{{- partial "render_img_column_flexrow.html" $ }}
|
||||
|
||||
{{ end }}
|
||||
72
themes/roazhon/layouts/_default/terms.html
Normal file
72
themes/roazhon/layouts/_default/terms.html
Normal file
@@ -0,0 +1,72 @@
|
||||
{{ define "main" }}
|
||||
{{- $thumb_width := default 480 ($.Param "thumb_width") }}
|
||||
{{- $thumb_quality := default 50 ($.Param "thumb_quality") }}
|
||||
|
||||
{{- $thumb_size := default (printf "%dx q%d" $thumb_width $thumb_quality) ($.Param "thumb_size") }}
|
||||
|
||||
{{- $.Scratch.Set "tags" (dict) }}
|
||||
|
||||
{{- range $.Site.Pages }}
|
||||
{{- $page := . }}
|
||||
|
||||
{{- /* Enumerate the tags on the page */}}
|
||||
{{- range (index $page.Params $.Data.Plural) }}
|
||||
{{- $tag := . }}
|
||||
|
||||
{{- partial "scratch_set_retalbumthumb.html" $page }}
|
||||
{{- /* Note that the Scratch below must come from $page context, not $ */}}
|
||||
{{- $image := $page.Scratch.Get "retalbumthumb" }}
|
||||
|
||||
{{- if not $image }}
|
||||
{{- errorf (printf "When processing '%s', no thumbnail image found for: %s" $page.Path $tag) }}
|
||||
{{- end }}
|
||||
|
||||
{{- $thumb := $image.Resize $thumb_size }}
|
||||
|
||||
{{- /* Create an object representing this tag term entry */}}
|
||||
{{- $page_desc := dict "type" "link" "link" $page.RelPermalink "title" $page.Title "thumb" $thumb }}
|
||||
|
||||
{{- /* Add this object to the list */}}
|
||||
{{- $cur_entry := (index ($.Scratch.Get "tags") $tag) }}
|
||||
{{- $new_list := $cur_entry | append $page_desc }}
|
||||
{{- $.Scratch.Set "tags" (merge ($.Scratch.Get "tags") (dict $tag $new_list)) }}
|
||||
{{ end }}
|
||||
|
||||
{{- /* Enumerate the tags on the resource images */}}
|
||||
{{- with $page.File }}
|
||||
{{- range resources.Match (path.Join $page.File.Dir "*") }}
|
||||
{{- $img := . }}
|
||||
{{- $filename := path.Base $img.Name }}
|
||||
{{- $filedir := path.Dir $img.Name }}
|
||||
|
||||
{{- with $page.Params.resources }}
|
||||
{{- range first 1 (where . "src" $img.Name) }}
|
||||
{{- $resource := . }}
|
||||
{{- range (index . $.Data.Plural) }}
|
||||
{{- $tag := . }}
|
||||
|
||||
{{- $thumb := $img.Resize $thumb_size }}
|
||||
|
||||
{{- /* Create an object representing this tag term entry */}}
|
||||
{{- $url := ( printf "/%s/#%s" $filedir ( md5 $filename ) ) | relURL }}
|
||||
{{- $img_desc := dict "type" "link" "link" $url "title" $resource.phototitle "thumb" $thumb }}
|
||||
{{- /* Add this object to the list */}}
|
||||
{{- $cur_entry := (index ($.Scratch.Get "tags") $tag) }}
|
||||
{{- $new_list := $cur_entry | append $img_desc }}
|
||||
{{- $.Scratch.Set "tags" (merge ($.Scratch.Get "tags") (dict $tag $new_list)) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{- range $term, $term_list := $.Scratch.Get "tags" }}
|
||||
|
||||
<h1 id="{{ $term | urlize }}">{{ $term }}</h1>
|
||||
{{- $.Scratch.Set "content" $term_list }}
|
||||
{{- partial "render_img_column_flexrow.html" $ }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
87
themes/roazhon/layouts/partials/footer.html
Normal file
87
themes/roazhon/layouts/partials/footer.html
Normal file
@@ -0,0 +1,87 @@
|
||||
{{ "<!-- Footer -->" | safeHTML }}
|
||||
<footer id="footer" class="panel">
|
||||
<div class="inner split">
|
||||
<div>
|
||||
<section>
|
||||
<h2>{{ with .Site.Params.footer.paragraph.headline }}{{ . | markdownify }}{{ end }}</h2>
|
||||
<p>{{ with .Site.Params.footer.paragraph.text }}{{ . | markdownify }}{{ end }}</p>
|
||||
</section>
|
||||
<section>
|
||||
<h2>{{ with .Site.Params.footer.social.headline }}{{ . | markdownify }}{{ end }}</h2>
|
||||
<ul class="icons">
|
||||
{{ range .Site.Params.footer.social.links }}
|
||||
<li><a href="{{ .url }}" class="icon {{ .icon }}"><span class="label">{{ .label }}</span></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
{{- /* Unfortunately I cannot find a way to determine if disableKinds
|
||||
is turned on, so I cannot check that for taxonomy or term.
|
||||
Instead I have to use this new parameter */}}
|
||||
{{- if (default false ($.Param "taxonomies_links")) }}
|
||||
|
||||
{{- with $.Site.Taxonomies }}
|
||||
<section class="taxonomy_list flexrow">
|
||||
<h2>View all:</h2>
|
||||
<div>
|
||||
{{- range $taxname, $taxterms := $.Site.Taxonomies }}
|
||||
{{- $url := ( printf "/%s/" ($taxname | urlize) ) | relURL }}
|
||||
<div class="tax_term"><a href="{{ $url }}">{{ $taxname | humanize }}</a></div>
|
||||
{{- end }}
|
||||
</div>
|
||||
</section>
|
||||
{{- end }}
|
||||
|
||||
{{- /* Only display the terms list if this page has some */}}
|
||||
{{- $.Scratch.Set "terms_present" false }}
|
||||
{{- range $taxname, $taxterms := $.Site.Taxonomies }}
|
||||
{{- range ($.Param $taxname) }}
|
||||
{{- $.Scratch.Set "terms_present" true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $.Scratch.Get "terms_present" }}
|
||||
<section class="taxonomy_list flexrow">
|
||||
<h2>Terms:</h2>
|
||||
<div>
|
||||
{{- range $taxname, $taxterms := $.Site.Taxonomies }}
|
||||
{{- range ($.Param $taxname) }}
|
||||
{{- $url := ( printf "/%s/#%s" ($taxname | urlize) ( . | urlize ) ) | relURL }}
|
||||
<div class="tax_term"><a href="{{ $url }}">{{ . | humanize }}</a></div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</section>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ if not .Site.Params.footer.contact.hide }}
|
||||
<div>
|
||||
<section>
|
||||
<h2>{{ with .Site.Params.footer.contact.headline }}{{ . | markdownify }}{{ end }}</h2>
|
||||
<p>If you want to contact me, it’s easy…</br>
|
||||
You can visit any of my social networks on the left of this page, or you can make it happen on Delat Chat : all you have to do is scan the QR Code below with your Delta Chat application, then send me a message and I’ll reply as soon as I can.</p>
|
||||
<p class="align-center"><a href="OPENPGP4FPR:B309119B75596F78835A539C8E705C55786BCF4A#a=jme69%40vivaldi.net&n=Julie%C3%B1&i=gBb5CCCF9er&s=LGUxX9megUO" title="Contact me on Delta Chat" target="_blank"><img src="/delta-chat.webp" width="70%" height="70%" alt="Contact me on Delta Chat" /></a></p>
|
||||
<!-- <p class="align-center"><a href="https://matrix.to/#/@jme69:matrix.org" title="Contact me on Matrix" target="_blank"><img src="contact.webp" width="75%" height="75%" alt="Contact me on Matrix" /></a></p> -->
|
||||
<!-- <form method="post" action="//formspree.io/f/{{ with .Site.Params.footer.contact.formspreeID }}{{.}}{{ end }}" novalidate>
|
||||
<div class="field half first">
|
||||
<input type="text" name="name" required data-validation-required-message="{{ with .Site.Params.footer.contact.name.warning }}{{ . | markdownify}}{{ end }}" id="name" placeholder="{{ with .Site.Params.footer.contact.name.text }}{{ . | markdownify }}{{ end }}" />
|
||||
</div>
|
||||
<div class="field half">
|
||||
<input type="email" name="email" required data-validation-required-message="{{ with .Site.Params.footer.contact.email.warning }}{{ . | markdownify }}{{ end }}" id="email" placeholder="{{ with .Site.Params.footer.contact.email.text }}{{ . | markdownify }}{{ end }}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<textarea name="message" required data-validation-required-message="{{ with .Site.Params.footer.contact.message.warning }}{{ . | markdownify }}{{ end }}" id="message" rows="4" placeholder="{{ with .Site.Params.footer.contact.message.text }}{{ . | markdownify }}{{ end }}"></textarea>
|
||||
</div>
|
||||
<ul class="actions">
|
||||
<li><input type="submit" value="{{ .Site.Params.footer.contact.buttonText }}" class="special" /></li>
|
||||
<li><input type="reset" value="{{ .Site.Params.footer.contact.resetText }}" /></li>
|
||||
</ul>
|
||||
</form> -->
|
||||
</section>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<p class="copyright">
|
||||
© 2024, {{ with .Site.Params.footer.copyright.name }}{{ . | markdownify }}{{ end }}. Made with <a href="https://gohugo.io/" title="Hugo" target="_blank">Hugo</a>, theme largely based on <a href="https://github.com/kc0bfv/autophugo/" title="View on GitHub" target="_blank">AutoPhugo</a>.
|
||||
</p>
|
||||
</footer>
|
||||
34
themes/roazhon/layouts/partials/head.html
Normal file
34
themes/roazhon/layouts/partials/head.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="keywords" content="{{ with .Site.Params.keywords }}{{ . }}{{ end }}">
|
||||
|
||||
{{ $description := $.Param "description" }}
|
||||
{{- with $description }}<meta name="description" content="{{ . }}">{{ end }}
|
||||
{{ $author := .Params.author.name | default .Site.Author.name }}
|
||||
{{- with $author }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
<link rel="icon" href="{{ .Site.Params.favicon | relURL }}">
|
||||
<link rel="shortcut icon" href="{{ .Site.Params.favicon | relURL }}">
|
||||
|
||||
{{- partial "scratch_set_retalbumthumb.html" . }}
|
||||
{{- /* Note that the Scratch below must come from . context, not $ */}}
|
||||
{{- .Scratch.Set "image" (.Scratch.Get "retalbumthumb") }}
|
||||
|
||||
{{- partial "opengraph_twittercard.html" . }}
|
||||
|
||||
<meta name="robots" content="index,follow">
|
||||
<meta name="referrer" content="origin-when-cross-origin">
|
||||
{{ with .Site.Params.googlesiteverification }}<meta name="google-site-verification" content="{{ . }}">{{ end }}
|
||||
{{ with .Site.Params.msvalidate }}<meta name="msvalidate.01" content="{{ . }}">{{ end }}
|
||||
{{ hugo.Generator }}
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
|
||||
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
|
||||
{{ end }}
|
||||
|
||||
{{- $font_awesome := resources.Get "css/fontawesome/all.css" -}}
|
||||
{{- $google_font := resources.Get "css/source-sans-pro.css" -}}
|
||||
{{- $main_css := resources.Get "css/main.css" -}}
|
||||
{{- $mg_pop_css := resources.Get "css/magnific-popup.css" -}}
|
||||
{{- $user_css := resources.Get "css/user.css" -}}
|
||||
{{- $custom_css := slice $font_awesome $google_font $main_css $mg_pop_css $user_css | resources.Concat "css/custom.css" | resources.Minify | resources.Fingerprint -}}
|
||||
<link rel="stylesheet" href="{{ $custom_css.RelPermalink }}" integrity="{{ $custom_css.Data.Integrity }}"/>
|
||||
39
themes/roazhon/layouts/partials/header.html
Normal file
39
themes/roazhon/layouts/partials/header.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<header id="header">
|
||||
<h1>
|
||||
|
||||
<!-- Grab the base URL, pull out the path, then count directories -->
|
||||
{{- $base_url_parsed := urls.Parse .Site.BaseURL -}}
|
||||
{{- $base_dir := trim $base_url_parsed.Path "/" -}}
|
||||
{{- $base_part_cnt := cond (ne $base_dir "") (len (split $base_dir "/" )) 0 -}}
|
||||
|
||||
<!-- Grab the current URL, separate it out -->
|
||||
{{- $url_parsed := urls.Parse .Permalink -}}
|
||||
{{- $trimmed_url := trim $url_parsed.Path "/" -}}
|
||||
{{- $pre_url_parts := split $trimmed_url "/" -}}
|
||||
{{- $pre_part_count := len $pre_url_parts -}}
|
||||
|
||||
<!-- Drop the part of the current URL that's the base URL -->
|
||||
{{- $url_parts := last (sub $pre_part_count $base_part_cnt) $pre_url_parts -}}
|
||||
{{- $part_count := len $url_parts -}}
|
||||
|
||||
<!-- Determine how much of the URL to use (sometimes last part is blank) -->
|
||||
{{- $last_part := index $url_parts (sub $part_count 1) -}}
|
||||
{{- $use_part_cnt := cond (eq (trim $last_part " ") "") (sub $part_count 1) $part_count -}}
|
||||
|
||||
<!-- Determine whether to use URL components or titles for breadcrumb -->
|
||||
{{- $crumb_is_title := .Site.Params.breadcrumb_use_title | default false -}}
|
||||
|
||||
<!-- Build the breadcrumb - base URL link, path links for each dir, cur location text -->
|
||||
<a href="{{ .Site.BaseURL }}"><strong>{{ .Site.Title }}</strong></a>
|
||||
{{- if gt $use_part_cnt 0 -}}
|
||||
{{- range $cur_ind, $element := first (sub $use_part_cnt 1) $url_parts -}}
|
||||
{{- $path := string (delimit (first (add $cur_ind 1) $url_parts) "/") -}}
|
||||
{{- $part := $element | humanize }}
|
||||
/ <a href="{{ $.Site.BaseURL }}{{ $path }}"><strong>{{ cond $crumb_is_title ((($.Site.GetPage $path).Title) | default $part) $part }}</strong></a>
|
||||
{{- end -}}
|
||||
{{- $cur_part := (index $url_parts (sub $use_part_cnt 1)) | humanize }}
|
||||
/ {{ cond $crumb_is_title (.Title | default $cur_part) $cur_part }}
|
||||
{{- end }}
|
||||
</h1>
|
||||
{{ partial "navigation.html" . }}
|
||||
</header>
|
||||
1
themes/roazhon/layouts/partials/lang.html
Normal file
1
themes/roazhon/layouts/partials/lang.html
Normal file
@@ -0,0 +1 @@
|
||||
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
|
||||
7
themes/roazhon/layouts/partials/navigation.html
Normal file
7
themes/roazhon/layouts/partials/navigation.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<nav>
|
||||
<ul>
|
||||
{{ range .Site.Params.header.links }}
|
||||
<li><a href="{{ .url }}" class="icon {{ .icon }}">{{ .name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
19
themes/roazhon/layouts/partials/opengraph_twittercard.html
Normal file
19
themes/roazhon/layouts/partials/opengraph_twittercard.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{- $description := $.Param "description" }}
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image"/>
|
||||
<meta name="twitter:image" content="{{ (.Scratch.Get "image").Permalink }}"/>
|
||||
<meta name="twitter:title" content="{{ with .Title }}{{ . }} - {{ end }}{{ .Site.Title }}"/>
|
||||
{{- with $description }}<meta name="twitter:description" content="{{ . }}">{{ end }}
|
||||
{{- with .Site.Social.twitter }}<meta name="twitter:site" content="@{{ . }}"/>{{- end }}
|
||||
|
||||
|
||||
<meta property="og:title" content="{{ with .Title }}{{ . }} - {{ end }}{{ .Site.Title }}"/>
|
||||
{{- with $description }}<meta property="og:description" content="{{ . }}">{{ end }}
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:image" content="{{ (.Scratch.Get "image").Permalink }}"/>
|
||||
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
|
||||
{{- with .Site.Title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
|
||||
|
||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
||||
105
themes/roazhon/layouts/partials/render_img_column_flexrow.html
Normal file
105
themes/roazhon/layouts/partials/render_img_column_flexrow.html
Normal file
@@ -0,0 +1,105 @@
|
||||
{{- /* This partial requires input context to have a Scratch with "content"
|
||||
|
||||
$.Scratch.Get "content" must return a slice (array) of object maps
|
||||
|
||||
Those objects need a "type" key, which can be "link" or something else.
|
||||
|
||||
See below to see what needs to be in those different types
|
||||
*/}}
|
||||
|
||||
<div class="flexrow">
|
||||
|
||||
{{- $column_count := default 3 ($.Param "column_count") }}
|
||||
{{- $downloadable := default false ($.Param "images_downloadable") }}
|
||||
{{- $orig_download := default false ($.Param "images_downloadable_use_orig") }}
|
||||
|
||||
{{- /* Initialize the column storage */}}
|
||||
{{- range $column_ind := seq $column_count }}
|
||||
{{- $st_name := printf "col-%d" $column_ind }}
|
||||
{{- $st_height_name := printf "col-height-%d" $column_ind }}
|
||||
{{- $.Scratch.Set $st_name (slice) }}
|
||||
{{- $.Scratch.Set $st_height_name 0 }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{- /* Add the sections into the columns followed by images */}}
|
||||
{{- range $elem_index, $elem_val := $.Scratch.Get "content" }}
|
||||
{{- /* Find the least-filled column */}}
|
||||
{{- $.Scratch.Set "min_height" -1 }}
|
||||
{{- $.Scratch.Set "min_col" -1 }}
|
||||
{{- range $column_ind := seq $column_count }}
|
||||
{{- $st_height_name := printf "col-height-%d" $column_ind }}
|
||||
{{- $col_height := $.Scratch.Get $st_height_name }}
|
||||
{{- $min_height := $.Scratch.Get "min_height" }}
|
||||
{{- if (or (eq $min_height -1) (lt $col_height $min_height)) }}
|
||||
{{- $.Scratch.Set "min_height" $col_height }}
|
||||
{{- $.Scratch.Set "min_col" $column_ind }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* column_ind becomes the least-filled column */}}
|
||||
{{- $column_ind := $.Scratch.Get "min_col" }}
|
||||
{{- if eq $column_ind -1 }}
|
||||
{{- errorf (printf "When processing '%s', failed to find a least-filled column!" $.Page.File.Path) }}
|
||||
{{- end }}
|
||||
{{- $st_name := printf "col-%d" $column_ind }}
|
||||
{{- $st_height_name := printf "col-height-%d" $column_ind }}
|
||||
|
||||
{{- /* Create a new version of the elem_val with an index reflecting position now, well after sorting is complete, and as we're placing things */}}
|
||||
{{- $reind_val := merge $elem_val (dict "index" $elem_index) }}
|
||||
|
||||
{{- $column := $.Scratch.Get $st_name }}
|
||||
{{- $column := $column | append $reind_val }}
|
||||
{{- $.Scratch.Set $st_name $column }}
|
||||
|
||||
{{- $.Scratch.Set $st_height_name (add ($.Scratch.Get $st_height_name) $reind_val.thumb.Height) }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Output the images in columns */}}
|
||||
{{- range $column_ind := seq $column_count }}
|
||||
{{- $st_name := printf "col-%d" $column_ind }}
|
||||
{{- $column := $.Scratch.Get $st_name }}
|
||||
<div class="flexcol">
|
||||
{{- range $column }}
|
||||
{{- $filename := path.Base .image.Name }}
|
||||
<article class="thumb">
|
||||
{{- if (eq .type "link") }}
|
||||
<a href="{{ .link }}" class="link" tabindex="0"><img src="{{ .thumb.RelPermalink }}" alt="{{ .title }}" /></a>
|
||||
<h2 class="overlay">{{ .title }}</h2>
|
||||
{{- else }}
|
||||
<a class="gallery-item" phototitle="{{ .phototitle }}"
|
||||
{{ printf "description='%s'" (.description | markdownify) | safeHTMLAttr }}
|
||||
gallery_index="{{ .index }}"
|
||||
id="{{ md5 $filename }}"
|
||||
downloadable="{{ cond $downloadable "true" "false" }}"
|
||||
{{- if $downloadable }}
|
||||
download_file="{{ (cond $orig_download .orig .full).RelPermalink }}"
|
||||
{{- end }}
|
||||
orig_name="{{ $filename }}"
|
||||
href="{{ .full.RelPermalink }}">
|
||||
<div id="image_number_{{ .index }}" class="gallery-item-marker"></div>
|
||||
<img src="{{ .thumb.RelPermalink }}"
|
||||
{{- with .alt }} alt="{{ . }}"{{ end }}>
|
||||
{{- with .description }}
|
||||
<div class="invis_desc">{{ (. | markdownify) | safeHTMLAttr }}</div>
|
||||
{{- end }}
|
||||
</a>
|
||||
{{- if (default false ($.Param "taxonomies_links")) }}
|
||||
<div class="caption_tax">
|
||||
{{- range $taxname, $terms := .taxonomies }}
|
||||
{{- range $terms }}
|
||||
<div class="tax_term">
|
||||
{{- $url := ( printf "/%s/#%s" ($taxname | urlize) ( . | urlize ) ) | relURL }}
|
||||
<a href="{{ $url }}">{{ . | humanize }}</a>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
<h2>{{ .phototitle }}</h2>
|
||||
{{- end }}
|
||||
</article>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
{{- /*
|
||||
Sets retalbumthumb in .Scratch to the correct albumthumb.
|
||||
PLEASE NOTE: partials can only get local "dot" . context, they
|
||||
do not get the global $ context. Therefore, you must get the returned
|
||||
scratch data from the . context, not from $.
|
||||
|
||||
Requires . to be set to the right section.
|
||||
*/}}
|
||||
|
||||
{{- .Scratch.Delete "retalbumthumb" }}
|
||||
|
||||
{{- /* If no albumthumb is set, get the first image*/}}
|
||||
{{- if or (not (isset .Params "albumthumb")) (eq .Params.albumthumb "") }}
|
||||
{{- with .File }}
|
||||
{{- $.Scratch.Set "imgglob" (printf "%s" (path.Join .Dir "**")) }}
|
||||
{{- end }}
|
||||
{{- $imgglob := default "**" ($.Scratch.Get "imgglob") }}
|
||||
{{- $imageresources := where (resources.Match $imgglob) "ResourceType" "image" }}
|
||||
{{- .Scratch.Set "retalbumthumb" (index $imageresources 0) }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Otherwise get the albumthumb*/}}
|
||||
{{- with .Params.albumthumb }}
|
||||
{{- $image := resources.Get . }}
|
||||
{{- /* The $ here with Scratch means the context outside the with */}}
|
||||
{{- $.Scratch.Set "retalbumthumb" $image }}
|
||||
{{- end }}
|
||||
6
themes/roazhon/layouts/partials/scripts.html
Normal file
6
themes/roazhon/layouts/partials/scripts.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{- $jquery := resources.Get "js/jquery.min.js" -}}
|
||||
{{- $mg_pop := resources.Get "js/jquery.magnific-popup.js" -}}
|
||||
{{- $main := resources.Get "js/main.js" -}}
|
||||
{{- $util := resources.Get "js/util.js" -}}
|
||||
{{- $custom_js := slice $jquery $mg_pop $main $util | resources.Concat "js/custom.js" | resources.Minify | resources.Fingerprint -}}
|
||||
<script src="{{ $custom_js.RelPermalink }}" integrity="{{ $custom_js.Data.Integrity }}"></script>
|
||||
Reference in New Issue
Block a user