HUGO

Hugo - Fuji Theme - Author info present but not displayed

Hello,

I have been learning Hugo recently and made my site using Hugo (https://raghsonline.com) hosted with Netlify using Fuji Theme.

As part of my learning journey, I am customizing few other stuff on the default aspects of the site. One such thing is the default author, which I felt it is a nice to have thought at the moment I am the only one managing the site.

I made use of the settings explained in the exampleSite of Fuji Theme in the GitHub Repo and also added a snippet in the archetypes\default.md file to have this snippet prepopulated in the new posts. I see that the author name is present in the new .md file generated for the post, however it does not get displayed in the web page.

Any idea as to what I am missing here ? Should I need to modify any meta html files for the posts?

Changes in the config.toml file

[params]
  author = "Raghs" # You can also set author in post front matter individually
  .......

Changes in the archetypes\default.md file

---
....
author: {{ .Site.Params.author }}
---

Actual file content of the default-author-test.md

---
title: "Default Author Test"
date: 2021-06-16T00:48:15+05:30
draft: false
tags: ["Test", "Hugo", "TODO"]
toc: true
author: Raghs
---

You can check the actual blog post I made on my website here → Default Author Test - Blogs of Raghs

Screenshot to show that the author info is not rendered

Cheers,
RM…

Your guess in the TODO section of the screenshot is spot on. You’ll need to override post-meta.html and make use of something like {{with .Params.author}} {{.}} {{end}}.

1 Like

Perfecto @funkydan2 . It worked :slight_smile:

I just made a small tweak on the icon, but it does not seem to work. Guess I need to work with the Fuji team, as the customization of the CSS and icons is more inclined with the theme setup/config.

change in \layouts\partial\post-meta.html

<span><i class="iconfont icon-pricetags-sharp"></i>&nbsp;{{with .Params.author}} {{.}} {{end}}</span>

Works fine. But the icon what I used is for ‘pricetag’ - which was used for the tags. I wanted to use something different like a human icon for an author. I tried the steps given in the websites as follows.

<span><i class="fab fa-github"></i>&nbsp;GitHub</span>
<span><i class="fas fa-user-tag"></i>&nbsp;{{with .Params.author}} {{.}} {{end}}</span>

But the classes start with fab and the css to be configured in the header or footer, with the .js file as well. It is a bit too detailed as per this link https://fontawesome.com/v5.15/how-to-use/on-the-web/setup/hosting-font-awesome-yourself. I also see that in this location is appropriate to keep the new icons in the Fuji Theme in the Assets - IconFont in Fuji Theme - GitHub Repo

If you can share any quick resolution on this, it would be highly appreciated. Else, I will post this in the Fuji Theme Git Hub Repo as a feature request or something. I wish once I gain a bit more knowledge on this (perhaps with the Go Lang Knowledge, I do it on my own :slight_smile: :blush: )

Cheers,
RM…

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.