Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions themes/2345lgbt/layouts/alias.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{- $page := .Page -}}
{{- $canonical := .Permalink -}}
<!DOCTYPE html>
<html lang="{{ $page.Site.Language }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="{{ $canonical }}" rel="canonical">
{{- if $page.IsHome }}
<script>
(() => {
const normalize = (path) => path.replace(/\/+$/, "") || "/";
const canonical = new URL(`{{ $canonical }}`, window.location.href);
if (normalize(window.location.pathname) !== normalize(canonical.pathname)) {
window.location.replace(canonical.href);
return;
}
window.__renderAliasHome = true;
})();
</script>
<style>
#alias-home[hidden] {
display: none;
}
</style>
{{- else }}
<meta http-equiv="refresh" content="0; url={{ $canonical }}">
{{- end }}
{{- with $page.Site.Params.contentSecurityPolicy }}
<meta http-equiv="content-security-policy" content="{{ . }}">
{{- end }}
<title>
{{- $title := slice $page.Title $page.Site.Title }}
{{- if $page.IsHome }}{{ $title = after 1 $title }}{{ end }}
{{- delimit $title " - " -}}
</title>
<meta name="description" content="{{ $page.Description | default (cond $page.IsPage $page.Summary $page.Site.Params.description) }}">
{{ partial "head/opengraph.html" $page }}
{{ partial "head/twitter-card.html" $page }}
{{ partial "head/alternate.html" $page }}
{{ partial "head/prefetch.html" $page }}
{{ partial "head/dns-prefetch.html" $page }}
{{ partial "head.html" $page }}
</head>
<body>
{{- if $page.IsHome }}
<div id="alias-home" hidden>
{{- partial "header.html" $page }}
{{- partial "homepage.html" $page }}
{{- partial "footer.html" $page }}
</div>
<script>
if (window.__renderAliasHome) {
document.getElementById("alias-home").hidden = false;
}
</script>
{{- else }}
<noscript><meta http-equiv="refresh" content="0; url={{ $canonical }}"></noscript>
{{- end }}
{{- partial "foot.html" $page }}
</body>
</html>
3 changes: 3 additions & 0 deletions themes/2345lgbt/layouts/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ define "main" }}
{{- partial "homepage.html" . }}
{{ end }}
36 changes: 2 additions & 34 deletions themes/2345lgbt/layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
{{ define "main" }}
<main class="homepage">
{{- with .Params.banner }}
<section class="container banner">
<section class="caption">{{ .caption | markdownify }}</section>
<section class="description">{{ .description | markdownify }}</section>
</section>
{{- end }}
{{- with .Params.featured }}
<section class="container featured">
<nav>
{{- range . }}
<a class="card" href="{{ .url | safeURL }}"><b>{{ .title }}</b><i>{{ partial "url" .url }}</i></a>
{{- end }}
</nav>
</section>
{{- end }}
<section class="container tags">
{{- $tags := slice }}
{{- range .Params.links }}{{ $tags = $tags | append .tags }}{{ end }}
{{- $tags := $tags | uniq | sort }}
{{ range $tags }}<button data-tag="{{ . }}">{{ . }}</button>{{ end }}
</section>
<section class="container links">
{{- range .Params.links }}
{{ $tags := delimit .tags "," -}}
<a href="{{ .url }}" class="card" target="_blank" data-tags="{{ $tags }}">
<b>{{ .title | safeHTML }}</b>
<i>{{ partial "url" .url }}</i>
<p class="tags">{{ range .tags }}<span>{{ . }}</span>{{ end }}</p>
</a>
{{- end }}
</section>
</main>
{{ end }}
{{- partial "homepage.html" . }}
{{ end }}
2 changes: 1 addition & 1 deletion themes/2345lgbt/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<button>{{ .Site.Params.ShortName }}</button>
<nav>
{{- range .Site.Home.AllTranslations }}
<a href="{{ .RelPermalink }}" data-active="{{ eq $currentLanguage .Language }}">{{ .Language.LanguageName
<a href="{{ .RelPermalink }}" data-active="{{ eq $currentLanguage .Language }}">{{ .Language.Label
}}</a>
{{- end }}
</nav>
Expand Down
33 changes: 33 additions & 0 deletions themes/2345lgbt/layouts/partials/homepage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<main class="homepage">
{{- with .Params.banner }}
<section class="container banner">
<section class="caption">{{ .caption | markdownify }}</section>
<section class="description">{{ .description | markdownify }}</section>
</section>
{{- end }}
{{- with .Params.featured }}
<section class="container featured">
<nav>
{{- range . }}
<a class="card" href="{{ .url | safeURL }}"><b>{{ .title }}</b><i>{{ partial "url" .url }}</i></a>
{{- end }}
</nav>
</section>
{{- end }}
<section class="container tags">
{{- $tags := slice }}
{{- range .Params.links }}{{ $tags = $tags | append .tags }}{{ end }}
{{- $tags := $tags | uniq | sort }}
{{ range $tags }}<button data-tag="{{ . }}">{{ . }}</button>{{ end }}
</section>
<section class="container links">
{{- range .Params.links }}
{{ $tags := delimit .tags "," -}}
<a href="{{ .url }}" class="card" target="_blank" data-tags="{{ $tags }}">
<b>{{ .title | safeHTML }}</b>
<i>{{ partial "url" .url }}</i>
<p class="tags">{{ range .tags }}<span>{{ . }}</span>{{ end }}</p>
</a>
{{- end }}
</section>
</main>
Loading