There are two main types of OTTR websites:
OTTR relies on R Markdown and GitHub Actions. You do not need to be an expert in either R Markdown or GitHub to get started as we will guide you through the process! However, we recommend spending a few minutes familiarizing yourself with both to gain a general understanding of their functionality before delving into our guide.
Please check out these resources if you are not familiar with R Markdown. Note that OTTR is also compatible with Quarto and regular markdown websites.
If you are not familiar with Git and GitHub, we recommend going through these chapters from our Reproducibility courses:
We offer two suggested approaches for creating content, based on your comfort and interest level in using Git and GitHub:
If you choose to use our OTTR Advanced guidance, you will need a method for working with Git.
If you do not have a method of working with Git already, we recommend using a Git client to facilitate easier branch management. Install GitKraken for a convenient way to handle your course locally.
On the landing page of the OTTR Website repository or the OTTR Course repository locate the green “Use this template” in the upper right corner. Click on it and then “Create a new repository” to follow the provided instructions to configure your course’s GitHub repository.
Enter a name for your repository in the “Repository name” field and provide a brief description for it in the “Description” box.
public
for all GitHub
Actions to workWhen creating your repository, make sure to set it to a public repository.
In particular, the rendered preview on pull requests won’t work, but you can alternatively preview the content by re-rendering locally if you want to keep your course private. We will cover this later.
In case you have a personal repository or an organization that hasn’t utilized GitHub Actions previously, it is important to verify if workflow actions have been enabled.
Go to Settings
and then Actions
. Make sure
that you have: 1. Given Read and write permissions
2.
Checked
Allow GitHub Actions to create and approve pull requests
.
Then click Save
.
The OTTR robots require certain permissions to execute certain actions.
To give them permission for all the Actions, you need to set a GitHub
Secret we will call GH_PAT
. Go to Settings
> Secrets and variables
on the left side menu >
Actions
. On this page, scroll down to
Repository secrets
. Read
more about GitHub Secrets here if you have general questions.
If you have organization admin privileges and plan on making multiple
courses with OTTR, you can set GH_PAT
as an organization
secret so you don’t have to do this again. You only need to do this once
as an organization (if this course is under jhudsl
you
don’t need to do this step).
New repository secret
/New organization secret
button.Name
, you must use GH_PAT
.Secret
: Create a personal access token following
these instructions
to create a “Classic” token (not a “Fine-grained token”). Underneath
Select scopes
, check both repo
and
workflow
. Copy the Personal Access Token and save as a
Secret in the repository that you made from our template.All of your GitHub Actions should now be capable of running without any issues. If you encounter any problems, please report your issue to the main OTTR repository here.
You’ll need to set this up so that your website or course will be published to a URL!
In your repository, go to Settings
>
Pages
.
Source
, pick
Deploy fom a branch
Branch
, pick main
and choose
/docs
.Save
.Enforce HTTPS
at the
bottom of this page.The URL for your material will be your
main github pages url
+ /
+
your OTTR repository name
and it will be displayed
underneath your Settings
> Pages
.
By default, Github Pages is sent to a URL that looks like
username.github.io
where username
is either
your individual user name or your organization’s name. However, you can
customize your GitHub Pages URL (like we have in this example here -
jhudatascience.org
). So it is likely your pages URL is
something like
username.github.io/your_ottr_repository_name
.
For more information about GitHub Pages we recommend you refer to the GitHub documentation here.
Warning: If you go to your URL right now (before you’ve pushed any file changes) you might see a 404 error because nothing has been triggered to be rendered. You can check the URL after you file your first pull request (which we will guide you through in the next section.
These OTTR templates (https://github.com/jhudsl/OTTR_Template_Website or https://github.com/jhudsl/OTTR_Template) are always a work in progress. We are working on adding more features and smoothing out bugs as we go. This is also why your feedback is greatly appreciated.
When updates are made to files that aren’t specific to the course content but instead run checks and other processes in the original repository, pull requests are filed automatically to any downstream repositories made from this template.
To enroll in these automatic update pull requests, the new course’s repository name will need to be added to the relevant OTTR template sync file. See Which file should you edit section for links to the file you want
If you’re a member of the jhudsl GitHub organization, you can make edits to the sync file in a new branch and open a pull request.
If you’re not a member of the jhudsl GitHub organization, you can use one of these alternatives:
sync.yml
file for you.sync.yml
file for you..github/sync.yml
of the OTTR
template repository you created your repository from:
If you’re not part of the jhudsl GitHub organization, to edit the
sync.yml
file you’ll need to - fork the repo - make the
changes (described below) to sync.yml
, committing them to a
branch - create a PR in the original OTTR repo using your branch
Detailed instructions for these steps are provided below:
#NEW REPO HERE#
. Be careful to indent the same amount
as the other repositories listed. @cansavvy
to alert us there’s a PR that needs to be merged.
Scroll down to “Add a comment”, type the @cansavvy
, and
click the green “Comment” button.Some alternative information on these steps are available here from GitHub or from James Priest’s Gist on the Fork and PR Workflow (note: you don’t need to clone the forked repo locally, instead making edits online and committing to a new branch).
Repository | Issues Links |
---|---|
OTTR_Template | Open a
general issue here Open an issue to add a new repo to sync.yml for OTTR
updatesOpen an issue to update your repo name/location in sync.yml for
OTTR updates |
OTTR_Quizzes | Open an issue here |
OTTR_Template_Website | Open an issue here |
#NEW REPO HERE#
. Be careful to indent the same amount as
the other repositories listed. Commit changes...
Add new repository to sync
to
Commit message
.Create a new branch for this commit and start a pull request.
Name the branch what you like. Propose changes
.sync.yml
file.Create Pull Request
@cansavvy
as a reviewer.If your new course doesn’t need some of the functionality of these files or you find the automatic updates bothersome, you can feel free to use this guide to tailor which files you want updates for.
If you have any questions about the implications of any of these
updates or files, please tag @cansavvy
.
Now you need to decide whether you want to build a course or a website and follow those instructions!
If you wish to contribute to OTTR, please take a look at our Code of Conduct.