diff --git a/CHANGELOG.md b/CHANGELOG.md index 1308da1..b176a1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Support for new author `headline` parameter +- Automatic author image resizing when image is provided as a Hugo asset - Alt text to author image ([#8](https://github.com/jpanther/lynx/pull/8)) - Expanded Emoji support in page titles diff --git a/config.toml b/config.toml index e730bd0..7b8e3fd 100644 --- a/config.toml +++ b/config.toml @@ -10,6 +10,7 @@ disableKinds = ["taxonomy", "term"] [author] # name = "Your name here" + # headline = "An awesome person" # image = "img/author.jpg" # path relative to static directory links = [ diff --git a/exampleSite/static/author.jpg b/exampleSite/assets/author.jpg similarity index 100% rename from exampleSite/static/author.jpg rename to exampleSite/assets/author.jpg diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 1c227ca..636cb0c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -6,6 +6,7 @@ disableKinds = ["taxonomy", "term"] [author] name = "Lynx" + headline = "A simple links theme for Hugo built with Tailwind CSS" image = "author.jpg" links = [ { link = { href = "https://github.com/jpanther/lynx/blob/stable/README.md", text = "View the readme", icon = "github" } }, diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 6a5de0a..68e99fb 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -2,4 +2,4 @@ description: "This is a demo of the Lynx theme for Hugo." --- -A simple links theme for Hugo built with Tailwind CSS. +View the readme or check out all the link styles available using the links below. diff --git a/layouts/index.html b/layouts/index.html index 2f925bf..e38890a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,15 +2,32 @@
{{ with .Site.Author.image }} + {{ $src := . }} + {{ $resource := "" }} + {{ if $.Page.Resources.GetMatch $src }} + {{ $resource = $.Page.Resources.GetMatch $src }} + {{ else if resources.GetMatch $src }} + {{ $resource = resources.Get $src }} + {{ end }} + {{ with $resource }} + {{ $src = (.Fill "288x288").RelPermalink }} + {{ end }} {{ $.Site.Author.name }} {{ end }}

{{ .Params.title | default .Site.Author.name | default .Site.Title | emojify }}

+ {{ with .Site.Author.headline }} +

+ {{ . | markdownify | emojify }} +

+ {{ end }} {{ with .Content }}
{{ . | emojify }}
{{ end }}