Functions to be run on the path to your blog post (rendered, not the Rmd).

Best practice

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


All good, yikes! :-)


/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&amp;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>&mdash; 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&amp;ref_src=twsrc%5Etfw">#rstats</a> package, I prefer to read ___________</p>&mdash; 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.

  • Use Hugo shortcodes to embed tweets, not Twitter html: ,

    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 phenomenal post draft!


/cache/roblog/examples/badtitle.md


  • Use Title Case for the title i.e. “Wonderful Title that is not in Title Case”. (Ignore this note if the words are e.g. package names)

A bit more work is needed on this astounding post draft!


/cache/roblog/examples/clickhereissue.md


A bit more work is needed on this laudable post draft!


/cache/roblog/examples/figureissue.md


A bit more work is needed on this super post draft!


/cache/roblog/examples/sentencecaseissue.md


  • Use Sentence case for headings i.e. “Heading in title case”, “Another title as heading”. (Ignore this note if the words are proper nouns)

A bit more work is needed on this transcendent post draft!

URL validity

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.