Initial commit
This commit is contained in:
commit
c61393c39b
162 changed files with 5158 additions and 0 deletions
122
layouts/_default/list.html
Normal file
122
layouts/_default/list.html
Normal file
|
@ -0,0 +1,122 @@
|
|||
{{- define "main" }}
|
||||
|
||||
{{- if (and site.Params.profileMode.enabled .IsHome) }}
|
||||
{{- partial "index_profile.html" . }}
|
||||
{{- else }} {{/* if not profileMode */}}
|
||||
|
||||
{{- if not .IsHome | and .Title }}
|
||||
<header class="page-header">
|
||||
{{- partial "breadcrumbs.html" . }}
|
||||
<h1>
|
||||
{{ .Title }}
|
||||
{{- if and (or (eq .Kind `term`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }}
|
||||
{{- with .OutputFormats.Get "rss" }}
|
||||
<a href="{{ .RelPermalink }}" title="RSS" aria-label="RSS">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round" height="23">
|
||||
<path d="M4 11a9 9 0 0 1 9 9" />
|
||||
<path d="M4 4a16 16 0 0 1 16 16" />
|
||||
<circle cx="5" cy="19" r="1" />
|
||||
</svg>
|
||||
</a>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</h1>
|
||||
{{- if .Description }}
|
||||
<div class="post-description">
|
||||
{{ .Description | markdownify }}
|
||||
</div>
|
||||
{{- end }}
|
||||
</header>
|
||||
{{- end }}
|
||||
|
||||
{{- if .Content }}
|
||||
<div class="post-content">
|
||||
{{- if not (.Param "disableAnchoredHeadings") }}
|
||||
{{- partial "anchored_headings.html" .Content -}}
|
||||
{{- else }}{{ .Content }}{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
{{- $pages := union .RegularPages .Sections }}
|
||||
|
||||
{{- if .IsHome }}
|
||||
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||
{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }}
|
||||
{{- end }}
|
||||
|
||||
{{- $paginator := .Paginate $pages }}
|
||||
|
||||
{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }}
|
||||
{{- partial "home_info.html" . }}
|
||||
{{- end }}
|
||||
|
||||
{{- $term := .Data.Term }}
|
||||
{{- range $index, $page := $paginator.Pages }}
|
||||
|
||||
{{- $class := "post-entry" }}
|
||||
|
||||
{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }}
|
||||
{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }}
|
||||
{{- $class = "first-entry" }}
|
||||
{{- else if $term }}
|
||||
{{- $class = "post-entry tag-entry" }}
|
||||
{{- end }}
|
||||
|
||||
<article class="{{ $class }}">
|
||||
{{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }}
|
||||
{{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
|
||||
<header class="entry-header">
|
||||
<h2 class="entry-hint-parent">
|
||||
{{- .Title }}
|
||||
{{- if .Draft }}
|
||||
<span class="entry-hint" title="Draft">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" fill="currentColor">
|
||||
<path
|
||||
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
|
||||
</svg>
|
||||
</span>
|
||||
{{- end }}
|
||||
{{- if .Weight }}<span class="entry-hint"> [angeheftet]</span>{{- end }}
|
||||
</h2>
|
||||
</header>
|
||||
{{- if (ne (.Param "hideSummary") true) }}
|
||||
<div class="entry-content">
|
||||
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- if not (.Param "hideMeta") }}
|
||||
<footer class="entry-footer">
|
||||
{{- partial "post_meta.html" . -}}
|
||||
</footer>
|
||||
{{- end }}
|
||||
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
|
||||
</article>
|
||||
{{- end }}
|
||||
|
||||
{{- if gt $paginator.TotalPages 1 }}
|
||||
<footer class="page-footer">
|
||||
<nav class="pagination">
|
||||
{{- if $paginator.HasPrev }}
|
||||
<a class="prev" href="{{ $paginator.Prev.URL | absURL }}">
|
||||
« {{ i18n "prev_page" }}
|
||||
{{- if (.Param "ShowPageNums") }}
|
||||
{{- sub $paginator.PageNumber 1 }}/{{ $paginator.TotalPages }}
|
||||
{{- end }}
|
||||
</a>
|
||||
{{- end }}
|
||||
{{- if $paginator.HasNext }}
|
||||
<a class="next" href="{{ $paginator.Next.URL | absURL }}">
|
||||
{{- i18n "next_page" }}
|
||||
{{- if (.Param "ShowPageNums") }}
|
||||
{{- add 1 $paginator.PageNumber }}/{{ $paginator.TotalPages }}
|
||||
{{- end }} »
|
||||
</a>
|
||||
{{- end }}
|
||||
</nav>
|
||||
</footer>
|
||||
{{- end }}
|
||||
|
||||
{{- end }}{{/* end profileMode */}}
|
||||
|
||||
{{- end }}{{- /* end main */ -}}
|
21
layouts/partials/footer.html
Normal file
21
layouts/partials/footer.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
{{- if not (.Param "hideFooter") }}
|
||||
<footer class="footer">
|
||||
<span>
|
||||
Powered by
|
||||
<a href="https://gohugo.io/" rel="noopener noreferrer">Hugo</a> &
|
||||
<a href="https://github.com/Wonderfall/hugo-WonderMod/" rel="noopener">WonderMod</a>
|
||||
</span>
|
||||
</footer>
|
||||
{{- end }}
|
||||
|
||||
{{- if (not site.Params.disableScrollToTop) }}
|
||||
<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor">
|
||||
<path d="M12 6H0l6-6z" />
|
||||
</svg>
|
||||
</a>
|
||||
{{- end }}
|
||||
|
||||
{{- partial "extend_footer.html" . }}
|
||||
|
||||
{{- partial "script.html" . }}
|
109
layouts/partials/header.html
Normal file
109
layouts/partials/header.html
Normal file
|
@ -0,0 +1,109 @@
|
|||
{{- /* theme.js */}}
|
||||
{{- if not site.Params.disableThemeToggle }}
|
||||
{{- $theme := resources.Get "js/theme.js" | resources.Minify }}
|
||||
{{- if not site.Params.assets.disableFingerprinting }}
|
||||
{{- $theme_js := (slice $theme) | resources.Concat "assets/js/theme.js" | fingerprint }}
|
||||
<script crossorigin="anonymous" src="{{ $theme_js.RelPermalink }}" integrity="{{ $theme_js.Data.Integrity }}"></script>
|
||||
{{- else }}
|
||||
{{- $theme_js := (slice $theme) | resources.Concat "assets/js/theme.js" }}
|
||||
<script crossorigin="anonymous" src="{{ $theme_js.RelPermalink }}"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
<header class="header">
|
||||
{{- if ( and (.IsPage) (ne .Layout "archives") (ne .Layout "search")) }}
|
||||
<div id="progressBar"></div>
|
||||
{{- end }}
|
||||
<nav class="nav">
|
||||
<div class="logo">
|
||||
{{- $label_text := (site.Params.label.text | default site.Title) }}
|
||||
{{- if site.Title }}
|
||||
<a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }} (Alt + H)">
|
||||
{{- if site.Params.label.icon }}
|
||||
{{- $img := resources.Get site.Params.label.icon }}
|
||||
{{- if $img }}
|
||||
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
|
||||
{{- if hugo.IsExtended -}}
|
||||
{{- $processableFormats = $processableFormats | append "webp" -}}
|
||||
{{- end -}}
|
||||
{{- $prod := (hugo.IsProduction | or (eq site.Params.env "production")) }}
|
||||
{{- if and (in $processableFormats $img.MediaType.SubType) (eq $prod true)}}
|
||||
{{- if site.Params.label.iconHeight }}
|
||||
{{- $img = $img.Resize (printf "x%d" site.Params.label.iconHeight) }}
|
||||
{{ else }}
|
||||
{{- $img = $img.Resize "x30" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<img src="{{ $img.Permalink }}" alt="" aria-label="logo"
|
||||
height="{{- site.Params.label.iconHeight | default "30" -}}">
|
||||
{{- else }}
|
||||
<img src="{{- site.Params.label.icon | absURL -}}" alt="" aria-label="logo"
|
||||
height="{{- site.Params.label.iconHeight | default "30" -}}">
|
||||
{{- end -}}
|
||||
{{- else if hasPrefix site.Params.label.iconSVG "<svg" }}
|
||||
{{ site.Params.label.iconSVG | safeHTML }}
|
||||
{{- end -}}
|
||||
{{- $label_text -}}
|
||||
</a>
|
||||
{{- end }}
|
||||
<div class="logo-switches">
|
||||
{{- if (not site.Params.disableThemeToggle) }}
|
||||
<button type="button" id="theme-toggle" accesskey="t" title="(Alt + T)">
|
||||
<svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24"
|
||||
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
|
||||
</svg>
|
||||
<svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24"
|
||||
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="5"></circle>
|
||||
<line x1="12" y1="1" x2="12" y2="3"></line>
|
||||
<line x1="12" y1="21" x2="12" y2="23"></line>
|
||||
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
|
||||
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
|
||||
<line x1="1" y1="12" x2="3" y2="12"></line>
|
||||
<line x1="21" y1="12" x2="23" y2="12"></line>
|
||||
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
|
||||
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
||||
</svg>
|
||||
</button>
|
||||
{{- end }}
|
||||
|
||||
{{- $lang := .Lang}}
|
||||
{{- $separator := or $label_text (not site.Params.disableThemeToggle)}}
|
||||
{{- with site.Home.AllTranslations }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
{{- $currentPage := . }}
|
||||
<input name="hamburger-input" id="hamburger-input" type="checkbox" aria-label="Navigation Menu">
|
||||
<label id="hamburger-menu" for="hamburger-input"></label>
|
||||
<div class="overlay"></div>
|
||||
<ul id="menu">
|
||||
{{- range site.Menus.main }}
|
||||
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
|
||||
{{- $page_url:= $currentPage.Permalink | absLangURL }}
|
||||
{{- $is_search := eq (site.GetPage .KeyName).Layout `search` }}
|
||||
<li>
|
||||
<a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
|
||||
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}>
|
||||
<span {{- if eq $menu_item_url $page_url }} class="active" {{- end }}>
|
||||
{{- .Pre }}
|
||||
{{- .Name -}}
|
||||
{{ .Post -}}
|
||||
</span>
|
||||
{{- if (findRE "://" .URL) }}
|
||||
<svg fill="none" shape-rendering="geometricPrecision" stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2.5" viewBox="0 0 24 24" height="12" width="12">
|
||||
<path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path>
|
||||
<path d="M15 3h6v6"></path>
|
||||
<path d="M10 14L21 3"></path>
|
||||
</svg>
|
||||
{{- end }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
59
layouts/partials/svg.html
Normal file
59
layouts/partials/svg.html
Normal file
|
@ -0,0 +1,59 @@
|
|||
{{- $icon_name := ( trim .name " " | lower )}}
|
||||
{{- if (eq $icon_name "gitlab") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path
|
||||
d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z">
|
||||
</path>
|
||||
</svg>
|
||||
{{- else if (eq $icon_name "threema") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentcolor">
|
||||
<path d="M11.998 20.486a1.757 1.757 0 1 1 0 3.514 1.757 1.757 0 0 1 0-3.514zm-6.335 0a1.757 1.757 0 1 1 0 3.514 1.757 1.757 0 0 1 0-3.514zm12.671 0a1.757 1.757 0 1 1 0 3.514 1.757 1.757 0 0 1 0-3.514zM12 0c5.7 0 10.322 4.066 10.322 9.082 0 5.016-4.622 9.083-10.322 9.083a11.45 11.45 0 0 1-4.523-.917l-5.171 1.293 1.105-4.42c-1.094-1.442-1.733-3.175-1.733-5.039C1.678 4.066 6.3 0 12 0zm-.001 4.235A2.926 2.926 0 0 0 9.072 7.16v1.17h-.115a.47.47 0 0 0-.47.47v4.126c0 .26.21.471.47.471h6.086c.26 0 .47-.21.47-.47V8.798a.47.47 0 0 0-.47-.47h-.115v-1.17a2.927 2.927 0 0 0-2.93-2.924zm0 1.17c.972 0 1.758.786 1.758 1.754v1.17h-3.514v-1.17c0-.968.786-1.754 1.756-1.754z"></path>
|
||||
</svg>
|
||||
{{- else if (eq $icon_name "github") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path
|
||||
d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22">
|
||||
</path>
|
||||
</svg>
|
||||
{{- else if (eq $icon_name "forgejo") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M16.7773 0c1.6018 0 2.9004 1.2986 2.9004 2.9005s-1.2986 2.9004-2.9004 2.9004c-1.0854 0-2.0315-.596-2.5288-1.4787H12.91c-2.3322 0-4.2272 1.8718-4.2649 4.195l-.0007 2.1175a7.0759 7.0759 0 0 1 4.148-1.4205l.1176-.001 1.3385.0002c.4973-.8827 1.4434-1.4788 2.5288-1.4788 1.6018 0 2.9004 1.2986 2.9004 2.9005s-1.2986 2.9004-2.9004 2.9004c-1.0854 0-2.0315-.596-2.5288-1.4787H12.91c-2.3322 0-4.2272 1.8718-4.2649 4.195l-.0007 2.319c.8827.4973 1.4788 1.4434 1.4788 2.5287 0 1.602-1.2986 2.9005-2.9005 2.9005-1.6018 0-2.9004-1.2986-2.9004-2.9005 0-1.0853.596-2.0314 1.4788-2.5287l-.0002-9.9831c0-3.887 3.1195-7.0453 6.9915-7.108l.1176-.001h1.3385C14.7458.5962 15.692 0 16.7773 0ZM7.2227 19.9052c-.6596 0-1.1943.5347-1.1943 1.1943s.5347 1.1943 1.1943 1.1943 1.1944-.5347 1.1944-1.1943-.5348-1.1943-1.1944-1.1943Zm9.5546-10.4644c-.6596 0-1.1944.5347-1.1944 1.1943s.5348 1.1943 1.1944 1.1943c.6596 0 1.1943-.5347 1.1943-1.1943s-.5347-1.1943-1.1943-1.1943Zm0-7.7346c-.6596 0-1.1944.5347-1.1944 1.1943s.5348 1.1943 1.1944 1.1943c.6596 0 1.1943-.5347 1.1943-1.1943s-.5347-1.1943-1.1943-1.1943Z" />
|
||||
</svg>
|
||||
{{- else if (eq $icon_name "freepik") -}}
|
||||
{{- else if (eq $icon_name "fediverse") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path
|
||||
d="M47.923 72.796a18.227 18.227 0 0 1-7.795 7.76l42.798 42.964 10.318-5.229zm56.452 56.67-10.318 5.229 21.686 21.77a18.227 18.227 0 0 1 7.797-7.76zm49.517-39.67-24.23 12.279 1.787 11.427 27.415-13.894a18.227 18.227 0 0 1-4.972-9.812zm-38.295 19.407L58.31 138.237a18.227 18.227 0 0 1 4.973 9.813l54.102-27.42zM97.174 37.686 69.53 91.653l8.162 8.193 29.269-57.138a18.227 18.227 0 0 1-9.787-5.022ZM62.34 105.69l-14.002 27.335a18.227 18.227 0 0 1 9.786 5.021l12.377-24.163ZM39.89 80.675a18.227 18.227 0 0 1-9.106 1.904 18.227 18.227 0 0 1-1.759-.184l8.176 52.297a18.227 18.227 0 0 1 9.106-1.903 18.227 18.227 0 0 1 1.758.184zm23.435 67.634a18.227 18.227 0 0 1 .19 3.672 18.227 18.227 0 0 1-1.922 7.19l52.289 8.391a18.227 18.227 0 0 1-.192-3.672 18.227 18.227 0 0 1 1.924-7.19zM159.048 99.8l-24.135 47.116a18.227 18.227 0 0 1 9.788 5.023l24.134-47.117a18.227 18.227 0 0 1-9.787-5.023zm-32.917-66.64a18.227 18.227 0 0 1-7.797 7.76l37.376 37.52a18.227 18.227 0 0 1 7.797-7.76zm-34.114-5.477L44.77 51.627a18.227 18.227 0 0 1 4.972 9.813L96.99 37.495a18.227 18.227 0 0 1-4.971-9.811zm26.231 13.281a18.227 18.227 0 0 1-9.256 1.98 18.227 18.227 0 0 1-1.595-.168l4.185 26.8 11.42 1.832zm-4.234 44.192 9.896 63.362a18.227 18.227 0 0 1 8.973-1.837 18.227 18.227 0 0 1 1.906.21l-9.354-59.903ZM49.775 61.64a18.227 18.227 0 0 1 .201 3.73 18.227 18.227 0 0 1-1.894 7.139l26.82 4.308 5.271-10.295zm45.968 7.382L90.47 79.318l63.37 10.177a18.227 18.227 0 0 1-.184-3.63 18.227 18.227 0 0 1 1.945-7.229z"
|
||||
style="display:inline" transform="matrix(.13855 0 0 .1385 -2.107 -1.132)" />
|
||||
<g style="display:inline;opacity:1" transform="matrix(.13834 .00753 -.00754 .1383 -1.182 -5.633)">
|
||||
<circle cx="106.266" cy="51.536" r="16.571" />
|
||||
<circle cx="171.428" cy="110.193" r="16.571" />
|
||||
<circle cx="135.764" cy="190.277" r="16.571" />
|
||||
<circle cx="48.559" cy="181.114" r="16.571" />
|
||||
<circle cx="30.329" cy="95.367" r="16.571" />
|
||||
</g>
|
||||
</svg>
|
||||
{{- else if (eq $icon_name "email") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 21" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>
|
||||
<polyline points="22,6 12,13 2,6"></polyline>
|
||||
</svg>
|
||||
{{- else if (eq $icon_name "gpg") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M2.968 11.583h1.274v-3.82A7.76 7.76 0 0 1 12.005 0a7.76 7.76 0 0 1 7.762 7.763v3.783c-.018.01-.037.028-.056.037l-.01.01-.008.009h-.01l-.01.01-.009.009H19.636l-.018.018h-.02l-.018.01h-.01l-.009.01-.009.009h-.01l-.009.009-.009.01-.01.009-.009.009-.028.019-.019.01-.028.018-.018.01-.02.009-.027.018-.019.01-.01.009-.027.019-.02.01-.046.027-.019.01-.018.009-.02.01h-.008l-.057.027h-.019c-.018.01-.037.02-.065.038h-.01l-.009.01-.028.018-.018.01-.029.018-.018.01h-.01l-.028.018-.018.01-.02.009c-.018.01-.046.019-.065.028l-.018.01-.02.009-.037.018-.037.02-.047.018-.047.019-.019.009-.037.019-.019.01c-1.545.739-4.017 1.516-8.708 1.853-3.362.244-5.403 1.723-6.724 3.502zm4.842 0h8.371v-3.82a4.184 4.184 0 0 0-4.186-4.186A4.184 4.184 0 0 0 7.81 7.763zm13.222 1.461V24H5.572c1.704-.946 2.968-.852 5.075-.787 2.865.094 6.03-1.105 7.585-2.696 1.554-1.592-.14-.375-1.901.074-1.76.45-5.17.497-7.454-.103 7.173.094 9.973-2.219 11.555-4.307 1.583-2.079-.683-.365-2.153.356-1.47.72-4.036 1.227-6.864.852 4.27-.01 7.52-2.144 9.607-4.345z"/></svg>
|
||||
{{- else if (eq $icon_name "xmpp") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none">
|
||||
<path
|
||||
d="m24 3.2-3.2 1.2-1 .3-3.1.9v.6c0 3.4-1.7 7.6-4.6 10.5-2.8-3-4.5-7-4.5-10.4v-.6l-3.1-.8-.8-.3L0 3.2c.1 5.7 4.8 11.7 10.5 15-1.3 1-2.8 1.8-4.3 2.2v.3c.4-.1.8-.1 1.3-.2.1 0 .3 0 .4-.1 1.4-.3 2.7-.8 4-1.4.4.2.8.4 1.2.5.1 0 .2.1.3.1.2.1.4.2.6.2 1.2.5 2.6.8 3.9.9v-.3c-1.7-.4-3.2-1.3-4.5-2.3C19.2 14.9 23.8 9 24 3.2z">
|
||||
</path>
|
||||
</svg>
|
||||
{{- else if (eq $icon_name "signal") -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path
|
||||
d="M 9.205253,0.64464814 9.4662637,1.7114982 A 10.69287,10.709597 0 0 0 6.5207075,2.9288165 L 5.9607465,1.9848669 A 11.571737,11.589837 0 0 1 9.2037889,0.64464631 Z m 5.624738,0.006259 -0.261912,1.06479996 a 10.69287,10.709597 0 0 1 2.942841,1.2238818 l 0.569383,-0.942681 A 11.718214,11.736545 0 0 0 14.829991,0.65091737 M 1.9779914,5.962053 A 11.718214,11.736545 0 0 0 0.63264603,9.2101106 l 1.06459877,0.26526 A 10.69287,10.709597 0 0 1 2.9192147,6.5279236 L 1.977993,5.9605859 Z M 1.3853391,12.02919 A 10.253437,10.269476 0 0 1 1.5057569,10.436088 L 0.42200799,10.267633 a 11.718214,11.736545 0 0 0 -0.003916,3.518027 L 1.5022097,13.622556 A 10.253437,10.269476 0 0 1 1.3853328,12.02919 m 16.6638462,10.065061 -0.561432,-0.93955 a 10.546392,10.56289 0 0 1 -2.941159,1.215857 l 0.262471,1.068318 a 11.718214,11.736545 0 0 0 3.24012,-1.344625 m 4.576868,-10.041387 q -8.91e-4,0.802487 -0.121883,1.593101 l 1.08375,0.165521 a 11.718214,11.736545 0 0 0 0.004,-3.518028 l -1.084119,0.166038 q 0.119225,0.79235 0.118342,1.593368 m 0.752698,2.814677 -1.066064,-0.26526 a 10.69287,10.709597 0 0 1 -1.221974,2.950381 l 0.94122,0.568806 a 11.718214,11.736545 0 0 0 1.346818,-3.253927 m -9.79326,7.691197 c -1.054817,0.160202 -2.128499,0.159006 -3.182958,-0.0036 l -0.165266,1.088381 a 11.718214,11.736545 0 0 0 3.509604,0.0041 L 13.584073,22.5603 Z m 6.962359,-4.199793 a 10.546392,10.56289 0 0 1 -2.25386,2.247973 l 0.652304,0.888303 A 11.718214,11.736545 0 0 0 21.4319,19.02011 Z M 18.313014,3.4847756 c 0.85912,0.6347312 1.617028,1.3955177 2.248854,2.2573915 L 21.447327,5.0829729 A 11.718214,11.736545 0 0 0 18.974613,2.5994032 Z M 3.4620766,5.7231078 A 10.546392,10.56289 0 0 1 5.7159424,3.470735 L 5.0577779,2.5838917 A 11.718214,11.736545 0 0 0 2.5780872,5.0604744 l 0.883991,0.6611664 z M 22.046886,5.9829545 21.102939,6.5496581 c 0.551205,0.9145983 0.961703,1.9082613 1.215422,2.9457616 L 23.385012,9.232537 A 11.718214,11.736545 0 0 0 22.046886,5.9829545 M 10.424439,1.5218471 a 10.69287,10.709597 0 0 1 3.181491,0.00355 l 0.165262,-1.08545108 a 11.718214,11.736545 0 0 0 -3.509603,-0.003905 z M 4.0067175,21.77345 1.7401226,22.299069 2.2699667,20.027168 1.2024224,19.776577 0.67111487,22.047008 A 1.0985825,1.1003011 0 0 0 1.987943,23.371772 L 4.2559977,22.850556 Z M 1.4305532,18.795363 2.5024951,19.043026 2.8704383,17.469271 A 10.546392,10.56289 0 0 1 1.6901058,14.58223 l -1.06518556,0.262884 a 11.718214,11.736545 0 0 0 1.07497456,2.791564 l -0.2708065,1.158683 z m 5.1240697,2.386763 -1.572112,0.365015 0.2478202,1.072705 1.157473,-0.268651 c 0.8783321,0.480709 1.8139217,0.844118 2.7848026,1.084332 L 9.4374532,22.367798 A 10.546392,10.56289 0 0 1 6.5648844,21.174803 Z M 12.01556,2.5050896 A 9.5210486,9.5359425 0 0 0 2.4868473,12.033352 9.5210486,9.5359425 0 0 0 3.9430616,17.103698 L 3.0232278,21.016812 6.9278739,20.104246 A 9.5239783,9.5388766 0 0 0 17.096701,3.9778221 9.5210486,9.5359425 0 0 0 12.01556,2.5050896" />
|
||||
</svg>
|
||||
{{- end -}}
|
13
layouts/shortcodes/peertube.html
Normal file
13
layouts/shortcodes/peertube.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{ if .IsNamedParams -}}
|
||||
<div style="position: relative; padding-bottom: 56.25%; margin-bottom: 1rem; height: 0; overflow: hidden;">
|
||||
<iframe sandbox="allow-scripts allow-popups" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;"
|
||||
src="https://{{ .Get "host" }}/videos/embed/{{ .Get "id" }}?{{ with .Get "title" }}title={{ . }}{{ else }}title=0{{ end }}&{{ with .Get "warning" }}warningTitle={{ . }}{{ else }}warningTitle=0{{ end }}{{ with .Get "subtitle" }}&subtitle={{ . }}{{ end }}&peertubeLink=0" allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
{{- else -}}
|
||||
<div style="position: relative; padding-bottom: 56.25%; margin-bottom: 1rem; height: 0; overflow: hidden;">
|
||||
<iframe sandbox="allow-scripts allow-popups" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;"
|
||||
src="https://{{ .Get 0 }}/videos/embed/{{ .Get 1 }}?title=0&warningTitle=0&peertubeLink=0" title="Peertube Video" allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
{{- end }}
|
168
layouts/shortcodes/stoot.html
Normal file
168
layouts/shortcodes/stoot.html
Normal file
|
@ -0,0 +1,168 @@
|
|||
{{ $masIns := .Get "instance" }}
|
||||
{{ $id := .Get "id" }}
|
||||
{{ $tootLink := "" }}
|
||||
{{ $card := "" }}
|
||||
{{ $handleInst := "" }}
|
||||
{{ $mediaMD5 := "" }}
|
||||
{{ $imageCount := 0 }}
|
||||
{{ $votesCount := 0 }}
|
||||
{{ $urlToGet := print "https://" $masIns "/api/v1/statuses/" $id }}
|
||||
|
||||
{{- with resources.GetRemote $urlToGet -}}
|
||||
{{ if (resources.GetRemote $urlToGet).Err }}
|
||||
<blockquote class="toot-blockquote">
|
||||
<p class="ctr legal">[Source not online<br />
|
||||
at time of site build.]</p>
|
||||
</blockquote>
|
||||
{{ else }}
|
||||
{{ $json := unmarshal .Content }}
|
||||
{{ $jsonHolder := $json }}{{/* Being safe */}}
|
||||
|
||||
{{ if isset $json "account" }}
|
||||
{{ $tootLink = print "https://" $masIns "@" $json.account.acct "/status/" $id }}
|
||||
{{ $handleInst = print "@" $json.account.acct "@" $masIns }}
|
||||
{{ end }}
|
||||
|
||||
{{ if isset $json "content" }}
|
||||
<blockquote class="toot-blockquote" cite="{{ $tootLink }}">
|
||||
<div class="toot-header">
|
||||
<a class="toot-profile" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">
|
||||
<img
|
||||
src="{{ $json.account.avatar }}"
|
||||
alt="Mastodon avatar for {{ $handleInst }}"
|
||||
width="64" height="64"
|
||||
loading="lazy"
|
||||
/>
|
||||
</a>
|
||||
<div class="toot-author">
|
||||
<a class="toot-author-name" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">{{ $json.account.display_name }}</a>
|
||||
<a class="toot-author-handle" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">{{ $handleInst }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ $json.content | safeHTML }}
|
||||
{{ with $json.media_attachments }}
|
||||
{{ range $media_attachments := . }}
|
||||
{{ if eq $media_attachments.type "image" }}
|
||||
{{ $imageCount = (add ($imageCount) 1) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<div class="toot-img-grid-{{ $imageCount }}">
|
||||
{{ range $media_attachments := . }}
|
||||
{{ if eq $media_attachments.type "image" }}
|
||||
{{ $mediaMD5 = md5 $media_attachments.url }}
|
||||
<style>
|
||||
.img-{{ $mediaMD5 }} {
|
||||
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
|
||||
}
|
||||
</style>
|
||||
<img
|
||||
src="{{ $media_attachments.url }}"
|
||||
alt="Image {{ $media_attachments.id }} from toot {{ $id }} on {{ $masIns }}"
|
||||
class="toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}"
|
||||
loading="lazy"
|
||||
{{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}
|
||||
/>
|
||||
{{- if $json.sensitive -}}
|
||||
<div class="blur-text">
|
||||
Sensitive content<br />
|
||||
(flagged at origin)
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{/*
|
||||
N.B.:
|
||||
The above results in an empty, no-height div
|
||||
when there's no image but there **is**
|
||||
at least one item in `$media_attachments`.
|
||||
Unfortunately, it seems to be the only way
|
||||
to accomplish this. Not a good HTML practice,
|
||||
but gets the job done.
|
||||
*/}}
|
||||
{{ range $media_attachments := . }}
|
||||
{{ if eq $media_attachments.type "video" }}
|
||||
{{ $mediaMD5 = md5 $media_attachments.url }}
|
||||
<style>
|
||||
.img-{{ $mediaMD5 }} {
|
||||
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
|
||||
}
|
||||
</style>
|
||||
<div class="ctr toot-video-wrapper">
|
||||
<video muted playsinline controls class="ctr toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}"{{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}>
|
||||
<source src="{{ $media_attachments.url }}">
|
||||
<p class="legal ctr">(Your browser doesn’t support the <code>video</code> tag.)</p>
|
||||
</video>
|
||||
{{- if $json.sensitive -}}
|
||||
<div class="blur-text">
|
||||
Sensitive content<br />
|
||||
(flagged at origin)
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if eq $media_attachments.type "gifv" }}
|
||||
{{ $mediaMD5 = md5 $media_attachments.url }}
|
||||
<style>
|
||||
.img-{{ $mediaMD5 }} {
|
||||
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
|
||||
}
|
||||
</style>
|
||||
<div class="ctr toot-video-wrapper">
|
||||
<video loop autoplay muted playsinline controls controlslist="nofullscreen" class="ctr toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}" {{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}>
|
||||
<source src="{{ $media_attachments.url }}">
|
||||
<p class="legal ctr">(Your browser doesn’t support the <code>video</code> tag.)</p>
|
||||
</video>
|
||||
{{- if $json.sensitive -}}
|
||||
<div class="blur-text">
|
||||
Sensitive content<br />
|
||||
(flagged at origin)
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with $json.card }}
|
||||
{{- $cardData := . -}}
|
||||
{{- with $cardData.image -}}
|
||||
<a href="{{ $cardData.url }}" rel="'noopener">
|
||||
<div class="toot-card">
|
||||
<div class="toot-card-image">
|
||||
<img src="{{ $cardData.image }}" alt="Card image from {{ $masIns }} toot {{ $id }}" loading="lazy" class="toot-card-image-image" />
|
||||
</div>
|
||||
<div class="toot-card-content">
|
||||
<p class="card-title">{{ $cardData.title }}</p>
|
||||
<p class="card-description">{{ $cardData.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{ with $json.poll }}
|
||||
{{ $poll := . }}
|
||||
{{ with $poll.options }}
|
||||
{{ range $pollOptions := . }}
|
||||
{{ $votesCount = add $votesCount $pollOptions.votes_count }}
|
||||
{{ end }}
|
||||
<div class="toot-poll-wrapper">
|
||||
{{ range $pollOptions := . }}
|
||||
<div class="toot-poll-count">
|
||||
<strong>{{ (mul 100 (div $pollOptions.votes_count $votesCount)) | lang.FormatPercent 1 }}</strong>
|
||||
</div>
|
||||
<div class="toot-poll-meter">
|
||||
<meter id="vote-count" max="{{ $votesCount }}" value="{{ $pollOptions.votes_count }}"></meter>
|
||||
</div>
|
||||
<div class="toot-poll-title">{{ $pollOptions.title }}</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<p class="legal toot-poll-total">{{ $votesCount }} people</p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<div class="toot-footer">
|
||||
<a href="https://{{ $masIns }}/@{{ $json.account.acct }}/{{ $json.id }}" class="toot-date" rel="noopener">{{ dateFormat "3:04 PM • January 2, 2006" $json.created_at }}</a> <span class="pokey">(UTC)</span>
|
||||
</div>
|
||||
</blockquote>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue