├── .gitignore
├── layouts
└── partials
│ ├── custom-header.html
│ ├── highlight-style.html
│ ├── logo.html
│ ├── custom-footer.html
│ ├── layout
│ ├── theme.html
│ └── javascript.html
│ └── menu.html
├── static
├── images
│ ├── favicon.png
│ └── highlight.jpg
├── countdown-0.3.5
│ ├── smb_stage_clear.mp3
│ ├── countdown.css
│ └── countdown.js
└── css
│ ├── theme-mine.css
│ └── pygments.css
├── content
├── conclusion
│ ├── _index.en.md
│ └── slides
│ │ ├── index.en.Rmd
│ │ └── index.en.md
├── intro
│ ├── _index.en.md
│ ├── starters.en.md
│ └── slides
│ │ ├── index.en.Rmd
│ │ └── index.en.md
├── promotion
│ ├── _index.en.Rmd
│ ├── _index.en.md
│ ├── further-resources.en.md
│ └── slides
│ │ ├── index.en.Rmd
│ │ └── index.en.md
├── others
│ ├── _index.en.md
│ ├── jekyll.en.md
│ ├── diy.en.md
│ ├── wix.en.md
│ └── gatsby.en.md
├── noblog
│ ├── _index.en.md
│ ├── gistr.en.md
│ └── devto.en.md
├── hugo
│ ├── _index.en.Rmd
│ ├── _index.en.md
│ ├── demo
│ │ ├── index.en.Rmd
│ │ └── index.en.md
│ ├── slides
│ │ ├── index.en.Rmd
│ │ └── index.en.md
│ └── further-resources.en.md
├── reproducibility
│ ├── _index.en.Rmd
│ ├── _index.en.md
│ ├── further-resources.en.md
│ └── slides
│ │ ├── index.en.Rmd
│ │ └── index.en.md
├── distill
│ ├── _index.en.Rmd
│ ├── _index.en.md
│ ├── demo
│ │ ├── index.en.Rmd
│ │ └── index.en.md
│ ├── slides
│ │ ├── index.en.Rmd
│ │ └── index.en.md
│ └── further-resources.en.md
├── webdev
│ ├── _index.en.md
│ ├── url.en.md
│ ├── jamstack.en.md
│ ├── css.en.md
│ ├── hire.en.md
│ ├── devtools.en.md
│ └── playgrounds.en.md
├── wordpress
│ ├── _index.en.Rmd
│ ├── _index.en.md
│ ├── demo
│ │ ├── index.en.Rmd
│ │ └── index.en.md
│ ├── further-resources.en.md
│ └── slides
│ │ ├── index.en.Rmd
│ │ └── index.en.md
├── _index.en.md
├── credits.en.md
└── snippets.en.md
├── archetypes
└── default.md
├── go.mod
├── test-course-site.Rproj
├── netlify.toml
├── go.sum
├── README.md
└── config.toml
/.gitignore:
--------------------------------------------------------------------------------
1 | .Rhistory
2 | .RData
3 | .Rproj.user
4 | node_modules
5 | public
6 |
--------------------------------------------------------------------------------
/layouts/partials/custom-header.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maelle/rmd-blogging-course/HEAD/static/images/favicon.png
--------------------------------------------------------------------------------
/layouts/partials/highlight-style.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/images/highlight.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maelle/rmd-blogging-course/HEAD/static/images/highlight.jpg
--------------------------------------------------------------------------------
/content/conclusion/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Conclusion
3 | weight: 10
4 | slides: true
5 | ---
6 |
7 | Let's debrief!
--------------------------------------------------------------------------------
/archetypes/default.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "{{ replace .Name "-" " " | title }}"
3 | date: {{ .Date }}
4 | draft: true
5 | ---
6 |
7 |
--------------------------------------------------------------------------------
/static/countdown-0.3.5/smb_stage_clear.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maelle/rmd-blogging-course/HEAD/static/countdown-0.3.5/smb_stage_clear.mp3
--------------------------------------------------------------------------------
/layouts/partials/logo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/content/intro/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Introduction
3 | weight: 1
4 | chapter: true
5 | slides: true
6 | menuTitle: Intro
7 | ---
8 |
9 | What do you need to know before this course?
10 |
11 | Why would you create a blog?
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module test-course-site
2 |
3 | go 1.14
4 |
5 | require (
6 | github.com/dzello/reveal-hugo v0.0.0-20200513004858-ff9f389743ae // indirect
7 | github.com/matcornic/hugo-theme-learn v0.0.0-20200601144331-3efb32712c5c // indirect
8 | )
9 |
--------------------------------------------------------------------------------
/content/promotion/_index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: Readers
3 | weight: 5
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | ---
8 |
9 | # Around readers
10 |
11 | A few tips about promoting your blog & interacting with readers.
--------------------------------------------------------------------------------
/layouts/partials/custom-footer.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-course-site.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: Default
4 | SaveWorkspace: Default
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 2
10 | Encoding: UTF-8
11 |
12 | RnwWeave: Sweave
13 | LaTeX: pdfLaTeX
14 |
--------------------------------------------------------------------------------
/content/promotion/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Readers
3 | weight: 5
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | rmd_hash: 0b4574a0f75ea15b
8 |
9 | ---
10 |
11 | Around readers
12 | ==============
13 |
14 | A few tips about promoting your blog & interacting with readers.
15 |
16 |
--------------------------------------------------------------------------------
/content/others/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Other website generators
3 | weight: 10
4 | ---
5 |
6 | You might prefer yet another solution!
7 | Note that if you use a website generator few other R users use,
8 | there will be
9 |
10 | * less tooling to go with it now,
11 | * less tooling for Rmd content migration from it in the future.
--------------------------------------------------------------------------------
/content/others/jekyll.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Jekyll
3 | weight: 5
4 | ---
5 |
6 | Use [Jekyll](https://jekyllrb.com/) if you use Ruby a lot: this way you might like it, and not be scared
7 | by the installation of gems.
8 |
9 | {{% notice info %}}
10 | Documentation of [Jekyll support in the blogdown package](https://bookdown.org/yihui/blogdown/jekyll.html).
11 | {{% /notice %}}
--------------------------------------------------------------------------------
/content/noblog/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: No blog?
3 | weight: 20
4 | ---
5 |
6 | How to share content without having a blog?
7 |
8 | A downside of the solutions is that you don't own your platform.
9 |
10 | Another downside is that these are platforms for tech blogging rather than _scientific_ blogging per se.
11 |
12 | In all cases remember to promote your content, even if there is no RSS feed!
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | publish = "/public"
3 | command = "hugo -d public"
4 |
5 | [context.production.environment]
6 | HUGO_VERSION = "0.73.0"
7 | GO_VERSION="1.12"
8 |
9 | [context.deploy-preview.environment]
10 | HUGO_VERSION = "0.73.0"
11 | GO_VERSION="1.12"
12 |
13 |
14 | [context.branch-deploy]
15 | command = "hugo --gc -b $DEPLOY_PRIME_URL"
16 |
17 | [context.deploy-preview]
18 | command = "hugo --gc -b $DEPLOY_PRIME_URL"
--------------------------------------------------------------------------------
/content/hugo/_index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hugo
3 | weight: 3
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | ---
8 |
9 | We'll explore [Hugo](https://gohugo.io/documentation/) with [hugodown](https://hugodown.r-lib.org/).
10 |
11 | Note that Hugo changes fast. Exciting (more features!) and scary (broken websites).
12 |
13 | The hugodown package is itself an experimental R package, but it pins a Hugo version to projects.
--------------------------------------------------------------------------------
/content/reproducibility/_index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: Reproducibility
3 | weight: 4
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | ---
8 |
9 | # Reproducibility
10 |
11 | We're all about transparency and reproducibility but are your blog posts supposed to be perfectly encapsulated reproducible analyses?
12 |
13 | Spoiler: probably not; but there are less ambitious steps that are important.
14 | Indicate session info and data origin, backup, take notes.
--------------------------------------------------------------------------------
/content/hugo/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hugo
3 | weight: 3
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | rmd_hash: b6610e2d051f0155
8 |
9 | ---
10 |
11 | We'll explore [Hugo](https://gohugo.io/documentation/) with [hugodown](https://hugodown.r-lib.org/).
12 |
13 | Note that Hugo changes fast. Exciting (more features!) and scary (broken websites).
14 |
15 | The hugodown package is itself an experimental R package, but it pins a Hugo version to projects.
16 |
17 |
--------------------------------------------------------------------------------
/go.sum:
--------------------------------------------------------------------------------
1 | github.com/dzello/reveal-hugo v0.0.0-20200513004858-ff9f389743ae h1:x2cMxkgkOshGVuUswcYK1Nda6s0QFff8QDOIt3eCfKA=
2 | github.com/dzello/reveal-hugo v0.0.0-20200513004858-ff9f389743ae/go.mod h1:0S5eDEdHBx8tSj8veo9lUnuJRXa8WqmpANd0Lz7CLc8=
3 | github.com/matcornic/hugo-theme-learn v0.0.0-20200601144331-3efb32712c5c h1:xPoHdfS2a/O/6q4LuhMtusqa6hP5f69d6LwiyfvkDfE=
4 | github.com/matcornic/hugo-theme-learn v0.0.0-20200601144331-3efb32712c5c/go.mod h1:YoToDcvQxmAFhpEuapKUysBDEBckqDEssqTrmeZ2+uY=
5 |
--------------------------------------------------------------------------------
/content/distill/_index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: Distill
3 | weight: 3
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | ---
8 |
9 | [Distill](rstudio.github.io/distill/) is both a framework and an R package.
10 |
11 | Its docs state:
12 |
13 | > Distill for R Markdown is a web publishing format optimized for scientific and technical communication.
14 |
15 | It has both an R Markdown output format, and handy functions such as `distill::create_post()`.
16 |
17 | Let's explore it!
--------------------------------------------------------------------------------
/content/reproducibility/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Reproducibility
3 | weight: 4
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | rmd_hash: f388f66391e3a783
8 |
9 | ---
10 |
11 | Reproducibility
12 | ===============
13 |
14 | We're all about transparency and reproducibility but are your blog posts supposed to be perfectly encapsulated reproducible analyses?
15 |
16 | Spoiler: probably not; but there are less ambitious steps that are important. Indicate session info and data origin, backup, take notes.
17 |
18 |
--------------------------------------------------------------------------------
/content/webdev/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Web development resources
3 | menuTitle: Web dev
4 | weight: 100
5 | ---
6 |
7 | Some resources around web development that I found interesting.
8 |
9 | You might need to learn more about web development to
10 |
11 | * tweak things yourself;
12 | * learn the language of the web developer you hire.
13 |
14 | For fun, I recommend reading [the dev.to post "How to build a website in 2020"](https://dev.to/thegreengreek/how-to-build-a-website-in-2020-4f0m) ([more about dev.to as a blogging platform](/noblog/devto/)).
--------------------------------------------------------------------------------
/content/webdev/url.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Domain
3 | weight: 2
4 | ---
5 |
6 | Having your own domain is in my opinion a great idea as opposed to depending on a commercial platform / your employer.
7 |
8 | + Search for "custom domain + tool you're using for deploying your website".
9 |
10 | + Follow instructions.
11 |
12 | + Be patient, there are things like caches etc. so it might take time until it works.
13 |
14 | + Read funny and useful posts like [Custom domain hosting with Github and Namecheap](https://blog.brooke.science/posts/custom-domain-hosting-with-github-and-namecheap/)
--------------------------------------------------------------------------------
/content/distill/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Distill
3 | weight: 3
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | rmd_hash: eac431401cb5fb0a
8 |
9 | ---
10 |
11 | [Distill](rstudio.github.io/distill/) is both a framework and an R package.
12 |
13 | Its docs state:
14 |
15 | > Distill for R Markdown is a web publishing format optimized for scientific and technical communication.
16 |
17 | It has both an R Markdown output format, and handy functions such as [`distill::create_post()`](https://rdrr.io/pkg/distill/man/create_post.html).
18 |
19 | Let's explore it!
20 |
21 |
--------------------------------------------------------------------------------
/content/noblog/gistr.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: GitHub gists
3 | weight: 7
4 | ---
5 |
6 | You can post short snippets, images, etc. to [GitHub gists](https://gist.github.com/).
7 |
8 | You can even use the [`gistr` package by Scott Chamberlain](https://docs.ropensci.org/gistr/).
9 |
10 | However contrary to dev.to gists are not really, at least in my experience, a platform where people go discover content.
11 | Therefore you might want to list gists from somewhere else.
12 | A portfolio (so a blog after all, ah! Hugo [lets you easily embed gists](https://gohugo.io/content-management/shortcodes/#gist)), a tweet (ephemerous attention).
--------------------------------------------------------------------------------
/content/webdev/jamstack.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: JAMStack
3 | weight: 60
4 | ---
5 |
6 | [JAMStack](https://jamstack.org/) (JavaScript, APIs, Markup) is a way to build website created & promoted by the company Netlify.
7 | From what I understand all three things shown in this course are more or less JAMStack (WordPress is not a part of the JAMStack but I've seen WordPress REST API [called "headless WordPress" and classified as JAMStack CMS](https://jamstack.wtf/#cms) :shrug:)
8 |
9 | You might find [jamstack.org](https://jamstack.org) and [jamstack.wtf](https://jamstack.wtf/) interesting for your own learning or for better interacting with web developers you might hire.
--------------------------------------------------------------------------------
/content/webdev/css.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: CSS
3 | weight: 5
4 | ---
5 |
6 | [An allegory for my tweaking CSS](https://www.theguardian.com/artanddesign/2020/jun/22/experts-call-for-regulation-after-latest-botched-art-restoration-in-spain) :grin:
7 |
8 | More seriously, I'm linking to good resources I have clearly not explored enough yet. :grimacing:
9 |
10 | {{< tweet 1278052903744344064 >}}
11 |
12 | * [Learn to style HTML using CSS](https://developer.mozilla.org/en-US/docs/Learn/CSS)
13 |
14 | * [CSS-Tricks](https://css-tricks.com/)
15 |
16 | * [Resilient CSS YouTube series by Jen Simmons](https://www.youtube.com/watch?v=u00FY9vADfQ)
17 |
18 | {{< tweet 1245391028795965442 >}}
19 |
20 |
--------------------------------------------------------------------------------
/content/webdev/hire.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Not yourself?
3 | weight: 2
4 | ---
5 |
6 | In the intro I mentioned that your blogging framework should be either fit in your workflow or use tools that you want to invest time in.
7 |
8 | If you want tweaks compared to default themes, you might need to hire a web developer / designer.
9 | There are also companies providing themes with support (so not tweaked).
10 |
11 | I'm not advertising for anything in particular, just reminding you that time is money or at least a finite resource. :wink:
12 |
13 | I don't have good tips for how to choose a web development company/person apart from knowing what you want and need (if you know Hugo templating, maybe you just need HTML+JS+CSS, for instance).
--------------------------------------------------------------------------------
/content/noblog/devto.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: dev.to
3 | weight: 5
4 | ---
5 |
6 | [Some](https://twitter.com/_ColinFay/status/1260580782181056514) [folks](https://twitter.com/juliasilge/status/1260580363971317765) with a blog use [dev.to](https://dev.to/) to _repost_ their content from their RSS feed.
7 |
8 | You could also use your [dev.to](https://dev.to/faq) profile as your only medium!
9 |
10 | Dave Parr wrote a blog post [Posting from .Rmd to dev.to](https://dev.to/daveparr/posting-from-rmd-to-dev-to-5gld) and an [**R package** to help you post from Rmd to dev.to](https://github.com/DaveParr/dev.to.ol)!
11 |
12 | Dave Parr also wrote an exciting post ["I made my dev.to content into a website to find a new job"](https://dev.to/daveparr/i-made-my-dev-to-content-into-a-website-to-find-a-new-job-2kn5).
--------------------------------------------------------------------------------
/content/wordpress/_index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: WordPress
3 | weight: 3
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | ---
8 |
9 | # WordPress
10 |
11 | First of all, no shame!
12 |
13 | `r hugodown::embed_tweet("1259058742513012736")`
14 |
15 | ## Our challenge
16 |
17 | How to publish your R Markdown posts to a WordPress website without copy-pasting?[^cp]
18 |
19 | The only modern solution is to my knowledge, my [own WIP package `goodpress`](https://github.com/maelle/goodpress). I'll explain a few setup steps on your website, and how to organize your posts to publish them with `goodpress::wp_post()`, if you're brave enough for using my tool. :wink:
20 |
21 | [^cp]: Copy-pasting is ok, [the pros do it](https://twitter.com/gvwilson/status/1274324689322741760); it's just not the vibe of this course.
--------------------------------------------------------------------------------
/content/others/diy.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Build your own site generator?
3 | menuTitle: DIY
4 | weight: 100
5 | ---
6 |
7 | Now say that like my colleague Mark you like programming and find a website framework that you like.
8 |
9 | How about building your own site generator?
10 |
11 | Read [how Mark created his own R-based site generator using Zurb Foundation as a powerful templating tool](https://mpadge.github.io/blog/blog001.html).
12 |
13 | For further inspiration, since the distill package is also an R-based site generator, you could have a look at [its source](http://github.com/rstudio/distill), in particular how it makes the most of [R Markdown websites](https://bookdown.org/yihui/rmarkdown/rmarkdown-site.html). You could also inspect the [pull request that added an R Markdown site generator for hugodown sites to hugodown](https://github.com/r-lib/hugodown/pull/52).
14 |
--------------------------------------------------------------------------------
/content/webdev/devtools.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: DevTools
3 | weight: 7
4 | ---
5 |
6 | In the distill demo if all goes well I'll have shown the web developer console in Firefox.
7 | Chrome has a web developer console too.
8 |
9 | Here are more resources about it thanks to [Bob Rudis](https://twitter.com/hrbrmstr/status/1272484048980578307) and [timelyportfolio](https://twitter.com/timelyportfolio/status/1272500040637059072)
10 |
11 | * [Official Google DevTools Docs](https://developers.google.com/web/tools/chrome-devtools/)
12 |
13 | * [Khan Academy](https://khanacademy.org/computing/computer-programming/html-css/web-development-tools/a/using-the-browser-developer-tools)
14 |
15 | * [Lifewire DevTools How-To](https://lifewire.com/web-browser-developer-tools-3988965)
16 |
17 | * [Designing in the Browser](https://www.youtube.com/playlist?list=PLNYkxOF6rcIDI0QtJvW6vKonTxn6azCsD)
--------------------------------------------------------------------------------
/content/others/wix.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Wix, Squarespace?
3 | menuTitle: Wix &co
4 | weight: 200
5 | ---
6 |
7 | What about other services for building websites like Wix?
8 |
9 | First, be careful you can export your content safely and easily before you commit to a website service.
10 |
11 | Now for being able to use a workflow like the one we introduced with [`goodpress` for WordPress](https://github.com/maelle/goodpress/) you need
12 |
13 | * the service to provide an API for publishing new posts and managing media (listing, deleting, uploading);
14 |
15 | * to know what format the R Markdown output should have.
16 |
17 | Then you'd need to write a script/package around that, using HTTP packages, rmarkdown, Pandoc, etc.
18 |
19 | OR you could figure out what R Markdown output format to use and copy-paste to the post editor, and upload media by hand + tweak references to media path in the output.
--------------------------------------------------------------------------------
/content/reproducibility/further-resources.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: More about reproducibility
3 | menuTitle: Further resources
4 | weight: 50
5 | ---
6 |
7 | Not specific to blogging.
8 |
9 | + [Reproducible Research Data & Project Management in R](https://annakrystalli.me/rrresearchACCE20/)
10 |
11 | + [A guide to modern reproducible data science with R](https://rstudio.com/resources/rstudioconf-2019/a-guide-to-modern-reproducible-data-science-with-r-karthik-ram/)
12 |
13 | + [A guide to reproducible code, British Ecological Society](http://www.britishecologicalsociety.org/wp-content/uploads/2017/12/guide-to-reproducible-code.pdf)
14 |
15 | + [How to Make a Reproducible Paper - slides](https://bit.ly/repro_vid), [code](https://github.com/ablucher/Workshop_ReproduciblePaper)
16 |
17 | + [How to make a reproducible version of your R analysis that can be run in a web browser](https://www.youtube.com/watch?v=wSkheV-Uqq4&feature=youtu.be)
--------------------------------------------------------------------------------
/content/wordpress/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: WordPress
3 | weight: 3
4 | chapter: true
5 | slides: true
6 | output: hugodown::md_document
7 | rmd_hash: b6188ee88187119c
8 |
9 | ---
10 |
11 | WordPress
12 | =========
13 |
14 | First of all, no shame!
15 |
16 | {{< tweet 1259058742513012736 >}}
17 |
18 | Our challenge
19 | -------------
20 |
21 | How to publish your R Markdown posts to a WordPress website without copy-pasting?[^1]
22 |
23 | The only modern solution is to my knowledge, my [own WIP package `goodpress`](https://github.com/maelle/goodpress). I'll explain a few setup steps on your website, and how to organize your posts to publish them with [`goodpress::wp_post()`](https://rdrr.io/pkg/goodpress/man/wp_post.html), if you're brave enough for using my tool. :wink:
24 |
25 | [^1]: Copy-pasting is ok, [the pros do it](https://twitter.com/gvwilson/status/1274324689322741760); it's just not the vibe of this course.
26 |
27 |
--------------------------------------------------------------------------------
/content/wordpress/demo/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notes from the demo
3 | menuTitle: Demo
4 | weight: 5
5 | slides: true
6 | output: hugodown::md_document
7 | ---
8 |
9 | - setup (on the WordPress side, in .Renviron) was discussed on the slides, see [goodpress setup vignette](https://maelle.github.io/goodpress/articles/setup.html)
10 |
11 | - install the remotes package, `install.packages("remotes")`
12 |
13 | - install the goodpress package, `remotes::install_github("maelle/goodpress", ref = "main")`
14 |
15 | - create a folder, possibly a subfolder in a folder called "my-wordpress-posts" or so, "2020-07-03-cool-post".
16 |
17 | - in that folder, create index.Rmd.
18 |
19 | - in index.Rmd, paste [example content](/snippets/#goodpress-post). look at the YAML field, see also [goodpress usage vignette](https://maelle.github.io/goodpress/articles/goodpress.html)
20 |
21 | - knit.
22 |
23 | - use `goodpress::wp_post("2020-07-03-cool-post")`
--------------------------------------------------------------------------------
/content/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Scientific Rmd Blogging"
3 | ---
4 |
5 | # Scientific Blogging with R Markdown
6 |
7 | Are you an R user who works in science? Would you like sharing more
8 | online? How about starting a new blog, with R Markdown (Rmd)?
9 |
10 | In this
11 | 2-hour course with live coding, we'll go on three short adventures:
12 |
13 | - setting up a scientific Rmd blog with the Distill framework and the
14 | distill package
15 |
16 | - setting up a scientific Rmd blog with the Hugo website generator and
17 | the hugodown package
18 |
19 | - adding Rmd posts to a Wordpress blog.
20 |
21 | We'll prepare for the adventures by defining what we expect of an Rmd blog.
22 | We'll end the course by reflecting on each adventure as well as
23 | mentioning important future paths such as how to promote your blog.
24 | You should leave the course ready to start a scientific R Markdown blog
25 | with your tool of choice, and knowing where to find more resources and help.
--------------------------------------------------------------------------------
/content/webdev/playgrounds.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Playgrounds
3 | weight: 55
4 | ---
5 |
6 | With web development as with many other things being able to experiment increases your chance to solve a problem, like [reprex](https://reprex.tidyverse.org/) for R.
7 |
8 | * Create a new distill/Hugo website and play in it. You might like this [Lorem Ipsum Hugo shortcode](https://www.giffgaff.io/tech/lorem-ipsum-shortcode-for-hugo/).
9 |
10 | * Create a free wordpress.com website (with which you cannot use goodpress, though), or some other sort of throw away Wordpress instance.
11 |
12 | * For HTML+JS+CSS independently from website generation, use a code playground such as [CodePen](https://codepen.io/) (or [build your own for blog posts](https://masalmon.eu/2020/04/21/css-snippet/) :smile_cat:).
13 |
14 | * For sketching layouts apart from drawing on paper :grin: there are tools like [Figma](https://www.figma.com/) (that has a free version) and [Sketch](https://www.sketch.com/) (macOS only, no free version).
--------------------------------------------------------------------------------
/content/intro/starters.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Before blogging
3 | weight: 5
4 | ---
5 |
6 | * In this course I expect some familiarity with R Markdown. Only the basics, some of you discovered R Markdown _yesterday_!
7 |
8 | * I use the usethis package a lot :robot: :sparkles:, and recommend doing so. Follow [usethis setup article](https://usethis.r-lib.org/articles/articles/usethis-setup.html) in particular [_"Use usethis or devtools in interactive work"_](https://usethis.r-lib.org/articles/articles/usethis-setup.html#use-usethis-or-devtools-in-interactive-work-1) and the Git/GitHub stuff.
9 |
10 | * If you use GitLab, not GitHub, you can follow [Heidi Seibold's instructions _"Setup Git RStudio GitLab"_](https://gitlab.com/HeidiSeibold/setup-git-rstudio-gitlab). There is no helper similar to `usethis::use_github()` to my knowledge.
11 |
12 | * You should be able to follow the course and manage a blog without any git knowledge. Now for later, if you feel curious about version control, I'd recommend checking out [happygitwithr.com](https://happygitwithr.com/) and [Suzan Baert's blog post about git](https://suzan.rbind.io/2018/03/reflections-4-months-of-github/).
--------------------------------------------------------------------------------
/content/wordpress/demo/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notes from the demo
3 | menuTitle: Demo
4 | weight: 5
5 | slides: true
6 | output: hugodown::md_document
7 | rmd_hash: af15b37e8ed932b0
8 |
9 | ---
10 |
11 | - setup (on the WordPress side, in .Renviron) was discussed on the slides, see [goodpress setup vignette](https://maelle.github.io/goodpress/articles/setup.html)
12 |
13 | - install the remotes package, [`install.packages("remotes")`](https://rdrr.io/r/utils/install.packages.html)
14 |
15 | - install the goodpress package, [`remotes::install_github("maelle/goodpress", ref = "main")`](https://remotes.r-lib.org/reference/install_github.html)
16 |
17 | - create a folder, possibly a subfolder in a folder called "my-wordpress-posts" or so, "2020-07-03-cool-post".
18 |
19 | - in that folder, create index.Rmd.
20 |
21 | - in index.Rmd, paste [example content](/snippets/#goodpress-post). look at the YAML field, see also [goodpress usage vignette](https://maelle.github.io/goodpress/articles/goodpress.html)
22 |
23 | - knit.
24 |
25 | - use [`goodpress::wp_post("2020-07-03-cool-post")`](https://maelle.github.io/goodpress//reference/wp_post.html)
26 |
27 |
--------------------------------------------------------------------------------
/content/credits.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Credits
3 | disableToc: true
4 | ---
5 |
6 | Thank you!
7 |
8 | ## Funding
9 |
10 | The first version of this workshop is supported by the German Federal Ministry of Education and Research as part of [a series of 3 workshops on research data management](https://wiho-fdm.github.io/).
11 |
12 | ## Hugo experts
13 |
14 | Fellow Hugo fans, who taught me a lot via their public materials and useful convos!
15 |
16 | * [Alison Hill](https://alison.rbind.io/) -- see for instance [her webinar with Desirée De Leon about "Sharing on Short Notice"](https://education.rstudio.com/blog/2020/04/sharing-on-short-notice/)
17 | * [Steph Locke](https://twitter.com/TheStephLocke)
18 | * [Lukas Burk](https://blog.jemu.name/)
19 |
20 | ## Wordpress expert
21 |
22 | * [Sébastien Rochette](https://statnmap.com/) who answered [Wordpress questions](https://twitter.com/ma_salmon/status/1263448146610438145) and actually also helped me with Hugo, directly, and [indirectly](https://github.com/matcornic/hugo-theme-learn/issues/187#issuecomment-461173989).
23 |
24 | ## Tooling
25 |
26 | * [Netlify](https://www.netlify.com) - Continuous deployement and hosting of this documentation
27 | * [Hugo](https://gohugo.io/)
28 | * [Hugo theme learn](https://github.com/matcornic/hugo-theme-learn)
29 | * [Hugo theme reveal-hugo](https://github.com/dzello/reveal-hugo)
30 | * [hugodown](https://github.com/r-lib/hugodown/)
31 |
--------------------------------------------------------------------------------
/content/others/gatsby.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Gatsby
3 | weight: 55
4 | ---
5 |
6 | Hugo is powered by Go, Jekyll by Ruby, [Gatsby](https://www.gatsbyjs.org/) by React.
7 | Gatsby lets you use GraphQL to flexibly render your content (a special listing page for instance).
8 | So if you like either React or GraphQL or want to learn them, check out Gatsby!
9 |
10 | {{% notice info %}}
11 | Robert Myles wrote a [tool for .Rmd to .mdx](https://github.com/RobertMyles/writeMDX),
12 | introduced in the blog post [From R to Gatsby](https://www.robertmylesmcdonnell.com/content/posts/rtogatsby/). [Source of Robert Myles' website](https://github.com/RobertMyles/site).
13 | {{% /notice %}}
14 |
15 | Example of other websites:
16 |
17 | * [ggplot2tor](https://ggplot2tor.com/)
18 |
19 | * [Krist Wongsuphasawat's website](https://kristw.yellowpigz.com/)
20 |
21 | * [Ben Lindsay's website](https://benjlindsay.com/)
22 |
23 | * [Neal Grantham's website](https://www.nsgrantham.com/)
24 |
25 | * [openFDA](https://open.fda.gov/), [source](https://github.com/FDA/open.fda.gov)
26 |
27 | Not R related but interesting read: [Migrating to Gatsby](https://czep.net/20/gatsby-migration.html) by Scott Czepiel.
28 |
29 | Last point, I read in a [post on RStudio Education blog](https://education.rstudio.com/blog/2020/05/teach-interactive-course/) that Gatsby is part of what powers [the course framework created by Ines Montani](https://github.com/ines/course-starter-r).
--------------------------------------------------------------------------------
/content/wordpress/further-resources.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: More about WordPress & goodpress
3 | menuTitle: Further resources
4 | weight: 50
5 | ---
6 |
7 | ## Read the manual :wink:
8 |
9 | * [goodpress docs](https://maelle.github.io/goodpress/)
10 |
11 | * Read about WordPress in your usual WordPress channels.
12 | And contribute good WordPress general resources to this repo. :wink:
13 |
14 | It's good to know how your website infrastructure evolves and works.
15 |
16 | ## Follow development :eyes: and contribute to goodpress&pressur!
17 |
18 | I have shown all there is to [`goodpress`](https://github.com/maelle/goodpress), if you want more you might contribute
19 |
20 | * with bug reports, feature requests;
21 |
22 | * with code and docs.
23 |
24 | I'd be glad to help you with R package development tips if you feel you're a n00b.
25 |
26 | Also follow [pressur development](https://github.com/hrbrmstr/pressur)!
27 |
28 | ## Where to get help? :wave:
29 |
30 | * [goodpress issue tracker](https://github.com/maelle/goodpress/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
31 |
32 | * About WordPress itself, [WordPress forums](https://wordpress.org/support/forums/)
33 |
34 | ## Migrate your content to a static website?
35 |
36 | No judgement on your using WordPress, of course! Keep going! :rocket:
37 |
38 | But now that your posts are neatly organized in folders they'd be easier to migrate than if they were scattered.
39 | Hugo docs in particular have [a section about migrating to Hugo from WordPress](https://gohugo.io/tools/migrations/).
--------------------------------------------------------------------------------
/content/reproducibility/slides/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: Workflows
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | ---
10 |
11 | # Reproducibility?
12 |
13 | Should your blog posts still be "knittable?"
14 |
15 | ---
16 |
17 | # Reproducibility?
18 |
19 | * Be able to update your post short/medium term
20 |
21 | * Same for readers except for private data
22 |
23 | {{% fragment %}}
24 |
25 | But blog posts will **age**, which is fine, a blog is not a current docs website.
26 | {{% /fragment %}}
27 |
28 | ---
29 |
30 | # All posts
31 |
32 | Need to re-knit posts for migration, tool updates?
33 |
34 | {{% fragment %}}
35 | Or use the R Markdown output after a point (.md), potentially with YAML/other tweaks.
36 |
37 | When I migrated from Jekyll to Hugo I used the .md, not .Rmd.
38 | {{% /fragment %}}
39 |
40 | ---
41 |
42 | # Evergreen posts
43 |
44 | If you want a tutorial to be evergreen you'll need to ensure it works with the latest packages etc.
45 |
46 | But are tutorials like package vignettes?
47 |
48 | ---
49 |
50 | # Reproducible analyses
51 |
52 | How to archive your computing environment?
53 |
54 | It might be "easier" to archive the analysis elsewhere (tools for scientific articles) and link to that from the blog post.
55 |
56 | ---
57 |
58 | # Transparency
59 |
60 | For you, for readers.
61 |
62 | * Add session info to bottom of posts
63 |
64 | * Mention data origin (URL to data?)
65 |
66 | ---
67 |
68 | # Common sense
69 |
70 | * Backup
71 |
72 | * Make note of anything that might be tricky (dev version of a package)
73 |
74 | ---
75 |
76 | # What's your own take?
77 |
78 |
--------------------------------------------------------------------------------
/static/countdown-0.3.5/countdown.css:
--------------------------------------------------------------------------------
1 | .countdown {
2 | background: inherit;
3 | position: absolute;
4 | cursor: pointer;
5 | font-size: 3em;
6 | line-height: 1;
7 | border-color: #ddd;
8 | border-width: 3px;
9 | border-style: solid;
10 | border-radius: 15px;
11 | box-shadow: 0px 4px 10px 0px rgba(50, 50, 50, 0.4);
12 | -webkit-box-shadow: 0px 4px 10px 0px rgba(50, 50, 50, 0.4);
13 | margin: 0.6em;
14 | padding: 10px 15px;
15 | text-align: center;
16 | }
17 | .countdown {
18 | display: flex;
19 | align-items: center;
20 | justify-content: center;
21 | }
22 | .countdown .countdown-time {
23 | background: none;
24 | font-size: 100%;
25 | padding: 0;
26 | }
27 | .countdown-digits {
28 | color: inherit;
29 | }
30 | .countdown.running {
31 | border-color: #3C9A5F;
32 | background-color: #43AC6A;
33 | }
34 | .countdown.running .countdown-digits {
35 | color: #102B1A;
36 | }
37 | .countdown.finished {
38 | border-color: #D83A20;
39 | background-color: #F04124;
40 | }
41 | .countdown.finished .countdown-digits {
42 | color: #3C1009;
43 | }
44 | .countdown.running.warning {
45 | border-color: #CFAE24;
46 | background-color: #E6C229;
47 | }
48 | .countdown.running.warning .countdown-digits {
49 | color: #39300A;
50 | }
51 |
52 | @-webkit-keyframes blink {
53 | from {opacity: 1}
54 | 50% {opacity: 0.1}
55 | to {opacity: 1}
56 | }
57 |
58 | @keyframes blink {
59 | from {opacity: 1}
60 | 50% {opacity: 0.1}
61 | to {opacity: 1}
62 | }
63 |
64 | .countdown.running.blink-colon .countdown-digits.colon {
65 | -webkit-animation: blink 2s steps(1, end) 0s infinite;
66 | animation: blink 2s steps(1, end) 0s infinite;
67 | }
68 |
--------------------------------------------------------------------------------
/content/distill/demo/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notes from the demo
3 | menuTitle: Demo
4 | weight: 5
5 | slides: true
6 | output: hugodown::md_document
7 | ---
8 |
9 | - show the RStudio IDE, ask whether anyone is unfamiliar with it.
10 |
11 | - install the distill package, `install.packages("distill")`
12 |
13 | - create blog (from RStudio Create New Project, not `distill::create_blog()`).
14 |
15 | - what's in the folder now?
16 |
17 | - show website in local browser.
18 |
19 | - `usethis::use_git()`
20 |
21 | - change site but not URL, and about. change citations: true!!!
22 |
23 | - rebuild the site via RStudio build button or `rmarkdown::render_site()`.
24 |
25 | - show website in local browser.
26 |
27 | - edit and knit welcome. including author info!!
28 |
29 | - look what changed, commit
30 |
31 | - show website in local browser.
32 |
33 | - look at post html in _posts and _site. mention navbar
34 |
35 | - commit
36 |
37 | - add a post with `distill::create_post()`. knit, look what changed this time.
38 |
39 | - add references
40 |
41 | - add latex, mention JavaScript
42 |
43 | - add footnote and aside
44 |
45 | - put website online via Netlify drag and drop.
46 |
47 | - add base_url to site config, show citations metadata is added.
48 |
49 | - Netlify drag and drop.
50 |
51 | - Some minimal styling. Introduce the web developer console.
52 |
53 | - Netlify drag and drop
54 |
55 | - GitHub repo `usethis::use_github()`
56 |
57 | - mention git checkout -b and [the distill docs about blog post workflows](https://rstudio.github.io/distill/blog_workflow.html).
58 |
59 | - Other options for deployment (Netlify link to repo, [distill docs](https://rstudio.github.io/distill/publish_website.html))
60 |
61 | - add Twitter&GitHub
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Scientific blogging with R Markdown
3 |
4 |
5 | [](https://app.netlify.com/sites/scientific-rmd-blogging/deploys)
6 | [](https://www.repostatus.org/#active)
7 |
8 |
9 | Source of the website of a short course.
10 |
11 | It is powered by [Hugo](https://gohugo.io/) and the following themes:
12 |
13 | * [Hugo theme learn](https://github.com/matcornic/hugo-theme-learn)
14 | * [Hugo theme reveal-hugo](https://github.com/dzello/reveal-hugo)
15 |
16 | Slides for each section are listed in the menu and opened in a new tab (thanks to a [custom menu layout](/blob/master/layouts/partials/menu.html), compared to the original Hugo learn theme).
17 |
18 | Some Markdown content is generated with [R Markdown](https://rmarkdown.rstudio.com/), using [hugodown](https://github.com/r-lib/hugodown/).
19 |
20 | The website is deployed by [Netlify](https://www.netlify.com/).
21 |
22 | Slides could be printed to PDF using Decktape which I [have done in a concept](https://github.com/maelle/test-course-site) but I am not pursuing it further.
23 |
24 | ### Why these tools?
25 |
26 | Why use Hugo for both the website and slidedecks, and not, say Hugo+hugodown for pages and xaringan for slides?
27 | This way the source of slides is html produced by Hugo from Markdown content.
28 | It allows me to use:
29 |
30 | * downlit syntax highlighting for slides created from R Markdown with hugodown output format;
31 | * Chroma syntax highlighting for other languages;
32 | * emojis! `:grin:` works in slides;
33 | * Shortcodes in slides, should I choose to.
34 |
35 | Also, because slides are in the content, they are indexed by the Hugo learn theme so searchable!
36 |
37 |
--------------------------------------------------------------------------------
/content/promotion/further-resources.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: More about readers
3 | menuTitle: Further resources
4 | weight: 50
5 | ---
6 |
7 | ## Promotion
8 |
9 | * [My blog post "Get on your soapbox! R blog content and promotion"](https://masalmon.eu/2018/07/16/soapbox/)
10 |
11 | * [How to have (my) content shared by R Weekly?](https://github.com/rweekly/rweekly.org#how-to-have-my-content-shared-by-r-weekly)
12 |
13 | * Look into how to add a (category specific) RSS feed to your blog, if there's not one by default. For R Bloggers, that feed needs to feature the full content of posts.
14 |
15 | ## Comments
16 |
17 | * [My blog post about utteranc.es](https://masalmon.eu/2019/10/02/disqus/) (which means you need to use GitHub...)
18 |
19 | * [Schnack, a simple Disqus-like drop-in commenting system written in JavaScript.](https://github.com/schn4ck/schnack) read about [in a post of Noam Ross'](https://www.noamross.net/2019/08/09/a-new-website/)
20 |
21 | * Not very recent but useful [ Blog comment systems: Disqus alternatives](https://fedidat.com/530-blog-comments/)
22 |
23 | * In WordPress, built-in.
24 |
25 |
26 | ## Citations
27 |
28 | * [Hugo template for adding citation metadata to posts by Sébastien Rochette](https://github.com/statnmap/hugo-statnmap-theme/blob/3e2a54a9836fdd65779865e91058ba304b628336/layouts/partials/citation.html)
29 |
30 | * [DOI for blog posts?](https://blog.datacite.org/schema-org-register-dois/)
31 |
32 | ## Analytics
33 |
34 | If you use another service than Google Analytics, I'd be glad to hear about your experience.
35 |
36 | ## Negative feedback
37 |
38 | * The topic of negative feedback is mentioned in [The Ladybug podcast about Blogging](https://www.ladybug.dev/episodes/blogging-101?rq=blogging)
39 |
40 | * Twitter [soft block](https://www.urbandictionary.com/define.php?term=Soft%20Block). You can also _mute_ accounts.
41 |
42 | * When you are wrong, don't get defensive. Thread below.
43 |
44 | {{< tweet 1275485736259792898 >}}
45 |
--------------------------------------------------------------------------------
/content/conclusion/slides/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: Conclusion
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | ---
10 |
11 | # Scientific blogging with R Markdown
12 |
13 | :sob: Nearly time to say goodbye!
14 |
15 | ---
16 |
17 | * distill: perfect, not flexible
18 |
19 | * Hugo&hugodown: very flexible (too flexible?), changes fast, experimental R package
20 |
21 | * WordPress&goodpress: also flexible, even more experimental R package
22 |
23 | ---
24 |
25 | # What to choose
26 |
27 | * distill
28 |
29 | * Hugo Academic with `hugodown::create_site_academic()`
30 |
31 | * WordPress if you already use WordPress?
32 |
33 | ---
34 |
35 | # What to choose
36 |
37 | Start by playing! Don't commit right away.
38 |
39 | Does any of you want to say what they'd choose and why?
40 |
41 | ---
42 |
43 | # True for all
44 |
45 | * Read the docs and follow development! :eyes:
46 |
47 | * Backup! :warning:
48 |
49 | ---
50 |
51 | # Change your mind?
52 |
53 | * Migration tools
54 |
55 | * `yaml`, `commonmark` packages, etc.
56 |
57 | * Redirects! URLs are important. 404 page.
58 |
59 | ---
60 |
61 | # Have fun!
62 |
63 | If you're worried about blogging, find a blogging buddy to read your drafts?
64 |
65 | Make efforts but don't be perfectionist.
66 |
67 | ---
68 |
69 | # Setup is not fun
70 |
71 | * With R helper packages, setup is smoother
72 |
73 | * But in general setup = learning a new thing, hard but then you get used to it!
74 |
75 | ---
76 |
77 | # Regular blogging?
78 |
79 | No you don't have to unless you call your blog "the daily blog" or so. :wink:
80 |
81 | Only write if you enjoy it! Your blog can be a portfolio/news board only.
82 |
83 | ---
84 |
85 | # Tell me
86 |
87 | * Questions this afternoon :raising_hand:
88 |
89 | * Issues in the [website repo](https://github.com/maelle/rmd-blogging-course/issues) for questions :raising_hand:
90 |
91 | * [Tweets](https://twitter.com/ma_salmon)/emails to show me your websites. :star:
92 |
--------------------------------------------------------------------------------
/config.toml:
--------------------------------------------------------------------------------
1 | baseURL = "https://scientific-rmd-blogging.netlify.app/"
2 | languageCode = "en-US"
3 | defaultContentLanguage = "en"
4 | title = "Scientific Rmd Blogging"
5 | enableEmoji = true
6 | pygmentsUseClasses=true
7 | ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$", "index\\.html", '\.knit\.md$', '\.utf8\.md$']
8 |
9 | [module]
10 | [[module.imports]]
11 | path = "github.com/matcornic/hugo-theme-learn"
12 | [[module.imports]]
13 | path = "github.com/dzello/reveal-hugo"
14 |
15 | [outputFormats.Reveal]
16 | baseName = "index"
17 | mediaType = "text/html"
18 | isHTML = true
19 |
20 |
21 | [outputs]
22 | home = [ "HTML", "RSS", "JSON"]
23 |
24 | [Languages]
25 | [Languages.en]
26 | title = "Scientific Rmd Blogging"
27 | weight = 1
28 | languageName = "English"
29 |
30 | [[Languages.en.menu.shortcuts]]
31 | name = " GitHub repo"
32 | identifier = "ds"
33 | url = "https://github.com/maelle/rmd-blogging-course"
34 | weight = 10
35 |
36 | [[Languages.en.menu.shortcuts]]
37 | name = " Snippets"
38 | url = "/snippets"
39 | weight = 20
40 |
41 | [[Languages.en.menu.shortcuts]]
42 | name = " Credits"
43 | url = "/credits"
44 | weight = 30
45 |
46 | [[Languages.en.menu.shortcuts]]
47 | name = " CC-BY Licence"
48 | url = "https://creativecommons.org/licenses/by/4.0/"
49 | weight = 40
50 |
51 | [params]
52 | editURL = "https://github.com/maelle/rmd-blogging-course/edit/main/content/"
53 | description = "Scientific Rmd Blogging"
54 | author = "Maëlle Salmon"
55 | showVisitedLinks = true
56 | disableBreadcrumb = false
57 | disableNextPrev = false
58 | themeVariant = "mine"
59 |
60 |
61 |
62 | [markup]
63 | [markup.goldmark]
64 | [markup.goldmark.renderer]
65 | unsafe = true
66 |
67 | [params.reveal_hugo]
68 | theme = "white"
69 | load_default_plugins = false
70 | plugins = [
71 | "reveal-js/plugin/zoom-js/zoom.js",
72 | "reveal-js/plugin/notes/notes.js",
73 | ]
74 |
--------------------------------------------------------------------------------
/layouts/partials/layout/theme.html:
--------------------------------------------------------------------------------
1 |
2 | {{- $reveal_location := $.Param "reveal_hugo.reveal_cdn" | default "reveal-js" -}}
3 | {{- $highlight_location := $.Param "reveal_hugo.highlight_cdn" | default "highlight-js" -}}
4 | {{- $custom_theme := $.Param "reveal_hugo.custom_theme" -}}
5 |
6 |
7 | {{- $custom_theme := $.Param "reveal_hugo.custom_theme" -}}
8 | {{- if $custom_theme -}}
9 | {{- $custom_theme_options := $.Param "reveal_hugo.custom_theme_options" | default dict -}}
10 | {{- if $.Param "reveal_hugo.custom_theme_compile" -}}
11 | {{ $asset := resources.Get $custom_theme | resources.ExecuteAsTemplate "_.scss" . | toCSS $custom_theme_options | minify | fingerprint }}
12 |
13 | {{- else -}}
14 |
15 | {{- end -}}
16 | {{ else -}}
17 | {{- $theme := $.Param "reveal_hugo.theme" | default "black" -}}
18 |
19 | {{ end -}}
20 | {{ if $.Param "reveal_hugo.load_default_plugins" | default true -}}
21 |
22 | {{- $highlight_theme := $.Param "reveal_hugo.highlight_theme" | default "default" -}}
23 |
24 | {{- end }}
25 | {{- $custom_css := $.Param "reveal_hugo.custom_css" -}}
26 | {{- if $custom_css -}}
27 |
28 | {{- end -}}
29 |
30 | {{ partial "highlight-style.html" . }}
31 | {{ with $.Params.countdown }} {{ end }}
--------------------------------------------------------------------------------
/content/distill/demo/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notes from the demo
3 | menuTitle: Demo
4 | weight: 5
5 | slides: true
6 | output: hugodown::md_document
7 | rmd_hash: 56c6444412ac02ba
8 |
9 | ---
10 |
11 | - show the RStudio IDE, ask whether anyone is unfamiliar with it.
12 |
13 | - install the distill package, [`install.packages("distill")`](https://rdrr.io/r/utils/install.packages.html)
14 |
15 | - create blog (from RStudio Create New Project, not [`distill::create_blog()`](https://rdrr.io/pkg/distill/man/create_website.html)).
16 |
17 | - what's in the folder now?
18 |
19 | - show website in local browser.
20 |
21 | - [`usethis::use_git()`](https://usethis.r-lib.org/reference/use_git.html)
22 |
23 | - change site but not URL, and about. change citations: true!!!
24 |
25 | - rebuild the site via RStudio build button or [`rmarkdown::render_site()`](https://rdrr.io/pkg/rmarkdown/man/render_site.html).
26 |
27 | - show website in local browser.
28 |
29 | - edit and knit welcome. including author info!!
30 |
31 | - look what changed, commit
32 |
33 | - show website in local browser.
34 |
35 | - look at post html in \_posts and \_site. mention navbar
36 |
37 | - commit
38 |
39 | - add a post with [`distill::create_post()`](https://rdrr.io/pkg/distill/man/create_post.html). knit, look what changed this time.
40 |
41 | - add references
42 |
43 | - add latex, mention JavaScript
44 |
45 | - add footnote and aside
46 |
47 | - put website online via Netlify drag and drop.
48 |
49 | - add base\_url to site config, show citations metadata is added.
50 |
51 | - Netlify drag and drop.
52 |
53 | - Some minimal styling. Introduce the web developer console.
54 |
55 | - Netlify drag and drop
56 |
57 | - GitHub repo [`usethis::use_github()`](https://usethis.r-lib.org/reference/use_github.html)
58 |
59 | - mention git checkout -b and [the distill docs about blog post workflows](https://rstudio.github.io/distill/blog_workflow.html).
60 |
61 | - Other options for deployment (Netlify link to repo, [distill docs](https://rstudio.github.io/distill/publish_website.html))
62 |
63 | - add Twitter&GitHub
64 |
65 |
--------------------------------------------------------------------------------
/content/reproducibility/slides/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: Workflows
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | rmd_hash: d72ca81ec9ad4774
10 |
11 | ---
12 |
13 | Reproducibility?
14 | ================
15 |
16 | Should your blog posts still be "knittable?"
17 |
18 | ------------------------------------------------------------------------
19 |
20 | Reproducibility?
21 | ================
22 |
23 | - Be able to update your post short/medium term
24 |
25 | - Same for readers except for private data
26 |
27 | {{% fragment %}} But blog posts will **age**, which is fine, a blog is not a current docs website. {{% /fragment %}}
28 |
29 | ------------------------------------------------------------------------
30 |
31 | All posts
32 | =========
33 |
34 | Need to re-knit posts for migration, tool updates?
35 |
36 | {{% fragment %}} Or use the R Markdown output after a point (.md), potentially with YAML/other tweaks.
37 |
38 | When I migrated from Jekyll to Hugo I used the .md, not .Rmd. {{% /fragment %}}
39 |
40 | ------------------------------------------------------------------------
41 |
42 | Evergreen posts
43 | ===============
44 |
45 | If you want a tutorial to be evergreen you'll need to ensure it works with the latest packages etc.
46 |
47 | But are tutorials like package vignettes?
48 |
49 | ------------------------------------------------------------------------
50 |
51 | Reproducible analyses
52 | =====================
53 |
54 | How to archive your computing environment?
55 |
56 | It might be "easier" to archive the analysis elsewhere (tools for scientific articles) and link to that from the blog post.
57 |
58 | ------------------------------------------------------------------------
59 |
60 | Transparency
61 | ============
62 |
63 | For you, for readers.
64 |
65 | - Add session info to bottom of posts
66 |
67 | - Mention data origin (URL to data?)
68 |
69 | ------------------------------------------------------------------------
70 |
71 | Common sense
72 | ============
73 |
74 | - Backup
75 |
76 | - Make note of anything that might be tricky (dev version of a package)
77 |
78 | ------------------------------------------------------------------------
79 |
80 | What's your own take?
81 | =====================
82 |
83 |
--------------------------------------------------------------------------------
/content/promotion/slides/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: Readers
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | ---
10 |
11 | # Promote your blog
12 |
13 | ---
14 |
15 | # Put its URL everywhere!
16 |
17 | Your ORCID profile, Twitter profile, GitHub profile, etc.
18 |
19 | No dead ends please!
20 |
21 | ---
22 |
23 | # R Weekly
24 |
25 | Weekly newsletter featuring links to blog posts but also slidedecks, etc., about R.
26 |
27 | * One-off sharing: [web form](https://rweekly.org/submit), [PRs](https://github.com/rweekly/rweekly.org).
28 |
29 | * Add your RSS feed via the [web form](https://rweekly.org/submit).
30 |
31 | ---
32 |
33 | # R Bloggers
34 |
35 | Ingests the entire feed and repost posts.
36 |
37 | It can take time from [feed submission](https://www.r-bloggers.com/add-your-blog/) to feed validation.
38 |
39 | ---
40 |
41 | # Social media
42 |
43 | E.g. Twitter.
44 |
45 | Write a clear text, post URL, add a few hashtags, image (or carefully crafted infographics?) + alternative text.
46 |
47 | ---
48 |
49 | # SEO
50 |
51 | Search Engine Optimization
52 |
53 | * Add links to your post
54 |
55 | * Read resources by marketers
56 |
57 | ---
58 |
59 | # Interact with readers
60 |
61 | ---
62 |
63 | # How to interact with readers?
64 |
65 | On social media?
66 |
67 | In comments? For Hugo, [Utteranc.es as an alternative to Disqus](https://masalmon.eu/2019/10/02/disqus/).
68 |
69 | ---
70 |
71 | # Negative feedback
72 |
73 | (not constructive feedback)
74 |
75 | Have a support system.
76 |
77 | You don't have to respond publicly, or at all.
78 |
79 | If _you_ were wrong, listen and do better.
80 |
81 | ---
82 |
83 | # Encouraging citations
84 |
85 | ---
86 |
87 | # Citing your posts
88 |
89 | * Distill metadata
90 |
91 | * Hugo [custom layout](https://github.com/statnmap/hugo-statnmap-theme/blob/3e2a54a9836fdd65779865e91058ba304b628336/layouts/partials/citation.html)
92 |
93 | * [DOI](https://twitter.com/mfenner/status/1126523120591020032)?
94 |
95 | ---
96 |
97 | # Analytics
98 |
99 | ---
100 |
101 | # Analytics
102 |
103 | * Do you need numbers? E.g. if you blog at work.
104 |
105 | * Are you ok using Google Analytics?
106 |
107 | * GDPR :wink:
108 |
109 | * Alternatives? [Fathom](https://usefathom.com/)? Others?
--------------------------------------------------------------------------------
/content/hugo/demo/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notes from the demo
3 | menuTitle: Demo
4 | weight: 5
5 | slides: true
6 | output: hugodown::md_document
7 | ---
8 |
9 | - install the remotes package, `install.packages("remotes)`
10 |
11 | - install the hugodown package, `remotes::install_github("r-lib/hugodown")`
12 |
13 | - `hugodown::hugo_install()`
14 |
15 | - new RStudio empty project.
16 |
17 | - `hugo new site . --force` from the command line in that new folder.
18 |
19 | - Download https://github.com/yihui/hugo-xmin and put into themes, remove "-master" from the folder name, delete example site.
20 |
21 | - Copy paste https://github.com/yihui/hugo-xmin/blob/master/exampleSite/config.toml
22 |
23 | - Create `_hugodown.yaml` with `hugo_version: 0.73.0`
24 |
25 | - `hugodown::hugo_start()`
26 |
27 | - add about.md
28 |
29 | - copy-paste from [hugodown setup vignette](https://hugodown.r-lib.org/articles/config.html)
30 |
31 | - create [static/css/code.css](/snippets/#codecss) from and create [layouts/partial/head_custom.html](/snippets/#head_customhtml) (one should read [theme docs](https://xmin.yihui.org/about/)!)
32 |
33 | - for mathjax create [layouts/partial/foot_custom.html](/snippets/#head_customhtml)
34 |
35 | - create post in content/post/2020-06-25-cool/index.Rmd and copy-paste from snippets page. knit, preview.
36 |
37 | - add citations.
38 |
39 | - `hugodown::hugo_stop()`, `hugodown::hugo_start(render_to_disk = TRUE)`
40 |
41 | - Netlify drag and drop
42 |
43 | - add URL to config
44 |
45 | - then something easier from the code point of view but more overwhelming!
46 |
47 | - create empty RStudio project (with git if it's available)
48 |
49 | - `hugodown::hugo_install('0.66.0')`
50 |
51 | - `hugodown::create_site_academic()`. Be happy to see everything happening automatically :sparkles:
52 |
53 | - `hugodown::hugo_start(render_to_disk = TRUE)`, open localhost in the browser.
54 |
55 | - Change site title and [theme](https://sourcethemes.com/academic/themes/) in config/_default/params.toml. Yes a theme for a theme!
56 |
57 | - Mention [academic docs](https://sourcethemes.com/academic/), all the things one can change.
58 |
59 | - `hugodown::use_post("post/new-rmd-post")`, knit, see post.
60 |
61 | - say there will probably be other themes later. show [Hugo theme gallery](https://themes.gohugo.io/) and how I would choose themes.
62 |
63 | - `usethis::use_github()`, `hugodown::use_netlify_toml()`, go to Netlify interface.
64 |
65 | - add URL to config
66 |
--------------------------------------------------------------------------------
/content/conclusion/slides/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: Conclusion
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | rmd_hash: b777bbe39c9e64c8
10 |
11 | ---
12 |
13 | Scientific blogging with R Markdown
14 | ===================================
15 |
16 | :sob: Nearly time to say goodbye!
17 |
18 | ------------------------------------------------------------------------
19 |
20 | - distill: perfect, not flexible
21 |
22 | - Hugo&hugodown: very flexible (too flexible?), changes fast, experimental R package
23 |
24 | - WordPress&goodpress: also flexible, even more experimental R package
25 |
26 | ------------------------------------------------------------------------
27 |
28 | What to choose
29 | ==============
30 |
31 | - distill
32 |
33 | - Hugo Academic with [`hugodown::create_site_academic()`](https://rdrr.io/pkg/hugodown/man/create_site_academic.html)
34 |
35 | - WordPress if you already use WordPress?
36 |
37 | ------------------------------------------------------------------------
38 |
39 | What to choose
40 | ==============
41 |
42 | Start by playing! Don't commit right away.
43 |
44 | Does any of you want to say what they'd choose and why?
45 |
46 | ------------------------------------------------------------------------
47 |
48 | True for all
49 | ============
50 |
51 | - Read the docs and follow development! :eyes:
52 |
53 | - Backup! :warning:
54 |
55 | ------------------------------------------------------------------------
56 |
57 | Change your mind?
58 | =================
59 |
60 | - Migration tools
61 |
62 | - `yaml`, `commonmark` packages, etc.
63 |
64 | - Redirects! URLs are important. 404 page.
65 |
66 | ------------------------------------------------------------------------
67 |
68 | Have fun!
69 | =========
70 |
71 | If you're worried about blogging, find a blogging buddy to read your drafts?
72 |
73 | Make efforts but don't be perfectionist.
74 |
75 | ------------------------------------------------------------------------
76 |
77 | Setup is not fun
78 | ================
79 |
80 | - With R helper packages, setup is smoother
81 |
82 | - But in general setup = learning a new thing, hard but then you get used to it!
83 |
84 | ------------------------------------------------------------------------
85 |
86 | Regular blogging?
87 | =================
88 |
89 | No you don't have to unless you call your blog "the daily blog" or so. :wink:
90 |
91 | Only write if you enjoy it! Your blog can be a portfolio/news board only.
92 |
93 | ------------------------------------------------------------------------
94 |
95 | Tell me
96 | =======
97 |
98 | - Questions this afternoon :raising_hand:
99 |
100 | - Issues in the [website repo](https://github.com/maelle/rmd-blogging-course/issues) for questions :raising_hand:
101 |
102 | - [Tweets](https://twitter.com/ma_salmon)/emails to show me your websites. :star:
103 |
104 |
--------------------------------------------------------------------------------
/content/distill/slides/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: distill
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | countdown: true
10 | ---
11 |
12 | # Distill
13 |
14 | ---
15 |
16 | [Distill](rstudio.github.io/distill/) is both a framework and an R package.
17 |
18 | > Distill for R Markdown is a web publishing format optimized for scientific and technical communication.
19 |
20 | ---
21 |
22 | * Output format for single documents
23 |
24 | * Websites
25 |
26 | * Blogs, like websites but with blog posts than aren't re-rendered automatically.
27 |
28 | ---
29 |
30 | Helpers like `distill::create_post()`
31 |
32 | ---
33 |
34 | # From Rmd to website
35 |
36 | Under the hood
37 |
38 |
39 | ```{=html}
40 | {{}}
41 | graph LR;
42 | A[Rmd] -->|"R ( distill :package:) & Pandoc & Distill framework" | B[HTML]
43 | {{< /mermaid >}}
44 | ```
45 |
46 | Inspired by [Emi Tanaka's post](https://emitanaka.org/r/posts/2018-12-12-scientific-and-technical-blogging-radix-vs-blogdown/)
47 |
48 | ---
49 |
50 | # From Rmd to website
51 |
52 | What you do
53 |
54 |
55 | ```{=html}
56 | {{}}
57 | graph LR;
58 | A[Rmd] -->|" :large_blue_circle: knit button" | B[HTML]
59 | {{< /mermaid >}}
60 | ```
61 |
62 |
63 | ---
64 |
65 | :train: Time for a demo!
66 |
67 | [Notes on the course website](/distill/demo/)
68 |
69 | ---
70 |
71 | Scientific Rmd Blog Checklist
72 |
73 | * [x] R Markdown
74 | * [x] Syntax highlighting (for all knitr-supported languages)
75 | * [x] Modern
76 | * [x] .bib
77 | * [x] Citation for posts
78 | * [x] Equations
79 |
80 | ---
81 |
82 | # Sustainability
83 |
84 | Created by:
85 |
86 | ```{r, echo=FALSE, results="asis"}
87 | glue::glue_collapse(
88 | trimws(
89 | gsub("<.*>", "",
90 | desc::desc_get_author(file = find.package("distill"), role = "aut")
91 | )
92 | ),
93 | sep = ", ")
94 | ```
95 |
96 | Used for [RStudio AI blog](https://blogs.rstudio.com/ai/), in particular.
97 |
98 | Active development.
99 |
100 | ---
101 |
102 | # Limitations?
103 |
104 | * Content stored as html (harder to migrate?)
105 |
106 | * Limited possibilities for customization (blessing in disguise?)
107 |
108 | * Some open issues (ORCID support, RSS feed tweaking) but active development
109 |
110 | ---
111 |
112 | # Further resources
113 |
114 | [Listed on the course website](/distill/further-resources/) :books:
115 |
116 | ---
117 |
118 | # Questions, comments?
119 |
120 | Write them in the pad!
121 |
122 | ---
123 |
124 | # Time for a break :coffee:
125 |
126 |
127 |
128 |
129 |
130 | 05:00
131 |
132 |
133 |
134 |
--------------------------------------------------------------------------------
/content/distill/further-resources.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: More about distill
3 | menuTitle: Further resources
4 | weight: 50
5 | ---
6 |
7 | ## Read the manual :wink:
8 |
9 | There aren't many pages in [distill docs website](https://rstudio.github.io/distill/) so I'd recommend reading all of them if you commit to this website builder.
10 |
11 | ## Follow developments? :eyes:
12 |
13 | If you start using distill for your website...
14 |
15 | * Read the changelog when updating the package?
16 |
17 | * [Watch development on GitHub](https://help.github.com/en/github/managing-subscriptions-and-notifications-on-github/viewing-your-subscriptions#configuring-your-watch-settings-for-an-individual-repository)?
18 |
19 | * Subscribe to the [issues](https://github.com/rstudio/distill/issues) that are interesting to you: [search](https://github.com/rstudio/distill/issues/9), [ORCID](https://github.com/rstudio/distill/issues/21), etc.?
20 |
21 | ## Websites for inspiration :sparkles:
22 |
23 | | Website | Source |
24 | |---|---|
25 | |[Scholarly Communication Analytics](https://subugoe.github.io/scholcomm_analytics/)| [](https://github.com/subugoe/scholcomm_analytics) |
26 | | [RStudio AI Blog](https://blogs.rstudio.com/ai/) | [](https://github.com/rstudio/ai-blog) |
27 | | [The Mockup Blog by Tom Mock](https://themockup.blog/) | [](https://github.com/jthomasmock/radix_themockup) |
28 | | [Michael Clark's personal website](https://m-clark.github.io/) | [](https://github.com/m-clark/m-clark.github.io) |
29 | | [Antoine Bichat's personal website](https://abichat.github.io/) | [](https://github.com/abichat/abichat.github.io) |
30 |
31 |
32 | ### A few more links
33 |
34 | [Emi Tanaka's take on distill (back when the package was called radix) vs Hugo (with blogdown)](https://emitanaka.org/r/posts/2018-12-12-scientific-and-technical-blogging-radix-vs-blogdown/)
35 |
36 | [A tentative GitHub code search](https://github.com/search?l=&o=desc&q=distill%3A%3Adistill_website+filename%3Aindex.Rmd&s=indexed&type=Code).
37 |
38 | ## A warning about customization :warning:
39 |
40 | > A word of warning though: Distill (the original library upon which the R package is based) is strongly opinionated about CSS and sometimes it's tricky or impossible to change things. Just to say your mileage may vary and if there is something you can't quite get right there is not likely much we can do about it -- *JJ Allaire [in a GitHub issue](https://github.com/rstudio/distill/issues/100#issuecomment-508075573)*.
41 |
42 | {{% notice tip %}}
43 | If you liked distill's looks but would like further customization, and if you like Hugo that we'll present in the next section, check out [this Distill theme for Hugo](https://github.com/activatedgeek/distillpub).
44 | {{% /notice %}}
45 |
46 | ## Where to get help? :wave:
47 |
48 | * [RStudio community forum](https://community.rstudio.com/c/R-Markdown/10) (RMarkdown category, distill tag)
49 |
50 | * [distill issue tracker](https://github.com/rstudio/distill/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
--------------------------------------------------------------------------------
/content/hugo/demo/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notes from the demo
3 | menuTitle: Demo
4 | weight: 5
5 | slides: true
6 | output: hugodown::md_document
7 | rmd_hash: bd629f4e40ea7fcd
8 |
9 | ---
10 |
11 | - install the remotes package, `install.packages("remotes)`
12 |
13 | - install the hugodown package, [`remotes::install_github("r-lib/hugodown")`](https://remotes.r-lib.org/reference/install_github.html)
14 |
15 | - [`hugodown::hugo_install()`](https://rdrr.io/pkg/hugodown/man/hugo_install.html)
16 |
17 | - new RStudio empty project.
18 |
19 | - `hugo new site . --force` from the command line in that new folder.
20 |
21 | - Download https://github.com/yihui/hugo-xmin and put into themes, remove "-master" from the folder name, delete example site.
22 |
23 | - Copy paste https://github.com/yihui/hugo-xmin/blob/master/exampleSite/config.toml
24 |
25 | - Create `_hugodown.yaml` with `hugo_version: 0.73.0`
26 |
27 | - [`hugodown::hugo_start()`](https://rdrr.io/pkg/hugodown/man/hugo_start.html)
28 |
29 | - add about.md
30 |
31 | - copy-paste from [hugodown setup vignette](https://hugodown.r-lib.org/articles/config.html)
32 |
33 | - create [static/css/code.css](/snippets/#codecss) from and create [layouts/partial/head\_custom.html](/snippets/#head_customhtml) (one should read [theme docs](https://xmin.yihui.org/about/)!)
34 |
35 | - for mathjax create [layouts/partial/foot\_custom.html](/snippets/#head_customhtml)
36 |
37 | - create post in content/post/2020-06-25-cool/index.Rmd and copy-paste from snippets page. knit, preview.
38 |
39 | - add citations.
40 |
41 | - [`hugodown::hugo_stop()`](https://rdrr.io/pkg/hugodown/man/hugo_start.html), [`hugodown::hugo_start(render_to_disk = TRUE)`](https://rdrr.io/pkg/hugodown/man/hugo_start.html)
42 |
43 | - Netlify drag and drop
44 |
45 | - add URL to config
46 |
47 | - then something easier from the code point of view but more overwhelming!
48 |
49 | - create empty RStudio project (with git if it's available)
50 |
51 | - [`hugodown::hugo_install('0.66.0')`](https://rdrr.io/pkg/hugodown/man/hugo_install.html)
52 |
53 | - [`hugodown::create_site_academic()`](https://rdrr.io/pkg/hugodown/man/create_site_academic.html). Be happy to see everything happening automatically :sparkles:
54 |
55 | - [`hugodown::hugo_start(render_to_disk = TRUE)`](https://rdrr.io/pkg/hugodown/man/hugo_start.html), open localhost in the browser.
56 |
57 | - Change site title and [theme](https://sourcethemes.com/academic/themes/) in config/\_default/params.toml. Yes a theme for a theme!
58 |
59 | - Mention [academic docs](https://sourcethemes.com/academic/), all the things one can change.
60 |
61 | - [`hugodown::use_post("post/new-rmd-post")`](https://rdrr.io/pkg/hugodown/man/use_post.html), knit, see post.
62 |
63 | - say there will probably be other themes later. show [Hugo theme gallery](https://themes.gohugo.io/) and how I would choose themes.
64 |
65 | - [`usethis::use_github()`](https://usethis.r-lib.org/reference/use_github.html), [`hugodown::use_netlify_toml()`](https://rdrr.io/pkg/hugodown/man/use_netlify_toml.html), go to Netlify interface.
66 |
67 | - add URL to config
68 |
69 |
--------------------------------------------------------------------------------
/content/promotion/slides/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: Readers
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | rmd_hash: 215653ad9f567b4b
10 |
11 | ---
12 |
13 | Promote your blog
14 | =================
15 |
16 | ------------------------------------------------------------------------
17 |
18 | Put its URL everywhere!
19 | =======================
20 |
21 | Your ORCID profile, Twitter profile, GitHub profile, etc.
22 |
23 | No dead ends please!
24 |
25 | ------------------------------------------------------------------------
26 |
27 | R Weekly
28 | ========
29 |
30 | Weekly newsletter featuring links to blog posts but also slidedecks, etc., about R.
31 |
32 | - One-off sharing: [web form](https://rweekly.org/submit), [PRs](https://github.com/rweekly/rweekly.org).
33 |
34 | - Add your RSS feed via the [web form](https://rweekly.org/submit).
35 |
36 | ------------------------------------------------------------------------
37 |
38 | R Bloggers
39 | ==========
40 |
41 | Ingests the entire feed and repost posts.
42 |
43 | It can take time from [feed submission](https://www.r-bloggers.com/add-your-blog/) to feed validation.
44 |
45 | ------------------------------------------------------------------------
46 |
47 | Social media
48 | ============
49 |
50 | E.g. Twitter.
51 |
52 | Write a clear text, post URL, add a few hashtags, image (or carefully crafted infographics?) + alternative text.
53 |
54 | ------------------------------------------------------------------------
55 |
56 | SEO
57 | ===
58 |
59 | Search Engine Optimization
60 |
61 | - Add links to your post
62 |
63 | - Read resources by marketers
64 |
65 | ------------------------------------------------------------------------
66 |
67 | Interact with readers
68 | =====================
69 |
70 | ------------------------------------------------------------------------
71 |
72 | How to interact with readers?
73 | =============================
74 |
75 | On social media?
76 |
77 | In comments? For Hugo, [Utteranc.es as an alternative to Disqus](https://masalmon.eu/2019/10/02/disqus/).
78 |
79 | ------------------------------------------------------------------------
80 |
81 | Negative feedback
82 | =================
83 |
84 | (not constructive feedback)
85 |
86 | Have a support system.
87 |
88 | You don't have to respond publicly, or at all.
89 |
90 | If *you* were wrong, listen and do better.
91 |
92 | ------------------------------------------------------------------------
93 |
94 | Encouraging citations
95 | =====================
96 |
97 | ------------------------------------------------------------------------
98 |
99 | Citing your posts
100 | =================
101 |
102 | - Distill metadata
103 |
104 | - Hugo [custom layout](https://github.com/statnmap/hugo-statnmap-theme/blob/3e2a54a9836fdd65779865e91058ba304b628336/layouts/partials/citation.html)
105 |
106 | - [DOI](https://twitter.com/mfenner/status/1126523120591020032)?
107 |
108 | ------------------------------------------------------------------------
109 |
110 | Analytics
111 | =========
112 |
113 | ------------------------------------------------------------------------
114 |
115 | Analytics
116 | =========
117 |
118 | - Do you need numbers? E.g. if you blog at work.
119 |
120 | - Are you ok using Google Analytics?
121 |
122 | - GDPR :wink:
123 |
124 | - Alternatives? [Fathom](https://usefathom.com/)? Others?
125 |
126 |
--------------------------------------------------------------------------------
/content/intro/slides/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: Scientific R Markdown blog?
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | ---
10 |
11 | # Scientific blogging with R Markdown
12 |
13 | :wave: Welcome!
14 |
15 | ---
16 |
17 | I'm Maëlle, I like R, blogging and science.
18 |
19 | {{% fragment %}}
20 |
21 | :house: https://masalmon.eu
22 |
23 | {{% /fragment %}}
24 |
25 |
26 | ---
27 |
28 | # Why blog?
29 |
30 | ---
31 |
32 | * Notes for future you
33 |
34 | * Passion for sharing?
35 |
36 | * Opportunities
37 |
38 | ---
39 |
40 | Teaching this course is an opportunity I got from blogging but blogging is not a pyramid scheme :wink:
41 |
42 | ---
43 |
44 | # Why create blog?
45 |
46 | What if I don't really want to blog regularly?
47 |
48 |
49 |
50 | - {{% fragment %}}Have a platform to share stuff when you need to.{{% /fragment %}}
51 | - {{% fragment %}}Portfolio. In particular, imagine someone recommending you for a thing.{{% /fragment %}}
52 |
53 |
54 | ---
55 |
56 | # What is a website?
57 |
58 | * static: HTML, CSS, JS
59 |
60 | * non static: more machinery on the server side
61 |
62 | Online server somewhere.
63 |
64 | ---
65 |
66 | # Why Rmd for blogging?
67 |
68 | - {{% fragment %}}Data analysis with R{{% /fragment %}}
69 | - {{% fragment %}}Blogging about R{{% /fragment %}}
70 | - {{% fragment %}}R as an utility tool e.g. to generate text from structured data{{% /fragment %}}
71 | - {{% fragment %}}knitr supports other languages...{{% /fragment %}}
72 |
73 | ---
74 |
75 | # WHAT is a scientific Rmd blog?
76 |
77 | ---
78 |
79 | IMHO :smile_cat:
80 |
81 | I'll list criteria so we have something to compare our adventures to.
82 |
83 | ---
84 |
85 | # Tech part
86 |
87 |
88 |
89 | * {{% fragment %}}Easy way to update from Rmd without too much copy-pasting{{% /fragment %}}
90 |
91 | * {{% fragment %}}Fits into your existing workflow or uses things you want to learn and invest time in{{% /fragment %}}
92 |
93 | * {{% fragment %}}Code, syntax highlighting{{% /fragment %}}
94 |
95 | * {{% fragment %}}Modern tooling (html5? mobile friendly?){{% /fragment %}}
96 |
97 |
98 | ---
99 |
100 | # Science part
101 |
102 | * {{% fragment %}}References from a .bib file{{% /fragment %}}
103 |
104 | * {{% fragment %}}Easy way to cite posts?{{% /fragment %}}
105 |
106 | * {{% fragment %}}Equations {{% /fragment %}}
107 |
108 | * {{% fragment %}}Content. Blog about science, or stuff relevant to science&co (e.g. comparisons of way to fit and present linear models in R).{{% /fragment %}}
109 |
110 | ---
111 |
112 | # Human part
113 |
114 | * {{% fragment %}}Accessible. Alt text, contrast. Don't add gate-keeping to science.{{% /fragment %}}
115 |
116 | * {{% fragment %}}You OWN it. Content, URL (no commercial service, no employer).{{% /fragment %}}
117 |
118 | * {{% fragment %}}Allows for interactions (social media? commenting?){{% /fragment %}}
119 |
120 | * {{% fragment %}}Costs a few dollars a month at most.{{% /fragment %}}
121 |
122 | ---
123 |
124 | # Let's go
125 |
126 | * {{% fragment %}}distill{{% /fragment %}}
127 |
128 | * {{% fragment %}}Hugo&hugodown{{% /fragment %}}
129 |
130 | * {{% fragment %}}WordPress{{% /fragment %}}
131 |
132 | * {{% fragment %}}Reproducibility{{% /fragment %}}
133 |
134 | * {{% fragment %}}Promotion{{% /fragment %}}
135 |
136 | * {{% fragment %}}Debrief{{% /fragment %}}
137 |
138 | ---
139 |
140 | # We'll start with a tour of the course website
141 |
142 | https://tiny.cc/rmd-blog
143 |
--------------------------------------------------------------------------------
/content/hugo/slides/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: Hugo & hugodown
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | countdown: true
10 | ---
11 |
12 | # Hugo and hugodown
13 |
14 | A powerful static generator, a handy WIP package
15 |
16 | ---
17 |
18 | # [Hugo](https://gohugo.io/)
19 |
20 | Powerful and fast static generator
21 |
22 | Only an .exe to install :tada:
23 |
24 | ---
25 |
26 | # [hugodown](https://hugodown.r-lib.org/)
27 |
28 | [R :package:](https://hugodown.r-lib.org/)
29 |
30 | * An R Markdown output format
31 |
32 | * Handy helpers
33 |
34 | Experimental but the best bet in my opinion.
35 |
36 | ---
37 |
38 | # From Rmd to website
39 |
40 | Under the hood
41 |
42 | ```{=html}
43 | {{}}
44 | graph LR;
45 | A[Rmd] --> |"R ( hugodown :package:, downlit :package:) & Pandoc"| B{md}
46 | B --> |"Hugo (Goldmark, Chroma)"| C[HTML]
47 | {{< /mermaid >}}
48 | ```
49 |
50 | Inspired by [Emi Tanaka's post](https://emitanaka.org/r/posts/2018-12-12-scientific-and-technical-blogging-radix-vs-blogdown/)
51 |
52 | ---
53 |
54 | # From Rmd to website
55 |
56 | What you do
57 |
58 | ```{=html}
59 | {{}}
60 | graph LR;
61 | A[Rmd] --> |":large_blue_circle: knit button"| B{md}
62 | B --> |"hugo build (locally or cloud)"| C[HTML]
63 | {{< /mermaid >}}
64 | ```
65 |
66 | ---
67 |
68 | No syntax highlighting :expressionless:
69 |
70 | ```{=html}
71 |
ggplot2::ggplot()
72 |
73 | ```
74 |
75 | Chroma syntax highlighting :+1:
76 |
77 | ````{=html}
78 | ```r
79 | ggplot2::ggplot()
80 | ```
81 | ````
82 |
83 | downlit syntax highlighting :smiley:
84 |
85 | ```{r, eval = FALSE}
86 | ggplot2::ggplot()
87 | ```
88 |
89 | ---
90 |
91 | ```{=html}
92 | {{< figure src="/images/highlight.jpg" alt="A meme to explain why downlit is great" height="550" >}}
93 | ```
94 |
95 | Inspired by [Mara Averick](https://twitter.com/dataandme/status/1255510799273132032)
96 |
97 | ---
98 |
99 | # hugodown syntax highlighting
100 |
101 | * downlit for R :tada:
102 |
103 | * Chroma for other languages :sparkles:
104 |
105 |
106 | ---
107 |
108 | :mountain_cableway: Time for a demo!
109 |
110 | [Notes on the course website](/hugo/demo/)
111 |
112 | ---
113 |
114 | Scientific Rmd Blog Checklist
115 |
116 | * [x] R Markdown
117 | * [x] Syntax highlighting
118 | * [x] Modern
119 | * [x] .bib
120 | * [?] Citation for posts (possible but custom layout)
121 | * [x] Equations
122 |
123 | ---
124 |
125 | # Sustainability
126 |
127 | Created by:
128 |
129 | ```{r, echo=FALSE, results="asis"}
130 | glue::glue_collapse(
131 | trimws(
132 | gsub("<.*>", "",
133 | desc::desc_get_author(file = find.package("hugodown"), role = "aut")
134 | )
135 | ),
136 | sep = ", ")
137 | ```
138 |
139 | Used for [tidyverse.org](https://tidyverse.org), in particular.
140 |
141 | [Active development](https://github.com/r-lib/hugodown/).
142 |
143 | ---
144 |
145 | # Limitations?
146 |
147 | * hugodown is a WIP package. One easy to use theme only at the moment, but a great one!
148 |
149 | * Hugo changes a lot (but hugodown helps protect your projects from that)
150 |
151 | ---
152 |
153 | # Further resources
154 |
155 | [Listed on the course website](/hugo/further-resources/) :ledger:
156 |
157 | ---
158 |
159 | # Questions, comments?
160 |
161 | Write them in the pad!
162 |
163 | ---
164 |
165 | # Time for a break :tea:
166 |
167 |
168 |
169 |
170 |
171 | 05:00
172 |
173 |
174 |
175 |
--------------------------------------------------------------------------------
/content/distill/slides/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: distill
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | countdown: true
10 | rmd_hash: f958a4a6947e9d10
11 |
12 | ---
13 |
14 | Distill
15 | =======
16 |
17 | ------------------------------------------------------------------------
18 |
19 | [Distill](rstudio.github.io/distill/) is both a framework and an R package.
20 |
21 | > Distill for R Markdown is a web publishing format optimized for scientific and technical communication.
22 |
23 | ------------------------------------------------------------------------
24 |
25 | - Output format for single documents
26 |
27 | - Websites
28 |
29 | - Blogs, like websites but with blog posts than aren't re-rendered automatically.
30 |
31 | ------------------------------------------------------------------------
32 |
33 | Helpers like [`distill::create_post()`](https://rdrr.io/pkg/distill/man/create_post.html)
34 |
35 | ------------------------------------------------------------------------
36 |
37 | From Rmd to website
38 | ===================
39 |
40 | Under the hood
41 |
42 | {{}}
43 | graph LR;
44 | A[Rmd] -->|"R ( distill :package:) & Pandoc & Distill framework" | B[HTML]
45 | {{< /mermaid >}}
46 |
47 | Inspired by [Emi Tanaka's post](https://emitanaka.org/r/posts/2018-12-12-scientific-and-technical-blogging-radix-vs-blogdown/)
48 |
49 | ------------------------------------------------------------------------
50 |
51 | From Rmd to website
52 | ===================
53 |
54 | What you do
55 |
56 | {{}}
57 | graph LR;
58 | A[Rmd] -->|" :large_blue_circle: knit button" | B[HTML]
59 | {{< /mermaid >}}
60 |
61 | ------------------------------------------------------------------------
62 |
63 | :train: Time for a demo!
64 |
65 | [Notes on the course website](/distill/demo/)
66 |
67 | ------------------------------------------------------------------------
68 |
69 | Scientific Rmd Blog Checklist
70 |
71 | - [x] R Markdown
72 | - [x] Syntax highlighting (for all knitr-supported languages)
73 | - [x] Modern
74 | - [x] .bib
75 | - [x] Citation for posts
76 | - [x] Equations
77 |
78 | ------------------------------------------------------------------------
79 |
80 | Sustainability
81 | ==============
82 |
83 | Created by:
84 |
85 |
134 |
135 | Used for [tidyverse.org](https://tidyverse.org), in particular.
136 |
137 | [Active development](https://github.com/r-lib/hugodown/).
138 |
139 | ------------------------------------------------------------------------
140 |
141 | Limitations?
142 | ============
143 |
144 | - hugodown is a WIP package. One easy to use theme only at the moment, but a great one!
145 |
146 | - Hugo changes a lot (but hugodown helps protect your projects from that)
147 |
148 | ------------------------------------------------------------------------
149 |
150 | Further resources
151 | =================
152 |
153 | [Listed on the course website](/hugo/further-resources/) :ledger:
154 |
155 | ------------------------------------------------------------------------
156 |
157 | Questions, comments?
158 | ====================
159 |
160 | Write them in the pad!
161 |
162 | ------------------------------------------------------------------------
163 |
164 | Time for a break :tea:
165 | ======================
166 |
167 |
168 |
169 |
170 |
171 | 05:00
172 |
173 |
174 |
175 |
176 |
177 |
--------------------------------------------------------------------------------
/content/hugo/further-resources.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | menuTitle: Further resources
3 | title: More about Hugo & hugodown
4 | weight: 7
5 | ---
6 |
7 | ## Read the manual :wink:
8 |
9 | You can read the [whole hugodown docs](https://hugodown.r-lib.org/) and probably should especially as hugodown evolves.
10 |
11 | Also read the docs of the theme you choose.
12 |
13 | You might not need to read [Hugo docs](https://gohugo.io/documentation/), that are much longer, much more overwhelming: you mostly only need to read Hugo docs when you need to tweak or customize a theme.
14 |
15 | ## Follow developments? :eyes:
16 |
17 | If you start using Hugo & hugodown for your website...
18 |
19 | * [Watch development on GitHub](https://help.github.com/en/github/managing-subscriptions-and-notifications-on-github/viewing-your-subscriptions#configuring-your-watch-settings-for-an-individual-repository) of hugodown, of the theme?
20 |
21 | * Subscribe to the [hugodown issues](https://github.com/r-lib/hugodown/issues) that are interesting to you?
22 |
23 | ## Contributing guide for your website :pencil:
24 |
25 | Personal website: take notes to not forget what you tweaked, etc.
26 |
27 | Collaborative website: even Hugo users might not know your website structure!
28 |
29 | * [rOpenSci blog guide](https://blogguide.ropensci.org/)
30 |
31 | * [golemverse website contributing guide](https://github.com/ThinkR-open/golemverse.org/blob/master/how-to.Rmd)
32 |
33 | ## Where to get help? :wave:
34 |
35 | * [RStudio community forum](https://community.rstudio.com/c/R-Markdown/10) (RMarkdown category)
36 |
37 | * [hugodown issue tracker](https://github.com/r-lib/hugodown/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
38 |
39 | * If you start tweaking Hugo templates, [Hugo forum](https://discourse.gohugo.io/)
40 |
41 |
42 | ## Hugo Academic :mortar_board:
43 |
44 | Hugo Academic has [excellent docs](https://sourcethemes.com/academic/docs/).
45 |
46 | You can build many different websites with Hugo Academic, see a few examples below.
47 | The theme is very versatile, and widely used in the R community.
48 |
49 | | Website | Source |
50 | |---|---|
51 | |[Yanina Bellini Saibene's personal website](https://yabellini.netlify.app/)| [](https://github.com/yabellini/SitioAcademico) |
52 | |[Metadocencia website](https://www.metadocencia.org/)| [](https://github.com/MetaDocencia/SitioWeb) |
53 | |[Personal website of Alison Presmanes Hill ](https://alison.rbind.io/)| [](https://github.com/rbind/apreshill) |
54 | |["Communicating with R Markdown" workshop by Alison Hill](https://ysc-rmarkdown.netlify.app/)| [](https://github.com/rstudio-education/communicate-rmd-workshop) |
55 |
56 |
57 | There's a [Python CLI to import your publications](https://github.com/sourcethemes/academic-admin), featured in [the blog post "Fixing Imports to Hugo"](https://dyerlab.org/post/fixing-imports-to-hugo/)
58 |
59 | ## Other Hugo themes :school_satchel:
60 |
61 | * Browse the [gallery](https://themes.gohugo.io/). [Choose your theme wisely](https://masalmon.eu/2020/02/29/hugo-maintenance/#choose-your-theme-wisely-and-keep-in-touch). Use Hugo docs to create new site.
62 |
63 | * [Hire someone](/webdev/hire/)?
64 |
65 | ## Another R package: blogdown :package:
66 |
67 | [blogdown](https://bookdown.org/yihui/blogdown/) is an alternative to hugodown. [hugodown vs blogdown](https://hugodown.r-lib.org/#compared-to-blogdown)
68 |
69 | ## Hugo and CMS :computer:
70 |
71 | To give a less technical interface to a Hugo website, you could use a CMS, see for instance [what Steph Locke set up in this website with Netlify CMS](https://github.com/hzi-braunschweig/serohub).
72 |
73 | ## Hugo template development/tweaking :nut_and_bolt:
74 |
75 | * How _I_ started: I needed to tweak one thing in an existing theme and I googled that thing; then I had to tweak one more thing; etc. Others might have built a theme from scratch.
76 |
77 | * [Mike Dane's tutorials](https://www.mikedane.com/static-site-generators/hugo/)
78 |
79 | * Threads indicating resources for beginners and the lack thereof: [2018](https://discourse.gohugo.io/t/comprehensive-hugo-tutorial-for-beginners/12586), [2019](https://discourse.gohugo.io/t/list-of-comprehensive-tutorials-for-beginners-2019/19654)
80 |
81 | * What you must know according to Steph Locke
82 |
83 | {{< tweet 1275677183915286531 >}}
84 |
85 | * More advanced
86 |
87 | {{< tweet 1275678631482834944 >}}
88 |
89 | * [Alison Hill's post on troubleshooting your build, and her other posts about Hugo](https://alison.rbind.io/post/2019-03-04-hugo-troubleshooting/), [Alison Hill's favourite Hugo resources](https://summer-of-blogdown.netlify.app/day-04/#deeper-dives)
90 |
91 | * [Lukas Burk posts about Hugo](https://blog.jemu.name/tags/hugo/)
92 |
93 | * [My Hugo posts on rOpenSci website](https://ropensci.org/tags/hugo/) and [on my blog](https://masalmon.eu/tags/hugo/)
94 |
95 | * [Julia Evan's blog post "Switching to Hugo"](https://jvns.ca/blog/2016/10/09/switching-to-hugo/)
96 |
97 | * [Tim Mastny's "Intro to Hugo: The Masterchef of Layouts"](https://timmastny.rbind.io/blog/intro-hugo-blogdown-chef/)
98 |
99 |
--------------------------------------------------------------------------------
/content/wordpress/slides/index.en.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | outputs:
3 | - Reveal
4 | title: R Markdown & WordPress
5 | hidden: true
6 | layout: list
7 | weight: 1
8 | output: hugodown::md_document
9 | countdown: true
10 | ---
11 |
12 | # WordPress
13 |
14 | ---
15 |
16 | # Why use WordPress?
17 |
18 | * Clicking to design the interface
19 |
20 | * Internationalization
21 |
22 | * Open Source
23 |
24 | ---
25 |
26 | # Why NOT use WordPress
27 |
28 | * Performance?
29 |
30 | * Security?
31 |
32 | If you use WordPress, read the docs.
33 |
34 | ---
35 |
36 | # Do you use WordPress?
37 |
38 | ---
39 |
40 | # Workarounds for no WordPress
41 |
42 | * Use a subdomain for your R Markdown blog, linked from your main WordPress website.
43 |
44 | * [Netlify CMS](https://www.netlifycms.org/) and other CMS as an user-friendly interface on static websites (like Hugo).
45 |
46 | ---
47 |
48 | # Now, Rmd and WordPress!
49 |
50 | * `knitr::knit2wp()` is now too dated (it uses `RCurl` and `XML`)
51 |
52 | * I made a package using WordPress dot org API!
53 |
54 | * Bob Rudis' package for WordPress dot com API!
55 |
56 | So your choice is between a too old tool and WIP packages. :joy: :sob:
57 |
58 | ---
59 |
60 | # wordpress.com vs wordpress.org
61 |
62 | * Free/cheap wordpress.com: no plugin
63 |
64 | * Business wordpress.com: $$$
65 |
66 | * Your own local server: efforts
67 |
68 | * Paid service hosting+domain name+ WordPress install: a few $ a month
69 |
70 | ---
71 |
72 | # JetPack
73 |
74 | Something you can add to any WordPress website (baked in dot com websites).
75 |
76 | Free and paid features.
77 |
78 | ---
79 |
80 | # Which API
81 |
82 | * wordpress dot com => .com API
83 |
84 | * self-hosted without JetPack => .org API
85 |
86 | * self-hosted with JetPack => .com API
87 |
88 | In my package, support for .org API, but .com coming.
89 |
90 | ---
91 |
92 | # From Rmd to website
93 |
94 | Under the hood
95 |
96 | ```{=html}
97 | {{}}
98 | graph LR;
99 | A[Rmd] --> |"R ( hugodown :package:, downlit :package:) & Pandoc"| B{md}
100 | B --> |"R (xml2 :package: ) & Pandoc"| C[HTML]
101 | C --> |"WordPress"| D[HTML]
102 | {{< /mermaid >}}
103 | ```
104 |
105 |
106 | ---
107 |
108 | # From Rmd to website
109 |
110 | What you do
111 |
112 | ```{=html}
113 | {{}}
114 | graph LR;
115 | A[Rmd] --> |":large_blue_circle: knit button"| B{md}
116 | B --> |"run wp_post()"| C[HTML]
117 | C --> |"Wait"| D[HTML]
118 | {{< /mermaid >}}
119 | ```
120 |
121 |
122 | ---
123 |
124 | # Setup for goodpress (0/3)
125 |
126 | Have a WordPress website that's not a free/cheap plan from wordpress.com :wink:
127 |
128 | [goodpress setup vignette](https://maelle.github.io/goodpress/articles/setup.html)
129 |
130 | ---
131 |
132 | # Setup for goodpress (1/3)
133 |
134 | * Install the [Application Passwords plugin](https://wordpress.org/plugins/application-passwords/)
135 |
136 | * Edit [.htaccess](https://github.com/WordPress/application-passwords/wiki/Basic-Authorization-Header----Missing) (with a plugin?)
137 |
138 | * Create an user with limited rights, and an application password for them. Save secrets in `.Renviron`
139 |
140 | ---
141 |
142 | # Setup for goodpress (2/3)
143 |
144 | For R syntax highlighting :sparkles:
145 |
146 | * Find [my code.css](https://github.com/maelle/goodpress/blob/main/inst/css/code.css) and copy it to your clipboard.
147 |
148 | * From your WordPress admin dasbhoard, go to Appearance > Customize > Additional CSS. Paste the CSS there and click on publish.
149 |
150 | ---
151 |
152 | # Setup for goodpress (3/3)
153 |
154 | If you want to use MathJax for equations.
155 |
156 | From WordPress interface go to Appearance > Theme Editor.
157 | In `` div of `header.php`, then save.
158 |
159 | ```html
160 |
161 |
162 | ```
163 |
164 | ---
165 |
166 | :mountain_railway: Time for a demo!
167 |
168 | [Notes on the course website](/wordpress/demo/)
169 |
170 | ---
171 |
172 | Scientific Rmd Blog Checklist
173 |
174 | * [x] R Markdown
175 | * [x] Syntax highlighting (for R)
176 | * [x] Modern
177 | * [x] .bib
178 | * [?] Citation for posts (add it to all posts? WordPress theme?)
179 | * [x] Equations
180 |
181 | ---
182 |
183 | # Sustainability
184 |
185 | goodpress:
186 |
187 | ```{r, echo=FALSE, results="asis"}
188 | glue::glue_collapse(
189 | trimws(
190 | gsub(")$", "",
191 | gsub("<.*>", "",
192 | desc::desc_get_author(file = find.package("goodpress"), role = "aut")
193 | )
194 | )
195 | ),
196 | sep = ", ")
197 | ```
198 |
199 | [Contributors welcome](https://github.com/maelle/goodpress/).
200 |
201 | pressur:
202 |
203 | ```{r, echo=FALSE, results="asis"}
204 | glue::glue_collapse(
205 | trimws(
206 | gsub(")$", "",
207 | gsub("<.*>", "",
208 | desc::desc_get_author(file = find.package("pressur"), role = "aut")
209 | )
210 | )
211 | ),
212 | sep = ", ")
213 | ```
214 |
215 |
216 |
217 | ---
218 |
219 | # Limitations?
220 |
221 | * WordPress limitations (performance? security? how to tweak a theme)
222 |
223 | * The R part is promising but not stable yet
224 |
225 | ---
226 |
227 | # Further resources
228 |
229 | [Listed on the course website](/wordpress/further-resources/) :bookmark_tabs:
230 |
231 | ---
232 |
233 | # Questions, comments?
234 |
235 | Write them in the pad!
236 |
237 | ---
238 |
239 | # Time for a break :tropical_drink:
240 |
241 |
242 |
243 |