I would like to remove the date from a post without having to manually delete from the html from the public folder after running blogdown::build_site().
I have a post called Gallery which has the following yaml header in the Rmarkdown file at the top:
---
title: Gallery
date: null
output:
blogdown::html_page:
date: null
---
This is how it is rendered in the public/gallery/index.html file:
<div class="item">
<h4><a href="/gallery/">Gallery</a></h4>
<h5>January 1, 0001</h5>
</div>
Anyway to remove/hide it without doing it manually?
I'm using the minimal theme https://github.com/calintat/minimal/
What you are asking for is not natively packed with the theme. But a simple line of tweak will do.
layouts/partials/
in your repo(if it does not exist).themes/minimal/layouts/partials/list-item.html
to layouts/partials/list-item.html
Change this line:
<h5>{{ $.Scratch.Get "subtitle" }}</h5>
to
{{ if not .Params.hidedate }}<h5>{{ $.Scratch.Get "subtitle" }}</h5>{{ end }}
In the yaml header of your post, add hidedate: true
, like this:
---
title: "Creating a New Theme"
tags: ["go", "golang", "hugo", "themes"]
hidedate: true
draft: false
---
This will turn off the date; other normal posts remain unaffected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With