✨ Add headline parameter and image resizing
This commit is contained in:
parent
5ae1a23727
commit
e2dd72d0be
@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### 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))
|
- Alt text to author image ([#8](https://github.com/jpanther/lynx/pull/8))
|
||||||
- Expanded Emoji support in page titles
|
- Expanded Emoji support in page titles
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ disableKinds = ["taxonomy", "term"]
|
|||||||
|
|
||||||
[author]
|
[author]
|
||||||
# name = "Your name here"
|
# name = "Your name here"
|
||||||
|
# headline = "An awesome person"
|
||||||
# image = "img/author.jpg" # path relative to static directory
|
# image = "img/author.jpg" # path relative to static directory
|
||||||
|
|
||||||
links = [
|
links = [
|
||||||
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
@ -6,6 +6,7 @@ disableKinds = ["taxonomy", "term"]
|
|||||||
|
|
||||||
[author]
|
[author]
|
||||||
name = "Lynx"
|
name = "Lynx"
|
||||||
|
headline = "A simple links theme for Hugo built with Tailwind CSS"
|
||||||
image = "author.jpg"
|
image = "author.jpg"
|
||||||
links = [
|
links = [
|
||||||
{ link = { href = "https://github.com/jpanther/lynx/blob/stable/README.md", text = "View the readme", icon = "github" } },
|
{ link = { href = "https://github.com/jpanther/lynx/blob/stable/README.md", text = "View the readme", icon = "github" } },
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
description: "This is a demo of the Lynx theme for Hugo."
|
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.
|
||||||
|
@ -2,15 +2,32 @@
|
|||||||
<article class="flex flex-col items-center justify-center h-full mt-10 text-center">
|
<article class="flex flex-col items-center justify-center h-full mt-10 text-center">
|
||||||
<header class="flex flex-col items-center mb-3">
|
<header class="flex flex-col items-center mb-3">
|
||||||
{{ with .Site.Author.image }}
|
{{ 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 }}
|
||||||
<img
|
<img
|
||||||
class="mb-2 rounded-full w-36 h-36"
|
class="mb-2 rounded-full w-36 h-36"
|
||||||
src="{{ . | relURL }}"
|
width="144"
|
||||||
alt="{{ $.Site.Author.name }}"
|
height="144"
|
||||||
|
alt="{{ $.Site.Author.name | default "Author" }}"
|
||||||
|
src="{{ $src }}"
|
||||||
/>
|
/>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<h1 class="text-4xl font-extrabold dark:text-white">
|
<h1 class="text-4xl font-extrabold dark:text-white">
|
||||||
{{ .Params.title | default .Site.Author.name | default .Site.Title | emojify }}
|
{{ .Params.title | default .Site.Author.name | default .Site.Title | emojify }}
|
||||||
</h1>
|
</h1>
|
||||||
|
{{ with .Site.Author.headline }}
|
||||||
|
<h2 class="text-xl text-neutral-500 dark:text-neutral-400">
|
||||||
|
{{ . | markdownify | emojify }}
|
||||||
|
</h2>
|
||||||
|
{{ end }}
|
||||||
{{ with .Content }}
|
{{ with .Content }}
|
||||||
<section class="pt-5 prose dark:prose-invert">{{ . | emojify }}</section>
|
<section class="pt-5 prose dark:prose-invert">{{ . | emojify }}</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user