Skip to content

fixed broken anchor link #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 25, 2025
Merged

Conversation

divine7022
Copy link
Contributor

@dlebauer
Fixed: #92
This PR addresses the issue of broken anchor links in the /gsoc_ideas page that were causing build warnings during yarn build.

@divine7022
Copy link
Contributor Author

@dlebauer Let me know if any further changes are required!

@dlebauer
Copy link
Member

Hi @divine7022 thanks for this change.

I'm trying to understand this change (and also the 'onbroken*' parameters).

Why do we want to ignore these and what is the behavior when a link is broken?

Would it be better to throw an error and fix links? Or throw a warning and let the build pass?

@divine7022
Copy link
Contributor Author

@dlebauer, thanks for your feedback sir!

The reason for using onBrokenAnchors: "ignore" is to allow the build to pass even if there are missing or broken anchor links.

There are two approches to fix it:

  • we can explicitly define them using {#custom-id} syntax in Markdown.
    For example: [GSoC - PEcAn Project Ideas]{#background}.
  • Alternatively, we can configure Docusaurus to ignore about broken anchors using onBrokenAnchors: "ignore"

I’m currently working on improving this to ensure a more efficient and reliable solution. Just a minute!

changes in docusaurus.config.js (onBrokenAnchors: "ignore") is no more need, because i fixed directly in gsoc_ideas.mdx which was casing an broken anchor link problem.
@divine7022
Copy link
Contributor Author

@dlebauer Hello sir,

  • Fixed the broken anchors issue.
  • Updated the project ideas list format by ensuring that each project title includes both a number and an ID for better linking.
  • Ensured that clicking on a project idea scrolls to the corresponding section.
  • Updated the Slack link for the #gsoc-2025 channel, ensuring contributors can easily access discussions.

Before:
image

After:
image

click here to review

Let me know if any further modifications are needed.
Thank you.

@dlebauer
Copy link
Member

dlebauer commented Feb 20, 2025

Awesome, thanks! But now it looks like there is a build issue? https://github.com/PecanProject/PecanProject.github.io/actions/runs/13444057397/job/37565167053#step:3:1

I just re-ran the build.

Thanks for fixing the header levels as well.

@dlebauer
Copy link
Member

Though I'm still not clear why either these are required / or why we would get warnings.

Docs said that these links will be automatically generated if not provided. https://docusaurus.io/docs/next/markdown-features/toc#heading-ids

I also want to make sure that we are solving the right problem. If this is required for all (or any) new pages, could you please update the contributing section of the README with info about using these links? - mostly what pages and header levels require them and how they should be formatted. It can be brief with a link to the docusaurus documentation (above). 🙏

@divine7022
Copy link
Contributor Author

Though I'm still not clear why either these are required / or why we would get warnings.

Docs said that these links will be automatically generated if not provided. https://docusaurus.io/docs/next/markdown-features/toc#heading-ids

I also want to make sure that we are solving the right problem. If this is required for all (or any) new pages, could you please update the contributing section of the README with info about using these links? - mostly what pages and header levels require them and how they should be formatted. It can be brief with a link to the docusaurus documentation (above). 🙏

@dlebauer hello sir, let me clarify why we need ### Hello World{#my-explicit-id} instead of [link](#heading-id) because:

  • ### Hello World {#my-explicit-id} -> This explicitly assigns an ID (my-explicit-id) to the heading.
  • [link](#my-explicit-id) -> This links to the heading using that fixed ID.

Why is this needed?

  • If you don’t set {#my-explicit-id}, Docusaurus will auto-generate an ID based on the text.
  • If the heading text changes, the auto-generated ID will change, but breaking links.
  • By setting {#my-explicit-id}, the link [link](#my-explicit-id) will always work, even if the heading text changes.

I'll also update the contributing section of the README with this information and a reference to the Docusaurus documentation.

@dlebauer
Copy link
Member

dlebauer commented Feb 21, 2025 via email

@divine7022
Copy link
Contributor Author

Got it - now it makes sense, as a way of preventing broken links if headers check. Thanks. Message ID: @.***>

@dlebauer Glad it makes sense!
Thank you!

@divine7022
Copy link
Contributor Author

Awesome, thanks! But now it looks like there is a build issue? https://github.com/PecanProject/PecanProject.github.io/actions/runs/13444057397/job/37565167053#step:3:1

I just re-ran the build.

Thanks for fixing the header levels as well.

@dlebauer
sir now All checks have passed now you can just review the gsoc_ideas.mdx which contains the necessary changes.

@divine7022
Copy link
Contributor Author

@dlebauer ,
Hi sir, I noticed that all checks have passed on this PR and the review is complete. Is there anything blocking it from being merged?

This PR fixes the broken anchor link warning during build and also lists all the projects which easier for navigation for the users.

@dlebauer dlebauer merged commit a14eb6a into PecanProject:master Feb 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug Report: Broken Anchors in /gsoc_ideas Page
2 participants