
Introduction to Blogdown (R Package) | RStudio Webinar - 2017
This is a recording of an RStudio webinar. You can subscribe to receive invitations to future webinars at https://www.rstudio.com/resources/webinars/ . We try to host a couple each month with the goal of furthering the R community's understanding of R and RStudio's capabilities. We are always interested in receiving feedback, so please don't hesitate to comment or reach out with a personal message. Read more on our blog: https://blog.rstudio.com/2017/09/11/announcing-blogdown/
image: thumbnail.jpg
Transcript#
This transcript was generated automatically and may contain errors.
Hello everyone, this is Yihui, and today I'm going to introduce this R package named blogdown to you and show you how you can make a website using R Markdown and this blogdown package. So first of all, if you don't have any experience with building websites, I think that is great because you just need to follow us a few simple steps and you will have a website up and running in just a few minutes. So if you don't have any experience, I would say congratulations, you don't have many things to worry about.
But if you do have some experience with building websites, I think it'll probably take you several days to get started because there are a few more things to consider. For example, if you have an existing website and you want to migrate to blogdown, that might take some time. I will talk about that later in this webinar. And the second thing is that you may need to spend a huge amount of time tweaking your website themes like styles, CSS, templates, and so on. And that is just because you know all these technologies. You know how to tweak CSS, you know how to write HTML, and if you don't know, you just use the default template and you can start writing your content. But if you do, I think you will be in some trouble.
Anyway, I just want to show you a quick test whether you have any website experience. If at this moment you are smiling at this slide in front of your computer, I think you do have some experience with HTML and web server and websites. So if you can recognize what these t-shirts mean, I think it'll probably take a few days for you to get started with blogdown.
Why blogdown?
So you may think, blogdown, another R package, why yet another tool? If you judge blogdown from the appearance of the websites that it creates, you may think what's the point of yet another tool for building websites? Since we have got plenty of tools, like I guess the most famous one is WordPress or sometimes some people may use like tumblr or medium.com, so we have got plenty of tools. And for all of these website tools, we can create pretty much everything we want. For example, for websites you may have a navigation menu, sidebar, the content of your posts, or the footer, the header, and so on. And if you just look at the websites that blogdown creates, the appearance looks similar, but there are some fundamental differences between blogdown and all these existing tools.
So first of all, blogdown is an R package based on two things. First is R Markdown, and actually R Markdown and Bookdown. I will talk about that in detail later. And the second thing is Hugo. So Hugo is a static website generator, and I will show you the reasons why I chose Hugo in a minute.
So for R Markdown, there are many advantages of using R Markdown. For example, the syntax of Markdown is very simple, or actually it's relatively simple because originally it was very, very simple, but later we added a lot of things to the syntax in R Markdown. And one thing that I hope you can remember is that the simpler the syntax is, the more portable your document is. For example, if you have got a simple R Markdown document, you are not tied to a specific output format. For example, it's not only for HTML output. Imagine you will be able to convert your blog posts or any web pages to PDF, Word, or eBooks very easily. And that is because we use another tool called Pandoc under the hood. So thanks to Pandoc, we can convert a single R Markdown document to many other document formats. And if you use R Markdown, it's not only very convenient for you to maintain your documents, but all of your documents are more reproducible. So because you don't have to cut and paste anything in the output, you just write the source document and compile the source documents to get the output documents.
R Markdown and Bookdown features
So in terms of the Markdown features, you can use most of the most of the features of Markdown if you are familiar with R Markdown. And I want to emphasize here is that besides the traditional features of R Markdown, like you can write paragraphs, section headings, numbered lists, or unnumbered lists, blog quotes, math expressions, tables, images, footnotes, bibliography, or citations, besides all of these features, you can actually use some additional features in the Bookdown package. Just in case you don't know anything about Bookdown, I will show you quickly the Bookdown package.
So the Bookdown package was actually designed to write books. And if you have never heard of this package before, there's a free book named Authoring Books and Technical Documents with R Markdown. You can read it online for free, and you can download a free PDF. And I don't want to show you the full book, but I just want you to read at least the second chapter of the Bookdown book. This is where you can know what you can do in addition to the traditional R Markdown syntax. So there's a lot of other things that you can do with the Bookdown Markdown syntax. For example, you can write equations, you can number them, you can reference the equations, you can actually also write things like theorems and proofs in R Markdown. So that is very convenient, I think.
So of course, you can generate figures and tables, and you can assign captions to your figures. Example figure 2.1 here, and then we can refer to these figures in the body of your document. You can cross-reference them. Similarly, for tables, you can also have table captions. And of course, you can do bibliography and citations. So just a lot more R Markdown features. And you can use HTML widgets, which I will show you examples later. So you can have some interactive widgets on your web pages.
Why Hugo?
So that is some of the Bookdown features. So that means it will be very convenient for you to write technical pages or web pages. So that is R Markdown. And the other thing is Hugo. Hugo is a free and open source package written in the Go language. The main reason that I chose Hugo as the backend of blogdown by default is that it is very easy to install. It is just a single binary that you download from the Hugo website, and there's nothing else, no dependencies. So I wrote a helper function in blogdown named installHugo. So just simply call this function and you will have Hugo installed.
And the second reason is that Hugo is lightning fast. And that is the main reason why I switched my own websites to Hugo from Jekyll. So I have nearly a thousand blog posts over the 10 years. And I found it just too slow to compile my websites using Jekyll. It often took me almost one minute to preview my website locally. That is just way too slow. And after I switched to Hugo, typically it takes about a second to compile a thousand pages. So I was very happy with that. It is very fast to build your website. And Hugo is actually a general purpose website framework. It is not only for blogs. You can build many types of websites using Hugo.
So you might have used other website tools like WordPress, Medium.com, Tumblr, Blogger.com. So you may ask why not all of these tools. And the key thing missing in these tools is R Markdown. So basically there is no R Markdown support in these tools. And even if you have any experience with using these tools, I think you know that even the basic math support is often it either does not exist or the support is very awkward. But in R Markdown, the support for math expressions is very natural. It's basically the latex syntax.
Static vs dynamic websites
And there are a lot of benefits of using static websites compared to dynamic websites. So all of these tools like WordPress, these tools are for dynamic websites and they have to like on the server side, there has to be like a server side language like PHP and there has to be databases. But for static websites like the websites built from Hugo, your website is completely static and it's basically a folder of files and there's no other dependencies like a server side language or databases. So you basically you will get a bunch of static HTML files and CSS files, JavaScript files and just a bunch of files. And you can upload these files anywhere and they will just work there. And the setup for on the server side is typically very simple. There's no need to install PHP or databases and you don't have to log in or use password on your website because simply because all these files are static, there's nothing, there's nowhere to log in. And that means your website will be more secure. So because you don't have any passwords for any hackers to steal.
And your static website will also work locally and very easy. And even if you don't have internet access, you will still be able to view your website locally. And because all these files are static, typically your website will be very fast to visit. There will not be any computation needed on the server side. And it's also very easy to speed up your website using a technology named CDN, which stands for content delivery network. That basically means all of your static files can be copied to servers worldwide. For example, there might be a server in Los Angeles on the West Coast. There might be a server on the East Coast in New York. So everybody can have fast access to your website because your website consists of static files that can be copied to many places.
And just to talk about some personal experience with different types of websites. So I have been blogging since 2005. And I've used several PHP applications before, including WordPress. But I had never felt I truly owned a website until I switched to static websites. Because, for example, when I was using WordPress, it is open source, but it is still a big black box to me. And it was difficult for me to maintain because there are many other things to consider like PHP databases. And after I switched to static websites, I can see my website is just basically some static files that I can see locally on my computer. Whenever I need to move my website to another place, I just copy all of these static files to that server and I'm done. And that makes me feel, oh, I own, I truly own this website because my website is nothing but this folder of static files.
And that makes me feel, oh, I own, I truly own this website because my website is nothing but this folder of static files.
So talking about static site generators, and there are many other static website generators as well. The most famous one might be Jekyll. So it is a generator written in Ruby. So as I said, Jekyll was too slow for me. And the, I didn't really enjoy the dependency hell because it's a Ruby gem. And there's, it has a lot of dependencies, so which makes it more difficult to install. But we will support Jekyll in blogdown anyway, in the future. So we have also heard some good words about Hexel. And if you have used that, I would like to know what you think about it. And we will also try to support it in the future as well. So unless you have strong reasons to go with other generators, and if you do have these reasons, I would love to know them. And I would recommend you to stay with Hugo.
So sometimes I feel just, I'm just like an R Markdown virus because I'm injecting R Markdown to many other tools like Hugo. So whenever I see a wonderful tool like Hugo, I will think to myself, oh, how about adding R Markdown to this? So that is how blogdown was born.
Getting started with blogdown
So if you want to get started with blogdown, it's actually pretty simple. You don't have to use RStudio, but for this webinar, I will use RStudio for demos. So basically, if you use RStudio, you just create a new empty project. And if you don't use RStudio, you just change your working directory to an empty directory using the function setwd. So after you are under an empty directory, you can install the blogdown package from GitHub using dev tools installed on GitHub. So after you install the blogdown package from GitHub, there is only one function that you need to call to create a new website, which is the new site function in blogdown. So if you are brave enough and you are using a daily version of RStudio, you can actually create a new website project using the menu file in new project. And I will show you in a minute how you could do that.
Hugo website structure
So before I show you a real website, let me just give you a quick overview of the structure of a typical Hugo website. So typically, a Hugo website consists of a config file, and then a couple of folders. So there will be the main directory that you will be working under is the content directory. So that is where you put all of your Markdown or R Markdown source documents. So that is the content of your website. For example, you may have an about page, so which could be a Markdown file named about.md. And you may also have a post directory for all of your blog posts. And under this post directory, you may have a series of blog posts, Markdown files or R Markdown files.
And there will be a themes directory where you put Hugo themes. And I will show you a couple of themes in a minute. And there will also be a static directory. And that is where you put all of your static files like images, CSS files, JavaScript files, and all of these files will be copied to the public directory when Hugo builds your website. And for the public directory, this is basically the generated website that can be uploaded to any web server. For example, you can upload all of these files under the public directory to Netlify or GitHub Pages or Amazon S3, and you will have your static website up and running. So basically, all the source files under the content directory, and all the static files under the static directory will be rendered to the public directory. So the public directory is what you will publish and deploy.
And then in terms of the individual pages or posts, they are either a Markdown file or an R Markdown file. And I think most of you must be familiar with the structure of an R Markdown document. So basically, in the beginning, you will have some YAML metadata where you specify things like the title and author and date of your document. And then you will start writing the body of your document.
Live demo
So as I said, you can either create an empty project in RStudio and use the function new site to create a new website. Or if you're using a daily version of RStudio, you can actually create a website project directly from this wizard. So I will just use the website project here. So I will click website using blogdown. And then I will choose a directory name. For example, I will say test-blogdown. And for now, I'm just using the default theme, which is called Hugo-Lithium theme. So we use the default theme and I will create the directory test-blogdown under the documents directory here. So open that website project in a new session. I will say create project. And then I have a new website project here.
So if I go to my documents folder, I will see a new directory named test-blogdown. So under this test-blogdown directory, I have a couple of files and directories like what I just mentioned to you, the content directory, the static directory, the themes directory in the config file. So when I build this website, you will see a new directory named public. So for every Hugo website, typically, there will be a config file named config.toml. So it doesn't matter if you are not familiar with toml. It's very similar to YAML. So even if you have never heard of it before, I think you will be able to guess what these options actually mean.
So when you open a new website project, and if you have installed the blogdown package, and you are using a recent version of RStudio, it doesn't have to be the daily version of RStudio. Just a recent release version of RStudio, you will see some add-ins in blogdown. So from the add-ins menu, you can see the add-ins like new post, surf site, update metadata. So for now, I'm going to use the surf site add-in. If I click that add-in, blogdown will compile my website and start a local server and show the websites in the RStudio viewer. So you can see now I have got a new website up and running.
So there are some sample posts in the default example. So some are just meaningless. Here's an R Markdown example. So let's go to the source directory. So as I said, when you build this website, there will be a new public directory. So that is where Hugo renders your website. And the directory that you will be working under is most likely the content directory. So if you go to content directory, you will see some pages like the about page, and you will also see a post directory. You don't have to follow this structure under the content directory. You can have arbitrary structure here.
So I just want to show you the source of the posts like the R Markdown post. There is a source file named r-rmarkdown.rmd with a date prefix. So that is the source of this post. Hello, R Markdown. So after you have used the serve site add-in, the website in your RStudio viewer will be listening to changes in any of your source files. Like, I can update anything here. So for example, I can add a new section. Let's say, hello, R Markdown. So all you need to do from now on is just write your content and then save it. So if I click save this document, R Markdown will know that there are changes in your source directory, and it will automatically recompile your website and refresh the page in RStudio viewer.
So I think that is very convenient. You don't have to click any buttons like make this document or build this website. All you have to do is to update your document and save it and that's it.
So as I said, you can use some markdown features like you can assign like figure captions to your R plots. For example, here I'm using the letter chunk option, figure.cap. That basically means the caption of this figure. So then I will have the figure caption and it is also numbered as the figure number one.
So, well, this is my personal favorite pie chart that shows you the sky, the sunny side of the pyramid and the shady side of the pyramid. And I hope you can enjoy this default example. So besides figures and tables, you can play with HTML widgets. So I will just show you a simple widget of data tables using the package named DT. So I can add a code chunk to my post and I will say here is the widget created from the DT package. And then I will save it and blogdown will automatically rebuild my website and refresh this page. So now you will have a data table on your website and it is interactive and you can use any other HTML widgets like leaflet or packages like that.
Hugo themes
So the default theme, Hugo Lithium, is a very, very simple and minimal theme. And that is also the theme I'm using for my own website. Of course, you can use many other themes from Hugo, so I didn't. Let me just show you the possible themes that you may use with Hugo. So if you go to the Hugo website, the Hugo themes website, themes.gohugo.io, you will see there are a lot of themes contributed from the Hugo users. And you can pick your favorite theme here and pass the address to the new site function in blogdown and you will have a website using the new theme. Let me show you some examples.
So the ghost writer theme is also a minimal theme. So let's create a new website project again using a different theme. So I'm still using this wizard website using blogdown. Now I'm creating a website under a new directory. Let's say test-ghost. And here in this build Hugo theme, I changed the default theme to the ghost writer theme. I'll open the project in a new session, create project. Now I've got another website using a different theme. Again, I just click the add-in serve site. So now I can see still some, so the posts are pretty much the same, like hello arm down, you have seen this before, but the theme is very different now. So that is the ghost writer theme.
And of course, we can use other fancier themes. So if you're in the academia, I strongly recommend this Hugo academic theme. This is very good for you to show your personal profile, especially when you have some courses to teach, you have some publications. Let's say Hugo academic and change the theme to Hugo academic. And then create a new project. And serve site. Okay, so now you've got another theme, which looks like this. So basically you can have your picture here, your name, your job or your affiliation, your biography, education, publications, talks. You can still write blog posts, your projects, your courses that you teach, your contact information. And I think this theme is very good for people working in the academia.
So by default, the configuration file will be open. So the configuration file is config.toml. So as I said, even if you are not familiar with toml, you can probably figure out what some of these options actually mean. For example, title means the title of your website. You can certainly change that to, for example, my cool website. And you can save it. And now you can see the title is changed to my cool website. And of course, you can change your name. Let's change that to my own name. And change my role on my software. Now you can see the name is changed to my name and my role and my affiliation.
So that is how you can update your website. And this theme is also very responsive, meaning that if the page width is very small, for example, if you are reading this page on your mobile phone, the style will change according to the available width. So for example, the menu is collapsed here under this icon when the screen is very narrow. But when there's enough space to show everything, for example, your profile image, then the style will be slightly different.
So that is the academic theme. Let me show you one more thing, just in case you love fancier themes. So the last theme is named Tranquil Pig Theme. All right, again, sub-site. So that is how this Tranquil Pig Theme looks like. Basically, there is a sidebar, and then there is a list of posts. And for every single post, you can assign a header image or a thumbnail. So for example, you can see a header image for this post, and you can see some thumbnail images for the rest of the posts. And it is also responsive. So when the page is relatively narrow, you can see the sidebar is collapsed into a list of icons. You can use pretty much anything you can find from the Hugo Themes website.
But my personal advice is that in the beginning, I don't recommend you to use very fancy or complicated themes. I would recommend you to spend more time on creating the content of your website instead of wrestling with CSS or JavaScript files. So I know you will not listen to me, but I want to mention this anyway. So no matter how fancy your current theme is, you will surely be tired of that fancy theme someday. So that is just my own experience. I have used a lot of themes, including WordPress themes in the past, and eventually I converged to this very minimal theme, Hugo Lithium Theme. So it's basically there is a header, then there's the content of your page, and then there's a footer. So that is just a very, very minimal theme. And at the moment, I'm very happy with this minimal theme. There's nothing fancy, but this makes me feel that I can focus on writing my content instead of wrestling with the theme forever.
blogdown internals and helper functions
All right. So I also want to mention some of the internals of blogdown. So basically, as I said, blogdown is pretty much the combination of Hugo and R Markdown. But for Hugo, it can only process Markdown files using another Markdown engine named Black Friday. You can know more about Black Friday from the Hugo website. So Hugo does not use Pandoc. So that is pretty much the whole motivation of blogdown. We want to use Pandoc's Markdown syntax instead of Black Friday's. So the way that blogdown works is that we will compile your R Markdown files to HTML files and pass the results to Hugo, and Hugo will pick the output from R Markdown and Pandoc and build the website. So it will basically bypass the Markdown engine in Hugo.
And there are a few helper functions in this package. So as I have already mentioned, the new site function, which you can create a new website, potentially using a different theme other than the default theme. So if you have not installed Hugo before, you can use the install Hugo function. And if you want to install an additional theme, you can use the install theme function. And if you want to automatically rebuild and reload your website, you can use the serve site function or equivalently using the RStudio add-in serve site.
And there's also a new post function, which I think is also very handy. The new post function can create a new blog post for you. And let me show you a quick example of the new post function. So basically, you can either use that function or the add-in named new post. So if you click this new post add-in, you can just fill out all the information related to your post. For example, you can say hello, blogdown, and you can choose the date of that post. And you can decide the subdirectory to put that post. And you can change the file name if you want. And there are many other things for you to tweak. And you can interactively select categories or tags. And of course, you can add new categories by just typing here. And then you can add a new category there. And you can also select tags there. And then you can decide whether you want your post to be markdown or rmarkdown file. Then you can click done. And blogdown will call the function new post to create a new post and open that automatically in RStudio. So now you can just start writing the content of your blog post. And I think that one is very useful.
So in terms of the RStudio IDE support, we have the add-ins. And there's only one add-in that I didn't mention, which is the add-in named update metadata. So this is for you to change the metadata. For example, sometimes you may want to change the information about your post. Like I want to delete a category here, so I just delete it. And then I hit done. You can see under the categories option, I only have one category now. So that is the update metadata add-in.
And typically your workflow will be something like you open your website project and you click the serve site add-in. And then you start writing your post or revise your old pages or post. And all you have to do is just to write and save. And then your website will be automatically previewed in RStudio Viewer.
Migrating existing websites
So if you have already got a website and you have to migrate to Hugo, for example, if you have a Jekyll website, I recommend you to go to the Hugo themes website and then pick a theme that you like. And then basically the rest of the things you need to do is to copy or mark down pages and posts to the new website. And then clean up, probably you need to clean up the YAML metadata of your old pages. And just to give you an idea of how difficult that is, it took me five hours in total to migrate the SimpliStatistics blog from Jekyll to Hugo. And I don't think that is very bad. So if you have a theme that you like from the Hugo website, good. I don't think it will take very long for you to migrate from Jekyll to Hugo. Otherwise, you will have to rewrite your theme using the new Hugo syntax. And I think that will take a lot of time.
And if you have a WordPress website, I recommend you to convert your website to Jekyll first and then go from Jekyll to Hugo. And there's a very convenient tool named ExitWP, which is a Python tool. And basically, there are instructions on the website of ExitWP. Basically, you just export your WordPress posts to XML and use a command line to convert WordPress posts to markdown files.
Publishing with Netlify
And after you have built your website, you need to publish it. So there are many, many possibilities to publish it. And I will only mention one today. I know some of you might be familiar with GitHub Pages, but I don't think that GitHub Pages is still a good option compared to a new approach, a new service named Netlify. So basically, I would say Netlify is the new and much more flexible GitHub Pages. And just a disclaimer, Netlify didn't pay me to say this, but I really love their service.
So Netlify has Hugo support on their server. So basically, you only have to push your source files to a GitHub repository and then connect your Netlify account with your GitHub repository. And then in the future, whenever you push to GitHub, Netlify will automatically rebuild your website. And it also provides free CDN content delivery network, which means your website will be very fast to visit. And you can bind your custom domain name for free. And it also provides free HTTPS. So remember, if you use WordPress.com, you have to pay if you want to bind your custom domain. And Netlify also provides flexible redirect rules, which means you can redirect any of your files or directories to another website.
And the thing that I personally like most is the thing called a continuous deployment, which is I have actually mentioned that, which basically means you can just push to GitHub and Netlify will just continuously build your website. And it also, if you care about collaborations on your website, it also has a very nice feature. That is, it provides a unique preview URL for each GitHub pull request. So if you host your website on GitHub and someone sends you a pull request, and then Netlify will automatically build this pull request and show you a unique URL, which you can find under this green checkmark here. So if you open this link, this is actually a preview of your website and you can see what this pull request looks like here before you merge it. So if the new post looks good to you, you can just hit the merge button on GitHub to merge that new post into your website. And I think that that is very, very handy.
And I'm not going to talk about Rbind in detail, but in case you need any technical help or you need a free subdomain, something.rbind.io, you can go to this GitHub organization, github.com slash rbind. You can seek for some technical help there. So basically this organization is, the goal of this organization is that we want to help you set up your website and we hope you could help someone else in the future after you have learned more about blogdown and all these web technologies. So this is basically a website community where you can show the source repositories of your websites and you can help other people set up their own website. So one thing that I want to emphasize is that this organization is still very young and I don't want you to tweet anything about it at this moment because we are still waiting for more volunteers to join Rbind.
Why you should have a website
So lastly, I want to talk about something that is not technical at all. So why should you have a website? So basically there is a blogdown book, which is still incomplete. And in the very beginning of that book, I said, I web, therefore I am. So that basically means you don't exist if you don't have a website. That might be a little exaggerative, but I think it's still true to some extent.
So basically, when you have a website, you can share what you have learned with other people. And more importantly, you can share what you have learned with your future self. And I find this very useful to myself because sometimes I might have learned some tricks and later I will forget them. And if I write them down on my own website, so sometimes I will go back to my own website and read my old posts again to learn the tricks that I learned before.
So for me, I started blogging since 2005. So that was like 12 years ago. So I, of course, I first started writing blog posts in Chinese because I'm originally from China. And I know most of you cannot read any of these characters here because they are Chinese. But at least you can see the dates of all these posts. You can see my very first post was in 2005, in January 7th. And I have written blog posts, maybe like 700 or 800 blog posts in Chinese and maybe 200 in English. And I started my English blog in 2007.
And I can tell you that the most important lesson that I learned. So basically I can summarize that as treat and forget, write and remember. So I have to admit that I wrote a large amount of garbage and bullshit over the 10 years. But I tend to think more deeply when I sit here and write something than when I talk or read. So among all the garbage that I produced on my website, occasionally there might be a gem or two. Sometimes I might come up with some ideas that later they will turn out to be actually very useful.
So if you are still not convinced that you should write something on your website, I would strongly recommend you to read the book Amusing Ourselves to Death. So I just finished reading this book a couple of days ago. And I was like, it totally blew my mind. I just feel like it is so important that you can sit down and focus for an hour or two and think about something. And I think writing is a very effective way to help you think deeply.
And I think writing is a very effective way to help you think deeply.
So that's all I have for you today. And if there's anything you need to remember, it is the github link github.com slash rstudio slash blogdown. That is where you can find the blogdown package as well as the blogdown book. So remember it's still not complete. You might struggle with this book, but it should get you started very easily. So remember that link. And I think that's all I have for today. And I hope you can enjoy the blogdown package as well as your own website. So I'll be ready to take your questions. If I'm not able to answer all of your questions, you can ask them on Stack Overflow later with the tags r and blogdown. Thank you.
Q&A
Do you recommend using iframe if wanting to embed a Shiny app into a post? Absolutely, yeah. If you have a Shiny app, I would strongly recommend you to use iframe. Typically, I don't like iframes, but I don't think there's a better option for Shiny applications.
Are files using .md extension and .rmd extension or either? Yeah, you can use either one. Your post can be either .md or .rmd. The difference is that the .md, the pure markdown files will be compiled by Hugo using Black Friday. But the .rmd files will be compiled through blogdown, rmarkdown, and Pandoc. So the markdown syntax is slightly different. But you can use either one. If you want to write something about r, if you have any computation in your post, you will have to use rmarkdown instead of markdown.
Is it better than Jekyll? Well, I think I have to clarify a little bit about the preference between Jekyll and Hugo. So basically, if you are comfortable with Jekyll right now, if you're comfortable with your website, I would recommend you to stay with Jekyll. I switched to Jekyll as I switched to Hugo. As I said, the main reason is that Jekyll was too slow for me and I hated the dependency hell. But for now, there's no native, or I should say there's no support from me to write rmarkdown with Jekyll. But I did have an experiment in 2014 where I tried to combine Jekyll with Knitr. Personally, I don't quite recommend you to look at this repository, but I would recommend you to try blogdown right away instead of hacking through my older repository, Knitr, Jekyll. I should say it's possible, but it's not very straightforward. It's certainly not as streamlined as in blogdown.
Okay, so is it possible to show tags or categories with the Hugo lithium theme? And the answer is, yeah, of course, it is possible. Well, I should say that currently my personal preference is that I don't want to use tags or categories, but I know most people will use them. And I should say it is possible to support tags and categories. To do that, you have to learn a little bit about the Hugo templating syntax and go to the documentation of Hugo, and then I will show you where you can find the information. So basically, yeah, I think that the section that you need to read is this taxonomy. Taxonomies, yeah, that is where we can find information. Or a better way is that you can find a theme that actually supports tags and categories, and you can study its source code of the templates. And I think you should be able to figure out how to add tags and categories support to the Hugo lithium theme. If you cannot figure that out, feel free to file a feature request to blogdown, and I can take a look at that.
So someone asked how to get the RSS link that can be used to add the blog to a blogger's website. Yeah, so for all Hugo websites, there will be an RSS file. So for example, for my own website, there is an index.xml file. So that is the RSS link that you can use to add to our bloggers. So basically, you can go to any sub-directory of your website. For example, I can go to my English posts directory and then add index.xml. And this will be the RSS feed for my English blog posts. Yeah, so basically, the thing to remember is that the file is named index.xml.
