Functions to be run on the path to your blog post (rendered, not the Rmd).
ro_lint_md()
should identify some potential problems and enforce:
the use of complete alternative descriptions for image;
the use of Title Case for the title;
the use of Sentence case for other headings;
the absence of “click here” as text for links;
the proper case (lowerCamelCase) for rOpenSci name;
the use of Hugo shortcodes for figures;
the use of Hugo shortcodes for tweets;
the use of relative links for links to rOpenSci website.
You need to run render_one
on the path to the Markdown file. Some Markdown examples and the corresponding messages below.
/cache/roblog/examples/allgood.md
---
slug: "post-template"
title: Wonderful Title
package_version: 0.1.0
authors:
- Author Name
date: 2019-06-04
categories: blog
topicid:
tags:
- Software Peer Review
- R
- community
# delete the line below
# if you have no preferred image
# for Twitter cards
twitterImg: img/blog-images/2019-06-04-post-template/name-of-image.png
---
Save this file under /content/blog/YEAR-MONTH-DAY-slug.md in the local copy of your roweb2 fork.
{{< figure src="orange-mug-near-macbook-3219546.jpg" width="300" link="https://www.pexels.com/photo/orange-mug-near-macbook-3219546/" alt="Laptop keyboard with a tree leaf beside it" class="center" caption="Another type of leaf. [Engin Akyurt on Pexels](https://www.pexels.com/photo/orange-mug-near-macbook-3219546/)." >}}
s
{{< figure src="orange-mug-near-macbook-3219546.jpg" width="300" link="https://www.pexels.com/photo/orange-mug-near-macbook-3219546/" alt="Laptop keyboard with a tree leaf beside it" >}}
### Heading in sentence case
#### Another sentence as heading
All good, huzzah! :-)
/cache/roblog/examples/bad-no-alt.md
---
slug: "post-template"
title: Wonderful title
package_version: 0.1.0
authors:
- Author Name
date: 2019-06-04
categories: blog
topicid:
tags:
- Software Peer Review
- R
- community
# delete the line below
# if you have no preferred image
# for Twitter cards
twitterImg: img/blog-images/2019-06-04-post-template/name-of-image.png
---
Save this file under /content/blog/YEAR-MONTH-DAY-slug.md in the local copy of your roweb2 fork.
[Cool blog](/blog/)
[Broken blog](https://masalmon.eu/40004)
[Broken blog again](https://masalmon.eu/400040)
Beware! If you want to generate this post from R Markdown, use the R Markdown template instead!
Everywhere in this template (YAML, paths to images), you should change "post-template" to the slug of your post, and "2019-06-04" to the publication date.
Introduction including outline of the post.
### First awesome section
I like Hugo[^1]. Yes, that is how you add a footnote.
#### First awesome subsection of the first awesome section
Here's how to use a Hugo shortcode to add an image.
{{< figure src = "/img/blog-images/2019-06-04-post-template/name-of-image.png" width = "200">}}
{{< figure src = "/img/blog-images/2019-06-04-post-template/name-of-image.png" width = "200" alt = "too short">}}
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Finally... hello subtools 1.0! 🥳 Read, write and manipulate subtitles in <a href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw">#rstats</a>. Substantially re-written to integrate with tidytext by <a href="https://twitter.com/juliasilge?ref_src=twsrc%5Etfw">@juliasilge</a> and <a href="https://twitter.com/drob?ref_src=twsrc%5Etfw">@drob</a> <a href="https://t.co/QmCWGk9NOX">https://t.co/QmCWGk9NOX</a> cc <a href="https://twitter.com/ma_salmon?ref_src=twsrc%5Etfw">@ma_salmon</a> <a href="https://t.co/7576oktL7k">pic.twitter.com/7576oktL7k</a></p>— Francois Keck (@FrancoisKeck) <a href="https://twitter.com/FrancoisKeck/status/1200040510540386304?ref_src=twsrc%5Etfw">November 28, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">When I try to become acquainted with a new (to me) <a href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw">#rstats</a> package, I prefer to read ___________</p>— Jonathan Carroll (@carroll_jono) <a href="https://twitter.com/carroll_jono/status/969442252610191361?ref_src=twsrc%5Etfw">March 2, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
{{% figure src = "/img/blog-images/2019-06-04-post-template/name-of-image.png" width = "200" % alt = "an actually good description!"%}}
Ropensci was very nice, cool ropensci.
#### Second awesome subsection
Here's how to use a Hugo shortcode to embed a tweet. We recommend the use of [Hugo shortcodes](https://gohugo.io/content-management/shortcodes/) to include tweets, Vimeo or Youtube videos, gists, etc.
{{< tweet 1138216112808529920 >}}
### Conclusion
Have fun writing your blog post!
[rOpenSci blog](https://ropensci.org/blog)
Here's how to add the footnote text for your reference above.
[^1]: Hugo! https://gohugo.io/
Alternative image description missing or too short for: {{< figure src = “/img/blog-images/2019-06-04-post-template/name-of-image.png” width = “200” alt = “too short”>}}, {{< figure src = “/img/blog-images/2019-06-04-post-template/name-of-image.png” width = “200”>}}.
Use Title Case for the title i.e. “Wonderful Title”. (Ignore this note if the words are e.g. package names)
Please write rOpenSci in lower camelCase, not: Ropensci, ropensci.
Finally… hello subtools 1.0! 🥳 Read, write and manipulate subtitles in #rstats. Substantially re-written to integrate with tidytext by @juliasilge and @drob https://t.co/QmCWGk9NOX cc @ma_salmon pic.twitter.com/7576oktL7k
— Francois Keck (@FrancoisKeck) November 28, 2019
,
When I try to become acquainted with a new (to me) #rstats package, I prefer to read ___________
— Jonathan Carroll (@carroll_jono) March 2, 2018
should be {{< tweet “1200040510540386304”>}}, {{< tweet “969442252610191361”>}}Please replace absolute links with relative links: https://ropensci.org/blog should become /blog.
A bit more work is needed on this striking post draft!
/cache/roblog/examples/badtitle.md
---
slug: "post-template"
title: Wonderful title that is not in title case
package_version: 0.1.0
authors:
- Author Name
date: 2019-06-04
categories: blog
topicid:
tags:
- Software Peer Review
- R
- community
# delete the line below
# if you have no preferred image
# for Twitter cards
twitterImg: img/blog-images/2019-06-04-post-template/name-of-image.png
---
Save this file under /content/blog/YEAR-MONTH-DAY-slug.md in the local copy of your roweb2 fork.
A bit more work is needed on this geometric post draft!
/cache/roblog/examples/clickhereissue.md
---
slug: "post-template"
title: Wonderful Title
package_version: 0.1.0
authors:
- Author Name
date: 2019-06-04
categories: blog
topicid:
tags:
- Software Peer Review
- R
- community
# delete the line below
# if you have no preferred image
# for Twitter cards
twitterImg: img/blog-images/2019-06-04-post-template/name-of-image.png
---
Save this file under /content/blog/YEAR-MONTH-DAY-slug.md in the local copy of your roweb2 fork.
### Heading in sentence case
#### Another sentence as heading
[Good link](https://twitter.com), [Click here](https://twitter.com), [here](https://twitter.com).
A bit more work is needed on this phenomenal post draft!
/cache/roblog/examples/figureissue.md
---
slug: "post-template"
title: Wonderful Title
package_version: 0.1.0
authors:
- Author Name
date: 2019-06-04
categories: blog
topicid:
tags:
- Software Peer Review
- R
- community
# delete the line below
# if you have no preferred image
# for Twitter cards
twitterImg: img/blog-images/2019-06-04-post-template/name-of-image.png
---
Save this file under /content/blog/YEAR-MONTH-DAY-slug.md in the local copy of your roweb2 fork.
### Heading in sentence case
#### Another sentence as heading

A bit more work is needed on this well-made post draft!
/cache/roblog/examples/sentencecaseissue.md
---
slug: "post-template"
title: Wonderful Title
package_version: 0.1.0
authors:
- Author Name
date: 2019-06-04
categories: blog
topicid:
tags:
- Software Peer Review
- R
- community
# delete the line below
# if you have no preferred image
# for Twitter cards
twitterImg: img/blog-images/2019-06-04-post-template/name-of-image.png
---
Save this file under /content/blog/YEAR-MONTH-DAY-slug.md in the local copy of your roweb2 fork.
### Heading in Title Case
#### Another sentence as heading
#### Another Title as Heading
A bit more work is needed on this swell post draft!
ro_check_urls()
will identify possibly broken URLs.
path1 <- system.file(file.path("examples", "bad-no-alt.md"),
package = "roblog")
roblog::ro_check_urls(path1)
#> Possibly broken URLs: https://masalmon.eu/40004, https://masalmon.eu/400040.