Skip to content

Bookdown Repo Duplication

Colin Madland edited this page Dec 16, 2021 · 5 revisions

Template repo can be found at twuonline/bookdown-template.

  • Ensure you have the twuonline/bookdown-template repo cloned to your local computer
  • Right click and duplicate the entire folder
  • Rename the new folder to CRSE###
  • Show hidden files
    • Windows
      • Open File Explorer from the taskbar.
      • Select View > Show > Hidden items.
    • Mac
      • command+shift+.

Folders to delete

  • .git
  • docs

Files to edit

  • _bookdown.yml

    • in row 1, change book_filename: "template" to book_filename: CRSE###
  • _output.yml

    • in row 8, change <li><a href="./">Template</a></li> to <li><a href="./">Course Full Name</a></li>
    • in row 10, change <li><a href="https://github.com/twuonline/bookdown-template" target="blank">Published with bookdown</a></li> to <li><a href="https://github.com/ORG/CRSE###" target="blank">Published with bookdown</a></li> , making sure to change both ORG and CRSE###
  • index.rmd

    • edit lines 2 and 6 to match the course
    • add details from the syllabus
  • template.Rproj

    • rename to CRSE###.Rproj

GitHub Desktop

  • choose File > Add local repository
  • click Choose
  • Navigate to the new course folder
  • Click Add Repository

Important

  • you will get a dialogue that the directory is not a repository.
  • if you don't see this box, make sure you have deleted the .git folder before proceeding. If you push with the changes you have made, you will overwrite the repo that you copied.

  • Click create a repository in the dialogue box.
  • you can likely leave the settings on the next page as they are.
  • Click Create Repository
  • GitHub Desktop will now show you the option to Publish Repository
  • once you click to create the repo, you will need to choose an organization.
  • Click Publish Repository.

github.com

  • open the published repo
  • Go to Settings > Pages
  • under Source click the dropdown and choose main
  • a second dropdown will appear; choose /docs
  • click Save
  • You will see a notice that your site is ready to be published at a randomized URL
  • the random URL is good for when we are building a site, but the GitHub Pages visibility setting needs to be changed to Public to go live.

RStudio

  • in the local folder of the course, double click CRSE###.Rproj to open the project in RStudio.
  • On the Build tab, click Build Book to generate HTML pages

GitHub Desktop

  • Commit and push changes to HTML files to update the site.