fix: add alignment option to home layout (#896)
This adds a configuration parameter for the home page layout to align
the content.
```toml
[params.ananke.home]
content_alignment = "center"
```
Default is `center` (due to it being the previous layout option).
Possible options are `left`, `right`, and `center`. This influences
_only_ the home page markdown content, not other parts of the home page.
---------
Signed-off-by: Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| | |
| | | [ananke] |
| | | show_recent_posts = true # show recent posts on the homepage |
| | | |
| | | [ananke.home] |
| | | content_alignment = "center" # options: left, center, right |
| | | |
| | | [ananke.social] |
| | | icon_path = "ananke/socials/%s.svg" |
| | | |
| | |
| | | {{ define "main" }} |
| | | <article class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy nested-links {{ $.Param "text_color" | compare.Default "mid-gray" }}"> |
| | | |
| | | {{- $config := site.Params.ananke.home -}} |
| | | {{- $text_alignment := "tc-l" -}} |
| | | {{- if eq $config.content_alignment "left" -}} |
| | | {{- $text_alignment = "tl-l" -}} |
| | | {{- else if eq $config.content_alignment "right" -}} |
| | | {{- $text_alignment = "tr-l" -}} |
| | | {{- end -}} |
| | | |
| | | <article class="cf ph3 ph5-l pv3 pv4-l f4 {{ $text_alignment }} center measure-wide lh-copy nested-links {{ $.Param "text_color" | compare.Default "mid-gray" }}"> |
| | | {{ .Content }} |
| | | </article> |
| | | |