welpo / tabi

A modern Zola theme with search, multilingual support, optional JavaScript, a perfect Lighthouse score, and a focus on accessibility.
https://welpo.github.io/tabi/
MIT License
97 stars 32 forks source link

author in page.html #319

Closed faassen closed 1 month ago

faassen commented 1 month ago

Feature Request

Author information on blog posts.

Summary

Optionally include author information on individual pages.

Motivation

I realize this information can be on the home page, about page and in the copyright footer, but I like it to be immediately obvious when you click through to my blog post that I wrote it, without having to scroll or follow links. Interestingly atom feeds already include this information.

Detailed Description

I'd like my blog post to include the author name before the date and tags, or under the title somehow. The author can be taken from the config, though could be overridden by page authors. There can be a global toggle to turn this on.

welpo commented 1 month ago

Sure thing! I knew this feature request would come sooner or later :)

Do you have any opinions on the format? E.g. just the author name, "Author: $author_name", "Written by $author_name"…

welpo commented 1 month ago

Alright, the code is ready, but I need to:

I'm leaning towards using the author as is, without prefixes. I'm open to suggestions, though.

faassen commented 1 month ago

That's what I have done in my template hack, just put in the author name. Like this:

Martijn Faassen  •  2024-05-24  • Tags: ..

You could prefix it with Author: too, which would make it consistent with Tags. That would make it clear my name is a name and not some weird language you can't read.

I noticed that config has a single author but pages can have specific multiple authors too. I haven't dealt with the latter as this is a personal blog, but that may be something to keep in mind.

welpo commented 1 month ago

I noticed that config has a single author but pages can have specific multiple authors too. I haven't dealt with the latter as this is a personal blog, but that may be something to keep in mind.

Thank you! I had not considered it.

That would make it clear my name is a name and not some weird language you can't read.

I also had not considered certain names might be confusing without any context. I decided to go with By $AUTHOR, as "Author: $AUTHOR" would be problematic for languages with grammatical gender.

welpo commented 1 month ago

Done! Let me know if you encounter any issues~