Skip to content
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

feat: broken link checker script #263

Merged
merged 13 commits into from
Mar 30, 2021
Merged

Conversation

bzp2010
Copy link
Contributor

@bzp2010 bzp2010 commented Mar 17, 2021

Fixes: #255

Changes:

A broken link checking script is implemented using NodeJS. It can scan the link and send an HTTP request to check if the link is available.

Problem:

Currently, markdown link detection uses an external library, which will have problems in link identification when checking links without title. Then consider refactoring this part of the code.

@bzp2010 bzp2010 requested a review from juzhiyuan March 17, 2021 11:54
@bzp2010 bzp2010 self-assigned this Mar 17, 2021
@bzp2010 bzp2010 changed the title feat: broken link checker script [WIP]feat: broken link checker script Mar 17, 2021
@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 18, 2021

Updated 2021-3-18

  • refactoring link scanner
  • create workflow

Tips

  • only links starting with http:// or https:// are checked
  • relative paths and page anchors are not checked
  • the list of broken links is stored by JSON in workflow artifacts

Problem

Is it necessary to check the existence of files linked by relative paths?

If necessary, the current PR has not been completed.

@bzp2010 bzp2010 marked this pull request as ready for review March 18, 2021 11:16
@bzp2010 bzp2010 changed the title [WIP]feat: broken link checker script feat: broken link checker script Mar 18, 2021
@juzhiyuan
Copy link
Member

Ya, I would prefer checking those links referenced across files.

@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 18, 2021

OK, I will continue to work on it.

@bzp2010 bzp2010 force-pushed the feat-link-checker branch from b796dc7 to 29c1fc6 Compare March 19, 2021 13:09
@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 19, 2021

Updated 2021-3-19

  • add local markdown file checking function

Tips

  • links starting with http:// or https:// and ending with .md are checked

Problem

Is there anything else to add?

@juzhiyuan
Copy link
Member

I noticed that there have some files end with .lua ?

@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 20, 2021

Those .lua files were not copied to the document directory, which prevented it from being checked. Therefore, it will be regarded as a broken link.

@juzhiyuan
Copy link
Member

yes, could we redirect users to the original site? (apisix's GitHub I mean)

@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 20, 2021

yes, could we redirect users to the original site? (apisix's GitHub I mean)

Redirect no .md files to GitHub page?

@juzhiyuan
Copy link
Member

.lua to github original file 🤔

@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 20, 2021

.lua to github original file 🤔

I need to try. Due to the problem of not copying other files, the correct file location relationship may not be established.

@bzp2010 bzp2010 force-pushed the feat-link-checker branch from 3bf4e1d to 3e56564 Compare March 20, 2021 08:15
@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 20, 2021

Updated 2021-3-20

  • add link conversion and check function for non document files

Tips

  • non document files link will be converse to a web link on GitHub

@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 21, 2021

Summary

  • The target function has been realized. (request review)
  • In order to ensure the correctness of the document, the link conversion function is not introduced in the workflow involving the output of compiled products. (Do we need this?)
  • The current implementation is not elegant enough. (Need help for improvement)

Thanks

link-checker.js Outdated Show resolved Hide resolved
@bzp2010 bzp2010 requested a review from juzhiyuan March 24, 2021 11:53
@bzp2010
Copy link
Contributor Author

bzp2010 commented Mar 24, 2021

The common code in the link-checker module has been splited. (such as document path generation)
The code in the document synchronization module will be implemented in the new PR.

Copy link
Member

@juzhiyuan juzhiyuan left a comment

Choose a reason for hiding this comment

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

LGTM

@juzhiyuan juzhiyuan requested review from LiteSun and liuxiran March 26, 2021 09:10
@LiteSun LiteSun merged commit 6561b84 into apache:master Mar 30, 2021
1502shivam-singh added a commit to 1502shivam-singh/apisix-website that referenced this pull request May 20, 2021
docs: added dashboard (apache#221)

fix: pull request in place of apache#214 (apache#222)

fix: changes to title style on landing page and doc addition

Co-authored-by: Amit Wani <[email protected]>

docs: added dashboard (apache#225)

docs: added blog `Get Front-End Test Coverage with Cypress`  (apache#227)

fix: Wrong doc url (apache#231)

fix: some url path can't replace by absolute url path (apache#237)

Co-authored-by: coolsoul <[email protected]>
Co-authored-by: 琚致远 <[email protected]>

feat: support edit this page & update styles (apache#235)

chore: fix release guide since doc layout changed (apache#238)

docs: added Integrate with Projects documentations (apache#234)

Co-authored-by: 琚致远 <[email protected]>

added latest styles

feat: algolia docSearch apache#226 (apache#241)

docs: use getting-started for ingress-controller (apache#242)

feat: upgrade APISIX version (apache#244)

fix: add <!--truncate--> to the blog markdown files apache#240 (apache#247)

fix: rectify the index doc page for apisix ingress controller (apache#249)

fix: fix the version number in mobile size overflow (apache#245)

fix: apache#220 (apache#239)

docs: added event about releasing APISIX 2.4 (apache#248)

docs: fixed broken powered-by.md link (apache#251)

docs: update navbar for apisix (apache#252)

fix: improved the description for users to join slack (apache#253)

chore: Add new committer jinchen in committer list (apache#254)

docs: add docs for ingress 0.4.0 (apache#258)

* docs: add docs for ingress 0.4.0

* docs: modify ingress downloads

* fix: lint

fix: update sync-docs.js (apache#257)

feat: improve documents synchronize (apache#262)

feat: sync user wall data (apache#260)

feat: support toggle sidebar (apache#269)

chore: move Chao Zhang from Committers to PMCs (apache#267)

feat: apache#216 add helm-chart project (apache#273)

fix: add a bundle of good first issues links to homepage  (apache#274)

feat: support apisix-docker (apache#275)

feat: broken link checker script (apache#263)

Co-authored-by: 琚致远 <[email protected]>

feat: apache#266 speed up static file (apache#270)

feat: upgrade APISIX Dashboard version (apache#276)

feat: support to load other projects (apache#277)

chore(deps): bump peaceiris/actions-gh-pages from v3 to v3.8.0 (apache#271)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore: upgrade APISIX 2.5 (apache#279)

chore: remove downloads for docker & helm chart (apache#284)

feat: APISIX 2.5 event (apache#283)

docs: added a new blog "Traffic Split in Apache APISIX Ingress Controller" (apache#286)

chore: support dark mode and switch (apache#289)

chore: support hide navbar on scroll down (apache#290)

fix: page not found for apisix docker and apisix helm chart (apache#282)

Co-authored-by: Ayush das <[email protected]>

fix: add truncate and source to newly added blog (apache#296)

* update traffic-split-in-ingress-controller.md

* Update website/blog/2021-03-27-traffic-split-in-apache-apisix-ingress-controller.md

Co-authored-by: John Bampton <[email protected]>

Co-authored-by: John Bampton <[email protected]>

fix: disable version switch button in sidebar, as website doesn't support it (apache#299)

fix: padding to arrow inside collapse sidebar button, and fit button to sidebar width (apache#300)

fix: darkMode enhanced (apache#297)

chore: release ingress controller 0.5.0 (apache#305)

* chore: release ingress controller 0.5.0

* feat: add event

fix: broken link in  release guide (apache#306)

docs: update the architecture diagram (apache#309)

chore: add alpha channel to showcase image for dark mode (apache#303)

Signed-off-by: yiyiyimu <[email protected]>

chore: Fix GitHub-icon sizes in team page  (apache#313)

docs: update logo wall (apache#315)

chore: upgrade APISIX Dashboard version to 2.6 (apache#317)

docs: update logo wall (apache#316)

docs: update download link (apache#320)

docs: update integration page (apache#327)

chore: Test Docusaurus webpack 5 support (apache#318)

feat: added last updated time (apache#331)

docs: fix broken links in Run Ingress on Amazon EKS blog (apache#333)

update docusaurus.config.json (apache#334)

feat: darkmode added to download-dropdown (apache#336)

Co-authored-by: 琚致远 <[email protected]>

chore(deps): bump actions/setup-python from 2 to 2.2.2 (apache#339)

Signed-off-by: dependabot[bot] <[email protected]>

chore(deps): bump actions/checkout from 2 to 2.3.4 (apache#337)

Signed-off-by: dependabot[bot] <[email protected]>

chore(deps): bump actions/setup-node from 2 to 2.1.5 (apache#338)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

release ingress 0.6.0 (apache#343)

docs: include  Helm charts and Docker to documents page (apache#342)

feat: added meta image (apache#345)

squashing: merge history commits on docs and landing page
1502shivam-singh added a commit to 1502shivam-singh/apisix-website that referenced this pull request May 20, 2021
docs: added dashboard (apache#221)

fix: pull request in place of apache#214 (apache#222)

fix: changes to title style on landing page and doc addition

Co-authored-by: Amit Wani <[email protected]>

docs: added dashboard (apache#225)

docs: added blog `Get Front-End Test Coverage with Cypress`  (apache#227)

fix: Wrong doc url (apache#231)

fix: some url path can't replace by absolute url path (apache#237)

Co-authored-by: coolsoul <[email protected]>
Co-authored-by: 琚致远 <[email protected]>

feat: support edit this page & update styles (apache#235)

chore: fix release guide since doc layout changed (apache#238)

docs: added Integrate with Projects documentations (apache#234)

Co-authored-by: 琚致远 <[email protected]>

added latest styles

feat: algolia docSearch apache#226 (apache#241)

docs: use getting-started for ingress-controller (apache#242)

feat: upgrade APISIX version (apache#244)

fix: add <!--truncate--> to the blog markdown files apache#240 (apache#247)

fix: rectify the index doc page for apisix ingress controller (apache#249)

fix: fix the version number in mobile size overflow (apache#245)

fix: apache#220 (apache#239)

docs: added event about releasing APISIX 2.4 (apache#248)

docs: fixed broken powered-by.md link (apache#251)

docs: update navbar for apisix (apache#252)

fix: improved the description for users to join slack (apache#253)

chore: Add new committer jinchen in committer list (apache#254)

docs: add docs for ingress 0.4.0 (apache#258)

* docs: add docs for ingress 0.4.0

* docs: modify ingress downloads

* fix: lint

fix: update sync-docs.js (apache#257)

feat: improve documents synchronize (apache#262)

feat: sync user wall data (apache#260)

feat: support toggle sidebar (apache#269)

chore: move Chao Zhang from Committers to PMCs (apache#267)

feat: apache#216 add helm-chart project (apache#273)

fix: add a bundle of good first issues links to homepage  (apache#274)

feat: support apisix-docker (apache#275)

feat: broken link checker script (apache#263)

Co-authored-by: 琚致远 <[email protected]>

feat: apache#266 speed up static file (apache#270)

feat: upgrade APISIX Dashboard version (apache#276)

feat: support to load other projects (apache#277)

chore(deps): bump peaceiris/actions-gh-pages from v3 to v3.8.0 (apache#271)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

chore: upgrade APISIX 2.5 (apache#279)

chore: remove downloads for docker & helm chart (apache#284)

feat: APISIX 2.5 event (apache#283)

docs: added a new blog "Traffic Split in Apache APISIX Ingress Controller" (apache#286)

chore: support dark mode and switch (apache#289)

chore: support hide navbar on scroll down (apache#290)

fix: page not found for apisix docker and apisix helm chart (apache#282)

Co-authored-by: Ayush das <[email protected]>

fix: add truncate and source to newly added blog (apache#296)

* update traffic-split-in-ingress-controller.md

* Update website/blog/2021-03-27-traffic-split-in-apache-apisix-ingress-controller.md

Co-authored-by: John Bampton <[email protected]>

Co-authored-by: John Bampton <[email protected]>

fix: disable version switch button in sidebar, as website doesn't support it (apache#299)

fix: padding to arrow inside collapse sidebar button, and fit button to sidebar width (apache#300)

fix: darkMode enhanced (apache#297)

chore: release ingress controller 0.5.0 (apache#305)

* chore: release ingress controller 0.5.0

* feat: add event

fix: broken link in  release guide (apache#306)

docs: update the architecture diagram (apache#309)

chore: add alpha channel to showcase image for dark mode (apache#303)

Signed-off-by: yiyiyimu <[email protected]>

chore: Fix GitHub-icon sizes in team page  (apache#313)

docs: update logo wall (apache#315)

chore: upgrade APISIX Dashboard version to 2.6 (apache#317)

docs: update logo wall (apache#316)

docs: update download link (apache#320)

docs: update integration page (apache#327)

chore: Test Docusaurus webpack 5 support (apache#318)

feat: added last updated time (apache#331)

docs: fix broken links in Run Ingress on Amazon EKS blog (apache#333)

update docusaurus.config.json (apache#334)

feat: darkmode added to download-dropdown (apache#336)

Co-authored-by: 琚致远 <[email protected]>

chore(deps): bump actions/setup-python from 2 to 2.2.2 (apache#339)

Signed-off-by: dependabot[bot] <[email protected]>

chore(deps): bump actions/checkout from 2 to 2.3.4 (apache#337)

Signed-off-by: dependabot[bot] <[email protected]>

chore(deps): bump actions/setup-node from 2 to 2.1.5 (apache#338)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

release ingress 0.6.0 (apache#343)

docs: include  Helm charts and Docker to documents page (apache#342)

feat: added meta image (apache#345)

squashing: merge history commits on docs and landing page

set max-width attribute to docMainContainer class

set max-width attribute to docMainContainer
SkyeYoung pushed a commit to SkyeYoung/apisix-website that referenced this pull request Mar 3, 2022
* remove outdated codes

* feat: merged next

* feat: update action

* feat: update README

* Delete .DS_Store
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.

Action: check broken links after building
3 participants