aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/section.media.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/_default/section.media.html')
-rw-r--r--themes/default/layouts/_default/section.media.html65
1 files changed, 65 insertions, 0 deletions
diff --git a/themes/default/layouts/_default/section.media.html b/themes/default/layouts/_default/section.media.html
new file mode 100644
index 0000000..ce570c7
--- /dev/null
+++ b/themes/default/layouts/_default/section.media.html
@@ -0,0 +1,65 @@
+{{- define "styles" -}}
+{{- $author := partial "function-authors-data.html" . -}}
+{{- $author = $author.user -}}
+<style>
+ {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }}
+
+ tab-bar a[href^="{{ "" | absURL }}/{{ $author }}/media"] {
+ color: #111;
+ color: var(--foreground);
+ font-weight: 700;
+ text-decoration-color: #014cc6;
+ text-decoration-color: var(--link);
+ text-decoration: underline;
+ border-bottom: 2px solid var(--background);
+ }
+</style>
+{{- end -}}
+
+{{- define "header" -}}
+ {{- partial "navigator-middle.html"
+ (dict
+ "Title" "Media"
+ "Subtitle" (print (partial "count-media.html" .) " " "Total")
+ "Icon" "arrow-left"
+ "IconLabel" "Back"
+ "Href" "/"
+ "Id" "back"
+ "Context" .
+ )
+ -}}
+
+ {{- partial "profile.html" . -}}
+{{- end -}}
+
+{{- define "middle" -}}
+ {{- $author := partial "function-authors-data.html" . -}}
+ {{- $notFeeds := where .Site.RegularPages "Params.feed" "eq" nil -}}
+ {{- $authors := where .Site.RegularPages "Section" $author.user -}}
+ {{- $filteredPages := $authors | intersect $notFeeds -}}
+ {{- $count := 0 -}}
+
+ {{- range first 100 $filteredPages -}}
+ {{- if eq $count 10 -}}
+ {{- break -}}
+ {{- end -}}
+ {{- if or
+ (in .Content "</video>")
+ (in .Content "</picture>")
+ (in .Content "</youtube-video>")
+ -}}
+ {{- partial "render-embed.html" . -}}
+ {{- $count = add $count 1 -}}
+ {{- end -}}
+ {{- end -}}
+
+ {{- if not $count -}}
+ <footer>
+ <code>No items found!</code>
+ </footer>
+ {{- end -}}
+{{- end -}}
+
+{{- define "right" -}}
+ {{- partial "navigator-right.html" . -}}
+{{- end -}}