3 changed files with 71 additions and 10 deletions
@ -1,8 +1,14 @@ |
|||||
{{ define "main" }} |
{{ define "main" }} |
||||
<section> |
<section> |
||||
<h1 class="center-text">Authors</h1> |
<h1 class="center-text">Authors</h1> |
||||
{{ range .Data.Pages }} |
{{- range .Data.Pages }} |
||||
<p>Hi</p> |
{{- partial "article-alt.html" |
||||
{{ end }} |
(dict |
||||
|
"image" (.Resources.GetMatch "avatar") |
||||
|
"alt" .Params.alt |
||||
|
"title" .Params.name |
||||
|
"summary" .Params.bio |
||||
|
"url" (printf "/%s/%s" "authors" (.Params.name | urlize))) }} |
||||
|
{{- end }} |
||||
</section> |
</section> |
||||
{{ end }} |
{{ end }} |
@ -0,0 +1,24 @@ |
|||||
|
{{- /* |
||||
|
Renders an article card with a circle image, title, and summary. |
||||
|
@context {image} the image resource. |
||||
|
@context {alt} alt text for the image. |
||||
|
@context {title} the title of the card. |
||||
|
@context {summary} the summary text. |
||||
|
@context {url} the url of the article. |
||||
|
*/}} |
||||
|
{{- $image := .image }} |
||||
|
{{- $alt := .alt }} |
||||
|
{{- $title := .title }} |
||||
|
{{- $summary := .summary }} |
||||
|
{{- $url := .url }} |
||||
|
<a href="{{ $url }}"> |
||||
|
<article class="alt float-on-hover"> |
||||
|
<div> |
||||
|
<img src="{{ $image.RelPermalink }}" alt="{{ $alt }}" /> |
||||
|
</div> |
||||
|
<div> |
||||
|
<h2>{{ $title }}</h2> |
||||
|
<p>{{ $summary }}</p> |
||||
|
</div> |
||||
|
</article> |
||||
|
</a> |
Loading…
Reference in new issue