aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/context-profile.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/context-profile.html')
-rw-r--r--themes/default/layouts/partials/context-profile.html42
1 files changed, 24 insertions, 18 deletions
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>