3 min read

This Website. The development story

The criteria set out for this website came squarely down to speed, cost and the lightest possible footprint presently possible for ‘presence’. A static website (Hugo powered) was selected because the content was not in the realm of 1000’s of pages - we think 100’s is more realistic, and should need arise for more we can easily change the layout.

Another consideration driving the minimalist concept is the nature of our content. This website concerns itself with the work of civil pursuing the Sustainable Development Agenda. We need text, all image media, ability to display plots and provide interactive pages but not spend the entire NGO’s budget on professional web development support, bespoke hardware and so on. So, we leant on Open Source.

We decided the Markdown ’language’ was best suited to serve the needs of our future team of writers - as it could also come in handy in their scholastic or work environment. We chose RStudio as our development interface, so writers can get development software for free But, importantly if they are already comfortable and committed to another IDE, say Visual Studio or VScode etc they’re not left behind. Furthermore as Rstudio (Posit) runs on R statistical analyses are a breeze.

You’d find pages load exceptionally fast. Credit is due to Cloudflare who does the heavy lifting for our media files, leaving our ISP (Dreamhost) to serve the HTML/text files.

For the absolutely inquisitive. This is a post written in plain Markdown (*.md) instead of R Markdown (*.Rmd) The laater actually is the base for most every post on this site. The major differences between the .md and ,Rmd are:

  1. R code does not work in a plain Markdown document, whereas in an R Markdown document, you can embed R code chunks (```{r});

  2. A plain Markdown post is rendered through Blackfriday, and an R Markdown document is compiled by rmarkdown and Pandoc.

There are many differences in syntax between Blackfriday’s Markdown and Pandoc’s Markdown. For example, you can write a task list with Blackfriday but not with Pandoc:

  • Write an R package.
  • Write a book.
  • Profit!

Similarly, Blackfriday does not support LaTeX math and Pandoc does. I have added the MathJax support to this theme (hugo-lithium) but there is a caveat for plain Markdown posts: you have to include math expressions in a pair of backticks (inline: `$ $`; display style: `$$ $$`), e.g., $S_n = \sum_{i=1}^n X_i$.^[This is because we have to protect the math expressions from being interpreted as Markdown. You may not need the backticks if your math expression does not contain any special Markdown syntax such as underscores or asterisks, but it is always a safer choice to use backticks. When you happen to have a pair of literal dollar signs inside the same element, you can escape one dollar sign, e.g., \$50 and $100 renders “$50 and $100”.] For R Markdown posts, you do not need the backticks, because Pandoc can identify and process math expressions.

When creating a new post, you have to decide whether the post format is Markdown or R Markdown, and this can be done via the ext argument of the function blogdown::new_post(), e.g.

blogdown::new_post("Post Title", ext = '.Rmd')

Github

A repository for this site exists on Github. Nobody does code as well as Github. Writers, analysts working on map and other data work collaboratively - we find the Project (a tool) comes in really handy for streamlining.

Stay tuned for additions to this page.