Introduction

Library guides are an important component of libraries of all types. In academic libraries, they are primarily used as instruction guides for information literacy as well as indexes of course- and subject-specific databases and other scholarly resources. But they are also a publishing tool that highlights upcoming workshops and events, and many institutions host their entire library website from them. It is therefore important that content on library guides be accessible and accurate. This can prove challenging, especially when there are multiple guide owners and no centralized mechanism to ensure conformance to accessibility standards. Furthermore, many guide owners are unfamiliar with accessibility standards and may have difficulty using or understanding tools to diagnose accessibility errors.

McGill University Libraries implemented an accessibility-checking tool on LibGuides called Editoria11y (Editorial ally). This tool has a number of advantages over other approaches to finding and fixing accessibility problems on websites. It is free to set up and requires no installation on the part of the user. Compared to other tools, it checks against a more comprehensive set of accessibility considerations. It is also user-friendly and provides a helpful explanation of the accessibility concern, informing users how an error translates into a concrete issue for those with disabilities.

In addition, we explain how to customize Editoria11y so it also checks broken links. While broken links are not traditionally viewed as an accessibility concern, they are related (Stitz & Blundell, 2018, p. 52), and library guides are notoriously plagued with them (Randtke & Burrell, 2012; Potvin et al., 2024). We show how to incorporate addressing accessibility issues and broken links into a regular website health regimen.

Literature Review

Website accessibility refers to the ability of all people, regardless of their (dis)ability, to access content on the web. The World Wide Web Consortium, an international organization devoted to ensuring the long-term growth of the web, published its first set of guidelines, the Web Content Accessibility Guidelines (WCAG) 1.0, in 1999. The consortium released a much broader and more mature set of standards, WCAG 2.0, in 2008. These were developed to apply to a large range of disabilities, including blindness and low vision, deafness and hearing loss, low mobility, and other cognitive and learning limitations (Caldwell et al., 2008). In 2018, WCAG 2.1 was released with the goal of improving accessibility guidance for users with cognitive disabilities, low vision, and disabilities with respect to using mobile devices (Kirkpatrick et al., 2025).

During this 20-year period, many governments looked to the WCAG as a compliance standard for laws and regulations mandating the accessibility of publicly funded websites. In the United States, the Department of Justice recently finalized a rule updating regulations for Title II of the Americans with Disabilities Act. This rule will require the websites of public entities to comply with WCAG 2.1 level AA by 2027 or 2028, depending on the population size served by the public entity (Lechtenberg & Gold, 2024; Extension of Compliance Dates, 2026). In Canada, website accessibility falls within the jurisdiction of the provinces. Quebec, for example, published the Standard sur l’accessibilité des sites Web which requires, as of April 2024, websites of public organizations to meet WCAG 2.0 level AA, with limited exceptions (Standard sur l’accessibilité des sites Web, 2025).

Making web content accessible can be challenging. Spina (2019, “How Accessible is the Web?” section) found from a review of the literature that “websites across all sectors have significant accessibility issues that present barriers for users with disabilities as they navigate the web.” For instance, many users with vision-related disabilities rely on screen readers to navigate the web. These devices must be able to harvest the textual content of web pages. If an image file does not contain alternative (alt) text describing what the image is, that information is not conveyed to the user of the screen reader, rendering the web page somewhat confusing at best or meaningless at worst. As another example, users with vision- or hearing-related disabilities are not always able to obtain information from audiovisual multimedia. That is why video files should have captions or a synchronized text transcript and why audio files should have a text transcript. Transcripts can also aid those who are not fluent in the language and those with low bandwidth that prevents them from playing multimedia files.

Like other types of websites, library websites remain susceptible to these problems (Oud, 2012; Yoon et al., 2016). Springshare’s LibGuides, which in the last decade have become a popular content management system in libraries, have received much attention in the literature on accessibility. Chee and Weaver (2021) conducted an audit of all research guides at the University of Waterloo Library. They evaluated sixty-three research guides based on twenty-seven criteria from WCAG 2.0 deemed applicable to academic libraries. Noncompliance was documented in twelve of the WCAG 2.0 criteria, five at the A level and seven at the AA level. For example, criterion 1.3.1, “Info and Relationships,” was non-compliant in 90 percent of cases. This criterion requires that relationships on a web page conveyed visually are also coded into the HTML. Research guides were considered noncompliant if they had incorrect use of headings, incorrect use of textual emphasis, missing table headings, or use of non-heading formatting when headings were called for.

Greene (2020) described auditing and improving approximately sixty public LibGuides at the Dahlgren Memorial Library at Georgetown University Medical Center. Library staff used the licensed product SiteImprove to detect WCAG errors as well as provide an overall accessibility score. Before starting the process LibGuides achieved a score of 60 percent—below the industry benchmark of 70 percent. Greene describes guide-level changes—performed by a committee of librarians plus a student worker—and global template changes that affected accessibility across multiple guides. After making changes to address accessibility errors over six months, the score improved to 96.6 percent.

Stitz and Blundell (2018) examined a sampling of eighteen public LibGuides at a mid-sized university in Ohio. They developed a comprehensive accessibility guidelines rubric, which was based on criteria from WCAG 2.0 but also included best practices from universal design and web design principles. Through auditing their sampled LibGuides, they discovered that every one failed more than 70 percent of the applicable criteria of the rubric. Many errors existed in templates that content creators did not control (and which Springshare has subsequently fixed), but they discovered issues in author-controlled content as well. Common examples included missing or insufficiently described text alternatives for non-text elements (images), inappropriate use of heading tags (such as not using consecutive levels), and hyperlinks that were not properly indicated (such as with an underline and an acceptable color contrast against the background). The web design best practice criterion was violated for numerous reasons, including “at least 26 broken URLs found throughout the template” (p. 52). These studies have recommended tools such as WAVE and SiteImprove (Greene, 2020; Lechtenberg and Gold, 2024; Percival, 2023; Rayl, 2021), although it is worth noting that automated tools alone cannot check many of the newer criteria in WCAG 2.1 (Spina, 2019).

Implementation

In the summer of 2024, McGill University Libraries implemented the open-source tool Editoria11y on its LibGuides system to improve website accessibility. The decision arose from several factors, but two stand out as deserving mention. First, legislation in the province of Quebec (the Standard sur l’accessibilité des sites Web) mandates that all websites of public bodies meet the AA level of the WCAG 2.0, with a small number of exceptions. Although we did not expect this measure to be enforced for subsidiary library websites such as LibGuides, the Libraries still desired to comply and improve accessibility. Second, addressing website accessibility is an important component of the Libraries’ strategic priority to improve equity, diversity, and inclusion.

Its developers describe Editoria11y as a “user-friendly accessibility ‘spellcheck’” that runs in the background of a website (Editoria11y Accessibility Checker, n.d.). It is maintained by Princeton University’s Web Development Services team and began life as a fork of Sa11y, another browser-based tool. The idea to use Editoria11y for LibGuides came to us from McGill’s own Web Services Group, which implemented the Editoria11y Drupal plugin on the central Drupal content management system in 2021.

To an anonymous user of the website (i.e., a user who is not logged in to Drupal), the website appears normally. However, an authenticated user sees the addition of an icon floating in the bottom-right corner of the screen. When clicked, this icon guides the user through a list of alerts—either accessibility warnings or errors. (See Figures 1 and 2.) Warnings are potential problems that need to be evaluated in context to determine if any action is required. For example, Editoria11y warns about long headings that could make navigating difficult for users of assistive devices. What counts as long, and whether the heading can be shortened at all, is left for the editor to determine. Errors are problems to address. For example, if a link does not have any accessible text, it will be practically unnavigable for users of assistive devices.

Figure 1:
Figure 1:

Editoria11y warning.

Figure 2:
Figure 2:

Editoria11y error.

As seen below, Editoria11y highlights the offending element, explains the nature of the accessibility issue, and suggests ways to fix it, making it ideal for someone with limited knowledge of website accessibility. In addition, compared to other accessibility software, Editoria11y is relatively “hands-off” in that the content editor does not need to install anything, run any local software, or visit a third-party website. The editor simply needs to visit a web page while it is in its “spellcheck” (accessibility) mode and run through the alerts. Prior knowledge of website accessibility is an asset while using this tool, especially for some types of warnings and errors, but the user interface and explanatory features of the tool make it well-suited for novices.

The Libraries wanted to replicate this experience on LibGuides, specifically the “dual mode” nature of being able to enable Editoria11y for the guide owners while keeping it disabled for the anonymous users of the guides (e.g., students and faculty). Unfortunately, this is less straightforward to achieve in LibGuides. Not only is there no out-of-the-box plugin for LibGuides, but the administrative interface used in making edits is very different from the public-facing view. Editoria11y would not be checking the same environment that the public user would be interacting with. Furthermore, the administrative interface in Springshare is locked down; uploading one’s own JavaScript files would not have any effect on those sets of pages. We used a different technique: We installed Editoria11y in LibGuides by adding <script> (JavaScript) and <link> (CSS) tags to the <head> of the pages. But in our “driver code,” we added a conditional when setting up the main Editoria11y configuration:


if (window.location.href.endsWith("?ed11y")) {
 // create “Ed11y” instance
 const ed11y = new Ed11y({
  // configuration options go here...
 });
}

What this means is that the code used to generate the Editoria11y alerts is only run if the URL of the website ends with the string “?ed11y”. This string, which consists of a question mark followed by some text, is called a URL parameter. URL parameters do not (typically) affect the behavior of web pages. Appending such a URL parameter to the address of a public-facing LibGuide would normally do nothing. However, by having our JavaScript code check for the presence of this specific URL parameter, we can mimic the effect of a content editor logging in to the web editing system. A student or faculty member is unlikely to visit any of our LibGuides with this URL parameter present, and so they will not encounter Editoria11y when they peruse our guides. Rather, this modified URL is “reserved” and used just for guide owners who want to improve the accessibility of their guides using Editoria11y. Simply tell guide owners to append “?ed11y” to any of their guides’ public-facing URLs, and Editoria11y will load.

When we added Editoria11y to our guide pages, we configured it so it would only scan the central portion of the pages, where guide owners add their content, for accessibility issues. We did this because the other sections of the page—the header, side navigation, and footer—were already free of accessibility errors. To borrow the language of Stitz and Blundell (2018), our objective was to correct the author-controlled LibGuide elements; we ignored non-author-controlled elements (the template and any inserted widgets).

This technique worked well for library staff to improve accessibility errors. But we wanted to go a step further, given our knowledge that broken links constitute a well-known and thorny issue for LibGuides (Randtke & Burrell, 2012; see Potvin et al., 2024 for an overview of reference rot in library resources). Broken links are links that point to unexpected places. Usually, links can “rot” when the target page ceases to exist, leading the user to encounter a 404 error. But we can define broken links more broadly to include web pages that are experiencing persistent server errors, web pages that unexpectedly require a login that we know students and staff will not have, and even web pages that have changed hands and no longer present the intended information. Any destination that is not what the library staff creator intended when the guide was designed is, in this sense, a broken link.

Springshare does have a built-in link checking capability for use with LibGuides, but it is restricted to links in Database, Link, and Book assets. Many guide creators create HTML content on their guides and add links in that content. Those links are not stored in LibGuides’s central asset system and are therefore beyond the scope of this link checker. This is a major problem; not only is adding links in regular HTML content a common practice among library staff, but in many cases, the nature of how LibGuides are created and passed on—often created by someone years ago and inherited multiple times over by others—tends to exacerbate the severity of link rot. Unless there is an easy way to correct these broken links, and a commitment among staff to treat this as a serious problem, the link rot will worsen over time.

Broken links are not, strictly speaking, a website accessibility issue as traditionally understood. Editoria11y does not have the ability to check for broken links out of the box. It does, however, provide developers the option to create custom JavaScript tests. Custom tests are features of some software frameworks that allow developers to verify that the software is working as expected even under conditions unique to their own project. In the case of Editoria11y, it allows developers to scan web pages for more than just a standard set of WCAG 2.0 errors. An example from Editoria11y’s website of a custom test is scanning for the presence of links that have likely been pasted from email messages (e.g., links containing the string “safelinks.protection.outlook.com”). This feature is not something that Editoria11y comes with in a fresh installation, but by adding a custom test to detect that specific string, Editoria11y can scan for it and include it in the list of alerts along with other accessibility-related errors and warnings.

We decided to write a custom test for Editoria11y that would highlight links pointing to websites that failed a third-party link checker program. For this project, we chose to use an open-source link checker called linkinator. We picked it because it was being actively maintained and had the option to generate a CSV report of broken links, which is a useful format if one is planning to do data manipulation. (Other tools meet these criteria, such as the Python-based LinkChecker. It is ultimately a matter of personal preference which link checker to use.) To run a link checker on all of our LibGuides, we needed a list of all the published web pages across all published guides. Unfortunately, while it is possible to export a list of published LibGuides, there does not seem to be a way to export a list of all the individual pages across all guides. This was important because we wanted to include child pages and not limit ourselves to just the landing pages of guides. Consequently, we wrote a script in R that visits each published LibGuide and pulls out the links of its child pages (see appendix 1).

Next, we ran our link checker on all pages of our published LibGuides. Using linkinator, it looked like this:


while read url
do
 npx linkinator "$url" --format CSV --timeout 10000 --skip '^https?://proxy\.library\.yourinstitution\.edu/' | tee -a linkinator-output.csv
 sleep 1
done < list_of_links.txt

There are a couple of observations to note about our experience using linkinator. First, it is a good idea to exclude (using the --skip flag) any web page that is likely to give a false positive. In our case, we were not interested in checking proxied links for electronic resources, which would not have returned a 200 OK status from most link checker programs. Second, with thousands of links to go through, the process could take several hours.

Once all the LibGuides links were run through linkinator, we needed to write the custom test in JavaScript that tells Editoria11y to scan and flag these potential broken links. Our strategy for writing the custom test was influenced by the large number of links that linkinator identified. If there had been only twenty broken links discovered, our custom test would have closely modeled the sample code provided on Editoria11y’s website for creating a custom test. However, linkinator identified over 4,000 potential broken links. Rather than having the JavaScript check each page for the presence of one or more of these 4,000 links, we decided to make things easier by grouping links by the guide ID of the LibGuide. This meant that prior to scanning a web page, Editoria11y would filter the list of broken links to only those links that were discovered on the LibGuide the page was associated with. Instead of needing to scan for 4,000 potential broken links, Editoria11y would only need to scan for a few dozen, or perhaps a hundred, which was more manageable.

The R code in appendix 2 took two inputs—the output text file from linkinator and the data frame of LibGuides (appendix 1)—and generated a JavaScript file that implemented the custom test as described above. We uploaded this JavaScript file to LibGuides. It worked in conjunction with the Editoria11y library and CSS, which we added directly in the <head> section of our LibGuides template. The result is that alongside accessibility errors, it flagged potential broken links for content editors when they went through their list of alerts in Editoria11y (see Figure 3).

Figure 3:
Figure 3:

Broken link error.

Results

After implementing the tool on our LibGuides system, we informed library staff at a monthly meeting and trained them on how to access the “reserved” URL for their guides and click through the list of alerts. We did not have time to do in-depth accessibility training, but we did run through some of the most common accessibility errors and how to correct them in LibGuides. We also sent instructions via email, along with periodic reminders throughout the semester. A few librarians got in touch with more specific questions about errors on their guides.

One-on-one consultations with librarians were generally of two types. Some librarians were unfamiliar with website accessibility and needed a more gently-paced introduction. For these individuals, we chose one of their LibGuides and looked at each individual guide page using Editoria11y, clicking on alerts and discussing how to resolve them. The most common Editoria11y warning was for link text in the form of a URL. This almost exclusively occurs when a link’s text is identical to its destination. According to Editoria11y, link text should be meaningful and concise:

Longer, less intelligible URLs used as link text might be difficult to comprehend with assistive technology. In most cases, it is better to use human-readable text instead of the URL. Short URLs (such as a site's homepage) are okay. (Jameson, 2026, https://github.com/itmaybejj/editoria11y/blob/9e630ffe5ee5aedad9719506a8e1ac902d6310ca/src/sa11y-lang/en.js#L234)

Fixing this is as simple as choosing a more meaningful phrase for the link, such as the title of the destination web page. Our top six most common accessibility-related alerts are in Table 1.

Table 1: Top six most common accessibility alerts.

Alert

Explanation

Link text is URL

Not meaningful, cannot be skimmed by users

Link opens in new window

Unexpected behavior, breaks “back” button

Table is missing header cells

Confusing for screen reader users

Linked PDF document may not be accessible

Ensure PDF-specific accessibility (e.g., headings, lists with table headers, etc.)

Linked image has no alt text

Produces no link title for screen readers

Very long alternative text

Usually unhelpful to users of screen readers

Beyond individuals who were unfamiliar with accessibility, some had questions on specific error messages. For example, many alerts included the text “The item with this issue may be invisible or off screen.” We frequently saw this for items in image carousels that were not on the screen. Tables without a header row were another source of frustration for some staff. Adding header cells to a table is fairly simple but can look awkward in some contexts, prompting discussions about non-tabular ways of displaying the same information.

Reflection

Overall, the implementation of Editoria11y has been successful, but the rate at which the tool has been used to fix errors and warnings has been slower than anticipated. Based on comparing a snapshot of all Editoria11y errors at the time of project implementation to a snapshot approximately one year afterward, we found that about one-third of our LibGuides contained fewer errors. This is consistent with our anecdotal experience of advocating for a non-binding recommendation across a large group: some enthusiastically take up the recommendation, many do so to a more limited extent, and some fail to heed it at all. Out of our almost fifty librarians with LibGuides, most of the progress was made in those guides belonging to the most eager half dozen. This is also consistent with the literature on addressing accessibility issues in LibGuides: very high rates of compliance are possible, but they tend to come about from legal or institutional pressure, as can be seen in the example from Greene (2020).

Readers can draw many lessons from our experience. It’s possible that a lack of knowledge of website accessibility hindered or intimidated people away from using Editorial11y. More training than we provided would have been helpful. In addition, we could have suggested other accessibility tools beyond Editoria11y in case people wanted to experiment. It seems clear that having strong incentives and administrative buy-in is important for motivating individuals to spend their time on accessibility issues. It may be the case, of course, that some guide owners have a small number of accessibility and link rot issues while others have considerably more. Consider alternative approaches for splitting up the work, perhaps by delegating some of it to a committee or some student workers. One idea we are contemplating is to prioritize guides that have a very large number of errors and reach out to their owners with an offer to sit down and work through some of them together.

Finally, the experience at McGill presents a couple of different opportunities for future research. What are the reasons library staff give for not addressing accessibility issues on their LibGuides? Is it all explained by a lack of training and time, or do other beliefs play a role as well? There is also a gap in the literature about the extent of link rot in library guides. To what extent is it a problem? Are they more or less vulnerable to link rot compared to other types of websites?

Conclusion

Implementing Editoria11y on our LibGuides has been a successful intervention for a stubborn, long-standing problem at McGill University Libraries. At the time of implementation, there were over 36,000 Editoria11y alerts across all of our LibGuides, with potential broken links making up about 5 percent of the total. About two-thirds of alerts were the result of just two errors: (1) a link’s text being a URL and (2) a link opening in a new window. The process to fix these and other errors is relatively easy, but given the enormous scope of the problem, it could take a long time to address. It is our goal to monitor how many alerts exist across all guides so we can record and measure progress. We will also periodically refresh our Editoria11y file with newly flagged links from linkinator.

References

Caldwell, B., Cooper, M., Reid, L. G., & Vanderheiden, G. (Eds.) (2008, December 11). Web content accessibility guidelines (WCAG) 2.0. W3C. https://www.w3.org/TR/WCAG20/https://www.w3.org/TR/WCAG20/

Chee, M., & Weaver, K. D. (2021). Meeting a higher standard: A case study of accessibility compliance in LibGuides upon the adoption of WCAG 2.0 Guidelines. Journal of Web Librarianship, 15(2), 69–89. https://doi.org/10.1080/19322909.2021.1907267https://doi.org/10.1080/19322909.2021.1907267

Editoria11y Accessibility Checker. (n.d.). https://editoria11y.princeton.edu/https://editoria11y.princeton.edu/

Extension of Compliance Dates for Nondiscrimination on the Basis of Disability; Accessibility of Web Information and Services of State and Local Government Entities, 91 F.R. 20902 (2026) (to be codified at 28 C.F.R. § 35.200). https://www.federalregister.gov/documents/2026/04/20/2026-07663/extension-of-compliance-dates-for-nondiscrimination-on-the-basis-of-disability-accessibility-of-webhttps://www.federalregister.gov/documents/2026/04/20/2026-07663/extension-of-compliance-dates-for-nondiscrimination-on-the-basis-of-disability-accessibility-of-web

Greene, K. (2020). Accessibility nuts and bolts: A case study of how a health sciences library boosted its LibGuide accessibility score from 60% to 96%. Serials Review, 46(2), 125–136. https://doi.org/10.1080/00987913.2020.1782628https://doi.org/10.1080/00987913.2020.1782628

Jameson, J. (2026). Editoria11y source code (Version 3.0.1) [Source code]. GitHub. https://github.com/itmaybejj/editoria11yhttps://github.com/itmaybejj/editoria11y

Kirkpatrick, A., O’Connor, J., Campbell, A., & Cooper, M. (Eds.) (2025, May 6). Web content accessibility guidelines (WCAG) 2.1. W3C. https://www.w3.org/TR/WCAG21/https://www.w3.org/TR/WCAG21/

Lechtenberg, U., & Gold, H. (2024). Beyond the minimum: New rule requires web content (I’m looking at you, LibGuides) to meet WCAG 2.1 Level AA Standards. Information Technology and Libraries, 43(4). https://doi.org/10.5860/ital.v43i4.17312https://doi.org/10.5860/ital.v43i4.17312

Oud, J. (2012). How well do Ontario library web sites meet new accessibility requirements? Partnership: The Canadian Journal of Library and Information Practice and Research, 7(1). https://doi.org/10.21083/partnership.v7i1.1613https://doi.org/10.21083/partnership.v7i1.1613

Percival, L. (2023). Wooing librarians to embrace WCAG (Wuh-cag). ALISS Quarterly, 18(2), 14–16. https://alissnet.com/wp-content/uploads/2023/02/aliss-vol-18-no.2-january-2023.pdfhttps://alissnet.com/wp-content/uploads/2023/02/aliss-vol-18-no.2-january-2023.pdf

Potvin, S., Budzise-Weaver, T., & Anders, K. C. (2024). Delicate links: Ephemerality in web-based evidence in electronic theses and dissertations. portal: Libraries and the Academy, 24(3), 519–552. https://doi.org/10.1353/pla.2024.a931770https://doi.org/10.1353/pla.2024.a931770

Randtke, W., & Burrell, M. D. (2012). Tools for reducing and managing link rot in LibGuides. Code4Lib Journal, 17. https://journal.code4lib.org/articles/7019https://journal.code4lib.org/articles/7019

Rayl, R. (2021). How to audit your library website for WCAG 2.1 compliance. Weave: Journal of Library User Experience, 4(1). https://doi.org/10.3998/weaveux.218https://doi.org/10.3998/weaveux.218

Spina, C. (2019). WCAG 2.1 and the current state of web accessibility in libraries. Weave: Journal of Library User Experience, 2(2). https://doi.org/10.3998/weave.12535642.0002.202https://doi.org/10.3998/weave.12535642.0002.202

Standard sur l’accessibilité des sites web, SGQRI 008 3.0. (2025). https://www.quebec.ca/gouvernement/ministeres-organismes/cybersecurite-numerique/publications/standard-accessibilite-sites-webhttps://www.quebec.ca/gouvernement/ministeres-organismes/cybersecurite-numerique/publications/standard-accessibilite-sites-web

Stitz, T., & Blundell, S. (2018). Evaluating the accessibility of online library guides at an academic library. Journal of Accessibility and Design for All, 8(1), 33–79. https://doi.org/10.17411/jacces.v8i1.145https://doi.org/10.17411/jacces.v8i1.145

Yoon, K., Dols, R., Hulscher, L., & Newberry, T. (2016). An exploratory study of library website accessibility for visually impaired users. Library & Information Science Research, 38(3), 250–258. https://doi.org/10.1016/j.lisr.2016.08.006https://doi.org/10.1016/j.lisr.2016.08.006

Appendix 1:  R Code to Generate List of All Public LibGuides Pages

This R code gathers all web pages (landing page and all child pages) across all LibGuides.


library(rvest) # package used for downloading webpages
# update this with list of all “friendly URLs” from LibGuides;
# below is an example using just six guide URLs
public <- c("african-studies", "coms101", "computer-science", "phys400", "religious-studies", "science-literacy-week")
libguides <- NULL
for (guide in public) {
 cat(guide, "...")
 guide_page <- read_html(paste0("https://guides.yourinstituion.edu/", guide))
 Sys.sleep(1)
 guide_id <- guide_page %>%
  html_nodes(xpath = "//input[@name='guide_id']") %>%
  html_attr("value")
 page <- guide_page %>%
  html_nodes(xpath = "//div[@id='s-lg-guide-tabs']/ul[@role='menu']//li/a[contains(@href, 'guides.yourinstitution.edu')]") %>%
  html_attr("href")
 if (length(page)) {
  libguides <- rbind(libguides, data.frame(guide_id = guide_id, page = page))
 }
 else {
  libguides <- rbind(libguides, data.frame(guide_id = guide_id, page = paste0("https://guides.yourinstitution.edu/", guide)))
 }
 cat(" done.\n")
}
# save
saveRDS(libguides, file = "libguides.rds")
# create newline-separated list of all LibGuides pages
writeLines(libguides$page, "list_of_links.txt")

Appendix 2:  R Code to Create Custom JavaScript File for Editoria11y

This R code merges the list of broken links with the list of all LibGuides pages. It then generates the custom JavaScript file (“ed11y.js”).


linkinator <- readLines("linkinator-output.csv")
linkinator <- ifelse(startsWith(linkinator, " "), gsub('"', '\\""', linkinator, fixed = TRUE), linkinator)
linkinator <- read.csv(text = paste(linkinator, collapse = "\n"))
broken <- subset(linkinator, state == "BROKEN", select = c("url", "parent"))
broken <- unique(broken)
libguides <- readRDS("libguides.rds")
merged <- merge(libguides, broken, by.x = "page", by.y = "parent")
ed11y_script <-
r"(if (window.location.href.endsWith("?ed11y")) {
 const ed11y = new Ed11y({
  // Define content regions
  checkRoots: '#s-lg-side-nav-content',
  // Ignore librarian profile boxes and asset icons and book props and link list attached files
  ignoreElements: 'div[id^="s-lib-profile"] *, div[class="s-lg-icons pad-left-sm"] *, div[class="s-lg-book-props"] *, ul[id^="s-lg-link-list"] a[href^="https://guides.yourinstitution.edu/ld.php?content_id"]',
  customTests: 1
 });
 document.addEventListener('ed11yRunCustomTests', function() {
  // utility function
  const retrieveBrokenLinks = () => {
%s
   const og_url = document.querySelector('meta[property="og:url"]').content;
   const url = new URL(og_url);
   const urlParams = new URLSearchParams(url.search);
   const g = urlParams.get('g');
   return brokenLinkMap.get(g);
  };
  Ed11y.elements['linkinator'] = [];
  Ed11y.roots.forEach(root => {
   Ed11y.elements['linkinator'] = Ed11y.elements['linkinator'].concat(Array.from(root.querySelectorAll(retrieveBrokenLinks())));
  });
  Ed11y.M.potentialBrokenLink = {
   title: 'This link might be broken',
   tip: (href) =>
     `<p>Please check if the following URL is broken. Even if it seems to work, verify that the destination address (after the webpage loads) is <em>identical</em> to the URL below. If they’re not identical, please correct your guide with this new URL.<br>
     <em style='word-break: break-all;font-size:90%%;line-height: 1.2;display: block;'>
       ${Ed11y.sanitizeForHTML(href)}
     </em></p>
     `,
  };
  Ed11y.elements.linkinator?.forEach((el) => {
   Ed11y.results.push({
     element: el,
     test: 'potentialBrokenLink',
     content: Ed11y.M.potentialBrokenLink.tip(el.getAttribute('href')),
     position: 'beforebegin',
     dismissalKey: false,
   });
  });
  let allDone = new CustomEvent('ed11yResume');
  document.dispatchEvent(allDone);
 });
}
)"
agg <- aggregate(merged$url, by = list(merged$guide_id), FUN = function(x) {paste(sprintf('a[href="%s"]', x), collapse = ",")})
map_declaration <- capture.output({
 cat("   const brokenLinkMap = new Map([\n")
 for (r in 1:nrow(agg)) {
  if (r < nrow(agg)) {
   cat("    ['", agg[r, 1], "', '", agg[r, 2], "'],\n", sep = "")
  }
  else {
   cat("    ['", agg[r, 1], "', '", agg[r, 2], "']\n", sep = "")
  }
 }
 cat("   ]);\n")
})
map_declaration <- paste(map_declaration, collapse = "\n")
sink("ed11y.js")
cat(sprintf(ed11y_script, map_declaration))
sink()