r-lib / hugodown

Make websites with hugo and RMarkdown
https://hugodown.r-lib.org
Other
166 stars 24 forks source link

Possible to keep or enter a post title using `use_post()`? #57

Closed apreshill closed 4 years ago

apreshill commented 4 years ago

Using hugodown::use_post(), the title in the post created is always blank (title: ""). This is confusing at first if you don't understand posts and slugs. For example, you can knit the post, but if you look at the rendered site's post listing page, you won't be able to click on the post to see it:

Screen Shot 2020-06-15 at 8 34 49 AM

If you understand how Hugo works and that the actual link is post/no-title/ you can of course see the rendered post, but this is likely to be confusing for beginners. Would it be possible to either keep or enter a title into use_post()?

I am guessing this is the bit that overwrites the Hugo-ified title from the theme's archetype:

https://github.com/r-lib/hugodown/blob/6812adadd7e887f13cd84772128914edcc6af6b6/R/site-academic.R#L129-L133

hadley commented 4 years ago

Ooops, I accidentally made this work only for use_tidy_post().