I mentioned in an earlier post about how I’m revamping my presentation slides process but that I hadn’t tackled the user experience of browsing my slides, which wasted lots of the effort I put in. To tackle this part of it, I’ve made lockedata.uk using Hugo to be a way of finding and browsing presentations on R, SQL, and more. As Hugo is so easy, I thought I’d throw in a quick Hugo walkthrough too so that you could build your own blog/slides/company site if you wanted to.
The great thing about using Hugo with a sort of blog taxonomy system is now all my presentations have categories and tags so you can find something relevant. Additionally, I’m also ordering slides by the date of the last presentation. This means if you see me present, you can straight away get the slides – they’ll be the first thing on the page.
A number of the talks will also include the videos (embedded with Hugo shortcodes for the most part) from when I’ve presented the talk as that’s the most robust way of getting value out of the slides.
If you’re interested in the tech behind the site read on…
This site uses Hugo. Hugo is a “static site generator” which means you write a bunch of markdown and it generates html. This is great for building simple sites like company leafletware or blogs.
You can get Hugo across platforms and on Windows it’s just an executable you can put in your program files. You can then work with it like git in the command line.
You will want to read some of the docs to make customisations but the “happy path” Hugo walkthrough to get started is:
- Make a new site you simply run
hugo new site NAME
- Let’s do some git, run
git initinside the new site’s directory to get your git repo going
- Make a repo on GitHub that we’ll want to push to later on
- Find a theme to suit your needs and go to its github page
- Change to the themes directory then clone the theme into the themes directory
- Back on the top-level of your site, extract your themes example content with something like
cp -av themes/academic/exampleSite/* .
- Get your site running locally with real-time changes by running
hugo server -w
- Start editing the sample content to meet your needs and using the site (available at
localhost:1313) to see how it’s going
- When you’re happy, stop the local server (in Windows, this is ctrl+c)
- Make sure in the
config.tomlfile, the site URL reflects where it’ll go on Github i.e.
- Generate your site to the
hugo -d docs
- Commit everything and push to your GitHub repo
- In the Settings page for the Github repo, set the
Github Pages > Sourceoption to “master branch /docs folder”
Now your site will be available
PS If you want to do a lot of R in your blog, you can utilise blogdown which is an rmarkdown Hugo hybrid.
The post All my talks in one place (plus a Hugo walkthrough!) appeared first on Locke Data. Locke Data are a data science consultancy aimed at helping organisations get ready and get started with data science.