mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-07 10:15:01 +00:00
- add `authors` to set username in user account and force generation of user profile page whether or not user has published content. This is particularly useful for linking users from the People widget. - People widget: only link to users which have profile pages generated - prevents 404 error if user did not perform the point (1) above - add i18n "user_profile_latest" to customize user profile text Fix #274
41 lines
1.2 KiB
HTML
41 lines
1.2 KiB
HTML
{{ partial "header.html" . }}
|
|
{{ partial "navbar.html" . }}
|
|
|
|
{{/* Just display author name as title if user profile unavailable. */}}
|
|
{{ if not ($.Site.GetPage (printf "/author/%s" (urlize .Title))) }}
|
|
<div class="universal-wrapper pt-3">
|
|
<h1 itemprop="name">{{ .Title }}</h1>
|
|
</div>
|
|
{{ end }}
|
|
|
|
<section id="about" class="pt-5">
|
|
<div class="container">
|
|
{{/* Only show About widget if a profile has been configured for this user. */}}
|
|
{{ $widget := "widgets/about.html" }}
|
|
{{ $params := dict "root" $ "page" . "author" .Title }}
|
|
{{ with $.Site.GetPage (printf "/author/%s" (urlize .Title)) }}
|
|
{{ partial $widget $params }}
|
|
{{ end }}
|
|
|
|
{{ $query := where .Pages ".IsNode" false }}
|
|
{{ $count := len $query }}
|
|
{{ if $count }}
|
|
<div class="article-widget">
|
|
<div class="hr-light"></div>
|
|
<h3>{{ i18n "user_profile_latest" | default "Latest" }}</h3>
|
|
<ul>
|
|
{{ range $query }}
|
|
<li>
|
|
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
</section>
|
|
|
|
<!-- Page Footer -->
|
|
{{ partial "footer_container.html" . }}
|
|
{{ partial "footer.html" . }}
|