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.html75
1 files changed, 35 insertions, 40 deletions
diff --git a/themes/default/layouts/_default/section.media.html b/themes/default/layouts/_default/section.media.html
index 9191a3e..ce570c7 100644
--- a/themes/default/layouts/_default/section.media.html
+++ b/themes/default/layouts/_default/section.media.html
@@ -1,70 +1,65 @@
-{{ define "styles" }}
+{{- define "styles" -}}
{{- $author := partial "function-authors-data.html" . -}}
{{- $author = $author.user -}}
<style>
- {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }}
+ {{ partial "navigator.css.html" (dict "Link" "/") | safeCSS }}
- tab-bar a[href="{{ .Site.BaseURL }}/{{ $author }}/media/"] {
+ tab-bar a[href^="{{ "" | absURL }}/{{ $author }}/media"] {
color: #111;
color: var(--foreground);
- display: inherit;
font-weight: 700;
text-decoration-color: #014cc6;
text-decoration-color: var(--link);
text-decoration: underline;
+ border-bottom: 2px solid var(--background);
}
</style>
-{{ end }}
+{{- end -}}
-{{ define "middle" }}
-
- {{ partial "navigator-middle.html"
+{{- define "header" -}}
+ {{- partial "navigator-middle.html"
(dict
"Title" "Media"
- "Subtitle" (partial "count-media.html" .)
+ "Subtitle" (print (partial "count-media.html" .) " " "Total")
"Icon" "arrow-left"
"IconLabel" "Back"
"Href" "/"
"Id" "back"
"Context" .
)
- }}
+ -}}
- {{ partial "profile.html" . }}
+ {{- partial "profile.html" . -}}
+{{- end -}}
+{{- define "middle" -}}
{{- $author := partial "function-authors-data.html" . -}}
- {{- $author = $author.user -}}
-
- {{ $count := 0 }}
- {{ $result := false }}
+ {{- $notFeeds := where .Site.RegularPages "Params.feed" "eq" nil -}}
+ {{- $authors := where .Site.RegularPages "Section" $author.user -}}
+ {{- $filteredPages := $authors | intersect $notFeeds -}}
+ {{- $count := 0 -}}
- {{ range .Site.RegularPages }}
- {{ if or
- (in .Content "<figure>")
- (in .Content "<imgur-video>")
- (in .Content "<youtube-video>")
- (in .Content "<video-container>")
- }}
- {{ if eq .Type $author }}
- {{ $result = true }}
- {{ $count = add $count 1 }}
- {{ if le $count 10 }}
- {{ .Render "summary" }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
+ {{- 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 $result }}
+ {{- if not $count -}}
<footer>
- <code>No media found!</code>
+ <code>No items found!</code>
</footer>
- {{ end }}
-
- {{ partial "pagination.html" . }}
-
-{{ end }}
+ {{- end -}}
+{{- end -}}
-{{ define "right" }}
+{{- define "right" -}}
{{- partial "navigator-right.html" . -}}
-{{ end }}
+{{- end -}}