Skip to content

The glossary is invisible to search engines because it renders in JavaScript #56

Description

@pushpam2404

Context

Every glossary entry is injected by js/glossary.js after load. The HTML served contains only "Loading the glossary…". Search engines and link previews see an empty page, which for a glossary — the most linkable content on the site — is the wrong way round.

What to change

Files: A new build script, glossary.html, js/glossary.js, a new workflow

Requirements:

  • Render the entries into glossary.html at build time so the served HTML contains them
  • Keep the client-side search working on top of the prerendered markup
  • A GitHub Action regenerates the page when data/glossary.json changes and commits the result
  • The JSON stays the single source of truth — never edit the generated markup by hand
  • Say clearly in the file that the section is generated

Acceptance criteria

  • curl on the built page returns the actual terms
  • Search still filters after load
  • Editing the JSON and running the build updates the page
  • CI keeps them in step and fails if they drift
  • The page works fully with JavaScript disabled

How to verify locally

python3 -m http.server 8000

Then open http://localhost:8000.

Difficulty

Advanced. The interesting constraint is keeping generated and source in step without letting them drift.


New here? Comment /claim on this issue and a bot will assign it to you. Then read CONTRIBUTING.md.

Stuck at any point? Comment here saying what you have tried and where it stopped working — that is not an admission of failure, it is how we find out the instructions were unclear. You can also come to a PR Debug Clinic (Oct 12 or Oct 21).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions