baranovskypd / goodpress

WIP!! :warning: R Package to Write Posts from R Markdown to Wordpress :warning:
https://maelle.github.io/goodpress/
Other
34 stars 5 forks source link

optimize rmarkdown template #30

Closed henrywangnl closed 3 years ago

henrywangnl commented 3 years ago

Optimized the rmarkdown template for writing post to save my life.

---
params:
  post_title: "The Post Title"
title: "`r params$post_title`"
date: "`r format(Sys.time(), '%Y-%m-%dT%H:%M:%S')`"
output: hugodown::md_document
slug: "`r gsub(' ', '-', tolower(params$post_title))`"
status: "publish"
comment_status: "open"
categories:
  - category1
  - category2
tags:
  - tag1
  - tag2
  - tag3
---
maelle commented 3 years ago

(and thank you!!)

henrywangnl commented 3 years ago

hmmm, the R CMD Check failed because of slugify package I think.

henrywangnl commented 3 years ago

Hmmm, if we keep it in the header, people can either change it or delete it? In that case, I'm afraid they would never know we can handle it by default in wp_post() . Instead they would most likely choose to change slugs manually every time. What do you think?

On Thu, Nov 26, 2020, 9:26 AM Maëlle Salmon notifications@github.com wrote:

@maelle commented on this pull request.

In inst/rmarkdown/templates/template-name/skeleton/skeleton.Rmd https://github.com/maelle/goodpress/pull/30#discussion_r530848140:

output: hugodown::md_document status: "publish" -slug: "the-post-slug"

sorry for the delay, I think I'd like to keep it in the template because folks might wonder how to add it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maelle/goodpress/pull/30#discussion_r530848140, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7BXKB26R4PD2DQ5OSJHX3SRYGMVANCNFSM4TONXG6Q .

maelle commented 3 years ago

ok then! :-)