Closed tyeeman closed 1 week ago
There is no template variable containing the file name, you may be able to extract it from the .url using Go template pipelines and functions, see https://pkg.go.dev/text/template
I'm using .slug even though I have to enter it in the meta area every time I make a new md file -
https://www.site.com/posts/{{.slug}}.html
Your documentation is great but I can't seem to find how to get the variable for the page filename.
.page
gives me the full url but I only need the filename plus ext if available.The reason is I want to create a link on my page to a specific newsletter like below. Now the tricky part is that this link is in a newsletter email and I want the link to go to the webpage with the same newsletter.
I will hardcode
https://www.site.com/posts/
but need the filename to append to that like thisI know .file does not exist so is there a var that gives just the filename?
I tried .slug and it works but I don't need a new slug. If there is something already available I would like to use it.