Adding an image to a blog post #1289
Replies: 4 comments 2 replies
-
To be documented (Doks): If page bundles are used, images with file names matching Note, you can add images to your |
Beta Was this translation helpful? Give feedback.
-
Copy Update lines <div class="row justify-content-start">
{{ $paginator := .Paginate (.Data.Pages) -}}
{{ range $paginator.Pages -}}
<div class="col-lg-8">
<div class="card">
{{ if site.Params.doks.imageList -}}
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- if $featured -}}
{{ partial "img" (dict
"page" .
"src" $featured
"alt" .Title
"class" "rounded-top-1"
)}}
{{ end -}}
{{ end -}}
<div class="card-body">
<article>
<h2 class="h3"><a class="stretched-link text-body" href="{{ .RelPermalink }}">{{ .Params.title }}</a></h2>
<p>{{ .Params.summary | safeHTML }}</p>
{{ partial "main/blog-meta.html" . -}}
</article>
</div>
</div>
</div>
{{ end -}}
</div> |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Just to note that side to side they can get a bit funky, but I guess i need to add the max size for images somewhere in the list.html |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! :)
I wanted an image for the blogpost header like it is being done here
https://getdoks.org/blog/
this is my example.md
The image in the text shows up, but no header. Just this:
Should be a simple one but I don't get it. Any thoughts?
I also wanted to do something like what this example in your "Showcase" section has:
https://foreverliketh.is/blog/. -with:
1- multiple posts per row
2- a top summary of the subjects so you can click the category you want to see
This part might be more complex so I can also leave it to another discussion
Thanks a bunch!
Beta Was this translation helpful? Give feedback.
All reactions