Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

mathurlabstanford/metabias.io

Repository files navigation

Based on theMinimal Mistakes Jekyll themeunder an MIT license.

Website Configuration

Global settings

See fullconfig.The following are the most important places where you need to make changes(see comments in these files also):

  • edit_config.yml to update site metadata
    • most important settings (site title, name, url) are highlighted at the top,
    • you can add Google Analytics tracking ID
  • edit_data/navigation.yml to add more tabs to the top navigation: title and url (relative to site url)
  • editassets/css/main.scss to change customized colors and fonts.
# main links in _data/navigation.ymlmain:  -title:"Publication bias"url:/pubbias/  -title:"p-hacking"url:/phacking/

Adding a new page

Open thesite.Rproj file in RStudio IDE.Open Rmd files you'd like to edit. Click render.Jekyll will ignore Rmd, and will deploy html based on the md files.

Adding a new page undermetabias.io/path/dir/:

  1. create folderpath/dir
  2. addindex.Rmd into the folder (see below for what goes into the header)
  3. Edit Rmd then render the md

This is the part that goes into the Rmd header of the filepath/dir/index.Rmd:

---title:Add your title herelayout:archiveoutput:md_document:variant:gfmpreserve_yaml:true---

Keeping thelayout andoutput is important, so that it will show up as expected after Jekyll renders the pages.

Note: if images are included as part of the Rmd, those will be placedrelative to theindex.Rmd file and need to be added to git.

Seethis cheat sheet for markdown formatting.

Adding new page for a Shiny app

Here is how you can add a page for Shiny apps that are already deployed (see themetabias-apps repo for information on how to structure and deploy them).

Create new folder in the root, e.g.my-app and add anmy-app/index.md filewith the following content: change the app url

---layout:appapp_url:https://qsu-stanford.shinyapps.io/my-app/---

This will indicate to the Jekyll template to use theapp layout (which puts the iframe around the app URL). Theapp_url is the link that will show up in the iframe.

If the website is served over https, the iframe needs to be https as well.

Website deployment

GitHub pages use Jekyll, so no additional steps are required.Commit changes and it is done. Make sure you go to the Settings tabof the repo and set GitHub pages deployment from the root folder ofthe master/main branch.

Custom domains

Set up a www subdomain (e.g.www.new-domain.com) followingthis guide.

  1. Go to the Settings tab of the repo, scroll down to the GitHub Pages section
  2. Addwww.new-domain.com to the Custom Domain field and click Save
  3. Go to your DNS settings on your provider's page (seehere)
  • In the first field, enterwww or the required subdomain
  • In the dropdown menu, select CNAME
  • In the TTL field, enter 1H
  • In the data field, entermathurlabstanford.github.io
  • Click Add

Editing the outer UI of the website

To edit the outer framework exclusive of the Shiny app iframe itself (e.g., the Resources tab), just edit and knit the relevant .Rmd file, commit as normal (with no special message), and push. Remember you need to knit the .Rmd file or else the changes will not be reflected in the .md file, which is what the website ultimately uses.

  • Changing font sizes: Edit per comments inassests/css/main.scss.
  • Changing width of text on page (i.e., change whitespace on either side of text column): Edit per comments in_sass/minimal_mistakes/_archive.scss.

Note: We are using the "archive" layout (_sass/minimal_mistakes/_archive.scss), so if you want to change a parameter that is normally in_page.scss, you should change it in_archive.scss instead.

Local development with jekyll

One-time steps to set up jekyll locally

Install jekyll (one time setup inside the directory): skip steps as appropriate, e.g. if you have Ruby installed etc (ruby -v should return Ruby version).See more about Ruby and Jekyll installationhere.

This will install jekyll toevalue_website/vendor. Important: To avoid errors inbundle install, the entire file path to ruby (which will be inevalue_website/vendor) needs to not have spaces in the directory names. Change them to underscores before the installation.

# Install Command Line Toolsxcode-select --install# Install Homebrew/bin/bash -c"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"# Install Rubybrew install ruby# Add the brew ruby path to your shell configuration:PATH="`ruby -e'puts Gem.user_dir'`/bin:$PATH"# Install Jekyllgem install --user-install bundler jekyll# Install gems (dependencies) for the templatebundle install

When you edit your files and want to check locally how the site looks, first make sure you are in the top-level directoryevalue_website (where the jekyll files live) and then use this:

bundleexec jekyll serve

This will build the site that you can check athttp://127.0.0.1:4000 inyour browser. When you change the source it render the changesbut you have to click refresh in the browser to see the changes.Stop the server with Ctrl+C in the command line.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp