WordPress

Why use WordPress?

  • Clicking to design the interface

  • Internationalization

  • Open Source

Why NOT use WordPress

  • Performance?

  • Security?

If you use WordPress, read the docs.

Do you use WordPress?

Workarounds for no WordPress

  • Use a subdomain for your R Markdown blog, linked from your main WordPress website.

  • Netlify CMS and other CMS as an user-friendly interface on static websites (like Hugo).

Now, Rmd and WordPress!

  • knitr::knit2wp() is now too dated (it uses RCurl and XML)

  • I made a package using WordPress dot org API!

  • Bob Rudis’ package for WordPress dot com API!

So your choice is between a too old tool and WIP packages. πŸ˜‚ 😭

wordpress.com vs wordpress.org

  • Free/cheap wordpress.com: no plugin

  • Business wordpress.com: $$$

  • Your own local server: efforts

  • Paid service hosting+domain name+ WordPress install: a few $ a month

JetPack

Something you can add to any WordPress website (baked in dot com websites).

Free and paid features.

Which API

  • wordpress dot com => .com API

  • self-hosted without JetPack => .org API

  • self-hosted with JetPack => .com API

In my package, support for .org API, but .com coming.

From Rmd to website

Under the hood

graph LR; A[Rmd] --> |"R ( hugodown πŸ“¦,
downlit πŸ“¦)
& Pandoc"| B{md} B --> |"R (xml2 πŸ“¦ )
& Pandoc"| C[HTML] C --> |"WordPress"| D[HTML]

From Rmd to website

What you do

graph LR; A[Rmd] --> |"πŸ”΅ knit button"| B{md} B --> |"run wp_post()"| C[HTML] C --> |"Wait"| D[HTML]

Setup for goodpress (0/3)

Have a WordPress website that’s not a free/cheap plan from wordpress.com πŸ˜‰

goodpress setup vignette

Setup for goodpress (1/3)

Setup for goodpress (2/3)

For R syntax highlighting ✨

  • Find my code.css and copy it to your clipboard.

  • From your WordPress admin dasbhoard, go to Appearance > Customize > Additional CSS. Paste the CSS there and click on publish.

Setup for goodpress (3/3)

If you want to use MathJax for equations.

From WordPress interface go to Appearance > Theme Editor. In <head> div of header.php, then save.

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

🚞 Time for a demo!

Notes on the course website

Scientific Rmd Blog Checklist

  • R Markdown
  • Syntax highlighting (for R)
  • Modern
  • .bib
  • [?] Citation for posts (add it to all posts? WordPress theme?)
  • Equations

Sustainability

goodpress:

MaΓ«lle Salmon

Contributors welcome.

pressur:

Bob Rudis

Limitations?

  • WordPress limitations (performance? security? how to tweak a theme)

  • The R part is promising but not stable yet

Further resources

Listed on the course website πŸ“‘

Questions, comments?

Write them in the pad!

Time for a break 🍹

05:00