Site Setup
Additional steps to set up this site.
Follows Hugo Quick Start.
.gitignore
Add a gitignore and push site to github
touch .gitignore
# .gitignore
# Hugo files
public
resources
# R project files
.Rproj.user
.Rhistory
.RData
.Ruserdata
Archetypes
Update default archetype
# archetypes/default.md
+++
title = "{{ replace .Name "-" " " | title }}"
description = ""
categories = []
tags = []
date = {{ .Date }}
draft = true
+++
r2hugo
Install r2hugo so posts can be created using R Markdown.
R Studio Project
Create R Studio project to make working with R easier
touch r.Rproj
echo Version: 1.0 >> r.Rproj
Config
Basic
Add basic site config
# config.toml
baseURL = "https://tomrea.uk/"
languageCode = "en-gb"
title = "tomrea.uk"
theme = ["r2hugo", "mole"]
ignoreFiles = [ "\\.rmd$" ]
[params]
description = "Data analysis, R and other things"
Menu
Configure site menu
# config.toml
...
[menu]
[[menu.main]]
weight = 1
name = "home"
url = "/"
post = " |"
[[menu.main]]
weight = 2
name = "about"
url = "/about/"
post = " |"
[[menu.main]]
weight = 3
name = "posts"
url = "/posts/"
Markup
Turn code highlighting off
# config.toml
...
[markup]
[markup.highlight]
codeFences = false
About
Create an about me page
hugo new about.md
Host
Host site with Netlify
Add netlify.toml
to configure the build
touch netlify.toml
# netlify.toml
[build]
publish = "public"
command = "hugo"
[build.environment]
HUGO_VERSION = "0.74.3"
[context.draft]
command = "hugo -D --baseURL https://draft.tomrea.uk/"
[context.dev]
command = "hugo --baseURL https://dev.tomrea.uk/"
Use UI to set up: