Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Fix broken links due to linking to submodules #12

Merged
merged 4 commits into from
Aug 29, 2023

Conversation

brsvh
Copy link
Contributor

@brsvh brsvh commented Aug 29, 2023

Fix the incorrect editURL generated during the build process for documents that are symbolically linked to sub-module directories.

For example, docs/modules/haskell-flake/examples.md.

before:

<a href="https://github.com/juspay/zero-to-flakes/tree/main/docs/modules/haskell-flake/examples.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a>

after:

<a href="https://github.com/srid/haskell-flake/blob/c8622c8a259e18e0a1919462ce885380108a723c/doc/examples.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a>

reslove #8

brsvh added 4 commits August 28, 2023 12:27
Signed-off-by: Burgess Chang <[email protected]>
New function `getModules' to parse git submodules and its latest hash.

New function `getDocOriginUrl' to construct the real link to the document on
the Git Forge. e.g. GitHub.

Signed-off-by: Burgess Chang <[email protected]>
Signed-off-by: Burgess Chang <[email protected]>
Avoid some name of variable and function that are too similar to JavaScript
module.

Signed-off-by: Burgess Chang <[email protected]>
Copy link
Member

@srid srid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Works great.

@srid srid merged commit e93f1e8 into juspay:main Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants