Closed UtkarshVerma closed 3 years ago
The author page is currently only compatible with the About widget.
Due to the way Hugo handles page bundles, it may require some changes on Hugo side to enable any widget to be used on author pages.
In the meantime, a number of users have had success with creating a Widget Page for each author (on a widget page, you can add whatever widgets you desire) and linking to each author's widget page from their author page or from a widget on the homepage, for example. See https://sourcethemes.com/academic/docs/managing-content/#create-a-widget-page
It appears that the Hugo limitation blocking this feature being implemented may be resolved in the recent Hugo v0.56 release which standardises page bundles, apparently removing limitations on author pages.
Would you recommend to wait until this feature is implemented in academic instead of moving to your other suggestion (a Widget Page for each author) ?
@gcushen Because I wanted to try out Foundation, I ended up creating a new theme in which I've implemented this feature and it seems to work pretty well. Check it here. These are the concerned filed:
// layouts/author.html
{{ define "main" }}
{{ $page := . }}
<div class="cell align-center grid-x grid-margin-x">
<div class="author-profile cell medium-12 large-4 grid-y">
{{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }}
{{ if and site.Params.avatar.gravatar .Params.email }}
<img class="avatar cell thumbnail align-self-middle" src="https://s.gravatar.com/avatar/{{ md5 .Params.email }}?s=200')" alt="{{ .Title }}">
{{ else if $avatar }}
{{ $avatar_image := $avatar.Fill "270x270 Center" }}
<img class="avatar cell thumbnail align-self-middle" src="{{ $avatar_image.RelPermalink }}" alt="{{ .Title }}">
{{ end }}
<div class="cell">
<h3 class="name text-center">{{ .Title }}</h3>
<h4 class="role subheader text-center">{{ .Params.role }}</h4>
</div>
{{ partial "author/social" . }}
</div>
{{ with .Content }}
<div class="author-bio cell medium-12 large-8 grid-y">
<h1>Biography</h1>
{{ . | emojify }}
</div>
{{ end }}
</div>
{{ range $i, $widget := where .Params.widgets ".active" "!=" false }}
{{ $widget_path := printf "widgets/%s.html" $widget.name }}
<hr>
{{ $ctx := dict "widget" $widget "root" $ }}
{{ partial $widget_path $ctx }}
{{ end }}
{{ end }}
The widgets are configured through taxonomy frontmatter.
title: .....
...
widgets:
- name: pages
.....
.....
I hope this helps.
Closing due to little demand and the discussion going stale with no contributions. May re-open after Widget Pages v2 #2049 is implemented.
I was wondering if it would be possible to use widgets on author pages like it's possible on section pages. The thing is that I need to create a team website where each member should get one page, with widgets.