Skip to content
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

[feat] add outdated tag, lecture prefix tag #6

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ heading_links:
url: ""
- text: "Project"
url: ""
lecture_prefix: "csXXX-sp25-lec"

# Theme settings
remote_theme: just-the-docs/[email protected]
Expand Down Expand Up @@ -117,3 +118,6 @@ waitlist_warning: false

# Set this to true if discussion times are uncertain (populates on calendar.md)
discussions_under_construction: false

# Set this to true to archive the semester
outdated: false
13 changes: 7 additions & 6 deletions _data/lectures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
# Pad lecture numbers, e.g. lecture 2 uses "02", not "2".
#
# For example, the first few lecture slides should be put at:
# - /assets/lectures/cs188-sp23-lec01.pdf
# - /assets/lectures/cs188-sp23-lec02.pdf
# - /assets/lectures/csXXX-sp25-lec01.pdf
# - /assets/lectures/csXXX-sp25-lec02.pdf
# ...
# - /assets/lectures/cs188-sp23-lec25.pdf
# - /assets/lectures/csXXX-sp25-lec25.pdf
# If you'd like a different prefix from csXXX-sp25-lec01, you can change this in _config.yml

# To link lecture recordings on the website, fill in the
# recordings field in the corresponding lecture below.
Expand All @@ -25,10 +26,10 @@
# in the right folder.
#
# For example, the first few lecture notes should be put at:
# - /assets/notes/cs188-sp23-note01.pdf
# - /assets/notes/cs188-sp23-note02.pdf
# - /assets/notes/csXXX-sp25-note01.pdf
# - /assets/notes/csXXX-sp25-note02.pdf
# ...
# - /assets/notes/cs188-sp23-note25.pdf
# - /assets/notes/csXXX-sp25-note25.pdf


#####################################
Expand Down
15 changes: 10 additions & 5 deletions _includes/lecture.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
then create filenames (see lectures.yml for more on filenames).
{%- endcomment -%}
{%- assign filenumber = include.number | prepend: '00' | slice: -2, 2 -%}
{%- assign slides_path = "/assets/lectures/csXXX-sp25-lec" | append: filenumber | append: ".pdf" -%}
{%- assign slides_path = "/assets/lectures/" | append: site.lecture_prefix | append: filenumber | append: ".pdf" -%}

{%- comment -%}
- Automatically check if files exist.
Expand All @@ -40,13 +40,18 @@
{{ include.number }}. {{ include.element.title }}
{%- endif -%}

{%- if include.element.slides or include.element.recording or include.element.readings.size > 0 -%}
{%- if include.element.slides or slides_exists or include.element.recording or include.element.readings.size > 0 -%}
<br>
{%- if include.element.slides -%}
<a href="{{ include.element.slides }}" aria-label="Slides for Lecture {{ include.number }} ({{ include.element.title }})">Slides</a>
{%- if include.element.recording or include.element.readings.size > 0 -%}
{{}} / {{}}
{%- endif -%}
{%- elsif slides_exists -%}
<a href="{{ slides_path | relative_url }}" aria-label="Slides for Lecture {{ include.number }} ({{ include.element.title }})">Slides</a>
{%- if include.element.recording or include.element.readings.size > 0 -%}
{{}} / {{}}
{%- endif -%}
{%- if include.element.recording or include.element.readings.size > 0 -%}
{{}} / {{}}
{%- endif -%}
{%- endif -%}
{%- if include.element.recording -%}
<a href="{{ include.element.recording }}" aria-label="Recording for Lecture {{ include.number }} ({{ include.element.title }})">Recording</a>
Expand Down
6 changes: 6 additions & 0 deletions calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ This schedule is tentative; additional times may be added later. The existing ti
</p>
{%- endif -%}

{%- if site.outdated -%}
<p class="warning">
This website contains materials from a past semester. Information, assignments, and announcements may no longer be relevant. Please refer to the <a href="https://template.cs161.org">current semester's site</a> for up-to-date content.
</p>
{%- endif -%}

If you would like to view this calendar ouside of the course website, please click "Open in Google Calendar" below. If you would like to add an accessible version of this calendar to your personal Google Calendar, please click "Add to your personal calendar" below.

[Open in Google Calendar]({{ site.data.calendar.google_calendar_embed_link }}){: .btn .btn-outline .fs-3 } [Add to your personal calendar]({{ site.data.calendar.google_calendar_add_link }}){: .btn .btn-outline .fs-3 }
Expand Down
7 changes: 7 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ If you're currently on the waitlist, or have any other course-related logistics
</p>
{%- endif -%}

{%- if site.outdated -%}
<p class="warning">
This website contains materials from a past semester. Information, assignments, and announcements may no longer be relevant. Please refer to the <a href="https://template.cs161.org">current semester's site</a> for up-to-date content.
</p>
{%- endif -%}


<img align="right" alt="161 lock logo" width="85px" src="{{ site.baseurl }}/assets/images/logo.png">

# {{ site.title }}
Expand Down
6 changes: 6 additions & 0 deletions policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ This site is under construction. All dates and policies are tentative until this
</p>
{%- endif -%}

{%- if site.outdated -%}
<p class="warning">
This website contains materials from a past semester. Information, assignments, and announcements may no longer be relevant. Please refer to the <a href="https://template.cs161.org">current semester's site</a> for up-to-date content.
</p>
{%- endif -%}

# Policies
{:.no_toc}

Expand Down