diff --git a/.github/automatic-issues/git-secrets.md b/.github/automatic-issues/git-secrets.md new file mode 100644 index 0000000..da8a7da --- /dev/null +++ b/.github/automatic-issues/git-secrets.md @@ -0,0 +1,14 @@ + +**Note these steps are only pertinent if you are setting up this website outside of the jhudsl organization** + +For more information on these settings see instructions in the [getting started on ottrproject.org](https://www.ottrproject.org/getting_started.html#6_Set_up_your_GitHub_personal_access_token). + +It's important that these are set up and named exactly what they are below in order for Github actions to work correctly. + +To set up these repository secrets, on your repository's main Github page, go to `Settings` and scroll down to see `Secrets` on the left side menu bar. + +- [ ] Set `GH_PAT` +`Name`: `GH_PAT` +`value`: A personal access token [following these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token). +Underneath `Select scopes`, check both `repo` and `workflow`. +Then copy the PAT and save as the value. diff --git a/.github/automatic-issues/set-repo-settings.md b/.github/automatic-issues/set-repo-settings.md new file mode 100644 index 0000000..c28cbcc --- /dev/null +++ b/.github/automatic-issues/set-repo-settings.md @@ -0,0 +1,23 @@ + +For more information on these settings see instructions in [Starting a new OTTR website](https://www.ottrproject.org/getting_started.html#starting-a-new-ottr-course). + +- [ ] This website repository is set to `public`. + +- [ ] [Github secret `GH_PAT` has been set](https://www.ottrproject.org/getting_started.html#6_Set_up_your_GitHub_personal_access_token) + `Name`: `GH_PAT` + `value`: A personal access token [following these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token). + Underneath `Select scopes`, check both `repo` and `workflow`. + Then copy the PAT and save as the value. + +- [ ] GitHub pages is turned on + - [ ] Go to `Settings` > `Pages`. Underneath `Source`, choose `main` for the branch and select the `docs` folder. Then click `Save`. + - [ ] Check `Enforce HTTPS`. + +- [ ] [Set branch protections settings](https://www.ottrproject.org/getting_started.html#8_Set_up_branch_rules) + - [ ] `main` branch has been set up: + - [ ] `Require pull request reviews before merging` box is checked. + - [ ] `Require status checks to pass before merging` box is checked. + - [ ] Underneath that `Require branches to be up to date before merging` box is checked. + - [ ] Click `Save` at the bottom of the page! + +- [ ] [Customize GitHub actions](https://www.ottrproject.org/customize-robots.html) for what you will need in this website. diff --git a/.github/automatic-issues/templates-to-edit.md b/.github/automatic-issues/templates-to-edit.md new file mode 100644 index 0000000..eaae3d5 --- /dev/null +++ b/.github/automatic-issues/templates-to-edit.md @@ -0,0 +1,32 @@ + +[Follow the instructions here in ottrproject.org](https://www.ottrproject.org/editing_website.html) for details on how to start editing your OTTR website. + +The following files need to be edited to get this new website started! + +### Files that need edited upon creating a new website. + +- [ ] `README.md` - Fill in the README with the title of the website, a brief description of the website, and any other details that would be useful for anyone who encounters your website. +- [ ] `index.Rmd` - Update the `title` field. Since this Rmd file serves as the website's landing page, include any information you believe will be beneficial for visitors upon their arrival. + + +### Files that need to be edited upon adding each new page. + +- [ ] `_site.yml` - Include the title of your newly created page in the `text` field, and insert the corresponding html file name into the `href` field. + +### Picking a style + +See more [about customizing style on this page in the guide](https://www.ottrproject.org/customize-style.html). +By default this website template will use the jhudsl data science lab style. However, you can customize and switch this to another style set. + +#### Using a style set + +[Read more about the style sets here](https://www.ottrproject.org/customize-style.html#Using_a_style_set). + +- [ ] On a new branch, copy the `style-sets/<set-name>/index.Rmd` and `style-sets/<set-name>/_output.yml` to the top of the repository to overwrite the default `index.Rmd` and `_output.yml`. +- [ ] Copy over all the files in the `style-sets/<set-name>/copy-to-assets` to the `assets` folder in the top of the repository. +- [ ] [Create a pull request](https://www.ottrproject.org/writing_content.html#Open_a_pull_request) with these changes, and double check the rendered preview to make sure that the style is what you are looking for. + +### Files that need to be edited upon adding new packages that the book's code uses: + +- `docker/Dockerfile` needs to have the new package added so it will be installed. See [instructions](https://www.ottrproject.org/customize-docker.html). +- The code chunk in `index.Rmd` should be edited to add the new package. diff --git a/.github/automatic-issues/update-enrollment.md b/.github/automatic-issues/update-enrollment.md new file mode 100644 index 0000000..5cc0a81 --- /dev/null +++ b/.github/automatic-issues/update-enrollment.md @@ -0,0 +1,7 @@ + +The original template: https://github.com/jhudsl/OTTR_Template_Website is always a work in progress. +We are working on adding more features and smoothing out bugs as we go. + +If you want to receive updates from the original template to your website template, you will need to enroll this repository to the template updates by adding it to the `sync.yml` file. + +- [ ] [Follow these instructions](https://www.ottrproject.org/getting_started.html#9_Enroll_your_repository_for_OTTR_updates) to enroll your website repository to receive these updates. diff --git a/.github/sync.yml b/.github/sync.yml index 763e774..2f01035 100644 --- a/.github/sync.yml +++ b/.github/sync.yml @@ -21,7 +21,7 @@ group: dest: config_automation.yml # Repositories to receive changes repos: | - jhudsl/ottr-website + jhudsl/ottrproject.org jhudsl/Baltimore_Community_Course maculatus/test-ottr-website dr-sayyadhury/OTTR_Template_Website_repo @@ -30,8 +30,12 @@ group: buriedsand/glbio-personal-website PurplFeesh/test-ottr-site jcha40/ottr_test_site - jhudsl/ITCR_Tables - fhdsl/ITN_search + jhudsl/ITN_computing_resources + fhdsl/ITN_course_search + cansavvy/cansavvy_website + fhdsl/metricminer-dashboard + fhdsl/Intermediate_R + fhdsl/AnVIL_Poll_2024 ###ADD NEW REPO HERE following the format above# ### These are custom groups for syncing -- not all files needs to be synced # will update later diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 21b0324..b1cdc47 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v4 - name: Verify Dockerfiles changed? - uses: tj-actions/verify-changed-files@v8.8 + uses: tj-actions/verify-changed-files@v17 id: verify-changed-files with: files: | diff --git a/.github/workflows/file-automatic-issues.yml b/.github/workflows/file-automatic-issues.yml new file mode 100644 index 0000000..e24658d --- /dev/null +++ b/.github/workflows/file-automatic-issues.yml @@ -0,0 +1,43 @@ +# Code adapted from https://github.com/JetBrains/intellij-platform-plugin-template/blob/deb171483598ee8a5d7621154db880e87b4db4ef/.github/workflows/template-cleanup.yml +# by Candace Savonen for this repository. + +name: Starting a website + +on: + push: + branches: [ main, staging ] + workflow_dispatch: + +jobs: + # Run cleaning process only if workflow is triggered by not being in the Bookdown template anymore + template-cleanup: + name: Template Cleanup + runs-on: ubuntu-latest + if: github.event.repository.name != 'OTTR_Template_Website' + steps: + - name: checkout repo + uses: actions/checkout@v4 + + # Issue for what repository settings need to be set + - name: New Course - Set Repository Settings + uses: peter-evans/create-issue-from-file@v4 + with: + title: New Course - Set Repository Settings + content-filepath: .github/automatic-issues/set-repo-settings.md + labels: automated training issue + + # Issue for what needs to be edited + - name: New Course - Templates to Edit + uses: peter-evans/create-issue-from-file@v4 + with: + title: New Course - Templates to Edit + content-filepath: .github/automatic-issues/templates-to-edit.md + labels: automated training issue + + # Issue for how to enroll repo for updates + - name: New Course - Template Update Enrollment + uses: peter-evans/create-issue-from-file@v4 + with: + title: New Course - Template Update Enrollment + content-filepath: .github/automatic-issues/update-enrollment.md + labels: automated training issue diff --git a/.github/workflows/render-site.yml b/.github/workflows/render-site.yml index b394041..d5d6415 100644 --- a/.github/workflows/render-site.yml +++ b/.github/workflows/render-site.yml @@ -70,6 +70,7 @@ jobs: exit 1 # Commit the rendered site files - html files and site_libs files +# The git reset step will remove any other files created in this workflow, such as API keys - name: Commit rendered site files run: | git config --global --add safe.directory $GITHUB_WORKSPACE @@ -77,4 +78,6 @@ jobs: git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add --force docs/* git commit -m 'Render site' || echo "No changes to commit" - git push --force origin main || echo "No changes to push" + git reset --hard HEAD + git pull --rebase --allow-unrelated-histories --strategy-option=ours + git push origin main || echo "No changes to push" diff --git a/.gitignore b/.gitignore index 5b6a065..7b732e7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .Rhistory .RData .Ruserdata +.DS_Store diff --git a/OTTR_template_website.Rproj b/OTTR_Template_Website.Rproj similarity index 100% rename from OTTR_template_website.Rproj rename to OTTR_Template_Website.Rproj diff --git a/config_automation.yml b/config_automation.yml index 12d9dd0..1a1a577 100644 --- a/config_automation.yml +++ b/config_automation.yml @@ -12,6 +12,8 @@ spell-check: yes style-code: yes # Test build the docker image if any docker-relevant files have been changed docker-test: no +# Should URLs be tested periodically? +url-check-periodically: yes ##### Renderings run upon merge to main branch ##### # Rendering each platform's content @@ -19,6 +21,10 @@ render-bookdown: yes render-leanpub: yes render-coursera: no +## Automate the creation of Book.txt file? TRUE/FALSE? +## This is only relevant if render-leanpub is yes, otherwise it will be ignored +make-book-txt: TRUE + # What docker image should be used for rendering? # The default is jhudsl/base_ottr:main rendering-docker-image: 'jhudsl/base_ottr:main' diff --git a/docs/check_reports/spell_check_results.tsv b/docs/check_reports/spell_check_results.tsv new file mode 100644 index 0000000..beacaed --- /dev/null +++ b/docs/check_reports/spell_check_results.tsv @@ -0,0 +1,2 @@ +word file lines +ottrproject README.md 3 diff --git a/docs/check_reports/url_checks.tsv b/docs/check_reports/url_checks.tsv new file mode 100644 index 0000000..f66589f --- /dev/null +++ b/docs/check_reports/url_checks.tsv @@ -0,0 +1,2 @@ +urls urls_status file +https://www.ottrproject.org/writing_content.html failed /github/workspace/editing.Rmd diff --git a/docs/editing.html b/docs/editing.html index e60c10d..1a27ba1 100644 --- a/docs/editing.html +++ b/docs/editing.html @@ -290,7 +290,7 @@ <h1 class="title toc-ignore">Editing</h1> <p>Now that your website is alive and hosted, how do you start customizing it to have your content?</p> <p>If you already know how to file pull requests, feel free to start making edits as you see fit using some of the structure points we’ve noted below.</p> -<p>If you are not familiar with pull requests, <a href="https://www.ottrproject.org/writing_content.html">read this guide to get started</a>.</p> +<p>If you are not familiar with pull requests, <a href="https://www.ottrproject.org/editing_website.html">read this guide to get started</a>.</p> <div id="title" class="section level2"> <h2>Title</h2> <p>To change the title of the website, modify the <code>name</code> line of the <code>_site.yml</code> file.</p> diff --git a/resources/dictionary.txt b/resources/dictionary.txt index c3dd255..c3bf9f5 100644 --- a/resources/dictionary.txt +++ b/resources/dictionary.txt @@ -9,12 +9,16 @@ GH Github GitHub HTTPS +ITN +ITCR lightblue lightgreen OTTR Rmd +repo subdir th +tibble www automations Bootstap