简体   繁体   中英

Create a new static page using blogdown with same hugo theme as main site

I'm using the R package blogdown to create a hugo-powered website. Specifically i'm using the gcushen/hugo-academic theme.

The tutorials by @xieyihui and @apreshill have been wonderfully helpful to get started, and adding new posts is clear, but what about a new static page that uses the same theme as the overall site?

I get that it can be as simple as creating a new .md file with

+++
date = "2017-08-01"
title = "new_page_test"
type = "pages"
+++

## new page test

stuff

My questions are

  1. where do I store this file so that it is copied properly to the public folder?
  2. how to I link to this new page from another page? I'm not clear on the organization of the final file structure that gets published.

I'm doing this for my classes. You can see the end result here , click on "teaching". You can see the source files in the GitHub repository . In particular look under the content/classes folder.

  1. Create a folder under content. I called it classes but it can be called anything. Add an _index.md file to this folder. I edited _index.md from the posts folder so it would automatically create a list of the contents of /classes.

  2. This is drop dead easy! The relative link to a page, say content/yourstuff/yourpage.html is, wait for it, yourstuff/yourpage.html . With an index file in yourstuff the relative link is just yourstuff/ . Follow the same structure to add subdirectories. I was blown away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM