Closed ghost closed 1 year ago
Answering my own question in case it helps others, and asking a followup:
To change the h1 header text, create posts/_index.md with type: post and title: "John Smith's Fabulous Blog Posts".
Content of this file below the header appears to be ignored.
Followup: Is there a way to add text that will appear above the listing of posts?
Answering my own question in case it helps others, and asking a followup:
To change the h1 header text, create posts/_index.md with type: post and title: "John Smith's Fabulous Blog Posts".
Content of this file below the header appears to be ignored.
Thanks for this
Followup: Is there a way to add text that will appear above the listing of posts?
Do you want to add a text above H1 ? can you send a rough picture/mockup of what you intend ?
Something like this:
though text above H1 would be acceptable too.
This does almost what I want: Copy themes/gokarna/layouts/partials/list.html
to layouts/partials
and add
{{ .Content }}
where I want it (after the H1 header). Then add content to the posts/_index.md
file:
Result looks like
The one problem is the HTTPS link. It's there and it is functional, but it is not underlined as links are on other pages (though the links in the posts list are not underlined either).
That can be fixed with some custom css, though.
On the other hand if instead of a custom layouts/partials/list.html
I create layouts/_default/list.html
containing
{{ define "main" }}
{{ if eq .Type "page" }}
{{- partial "page.html" . -}}
{{ else }}
{{ .Content }}
{{- partial "list.html" . -}}
{{ end }}
{{ end }}
the result looks like
Now the link is underlined. But the content appears above the H1 header, which is not what I'd prefer, and it's wider than the rest of the page.
The above custom partials/list.html
with suitable css tweaking does what I want, I think.
Is it possible to change the h1 header text on the Posts page? I mean, I find if I change the name of the posts directory that changes the text — though in variable ways, sometimes it just uses the directory name, sometimes it adds an "s", sometimes it adds "es". But if I wanted it to say for instance "John Smith's Fabulous Blog Posts" how would I do that? Short of changing the directory name to "John Smith's Fabulous Blog Posts".