gc-da11yn / gc-da11yn.github.io

Digital Accessibility Toolkit - Boîte à outils d'accessibilité numérique
https://a11y.canada.ca/en/
MIT License
31 stars 32 forks source link

Fixing broken links #423

Closed acev0010 closed 9 months ago

acev0010 commented 9 months ago

What does this pull request (PR) do? / Que fait cette demande « pull » (PR)?

This pull contains:

Below I will leave a breakdown of each script, how they run and its purpose:

Scripts and plugins

link-check.js

The markdown-link-checker is an implemented plugin from markdown-link-checker

To run the plugin type 'npm run link-check' in your terminal. The links will load in the terminal but only the broken ones will be generated inside a 'broken-links.json' in the root directory.

This command and plugin will check for links inside the "src\pages" directory, checking both English and French pages.

The link checker currently ignores:

markdown-to-html

The plugin used here is 'markdown-it-replace-link'.

This plugin will convert only markdown links such as [Access Working Group (AWG)](/en/about/workinggroups/awg/) to be converted into HTML links on build. This command runs automatically after writing npm: run build.

replace-links.js

This doesn't use a plugin and instead uses a regex generously crafted by ChatGPT to change links inside each markdown file to work on HTML. This command runs automatically after writing npm: run build.

For example, it will change:

From ./developpeurs-dapplication-web.md To ../developpeurs-dapplication-web/

Missing links

Below is a list of links that are either missing or have changed and I couldn't find, all these links are from the src\pagesdirectory:

Link: consultez <a href="" rel="external">
From:  `ameliorer-laccessibilite-des-formulaires.md`

Link: <a href="./Official-languages-recommendations">Recommandations sur les langues officielles (LO)</a></h2>
From: reunions-evenements-virtuels-accessibles.md

Link: [Official Languages (OL) recommendations](./Official-languages-recommendations)
From: accessible-meeting-event-guidelines.md

Link: <a href="../../fr/curriculum/a11ycheck-nonweb/" class="btn btn-success">Lire<span class="wb-inv"> Liste de contrôle des évaluations de la conformité de l'accessibilité (non Web / logiciel)</span></a>
From: testeurs-dapplications-bureautiques.md

Link: [Liste de contrôle pour la description sonore](#_Audio_Description_Checklist)
From: introduction-aux-exigences-daccessibilite-pour-laudio-video.md

Link: [Directives d’accès au clavier](#_Time-based_Media_Player)
From: introduction-aux-exigences-daccessibilite-pour-laudio-video.md

Link: [Liste de contrôle d’accès au clavier](#_Time-based_Media_Player_1)
From: introduction-aux-exigences-daccessibilite-pour-laudio-video.md

Link: [les recommandations en matière de langues officielles (LO)](./Official-languages-recommendations-fr.html)
From: lignes-directrices-pour-les-reunions-evenements-accessibles.md

Link: [Choses à faire et à ne pas faire dans la conception accessible](../fr/index.html)
From: liste-de-verification-de-laccessibilite-des-documents-pdf.md

Link: [Do's and Dont's for Accessible Designs](../en/index.html)
From: pdf-accessibility-checklist.md

Link: <a href="./services-cart-et-interpretes-en-langue-des-signes-sli.md">
From: reunions-evenements-virtuels-accessibles.md

Link: [Accessibility Strategy for the Public Service](//www.canada.ca/en/government/publicservice/wellness-inclusion-diversity-public-service/diversity-inclusion-public-service/accessibility-public-service/accessibility-strategy-public-service-toc.html)
From: measurement-of-accessible-information-and-communications-technology-ict.md

Link:[Arvind Srivastava (Treasury Board of Canada Secretariat)](mailto:arvind.srivastava@tbs-sct.gc.ca) and [Melissa Smith (Shared Services Canada)](mailto:melissa.smith@canada.ca)
From: measurement-of-accessible-information-and-communications-technology-ict.md

The following links work on build but not in between markdown files

Link: [Accessible meetings and events - Summary of Advice list (DOCX, 28 KB)](../../docs/accessible-meetings-and-events-summary-of-advice-list.docx)
From: accessible-meeting-event-guidelines

Link: [Réunions et événements accessibles - Résumé de la liste de conseils (DOCX, 28 KB)](../../docs/reunions-et-evenements-accessibles-resume-de-la-liste-de-conseils.docx)
From: lignes-directrices-pour-les-reunions-evenements-accessibles.md

Additional information (optional) / Information additionnelle (optionel)

I tried used the linkinator plugin and it works in showing all the links that lead to 404, however I was unable to make it show me where the broken links are originated from. I'm leaving this information here in case I decide to give it another go.

netlify[bot] commented 9 months ago

Deploy Preview for a11ycanada ready!

Name Link
Latest commit e3792125c8fb167724915a9f59ea576528141ad6
Latest deploy log https://app.netlify.com/sites/a11ycanada/deploys/655d015dec1c740008a4ae9f
Deploy Preview https://deploy-preview-423--a11ycanada.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

acev0010 commented 9 months ago

For clarification as of why there are two different link checkers: I was unable to make them work as one, so I had to separate them. 😔

shawnthompson commented 9 months ago

This was replaced with this merge: #428