Skip to content

Instantly share code, notes, and snippets.

@cpsievert
Created November 6, 2019 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpsievert/f285f61b15613f221e5111e89fd3d45d to your computer and use it in GitHub Desktop.
Save cpsievert/f285f61b15613f221e5111e89fd3d45d to your computer and use it in GitHub Desktop.
name: "site"
output:
html_document:
theme: sketchy
bootstrap_version: 4
theme_variables:
primary: pink
font-size-base: 1.5rem
navbar:
title: "My Website"
type: "inverse"
left:
- text: "Home"
href: index.html
- text: "About"
href: about.html
menu:
- text: "Sub_1"
href: sub1.html
- text: "Sub_2"
menu:
- text: "Sub_2_below"
href: sub2.html
right:
- text: "Home"
href: index.html
- text: "About"
href: about.html
menu:
- text: "Sub_1"
href: sub1.html
- text: "Sub_2"
menu:
- text: "Sub_2_below"
href: sub2.html
library(rmarkdown)
index <-
'---
title: "My Website"
---
Hello, Website!'
about <-
'---
title: "About This Website"
---
More about this website.'
sub_part_1 <-
'---
title: "About This Website"
---
sub_1: This is right below the About page.'
sub_part_2 <-
'---
title: "About This Website"
---
sub_2: This is 2 levels below the About page.'
writeLines(index, "index.Rmd")
writeLines(about, "about.Rmd")
writeLines(sub_part_1, "sub1.Rmd")
writeLines(sub_part_2, "sub2.Rmd")
# TODO:
# 1. Account for navbar height
# 2. submenu is broken for some themes (e.g., sketchy)?
render_site()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment