diff options
author | tdro <tdro@noreply.example.com> | 2022-05-04 02:27:15 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-05-04 02:27:15 -0400 |
commit | 30d44aac7a8539d9706df009cb3667d39ed7f350 (patch) | |
tree | 90fb63f92a3998c6a2b3ce8f18d7b2f286e9b9dc /themes | |
parent | e4d1b4ae07b939730b82635b9cea4fab4005237e (diff) | |
download | canory-30d44aac7a8539d9706df009cb3667d39ed7f350.tar.gz canory-30d44aac7a8539d9706df009cb3667d39ed7f350.tar.bz2 canory-30d44aac7a8539d9706df009cb3667d39ed7f350.zip |
themes/default/layouts: Allow sub directories
Set base URL on all links.
Diffstat (limited to 'themes')
18 files changed, 38 insertions, 36 deletions
diff --git a/themes/default/layouts/_default/_markup/render-image.html b/themes/default/layouts/_default/_markup/render-image.html index 00f37cf..d2a9ff7 100644 --- a/themes/default/layouts/_default/_markup/render-image.html +++ b/themes/default/layouts/_default/_markup/render-image.html @@ -12,6 +12,7 @@ {{- $width = .Width -}} {{- $height = .Height -}} {{- end -}} + {{ $source = print ("" | absURL) $source }} {{- else -}} {{- $source = print "/images/404.png" -}} {{- $localPath = print "static/" $source -}} @@ -20,6 +21,7 @@ {{- $width = .Width -}} {{- $height = .Height -}} {{- end -}} + {{ $source = print ("" | absURL) $source }} {{- end -}} {{- else -}} {{- $width = .Width -}} diff --git a/themes/default/layouts/_default/feeds.html b/themes/default/layouts/_default/feeds.html index 40442a1..a4ddb66 100644 --- a/themes/default/layouts/_default/feeds.html +++ b/themes/default/layouts/_default/feeds.html @@ -3,7 +3,7 @@ <style> {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} - tab-list a[href="/{{ $author }}/feeds/"] { + tab-list a[href="{{ .Site.BaseURL }}/{{ $author }}/feeds/"] { display: inherit; font-weight: 700; text-decoration: underline; diff --git a/themes/default/layouts/_default/home.archive-tags.html b/themes/default/layouts/_default/home.archive-tags.html index cf26c40..57854cc 100644 --- a/themes/default/layouts/_default/home.archive-tags.html +++ b/themes/default/layouts/_default/home.archive-tags.html @@ -23,13 +23,13 @@ <item-list> {{ range $taxonomy := .Site.Taxonomies }} {{ range $tag, $article := $taxonomy }} - <h1><a href="/tags/{{ $tag }}/">#{{ $tag }}</a></h1> + <h1><a href="{{ $.Site.BaseURL }}/tags/{{ $tag }}/">#{{ $tag }}</a></h1> <ul> {{ range $article.Pages }} <li> <a title="{{ partial "title.html" . }}" - href="/tags/{{ $tag }}/#{{ partial "card-id.html" . }}"> + href="{{ $.Site.BaseURL }}/tags/{{ $tag }}/#{{ partial "card-id.html" . }}"> <span>{{ .Date.Format "02 Jan 2006" }}</span> <span>{{ partial "title.html" . }}</span> <span>@{{ partial "author-user.html" . }}</span> diff --git a/themes/default/layouts/_default/home.sources.html b/themes/default/layouts/_default/home.sources.html index aa77e2a..e37f53e 100644 --- a/themes/default/layouts/_default/home.sources.html +++ b/themes/default/layouts/_default/home.sources.html @@ -35,7 +35,7 @@ {{ range sort $_default ".ModTime" "desc" }} {{ if not .IsDir }} <li> - <a download title="{{ .Name }}" href="/source/files/_default/{{ .Name }}"> + <a download title="{{ .Name }}" href="{{ $.Site.BaseURL }}/source/files/_default/{{ .Name }}"> <code> <span>{{- .ModTime | time.Format "2006-01-02 15:04 MST" }}</span> <span>{{ .Name }}</span> @@ -52,7 +52,7 @@ {{ range sort $_markup ".ModTime" "desc" }} {{ if not .IsDir }} <li> - <a download title="{{ .Name }}" href="/source/files/_default/_markup/{{ .Name }}"> + <a download title="{{ .Name }}" href="{{ $.Site.BaseURL }}/source/files/_default/_markup/{{ .Name }}"> <code> <span>{{- .ModTime | time.Format "2006-01-02 15:04 MST" }}</span> <span>{{ .Name }}</span> @@ -69,7 +69,7 @@ {{ range sort $partials ".ModTime" "desc" }} {{ if not .IsDir }} <li> - <a download title="{{ .Name }}" href="/source/files/partials/{{ .Name }}"> + <a download title="{{ .Name }}" href="{{ $.Site.BaseURL }}/source/files/partials/{{ .Name }}"> <code> <span>{{- .ModTime | time.Format "2006-01-02 15:04 MST" }}</span> <span>{{ .Name }}</span> @@ -86,7 +86,7 @@ {{ range sort $shortcodes ".ModTime" "desc" }} {{ if not .IsDir }} <li> - <a download title="{{ .Name }}" href="/source/files/shortcodes/{{ .Name }}"> + <a download title="{{ .Name }}" href="{{ $.Site.BaseURL }}/source/files/shortcodes/{{ .Name }}"> <code> <span>{{- .ModTime | time.Format "2006-01-02 15:04 MST" }}</span> <span>{{ .Name }}</span> diff --git a/themes/default/layouts/_default/likes.html b/themes/default/layouts/_default/likes.html index b3be32c..702da5e 100644 --- a/themes/default/layouts/_default/likes.html +++ b/themes/default/layouts/_default/likes.html @@ -3,7 +3,7 @@ <style> {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} - tab-list a[href="/{{ $author }}/likes/"] { + tab-list a[href="{{ .Site.BaseURL }}/{{ $author }}/likes/"] { display: inherit; font-weight: 700; text-decoration: underline; diff --git a/themes/default/layouts/_default/media.html b/themes/default/layouts/_default/media.html index 8073928..a1d885d 100644 --- a/themes/default/layouts/_default/media.html +++ b/themes/default/layouts/_default/media.html @@ -3,7 +3,7 @@ <style> {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} - tab-list a[href="/{{ $author }}/media/"] { + tab-list a[href="{{ .Site.BaseURL }}/{{ $author }}/media/"] { display: inherit; font-weight: 700; text-decoration: underline; diff --git a/themes/default/layouts/_default/section.html b/themes/default/layouts/_default/section.html index e0b607c..fb10957 100644 --- a/themes/default/layouts/_default/section.html +++ b/themes/default/layouts/_default/section.html @@ -2,7 +2,7 @@ <style> {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} - tab-list a[href="/{{ partial "author-user.html" . }}"] { + tab-list a[href="{{ .Site.BaseURL }}/{{ partial "author-user.html" . }}"] { display: inherit; font-weight: 700; text-decoration: underline; diff --git a/themes/default/layouts/_default/taxonomy.html b/themes/default/layouts/_default/taxonomy.html index e43bc29..3f2a83c 100644 --- a/themes/default/layouts/_default/taxonomy.html +++ b/themes/default/layouts/_default/taxonomy.html @@ -28,14 +28,14 @@ {{ range .Paginator.Pages }} {{ $title := lower .Title }} <item-list> - <h1><a href="/tags/{{ $title }}">#{{ .Title }}</a></h1> + <h1><a href="{{ .Site.BaseURL }}/tags/{{ $title }}">#{{ .Title }}</a></h1> <ul> {{ range .Pages }} {{ $count = add $count 1 }} <li> <a title="{{ partial "title.html" . }}" - href="/tags/{{ $title }}/{{ if gt $page 1 }}page/{{ $page }}/{{ end }}#{{ partial "card-id.html" . }}"> + href="{{ .Site.BaseURL }}/tags/{{ $title }}/{{ if gt $page 1 }}page/{{ $page }}/{{ end }}#{{ partial "card-id.html" . }}"> <span>{{ .Date.Format "02 Jan 2006" }}</span> <span>{{ partial "title.html" . }}</span> <span>@{{ partial "author-user.html" . }}</span> diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index bbb79b0..d25abc6 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -3,18 +3,18 @@ <micro-summary> <micro-thumbnail> <figure> - <a title="{{ .Data.name }}" href="/{{ .Data.user }}#"> + <a title="{{ .Data.name }}" href="{{ .Site.BaseURL }}/{{ .Data.user }}#"> <picture> - <img alt="{{ .Data.name }}" src="/{{ .Data.user }}/media/profile/picture.png" /> + <img alt="{{ .Data.name }}" src="{{ .Site.BaseURL }}/{{ .Data.user }}/media/profile/picture.png" /> </picture> </a> </figure> </micro-thumbnail> <micro-header> <h1>{{ .Data.name }}</h1> - <h2><a title="" href="/{{ .Data.user }}">@{{ .Data.user }}</a></h2> + <h2><a title="" href="{{ .Site.BaseURL }}/{{ .Data.user }}">@{{ .Data.user }}</a></h2> </micro-header> - <a title="RSS" href="/{{ .Data.user }}/rss.xml"> + <a title="RSS" href="{{ .Site.BaseURL }}/{{ .Data.user }}/rss.xml"> {{ safeHTML (readFile "static/icons/feather/rss.svg") }} <span>Follow</span> </a> diff --git a/themes/default/layouts/partials/context-profile.html b/themes/default/layouts/partials/context-profile.html index 91446a9..cb0f71f 100644 --- a/themes/default/layouts/partials/context-profile.html +++ b/themes/default/layouts/partials/context-profile.html @@ -5,9 +5,9 @@ <section> <aside> <figure> - <a title="{{ $author.name }}" href="/{{ $author.user }}"> + <a title="{{ $author.name }}" href="{{ .Site.BaseURL }}/{{ $author.user }}"> <picture> - <img alt="{{ $author.name }}" src="/{{ $author.user }}/media/profile/picture.png" /> + <img alt="{{ $author.name }}" src="{{ .Site.BaseURL }}/{{ $author.user }}/media/profile/picture.png" /> </picture> </a> </figure> diff --git a/themes/default/layouts/partials/gallery-walk.html b/themes/default/layouts/partials/gallery-walk.html index daa27ac..11eba52 100644 --- a/themes/default/layouts/partials/gallery-walk.html +++ b/themes/default/layouts/partials/gallery-walk.html @@ -26,7 +26,7 @@ <img title="{{- .Name }}" alt="{{- .Name }}" - src="/{{- strings.TrimPrefix "content/" (trim $folder "/") }}/{{- .Name }}" + src="{{ "" | absURL }}/{{- strings.TrimPrefix "content/" (trim $folder "/") }}/{{- .Name }}" /> {{- end }} diff --git a/themes/default/layouts/partials/handle.html b/themes/default/layouts/partials/handle.html index dcfb335..e7b324f 100644 --- a/themes/default/layouts/partials/handle.html +++ b/themes/default/layouts/partials/handle.html @@ -1,5 +1,5 @@ <a title="{{ partial "author-user.html" . }}@{{ partial "author-domain-host.html" . }}" - href="/{{ partial "author-user.html" . }}"> + href="{{ .Site.BaseURL }}/{{ partial "author-user.html" . }}"> @{{ partial "author-user.html" . }} </a> diff --git a/themes/default/layouts/partials/head.html b/themes/default/layouts/partials/head.html index 856fb2f..8adc282 100644 --- a/themes/default/layouts/partials/head.html +++ b/themes/default/layouts/partials/head.html @@ -36,11 +36,11 @@ {{- partial "csp.html" . -}} <!-- Style Sheets --> -<link rel="stylesheet" href="/css/default.css"> -<link rel="stylesheet" href="/css/syntax-highlight-default.css"> +<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/default.css"> +<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/syntax-highlight-default.css"> <!-- Scripts --> -<script src="/js/index.js"></script> +<script src="{{ .Site.BaseURL }}/js/index.js"></script> <!-- No Scripts --> <noscript> diff --git a/themes/default/layouts/partials/manifest.html b/themes/default/layouts/partials/manifest.html index 4bd935a..01ec541 100644 --- a/themes/default/layouts/partials/manifest.html +++ b/themes/default/layouts/partials/manifest.html @@ -10,7 +10,7 @@ <link rel="icon" type="image/png" sizes="16x16" href="{{ $icon16.RelPermalink | relURL }}"> <link rel="icon" type="image/png" sizes="32x32" href="{{ $icon32.RelPermalink | relURL }}"> <link rel="apple-touch-icon" sizes="180x180" href="{{ $appleTouchIcon.RelPermalink | relURL }}"> -<link rel="manifest" href="/site.webmanifest"> +<link rel="manifest" href="{{ .Site.BaseURL }}/site.webmanifest"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="theme-color" content="#ffffff"> diff --git a/themes/default/layouts/partials/meta.html b/themes/default/layouts/partials/meta.html index 6e10754..61f9f6a 100644 --- a/themes/default/layouts/partials/meta.html +++ b/themes/default/layouts/partials/meta.html @@ -44,7 +44,7 @@ <span>unlisted</span></unlisted-entry> {{ end }} - · <a href="/{{ $author.user }}/messages/{{ path.Base .Permalink }}#{{ partial "card-id.html" . }}"> + · <a href="{{ .Site.BaseURL }}/{{ $author.user }}/messages/{{ path.Base .Permalink }}#{{ partial "card-id.html" . }}"> <time datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}" title="{{ .Date | time.Format "Monday, January 2 2006 at 15:04:05 MST" }}"> @@ -59,6 +59,6 @@ · <cite><a title="#{{ partial "card-id.html" . }}" href="#{{ partial "card-id.html" . }}">#id</a></cite> {{ if not .ExpiryDate }} - · <cite><a title="/raw/{{ $source }}" href="/raw/{{ $source }}">raw</a></cite> + · <cite><a title="{{ .Site.BaseURL }}/raw/{{ $source }}" href="{{ .Site.BaseURL }}/raw/{{ $source }}">raw</a></cite> {{- end -}} </section> diff --git a/themes/default/layouts/partials/profile-picture.html b/themes/default/layouts/partials/profile-picture.html index fba35f7..1c6757e 100644 --- a/themes/default/layouts/partials/profile-picture.html +++ b/themes/default/layouts/partials/profile-picture.html @@ -1,9 +1,9 @@ <figure> <picture> - <source srcset="/{{ partial "author-media-path.html" . }}/profile/picture.png" type="image/png" /> - <source srcset="/{{ partial "author-media-path.html" . }}/profile/picture.jpg" type="image/jpeg" /> - <source srcset="/{{ partial "author-media-path.html" . }}/profile/picture.webp" type="image/webp" /> - <img alt="{{ .Title }}" src="/{{ partial "author-media-path.html" . }}/profile/picture.png" /> + <source srcset="{{ .Site.BaseURL }}/{{ partial "author-media-path.html" . }}/profile/picture.png" type="image/png" /> + <source srcset="{{ .Site.BaseURL }}/{{ partial "author-media-path.html" . }}/profile/picture.jpg" type="image/jpeg" /> + <source srcset="{{ .Site.BaseURL }}/{{ partial "author-media-path.html" . }}/profile/picture.webp" type="image/webp" /> + <img alt="{{ .Title }}" src="{{ .Site.BaseURL }}/{{ partial "author-media-path.html" . }}/profile/picture.png" /> </picture> {{ partial "context-profile.html" . }} </figure> diff --git a/themes/default/layouts/partials/profile-tabs.html b/themes/default/layouts/partials/profile-tabs.html index 94b80ff..66b32c3 100644 --- a/themes/default/layouts/partials/profile-tabs.html +++ b/themes/default/layouts/partials/profile-tabs.html @@ -1,8 +1,8 @@ {{ $author := index .Site.Data.authors ((or .Params.author .Site.Author.default.user) | default "default") }} <tab-list> - <a href="/{{ $author.user }}">Messages</a> - <a href="/{{ $author.user }}/feeds/">Feeds</a> - <a href="/{{ $author.user }}/media/">Media</a> - <a href="/{{ $author.user }}/likes/">Likes</a> + <a href="{{ .Site.BaseURL }}/{{ $author.user }}">Messages</a> + <a href="{{ .Site.BaseURL }}/{{ $author.user }}/feeds/">Feeds</a> + <a href="{{ .Site.BaseURL }}/{{ $author.user }}/media/">Media</a> + <a href="{{ .Site.BaseURL }}/{{ $author.user }}/likes/">Likes</a> </tab-list> diff --git a/themes/default/layouts/partials/profile.html b/themes/default/layouts/partials/profile.html index b20159f..417af56 100644 --- a/themes/default/layouts/partials/profile.html +++ b/themes/default/layouts/partials/profile.html @@ -4,13 +4,13 @@ <micro-header-image> <picture> - <img alt="{{ .Title }}" src="/{{ partial "author-media-path.html" . }}/profile/header.jpg" /> + <img alt="{{ .Title }}" src="{{ .Site.BaseURL }}/{{ partial "author-media-path.html" . }}/profile/header.jpg" /> </picture> </micro-header-image> <micro-header-picture> <picture> - <img src="/{{ partial "author-media-path.html" . }}/profile/picture.png"/> + <img src="{{ .Site.BaseURL }}/{{ partial "author-media-path.html" . }}/profile/picture.png"/> </picture> </micro-header-picture> |