diff --git a/README.md b/README.md index f234bab..07bebc9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![COmanage Logo](https://registry-test.cilogon.org/registry/img/COmanage-Logo-LG-onWhite.png) +![COmanage Logo](assets/registry/img/COmanage-Logo-LG-onWhite.png) CO301: Modeling Your Collaboration ================================== diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..f71ca94 --- /dev/null +++ b/_config.yml @@ -0,0 +1,81 @@ +#------------------------------------------------------------ +# The structure of this site including this file was adapted +# from The Carpentries, who should receive attribution and +# credit for these configurations. They are covered by a +# Creative Commons Attribution license +# https://creativecommons.org/licenses/by/4.0/ +#------------------------------------------------------------ + + +#------------------------------------------------------------ +# Values for this lesson. +#------------------------------------------------------------ + +# Overall title for pages. +title: "COmanage Training" + +# Life cycle stage of the lesson +# possible values: "pre-alpha", "alpha", "beta", "stable" +life_cycle: "alpha" + +#------------------------------------------------------------ +# Generic settings (should not need to change). +#------------------------------------------------------------ + +# What kind of thing is this ("workshop" or "lesson")? +kind: "lesson" + +# Magic to make URLs resolve both locally and on GitHub. +# See https://help.github.com/articles/repository-metadata-on-github-pages/. +# Please don't change it: / is correct. +repository: / + +# Email address, no mailto: +email: "checkout@carpentries.org" + +# Sites. +carpentries_site: "https://carpentries.org/" + +# Surveys. +pre_survey: "" +post_survey: "" + +# Start time in minutes (0 to be clock-independent, 540 to show a start at 09:00 am) +start_time: 540 + +# Specify that things in the episodes collection should be output. +collections: + episodes: + output: true + permalink: /:path/index.html + extras: + output: true + permalink: /:path/index.html + +# Set the default layout for things in the episodes collection. +defaults: + - values: + root: . + layout: page + - scope: + path: "" + type: episodes + values: + root: .. + layout: episode + - scope: + path: "" + type: extras + values: + root: .. + layout: page + +# Files and directories that are not to be copied. +exclude: + - Makefile + - bin/ + +# Turn on built-in syntax highlighting. +highlighter: rouge + +plugins: [jekyll-redirect-from] \ No newline at end of file diff --git a/_includes/base_path.html b/_includes/base_path.html new file mode 100644 index 0000000..745f865 --- /dev/null +++ b/_includes/base_path.html @@ -0,0 +1,27 @@ +{% comment %} +This is adapted from: https://ricostacruz.com/til/relative-paths-in-jekyll + +`page.url` gives the URL of the current page with a leading /: + +- when the URL ends with the extension (e.g., /foo/bar.html) then we can get + the depth by counting the number of / and remove - 1 +- when the URL ends with a / (e.g. /foo/bar/) then the number / gives the depth + directly +{% endcomment %} + +{% assign relative_root_path = '' %} + +{% assign last_char = page.url | slice: -1 %} + +{% if last_char == "/"} +{% assign offset = 0 %} +{% else %} +{% assign offset = 1 %} +{% endif %} + +{% assign depth = page.url | split: '/' | size | minus: offset %} +{% if depth <= 1 %}{% assign relative_root_path = '.' %} +{% elsif depth == 2 %}{% assign relative_root_path = '..' %} +{% elsif depth == 3 %}{% assign relative_root_path = '../..' %} +{% elsif depth == 4 %}{% assign relative_root_path = '../../..' %} +{% endif %} \ No newline at end of file diff --git a/_includes/gh_variables.html b/_includes/gh_variables.html new file mode 100644 index 0000000..171a55a --- /dev/null +++ b/_includes/gh_variables.html @@ -0,0 +1,45 @@ +{% comment %} +When rendering websites locally, `site.github.url` doesn't get resolved properly +unless a GitHub Personal Access Token is set up and available in the +environment. This leads to warnings and errors when trying to serve the site +locally. To work around this, we use the `jekyll.environment` variable which is +set to `development` when rendering the site locally, and set to `production` on +GitHub where `site.github.url` is defined. +{% endcomment %} + +{% if jekyll.environment == "production" %} + +{% comment %} +First, get the name of the repository +{% endcomment %} +{% assign repo_name = site.github.repository_name %} + +{% comment %} +`site.github.public_repositories` contains comprehensive information for all public repositories for the organization. We use `where` to extract the part +of the metadata that is relevant to the present repository. +{% endcomment %} +{% assign repo_info = site.github.public_repositories | where: "name", repo_name %} + +{% comment %} +Now, we can extract the default branch for the repo +{% endcomment %} +{% assign default_branch = repo_info[0].default_branch %} + +{% comment %} +Other variables requested by the template +{% endcomment %} +{% assign repo_url = site.github.repository_url %} +{% assign search_domain_url = site.github.url %} +{% assign project_title = site.github.project_title %} +{% assign source_branch = site.github.source.branch %} + +{% elsif jekyll.environment == "development" %} + +{% assign repo_name = "" %} +{% assign repo_url = "" %} +{% assign default_branch = "" %} +{% assign search_domain_url = "" %} +{% assign project_title = "" %} +{% assign source_branch = "" %} + +{% endif %} \ No newline at end of file diff --git a/_includes/life_cycle.html b/_includes/life_cycle.html new file mode 100644 index 0000000..d1d5440 --- /dev/null +++ b/_includes/life_cycle.html @@ -0,0 +1,34 @@ + +{% if site.life_cycle == "pre-alpha" %} + +
+
+ This lesson is still being designed and assembled (Pre-Alpha version) +
+
+ + +{% elsif site.life_cycle == "alpha" %} + +
+
+ This lesson is in the early stages of development (Alpha version) +
+
+ + +{% elsif site.life_cycle == "beta" %} + +
+
+ This lesson is being piloted (Beta version) +
+
+ +{% elsif site.life_cycle == "stable" %} + +{% comment %} +We don't do anything special for now +{% endcomment %} + +{% endif %} \ No newline at end of file diff --git a/_includes/navbar.html b/_includes/navbar.html new file mode 100644 index 0000000..0010410 --- /dev/null +++ b/_includes/navbar.html @@ -0,0 +1,93 @@ +{% comment %} + Lesson navigation bar. +{% endcomment %} + +{% include gh_variables.html %} + + \ No newline at end of file diff --git a/_includes/syllabus.html b/_includes/syllabus.html new file mode 100644 index 0000000..c5c6cf9 --- /dev/null +++ b/_includes/syllabus.html @@ -0,0 +1,94 @@ +{% include base_path.html %} + +{% comment %} + Display syllabus in tabular form. + Days are displayed if at least one episode has 'start = true'. +{% endcomment %} +
+

Sample Schedule

+ + {% assign day = 0 %} + {% assign multiday = false %} + {% for episode in site.episodes %} + {% if episode.start %}{% assign multiday = true %}{% break %}{% endif %} + {% endfor %} + {% assign current = site.start_time %} + + + + {% if multiday %}{% endif %} + + + + + + {% if multiday %}{% endif %} + + + + + {% for episode in site.episodes %} + {% if episode.start %} {% comment %} Starting a new day? {% endcomment %} + {% assign day = day | plus: 1 %} + {% if day > 1 %} {% comment %} If about to start day 2 or later, show finishing time for previous day {% endcomment %} + {% assign hours = current | divided_by: 60 %} + {% assign minutes = current | modulo: 60 %} + + {% if multiday %}{% endif %} + + + + + {% endif %} + {% assign current = site.start_time %} {% comment %}Re-set start time of this episode to general daily start time {% endcomment %} + {% endif %} + {% assign hours = current | divided_by: 60 %} + {% assign minutes = current | modulo: 60 %} + + {% if multiday %}{% endif %} + + + + + {% assign current = current | plus: episode.teaching | plus: episode.exercises | plus: episode.break %} + {% endfor %} + {% assign hours = current | divided_by: 60 %} + {% assign minutes = current | modulo: 60 %} + + {% if multiday %}{% endif %} + + + + + {% assign current = current | plus: 15 %} + {% assign hours = current | divided_by: 60 %} + {% assign minutes = current | modulo: 60 %} + + {% if multiday %}{% endif %} + + + + +
SetupDownload files required for the lesson
Pre-training surveyPlease fill out our pre-training survey before the start of the course.
{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}Finish
{% if episode.start %}Day {{ day }}{% endif %}{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }} + {% assign lesson_number = lesson_number | plus: 1 %} + {{ lesson_number }}. {{ episode.title }} + + {% if episode.break %} + Break + {% else %} + {% if episode.questions %} + {% for question in episode.questions %} + {{question|markdownify|strip_html}} + {% unless forloop.last %} +
+ {% endunless %} + {% endfor %} + {% endif %} + {% endif %} +
{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}Post-training surveyPlease fill out our pre-training survey before the start of the course.
{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}Finish
+ +

+ The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor. +

+ +
\ No newline at end of file diff --git a/_layouts/base.html b/_layouts/base.html new file mode 100644 index 0000000..cab857d --- /dev/null +++ b/_layouts/base.html @@ -0,0 +1,56 @@ +--- +--- + +{% include base_path.html %} +{% include gh_variables.html %} + + + + + + + + + + + + + + + + + + + + + + + {% if page.title %}{{ page.title }}{% endif %}{% if page.title and site.title %} – {% endif %}{% if site.title %}{{ site.title }}{% endif %} + + + + + + + + + + + + {% include life_cycle.html %} + +
+ {% include navbar.html %} +{{ content }} + {% if site.kind == "workshop" %} + {% include workshop_footer.html %} + {% else %} + {% include lesson_footer.html %} + {% endif %} +
+ {% include javascript.html %} + + \ No newline at end of file diff --git a/assets/img/COmanage-Logo-LG-onWhite.png b/assets/img/COmanage-Logo-LG-onWhite.png new file mode 100644 index 0000000..8783203 Binary files /dev/null and b/assets/img/COmanage-Logo-LG-onWhite.png differ