🚚 Move author to params.author

This commit is contained in:
James Panther 2023-11-27 20:15:26 +11:00
parent e440c3c01b
commit 6ef5e3685a
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
5 changed files with 17 additions and 11 deletions

View File

@ -1,6 +1,6 @@
# Changelog
All notable changes to this project will be documented in this file.
All notable changes to Lynx will be documented in this file. Things that need particular attention when upgrading from a prior version are marked ⚠️.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for Spotify and Threads
- Support for X (Twitter) ([#107](https://github.com/jpanther/lynx/pull/107))
### Changed
- ⚠️ Author param block in site config moved to `params.author` to align with recent deprecations in the Hugo project
## [1.3.1] - 2023-09-10
### Changed

View File

@ -71,7 +71,7 @@ Acceptable link parameters are:
- `title` = the HTML title of the link
```toml
[author]
[params.author]
links = {
# Simple link
{ github = "https://github.com/jpanther/lynx" }

View File

@ -8,7 +8,7 @@ title = "Lynx"
enableEmoji = true
disableKinds = ["taxonomy", "term"]
[author]
[params.author]
# name = "Your name here"
# headline = "An awesome person"
# image = "img/author.jpg" # path relative to static directory
@ -42,10 +42,12 @@ disableKinds = ["taxonomy", "term"]
# { slack = "https://workspace.url/team/userid" },
# { snapchat = "https://snapchat.com/add/username" },
# { soundcloud = "https://soundcloud.com/username" },
# { spotify = "https://spotify.com/user/username" },
# { stack-exchange = "https://stackexchange.com/users/userid/username" },
# { stack-overflow = "https://stackoverflow.com/users/userid/username" },
# { steam = "https://steamcommunity.com/profiles/userid" },
# { telegram = "https://t.me/username" },
# { threads = "https://threads.com/username" },
# { tiktok = "https://tiktok.com/@username" },
# { tumblr = "https://username.tumblr.com" },
# { twitch = "https://twitch.tv/username" },

View File

@ -4,7 +4,7 @@ title = "Lynx"
enableEmoji = true
disableKinds = ["taxonomy", "term"]
[author]
[params.author]
name = "Lynx"
headline = "A simple links theme for Hugo built with Tailwind CSS"
image = "author.jpg"

View File

@ -1,7 +1,7 @@
{{ define "main" }}
<article class="flex flex-col items-center justify-center h-full mt-10 text-center">
<header class="flex flex-col items-center mb-3">
{{ with .Site.Author.image }}
{{ with .Site.Params.Author.image }}
{{ $src := . }}
{{ $resource := "" }}
{{ if $.Page.Resources.GetMatch $src }}
@ -16,14 +16,14 @@
class="mb-2 rounded-full h-36 w-36"
width="144"
height="144"
alt="{{ $.Site.Author.name | default "Author" }}"
alt="{{ $.Site.Params.Author.name | default "Author" }}"
src="{{ $src }}"
/>
{{ end }}
<h1 class="text-4xl font-extrabold dark:text-white">
{{ .Params.title | default .Site.Author.name | default .Site.Title | emojify }}
{{ .Params.title | default .Site.Params.Author.name | default .Site.Title | emojify }}
</h1>
{{ with .Site.Author.headline }}
{{ with .Site.Params.Author.headline }}
<h2 class="text-xl text-neutral-500 dark:text-neutral-400">
{{ . | markdownify | emojify }}
</h2>
@ -32,7 +32,7 @@
<section class="pt-5 prose dark:prose-invert">{{ . | emojify }}</section>
{{ end }}
</header>
{{ with .Site.Author.links }}
{{ with .Site.Params.Author.links }}
<div class="flex flex-col flex-wrap min-w-full mt-4 sm:min-w-0">
{{ range $links := . }}
{{ range $type, $data := $links }}