Skip to content

Commit bd4061d

Browse files
committed
fix: Internal links; Use HtmlBasePlugin (#22)
1 parent b8479ea commit bd4061d

14 files changed

Lines changed: 119 additions & 104 deletions

File tree

eleventy.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { HtmlBasePlugin } from '@11ty/eleventy';
12
import { resolve } from 'node:path';
23
import debug from 'debug';
34
import diaPluginLoader, { loadEnvJs } from 'dia-plugins';
45
import togglePopoverShortcode from 'eleventy-plugin-popover';
56

67
// GitHub Pages sub-directory deployment.
7-
const buildBaseUrl = '/diveintoaccessibility/';
8+
const baseHref = '/diveintoaccessibility/';
89

910
/**
1011
* Configure Eleventy
@@ -44,9 +45,11 @@ export default async function (eleventyConfig) {
4445
return (data) => pageId.compute(data.page);
4546
}); */
4647

48+
eleventyConfig.addPlugin(HtmlBasePlugin, { baseHref }); // eleventyConfig.pathPrefix,
49+
4750
eleventyConfig.addPlugin(diaPluginLoader, {
4851
linkFiles: getLinkFilePaths(),
49-
buildBaseUrl
52+
buildBaseUrl: baseHref
5053
});
5154

5255
eleventyConfig.addPlugin(togglePopoverShortcode);
@@ -64,6 +67,10 @@ function getLinkFilePaths () {
6467
];
6568
}
6669

70+
export const config = {
71+
pathPrefix: baseHref,
72+
};
73+
6774
/* export const config = {
6875
dir: {
6976
includes: '../_includes',

pages/en/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: page
33
title: Home
44
eleventyComputed:
55
status: amber
6-
notesUrl: ./en/notes/index.html
6+
notesUrl: ./notes/index.html
77
archive: https://web.archive.org/web/20110927131211/http://diveintoaccessibility.org/
88
archiveDate: 2011-09-27
99
---
@@ -20,17 +20,17 @@ This book answers two questions. The first question is "Why should I make my we
2020
## Read <cite>Dive Into Accessibility</cite>
2121

2222
<dl>
23-
<dt><a href="./en/table_of_contents.html">Table of contents</a></dt>
23+
<dt><a href="./table_of_contents.html">Table of contents</a></dt>
2424
<dd>All tips, in the order in which they were originally published. The recommended way to read the book for the first time.</dd>
25-
<dt><a href="./en/by_person.html">Tips by person</a></dt>
25+
<dt><a href="./by_person.html">Tips by person</a></dt>
2626
<dd>Here the tips are grouped by the people who benefit from them.</dd>
27-
<dt><a href="./en/by_disability.html">Tips by disability</a></dt>
27+
<dt><a href="./by_disability.html">Tips by disability</a></dt>
2828
<dd>Here the tips are grouped by the disabilities that benefit from them. This includes both physical and technological disabilities.</dd>
29-
<dt><a href="./en/by_design_principle.html">Tips by design principle</a></dt>
29+
<dt><a href="./by_design_principle.html">Tips by design principle</a></dt>
3030
<dd>Here the tips are grouped by design principles proposed by the <abbr title="World Wide Web Consortium">W3C</abbr>. All web pages should be perceivable, operable, navigable, understandable, and robust.</dd>
31-
<dt><a href="./en/by_web_browser.html">Tips by web browser</a></dt>
31+
<dt><a href="./by_web_browser.html">Tips by web browser</a></dt>
3232
<dd>Here the tips are grouped by the web browsers or assistive technologies that benefit from them.</dd>
33-
<dt><a href="./en/by_publishing_tool.html">Tips by publishing tool</a></dt>
33+
<dt><a href="./by_publishing_tool.html">Tips by publishing tool</a></dt>
3434
<dd>Here the tips are grouped by the publishing tools that can implement them. Each tip includes specific instructions for each publishing tool, where applicable.</dd>
3535
</dl>
3636

pages/en/notes/index.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Not surprisingly after that amount of time, there are errors, some out-of-date p
1515

1616
Here are two reasons:
1717

18-
1. [Translations][] are still live out on the Web, and I realised that if these persisted, without the problems being documented, then readers would be likely to pick up wrong ideas. And while I have written a dry [Errata][] document, more detail can be added to this page-by-page commentary.
18+
1. [Translations][n/translations] are still live out on the Web, and I realised that if these persisted, without the problems being documented, then readers would be likely to pick up wrong ideas. And while I have written a dry [Errata][] document, more detail can be added to this page-by-page commentary.
1919

2020
2. Mark Pilgrim’s original [user-centered][ucd] narrative, with realistic personas, which was revolutionary in 2002, still has value now.
2121

@@ -24,26 +24,34 @@ So, I am documenting the errors, out-of-date practices, and other notes for indi
2424
### Index of notes
2525

2626
* Note for [Day 10: Somewhat flawed][note 10]
27-
- Day 10: [Presenting your main content first][day 10]
27+
- Day 10: [Presenting your main content first][n/day 10]
2828
* Note for [Day 11: Incorrect implementation][note 11]
29-
- Day 11: [Skipping over navigation links][day 11]
29+
- Day 11: [Skipping over navigation links][n/day 11]
3030
* Note for [Day 14: Don't do this!][note 14]
31-
- Day 14: [Adding titles to links][day 14]
31+
- Day 14: [Adding titles to links][n/day 14]
3232
* Note for [Day 15: Caution!][note 15]
33-
- Day 15: [Defining keyboard shortcuts][day 15]
33+
- Day 15: [Defining keyboard shortcuts][n/day 15]
3434
* Note for [Day 17: `<acronym>` is deprecated][note 17]
35-
- Day 17: [Defining acronyms][day 17]
35+
- Day 17: [Defining acronyms][n/day 17]
3636
* Note for [Day 20: `summary` is deprecated][note 20]
37-
- Day 20: [Providing a summary for tables][day 20]
37+
- Day 20: [Providing a summary for tables][n/day 20]
3838
* Also see: [errata document on GitHub][errata].
3939

40-
[note 10]: ./en/notes/day_10_presenting_your_main_content_first.html
41-
[note 11]: ./en/notes/day_11_skipping_over_navigation_links.html
42-
[note 14]: ./en/notes/day_14_adding_titles_to_links.html
43-
[note 15]: ./en/notes/day_15_defining_keyboard_shortcuts.html
44-
[note 17]: ./en/notes/day_17_defining_acronyms.html
45-
[note 20]: ./en/notes/day_20_providing_a_summary_for_tables.html
40+
[note 10]: ./day_10_presenting_your_main_content_first.html
41+
[note 11]: ./day_11_skipping_over_navigation_links.html
42+
[note 14]: ./day_14_adding_titles_to_links.html
43+
[note 15]: ./day_15_defining_keyboard_shortcuts.html
44+
[note 17]: ./day_17_defining_acronyms.html
45+
[note 20]: ./day_20_providing_a_summary_for_tables.html
4646
[errata]: https://github.com/nfreear/diveintoaccessibility/blob/revive/docs/ERRATA.md
4747

48+
[n/day 10]: ../day_10_presenting_your_main_content_first.html
49+
[n/day 11]: ../day_11_skipping_over_navigation_links.html
50+
[n/day 14]: ../day_14_adding_titles_to_links.html
51+
[n/day 15]: ../day_15_defining_keyboard_shortcuts.html
52+
[n/day 17]: ../day_17_defining_acronyms.html
53+
[n/day 20]: ../day_20_providing_a_summary_for_tables.html
54+
[n/translations]: ../translations.html
55+
4856
[dia2002]: https://web.archive.org/web/20020724125508/http://diveintoaccessibility.org/
4957
[ucd]: https://en.wikipedia.org/wiki/User-centered_design

pages/links/internal.md

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,64 @@ permalink: false
88
[email]: mailto:f8dy@diveintoaccessibility.org
99
[translate-email]: mailto:translate@diveintoaccessibility.org
1010

11-
[home]: ./en/index.html
12-
[table of contents]: ./en/table_of_contents.html
13-
[introduction]: ./en/introduction.html
14-
[search]: ./en/mt/mt-search.cgi
11+
[home]: ./index.html
12+
[table of contents]: ./table_of_contents.html
13+
[introduction]: ./introduction.html
14+
[search]: ./mt/mt-search.cgi
1515
[feedback]: mailto:feedback@diveintoaccessibility.org
1616

17-
[jackie]: ./en/day_1_jackie.html
18-
[michael]: ./en/day_2_michael.html
19-
[bill]: ./en/day_3_bill.html
20-
[lillian]: ./en/day_4_lillian.html
21-
[marcus]: ./en/day_5_marcus.html
22-
23-
[day 1]: ./en/day_1_jackie.html
24-
[day 2]: ./en/day_2_michael.html
25-
[day 3]: ./en/day_3_bill.html
26-
[day 4]: ./en/day_4_lillian.html
27-
[day 5]: ./en/day_5_marcus.html
28-
29-
[day 6]: ./en/day_6_choosing_a_doctype.html
30-
[day 7]: ./en/day_7_identifying_your_language.html
31-
[day 8]: ./en/day_8_constructing_meaningful_page_titles.html
32-
[day 9]: ./en/day_9_providing_additional_navigation_aids.html
33-
[day 10]: ./en/day_10_presenting_your_main_content_first.html
34-
35-
[day 11]: ./en/day_11_skipping_over_navigation_links.html
36-
[day 12]: ./en/day_12_using_color_safely.html
37-
[day 13]: ./en/day_13_using_real_links.html
38-
[day 14]: ./en/day_14_adding_titles_to_links.html
39-
[day 15]: ./en/day_15_defining_keyboard_shortcuts.html
40-
41-
[day 16]: ./en/day_16_not_opening_new_windows.html
42-
[day 17]: ./en/day_17_defining_acronyms.html
43-
[day 18]: ./en/day_18_giving_your_calendar_a_real_caption.html
44-
[day 19]: ./en/day_19_using_real_table_headers.html
45-
[day 20]: ./en/day_20_providing_a_summary_for_tables.html
46-
47-
[day 21]: ./en/day_21_ignoring_spacer_images.html
48-
[day 22]: ./en/day_22_using_real_lists_or_faking_them_properly.html
49-
[day 23]: ./en/day_23_providing_text_equivalents_for_images.html
50-
[day 24]: ./en/day_24_providing_text_equivalents_for_image_maps.html
51-
[day 25]: ./en/day_25_using_real_horizontal_rules_or_faking_them_properly.html
52-
53-
[day 26]: ./en/day_26_using_relative_font_sizes.html
54-
[day 27]: ./en/day_27_using_real_headers.html
55-
[day 28]: ./en/day_28_labeling_form_elements.html
56-
[day 29]: ./en/day_29_making_everything_searchable.html
57-
[day 30]: ./en/day_30_creating_an_accessibility_statement.html
58-
59-
[conclusion]: ./en/conclusion.html
60-
[accessibility statement]: ./en/accessibility_statement.html
61-
[terms of use]: ./en/terms_of_use.html
62-
[translations]: ./en/translations.html
63-
64-
[by person]: ./en/by_person.html
65-
[by disability]: ./en/by_disability.html
66-
[by design principle]: ./en/by_design_principle.html
67-
[by assistive technology]: ./en/by_web_browser.html
68-
[by publishing tool]: ./en/by_publishing_tool.html
17+
[jackie]: ./day_1_jackie.html
18+
[michael]: ./day_2_michael.html
19+
[bill]: ./day_3_bill.html
20+
[lillian]: ./day_4_lillian.html
21+
[marcus]: ./day_5_marcus.html
22+
23+
[day 1]: ./day_1_jackie.html
24+
[day 2]: ./day_2_michael.html
25+
[day 3]: ./day_3_bill.html
26+
[day 4]: ./day_4_lillian.html
27+
[day 5]: ./day_5_marcus.html
28+
29+
[day 6]: ./day_6_choosing_a_doctype.html
30+
[day 7]: ./day_7_identifying_your_language.html
31+
[day 8]: ./day_8_constructing_meaningful_page_titles.html
32+
[day 9]: ./day_9_providing_additional_navigation_aids.html
33+
[day 10]: ./day_10_presenting_your_main_content_first.html
34+
35+
[day 11]: ./day_11_skipping_over_navigation_links.html
36+
[day 12]: ./day_12_using_color_safely.html
37+
[day 13]: ./day_13_using_real_links.html
38+
[day 14]: ./day_14_adding_titles_to_links.html
39+
[day 15]: ./day_15_defining_keyboard_shortcuts.html
40+
41+
[day 16]: ./day_16_not_opening_new_windows.html
42+
[day 17]: ./day_17_defining_acronyms.html
43+
[day 18]: ./day_18_giving_your_calendar_a_real_caption.html
44+
[day 19]: ./day_19_using_real_table_headers.html
45+
[day 20]: ./day_20_providing_a_summary_for_tables.html
46+
47+
[day 21]: ./day_21_ignoring_spacer_images.html
48+
[day 22]: ./day_22_using_real_lists_or_faking_them_properly.html
49+
[day 23]: ./day_23_providing_text_equivalents_for_images.html
50+
[day 24]: ./day_24_providing_text_equivalents_for_image_maps.html
51+
[day 25]: ./day_25_using_real_horizontal_rules_or_faking_them_properly.html
52+
53+
[day 26]: ./day_26_using_relative_font_sizes.html
54+
[day 27]: ./day_27_using_real_headers.html
55+
[day 28]: ./day_28_labeling_form_elements.html
56+
[day 29]: ./day_29_making_everything_searchable.html
57+
[day 30]: ./day_30_creating_an_accessibility_statement.html
58+
59+
[conclusion]: ./conclusion.html
60+
[accessibility statement]: ./accessibility_statement.html
61+
[terms of use]: ./terms_of_use.html
62+
[translations]: ./translations.html
63+
64+
[by person]: ./by_person.html
65+
[by disability]: ./by_disability.html
66+
[by design principle]: ./by_design_principle.html
67+
[by assistive technology]: ./by_web_browser.html
68+
[by publishing tool]: ./by_publishing_tool.html
6969

7070
[notabletrick]: ./examples/notabletrick.html
7171
[tabletrick]: ./examples/tabletrick.html

plugins/client-js/importMapPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const githubPages = 'https://nfreear.github.io';
88
const elementServer = `${githubPages}/elements/src/components`;
99

1010
const importMap = {
11-
'page-note': './js/PageNoteElement.js',
11+
/** @WAS 'page-note': './js/PageNoteElement.js', */
1212
'npm:fix-title-attr': 'https://esm.sh/fix-title-attr@0.9.5',
1313
'fix-title-attr': `${githubPages}/fix-title-attr/index.js`,
1414
'ndf-elements/dia': `${githubPages}/elements/src/dia.js`,

plugins/client-js/js/PageNoteElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class PageNoteElement extends HTMLElement {
1717
#pageId;
1818

1919
get urlTemplate () {
20-
return this.getAttribute('url-template') ?? './en/notes/%s.html';
20+
return this.getAttribute('url-template') ?? './notes/%s.html'; /** @WAS: './en/notes/' */
2121
}
2222

2323
get mainSelector () { return this.getAttribute('main-selector') ?? 'main'; }

plugins/client-js/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PageNoteElement from 'page-note';
1+
import PageNoteElement from './PageNoteElement.js';
22
import { MySearchApiElement, MySharingWidgetElement, MySiteCounterElement } from 'ndf-elements/dia';
33
import { fixTitleAttributes, fixArchiveLinks, TitleTipElement } from 'fix-title-attr';
44
import defineTogglePopoverElement from 'eleventy-plugin-popover/browser';

plugins/mobile-theme/_includes/en/breadcrumb.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<nav class="breadcrumb-nav" aria-labelledby="breadLabel">
22
<p>
33
<span id="breadLabel">You are here: </span><a
4-
href="./en/">Home</a><x-sep
4+
href="./">Home</a><x-sep
55
></x-sep><a
6-
href="./en/table_of_contents.html"><i>Table of </i>Contents</a><x-sep
6+
href="./table_of_contents.html"><i>Table of </i>Contents</a><x-sep
77
></x-sep><b
88
>{{ title }}</b>
99
</p>

plugins/mobile-theme/_includes/en/header.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<flex-row>
99
<div>
10-
<h1><a href="./en/">Dive Into Accessibility</a></h1>
10+
<h1><a href="./">Dive Into Accessibility</a></h1>
1111
<p class="tagline">30 days to a more accessible web site</p>
1212
</div>
1313

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11

22
<nav aria-label="Main navigation">
33
<ul>
4-
<li><a title="accessibility features of this site" href="./en/accessibility_statement.html" accesskey="0">Accessibility statement</a></li>
5-
<li><a href="./en/search.html" data-href="mt/mt-search.cgi" accesskey="4" rel="nofollow">Site search</a></li>
6-
<li><a href="./en/table_of_contents.html" accesskey="3">Table of contents</a></li>
7-
<li><a href="./en/by_person.html">Tips by person</a></li>
8-
<li><a href="./en/by_disability.html">Tips by disability</a></li>
9-
<li><a href="./en/by_design_principle.html">Tips by design principle</a></li>
10-
<li><a href="./en/by_web_browser.html">Tips by web browser</a></li>
11-
<li><a href="./en/by_publishing_tool.html">Tips by publishing tool</a></li>
4+
<li><a title="accessibility features of this site" href="./accessibility_statement.html" accesskey="0">Accessibility statement</a></li>
5+
<li><a href="./search.html" data-href="mt/mt-search.cgi" accesskey="4" rel="nofollow">Site search</a></li>
6+
<li><a href="./table_of_contents.html" accesskey="3">Table of contents</a></li>
7+
<li><a href="./by_person.html">Tips by person</a></li>
8+
<li><a href="./by_disability.html">Tips by disability</a></li>
9+
<li><a href="./by_design_principle.html">Tips by design principle</a></li>
10+
<li><a href="./by_web_browser.html">Tips by web browser</a></li>
11+
<li><a href="./by_publishing_tool.html">Tips by publishing tool</a></li>
1212
<li><a title="send email to the author" href="mailto:feedback@diveintoaccessibility.org" accesskey="9">Feedback</a></li>
13-
<li><a title="Copyright and licensing information" href="./en/terms_of_use.html" accesskey="8">Terms of use</a></li>
13+
<li><a title="Copyright and licensing information" href="./terms_of_use.html" accesskey="8">Terms of use</a></li>
1414
<li><a href="https://github.com/nfreear/diveintoaccessibility">(Source on GitHub)</a></li>
1515
</ul>
1616
</nav>

0 commit comments

Comments
 (0)