aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-12-09 19:30:14 -0500
committertdro <tdro@noreply.example.com>2022-12-09 19:30:14 -0500
commit4250104277590526146a45df8af48a34e0f3df8b (patch)
tree24a3adcc484d086d814eb3a3c50909b4b0867569
parent782b736c14cc10adf7bff908717516f616018082 (diff)
downloadcanory-4250104277590526146a45df8af48a34e0f3df8b.tar.gz
canory-4250104277590526146a45df8af48a34e0f3df8b.tar.bz2
canory-4250104277590526146a45df8af48a34e0f3df8b.zip
themes/default/layouts/partials: Add user@host in select places
-rw-r--r--themes/default/layouts/partials/author-card.html14
-rw-r--r--themes/default/layouts/partials/context-profile.html42
-rw-r--r--themes/default/layouts/partials/meta-handle.html4
3 files changed, 37 insertions, 23 deletions
diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html
index 97ec9c2..3da9ab2 100644
--- a/themes/default/layouts/partials/author-card.html
+++ b/themes/default/layouts/partials/author-card.html
@@ -1,6 +1,12 @@
{{- $profile := .Data.picture.profile -}}
{{- $file := not (urls.Parse $profile).Host -}}
+{{- $host := (urls.Parse ("" | absURL)).Host -}}
+
+{{- if not $host -}}
+ {{- $host = "localhost" -}}
+{{- end -}}
+
{{- if $file -}}
{{- $profile = print .Data.user "/" $profile -}}
{{- end -}}
@@ -49,8 +55,12 @@
</figure>
</micro-thumbnail>
<micro-header>
- <h2><b>{{ .Data.name }}</b></h2>
- <h3><a title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}/#">@{{ .Data.user }}</a></h3>
+ <h2>
+ <b>{{ .Data.name }}</b>
+ </h2>
+ <h3>
+ <a title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}/#">{{ .Data.user }}@{{ $host }}</a>
+ </h3>
</micro-header>
<p>{{ .Data.description | markdownify | plainify | htmlUnescape | truncate 60 "..." }}</p>
<a title="Follow with RSS Reader" href="{{ "" | absURL }}/{{ .Data.user }}/rss.xml">
diff --git a/themes/default/layouts/partials/context-profile.html b/themes/default/layouts/partials/context-profile.html
index 2fe3811..ec18c21 100644
--- a/themes/default/layouts/partials/context-profile.html
+++ b/themes/default/layouts/partials/context-profile.html
@@ -1,35 +1,41 @@
{{- $author := partial "function-authors-data.html" . -}}
+{{- $description := or .Params.feed.description ($author.description | markdownify) -}}
+{{- $name := or .Params.feed.name $author.name -}}
+{{- $user := $author.user -}}
+
+{{- $host := (urls.Parse .Site.BaseURL).Host -}}
+{{- $href := print .Site.BaseURL "/" (partial "author-user.html" .) "/#" -}}
+
+{{- if not $host -}}
+ {{- $host = "localhost" -}}
+{{- end -}}
+
+{{- $title := print (partial "author-user.html" .) "@" $host -}}
+
+{{- with .Params.feed -}}
+ {{- $host = $.Params.feed.domain -}}
+ {{- $href = or $.Params.feed.home (print "http://" $.Params.feed.domain) -}}
+ {{- $title = $.Params.feed.domain -}}
+ {{- $user = "" -}}
+{{- end -}}
<context-profile>
<context-menu>
<div>
<aside>
<figure>
- {{- with .Params.feed -}}
- <a title="{{ $.Params.feed.name }}" href="http://{{ $.Params.feed.domain }}">
- {{- else -}}
- <a title="{{ $author.name }}" href="{{ .Site.BaseURL }}/{{ $author.user }}/#">
- {{- end -}}
+ <a title="{{ $name }}" href="{{ $href }}">
<picture>
- {{ partial "author-picture" . }}
+ {{ partial "author-picture" . }}
</picture>
</a>
</figure>
</aside>
<aside>
- {{- with .Params.feed.name -}}
- <h2>{{ . }}</h2>
- <p>@{{ $.Params.feed.domain }}</p>
- {{- else -}}
- <h2>{{ $author.name }}</h2>
- <p>@{{ $author.user }}</p>
- {{- end -}}
+ <h2>{{ $name }}</h2>
+ <p>{{ $user }}@{{ $host }}</p>
</aside>
</div>
- {{- with .Params.feed.description -}}
- <p>{{ . }}</p>
- {{- else -}}
- <p>{{- $author.description | markdownify -}}</p>
- {{- end -}}
+ <p>{{ $description }}</p>
</context-menu>
</context-profile>
diff --git a/themes/default/layouts/partials/meta-handle.html b/themes/default/layouts/partials/meta-handle.html
index 5fa9811..20e11d7 100644
--- a/themes/default/layouts/partials/meta-handle.html
+++ b/themes/default/layouts/partials/meta-handle.html
@@ -1,9 +1,7 @@
{{- $host := (urls.Parse .Site.BaseURL).Host -}}
{{- $href := print .Site.BaseURL "/" (partial "author-user.html" .) "/#" -}}
-{{- if (urls.Parse .Site.BaseURL).Host -}}
- {{- $host = (urls.Parse .Site.BaseURL).Host -}}
-{{- else -}}
+{{- if not $host -}}
{{- $host = "localhost" -}}
{{- end -}}