shift-org / shift-org/shift-docs

Move calendar inline Javascript from HTML partials to JS files

Open
#783 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement frontend
Dominant language
JavaScript
Stars
30
Forks
25
Avg merge
9m
Merged PRs (30d)
1

Description

Our main calendar Javascript is in the theme's /assets/js/cal folder. However, there is also some JS inline in HTML partials, in the theme's /layouts/partials/cal directory:

  • events.html
  • fullcal.html
  • up-next.html
  • pp-2020-cal.html
  • scripts.html
  • and maybe others?

We should get that JS code out of those HTML partials and into JS files, which would make it clearer where all of the JS actually lives (and also makes it easier to minify them).

Note that Hugo variables probably can't be accessed within plain JS files. But we might want to refactor uses of that anyway, as it muddies the line between the Hugo site and our calendar client.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the JavaScript in assets/js/cal with the inline scripts in layouts/partials/cal, especially events.html, fullcal.html, up-next.html, pp-2020-cal.html, and scripts.html. Inventory any additional inline calendar code and identify uses of Hugo variables before moving the code. Done means calendar behavior is preserved while the JavaScript lives in external files and can be minified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.