shift-org / shift-org/shift-docs

consider creating separate hugo pages for each important url

Open
#790 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In talking through the hugo url handling at the biking and bits ride with Steven and Melanie -- i think it might be good to detangle the page handling some. ( noting that this would be a relatively big change. )

currently, production splats down[^1] what should be multiple pages into single page(s):

  1. all https://shift2bikes.org/addevent/... urls are handled by addevent.md which uses the caledit layout.
  2. all https://shift2bikes.org/calendar/... urls are handled by calendar.md which uses the calevents layout

what might be better is something like:

  • newEvent.md: for shift2bikes.org/addevent/
  • editEvent.md: for shift2bikes.org/addevent/edit-<event_id>-
  • calList.md: for shift2bikes.org/calendar/
  • calDaily.md: for shift2bikes.org/calendar/ event-<daily_id>

each pointing to a unique layout. similarly, the pedalpalooza page ( +/- the archive pages ) could point to pedalpalooza-calendar.md as they do currently; but that markdown could use a specialized pedalpalooza layout instead of calevents.


probably first it'd be worth investigating base templates. much of the various layout .html is duplicated, and introducing new layouts would only make that worse. ( base templates would allow better sharing )

or, as an alternative to adding a layout per .md file, it might be possible to create custom shortcodes so the .md files can directly indicate how the page should look. ( right now the .md files are empty except for the layout type: name )


[^1]: the production mapping is in netlify.toml: https://github.com/shift-org/shift-docs/blob/87980dcf72c81a9679b79432a43ad1ce03d1596e/netlify.toml#L137 -- unfortunately, netlify.toml isn't used in development mod. so its behavior is duplicated for 'npm run dev' byapp/facade.js and in services/nginx/conf.d/shift.conf for docker dev ( under the section 'development endpoints'. ) all three spots would have to be updated to stay in sync.

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 reading netlify.toml, app/facade.js, and services/nginx/conf.d/shift.conf to compare the production and development URL mappings. Then inspect the addevent.md, calendar.md, pedalpalooza content, and caledit/calevents layouts alongside Hugo base templates and shortcode documentation; the work is done when the chosen structure separates the important URL types without leaving the three mappings out of sync.

Written by the indexing model from the issue text.

Assessment

Tech stack
hugo, javascript
Domain
build-system, web-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.