Closed samajammin closed 1 year ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Encountered some issues trying to implement this in an automatic way.
Using the pre-commit hook causes issues with staging the potential changes that are made when running a script to clean all of these up. It gets messy trying to stage only the new changes from the script with only what the user had previously staged, without potentially overwriting their stash in some cases.
Perhaps a GH action / bot that could scan for changes to /contents/
(minus content/translations
) folder and automatically run a script then and submit a bot PR to fix?
This now has added importance given that we rely on header IDs to determine if a translated file is outdated our not (#4441).
This issue is stale because it has been open 45 days with no activity.
Resurfacing in https://github.com/ethereum/ethereum-org-website/issues/10773 to refresh this issue
Is your feature request related to a problem? Please describe.
Often when contributors add new markdown files, they forget to add explicit header IDs (e.g. see @wackerow's review of #2194).
Describe the solution you'd like
We have a script to automatically add these explicit header IDs when they're not present: https://github.com/ethereum/ethereum-org-website/blob/dev/src/scripts/generate-heading-ids.js
It can be executed from the project root, e.g.
Let's explore the potential to add this as a pre-commit hook (can we access the filename?) so that before any markdown files are committed, we run the
generate-heading-ids
script on the file.Describe alternatives you've considered
Additional context
Why add add explicit header IDs: #272 TL;DR it's for anchor link consistency across translations