-
Notifications
You must be signed in to change notification settings - Fork 0
upgrade: Use Jekyll; style and content updates #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ryanphuang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two major changes: (1) don't use redirect; let index.html directly render the latest semester page; (2) make semesters file into collections.
| semesters: | ||
| - id: fall25 | ||
| name: "Fall 2025" | ||
| active: true | ||
| - id: summer25 | ||
| name: "Summer 2025" | ||
| active: false | ||
| - id: winter25 | ||
| name: "Winter 2025" | ||
| active: false | ||
| - id: fall24 | ||
| name: "Fall 2024" | ||
| active: false | ||
| - id: summer24 | ||
| name: "Summer 2024" | ||
| active: false | ||
| - id: winter24 | ||
| name: "Winter 2024" | ||
| active: false | ||
| - id: fall23 | ||
| name: "Fall 2023" | ||
| active: false | ||
| - id: fall22 | ||
| name: "Fall 2022" | ||
| active: false | ||
| - id: summer22 | ||
| name: "Summer 2022" | ||
| active: false | ||
| - id: spring22 | ||
| name: "Spring 2022" | ||
| active: false | ||
| - id: fall21 | ||
| name: "Fall 2021" | ||
| active: false | ||
| - id: spring21 | ||
| name: "Spring 2021" | ||
| active: false | ||
| - id: fall20 | ||
| name: "Fall 2020" | ||
| active: false | ||
| - id: spring20 | ||
| name: "Spring 2020" | ||
| active: false | ||
| - id: fall19 | ||
| name: "Fall 2019" | ||
| active: false | ||
| - id: spring19 | ||
| name: "Spring 2019" | ||
| active: false | ||
| - id: fall18 | ||
| name: "Fall 2018" | ||
| active: false | ||
| - id: summer18 | ||
| name: "Summer 2018" | ||
| active: false | ||
| - id: spring18 | ||
| name: "Spring 2018" | ||
| active: false | ||
| - id: fall17 | ||
| name: "Fall 2017" | ||
| active: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make semesters into collections to avoid this manual specification
mv semesters _semesters- Replace the semester config block in
_config.ymlwith
collections:
semesters:
output: true
permalink: /reading-group/:name/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this file to _includes, so it can be used to render the root index.html as well. Several changes are needed.
- Move the file to
_includes/semester_page.html. - Replace all the
page.*with something likeinclude.sem.*, e.g.,
- <meta name="description" content="OrderLab Reading Group, {{ page.semester }}">
+ <meta name="description" content="OrderLab Reading Group, {{ include.sem.semester }}">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/site.css">
<link rel="icon" type="image/vnd.microsoft.icon" href="{{ site.baseurl }}/assets/favicon.ico">
- <title>{{ page.semester }}</title>
+ <title>{{ include.sem.semester }}</title>- Update the way to loop the semesters:
- {% for sem in site.semesters %}
- <li{% if sem.id == page.semester_id %} class="current-semester"{% endif %}>
- <a href="{{ site.baseurl }}/{{ sem.id }}/">{{ sem.name }}</a>
- </li>
- {% endfor %}
+ {% assign all_sems = site.semesters | sort: "date" | reverse %}
+ {% for sem in all_sems %}
+ <li{% if sem.url == include.sem.url %} class="current-semester"{% endif %}>
+ <a href="{{ sem.url | relative_url }}">{{ sem.semester }}</a>
+ </li>
+ {% endfor %}This will use the tag inside the semester page, instead of the previous manual metadata in the _config.yml. It also automatically sort the semester pages by date, so make sure you add a date field in side each file.
- Create the
_layouts/semester.htmlto be simply:
{% include semester_page.html sem=page %}
- Create another layout for the root index.html, e.g.,
_layouts/home.html
{% assign latest = site.semesters | sort: "date" | last %}
{% include semester_page.html sem=latest %}
This will automatically use the latest semester page.
| --- | ||
| layout: semester | ||
| semester_id: fall25 | ||
| semester: "Fall 2025" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a date field (like 2025-08-26) for each file to support sorting and finding latest page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use redirect for this use case. It's not a good practice. With the suggested new layout page, e.g., _layout/home.html, you just need the following for the root index.html:
---
layout: home
---
This PR does not change the website, including the content and style, though I plan to add another PR to improve those as well. What it does:
/reading-group/and have it redirect to the current semester, which can be set in the config file, instead of/reading-group/current/archive/folder@ryanphuang I cannot test how the website looks like because GitHub Page's CI tracks only the main branch for deployment. Can you help take a look at whether these changes are plausible? Thanks!
There are too many file changes, please don't request Copilot to review this PR!