Skip to content

Conversation

JohnnyRobs19
Copy link

@JohnnyRobs19 JohnnyRobs19 commented Aug 24, 2025

What does this change?

  • Adds a shortcode (common-theme/layouts/shortcodes/next-class-day-plan.html) that computes the next likely class day-plan and renders a direct link.
  • Wires the shortcode into org-cyf-itp/content/_index.md so the module index shows a single "Next class" link.
  • Heuristic used: next Saturday -> match course start month -> compute week/sprint -> index into the "scheduled" menu. Falls back when no data available.

Common Content?

  • Block/s

Common Theme?

  • Yes

Issue number: #1119

Org Content?

Module Sprint Page Type Block Type
org-cyf-itp N/A Module index page (_index.md) N/A

Checklist

  • I have read the contributing guidelines
  • I have checked spelling/grammar
  • I have previewed my changes locally
  • I have run my code to check it works

Who needs to know about this?

Please review: @SallyMcGrath

Before / After (artifacts)

Before

  • Full-page screenshot (current UI) image
  • Editor screenshot or paste of org-cyf-itp/content/_index.md (pre-change) image
  • Small reproduction command snippet:
cd ~/code/curriculum/org-cyf-itp
sed -n '1,200p' content/_index.md > before__index.md
hugo server -D --bind=0.0.0.0 --port=1313
# open http://localhost:1313

After

  • Full-page screenshot showing the rendered Next class link image
  • The new shortcode file: common-theme/layouts/shortcodes/next-class-day-plan.html image
  • The updated file: org-cyf-itp/content/_index.md image
  • Preview commands:
cd ~/code/curriculum
git checkout -b updated-link-1119
# add the new and modified files
git add common-theme/layouts/shortcodes/next-class-day-plan.html org-cyf-itp/content/_index.md
git commit -m "feat(next-class): add next-class-day-plan shortcode and wire to ITP index (#1119)"
hugo server -D --bind=0.0.0.0 --port=1313
# open http://localhost:1313

Notes

  • The shortcode is referenced in org-cyf-itp/content/_index.md using {{< next-class-day-plan >}}.
  • If a site build fails with an error like failed to render shortcode "next-class-day-plan", ensure the shortcode file path is exactly common-theme/layouts/shortcodes/next-class-day-plan.html and that the partials it calls (if any) exist at the expected paths.

Copy link

netlify bot commented Aug 24, 2025

👷 Deploy request for cyf-curriculum pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ed67d4f

Copy link

netlify bot commented Aug 24, 2025

👷 Deploy request for cyf-piscine pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ed67d4f

Copy link

netlify bot commented Aug 24, 2025

👷 Deploy request for cyf-sdc pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ed67d4f

Copy link

netlify bot commented Aug 24, 2025

👷 Deploy request for cyf-tracks pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ed67d4f

Copy link

netlify bot commented Aug 24, 2025

👷 Deploy request for cyf-launch pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ed67d4f

Copy link

netlify bot commented Aug 24, 2025

👷 Deploy request for cyf-itd pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ed67d4f

Copy link

netlify bot commented Aug 24, 2025

👷 Deploy request for cyf-common pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ed67d4f

@illicitonion
Copy link
Member

illicitonion commented Aug 29, 2025

Thanks for putting this together! It generally looks reasonable, but one thing I'm not sure about is the scheduled menu - what are you expecting to be added to it?

As far as I can tell, this pull request doesn't create a menu called scheduled - what's meant to be in it? It looks like it's meant to be each sprint?

We already have a menu called "syllabus" which contains each module, and then a menu_level called "module" which contains each sprint within a module - could we use these existing menus, rather than having to introduce another one?

@illicitonion illicitonion self-requested a review August 29, 2025 17:17
@JohnnyRobs19
Copy link
Author

JohnnyRobs19 commented Sep 1, 2025

Hi @illicitonion,

Thank you for the feedback. I have reworked the PR so the shortcode now pulls sprint day‑plan pages directly from the existing syllabus → module menu structure—no additional scheduled menu is needed. The logic lives in common-theme/layouts/shortcodes/next-class-day-plan.html, which uses .Page.CurrentSection to gather the module’s pages and select the correct sprint link. I also removed the redundant partial/shortcode from org-cyf-theme and updated the README to note that next-class-day-plan relies on the current menu hierarchy.

Let me know if anything still looks off, and I will be happy to tweak further.

@illicitonion illicitonion moved this from 📋 Backlog to 👀 In review in Curriculum Planning Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants