From b66ae57450985985fbc0d9db1f469eddde4a5aaa Mon Sep 17 00:00:00 2001 From: EJ Mason <13525251+mxmason@users.noreply.github.com> Date: Mon, 29 Nov 2021 12:31:03 -0800 Subject: [PATCH 1/3] Chore: update demo --- demo/404.html | 7 +- .../index.html | 24 ++-- demo/{posts/2018-05-01 => about}/index.html | 10 +- demo/css/colors.css | 85 ++++++++++++ demo/css/index.css | 104 +++++++------- demo/css/prism-base16-monokai.dark.css | 127 ++++++++---------- demo/feed/feed.json | 26 +++- demo/feed/feed.xml | 58 ++++++-- demo/img/.gitkeep | 0 demo/img/cats.png | Bin 0 -> 643852 bytes demo/img/img_6935_720.png | Bin 0 -> 643852 bytes demo/index.html | 36 ++++- demo/page-list/index.html | 41 +++++- demo/posts/firstpost/index.html | 56 ++++++++ demo/posts/fourthpost/index.html | 55 ++++++++ demo/posts/index.html | 39 +++++- demo/posts/secondpost/index.html | 57 ++++++++ demo/posts/thirdpost/index.html | 56 ++++++++ demo/sitemap.xml | 48 +++++-- demo/tags/another-tag/index.html | 7 +- demo/tags/index.html | 14 +- demo/tags/number-2/index.html | 61 +++++++++ demo/tags/posts-with-two-tags/index.html | 64 +++++++++ demo/tags/second-tag/index.html | 73 ++++++++++ 24 files changed, 871 insertions(+), 177 deletions(-) rename demo/{contact-me => a11y-errors-page}/index.html (70%) rename demo/{posts/2018-05-01 => about}/index.html (80%) create mode 100644 demo/css/colors.css create mode 100644 demo/img/.gitkeep create mode 100644 demo/img/cats.png create mode 100644 demo/img/img_6935_720.png create mode 100644 demo/posts/firstpost/index.html create mode 100644 demo/posts/fourthpost/index.html create mode 100644 demo/posts/secondpost/index.html create mode 100644 demo/posts/thirdpost/index.html create mode 100644 demo/tags/number-2/index.html create mode 100644 demo/tags/posts-with-two-tags/index.html create mode 100644 demo/tags/second-tag/index.html diff --git a/demo/404.html b/demo/404.html index ccb239f..c82840d 100644 --- a/demo/404.html +++ b/demo/404.html @@ -12,6 +12,9 @@ + + +
@@ -20,7 +23,7 @@

netlify-plugin-a11y

@@ -33,7 +36,7 @@

netlify-plugin-a11y

Content not found.

-

Go home.

+

Go home.

diff --git a/demo/contact-me/index.html b/demo/a11y-errors-page/index.html similarity index 70% rename from demo/contact-me/index.html rename to demo/a11y-errors-page/index.html index eea3670..40c76c4 100644 --- a/demo/contact-me/index.html +++ b/demo/a11y-errors-page/index.html @@ -3,7 +3,7 @@ - Contact me + A page with some errors @@ -12,6 +12,9 @@ + + +
@@ -20,7 +23,7 @@

netlify-plugin-a11y

@@ -33,18 +36,17 @@

netlify-plugin-a11y

-

Contact me

` +

A page with some errors

-
- -
- -
- -
+
+ +
+ This image doesn't have an alt attribute. +
+
- + diff --git a/demo/posts/2018-05-01/index.html b/demo/about/index.html similarity index 80% rename from demo/posts/2018-05-01/index.html rename to demo/about/index.html index 43c7acf..3d21b7d 100644 --- a/demo/posts/2018-05-01/index.html +++ b/demo/about/index.html @@ -3,8 +3,8 @@ - Would you get a load of these cats - + A page with some errors + @@ -20,7 +20,7 @@

netlify-plugin-a11y

@@ -33,7 +33,7 @@

netlify-plugin-a11y

-

Would you get a load of these cats

another tag +

A page with some errors

@@ -44,6 +44,6 @@

Would you get a load of these cats

@@ -34,18 +37,39 @@

netlify-plugin-a11y

-

Latest Post

+

Latest 3 Posts

-
    +
    1. - Would you get a load of these cats - + This is my fourth post. + - + + +
    2. + +
    3. + This is my third post. + + + + + + + + +
    4. + +
    5. + This is my second post. + + + +
    6. diff --git a/demo/page-list/index.html b/demo/page-list/index.html index 9ce5933..7d81a1e 100644 --- a/demo/page-list/index.html +++ b/demo/page-list/index.html @@ -12,6 +12,9 @@ + + +
      @@ -20,7 +23,7 @@

      netlify-plugin-a11y

@@ -41,16 +44,28 @@

netlify-plugin-a11y

- /posts/2018-05-01/ - Would you get a load of these cats + /posts/firstpost/ + This is my first post. - /posts/ - + /posts/secondpost/ + This is my second post. + + + /posts/thirdpost/ + This is my third post. + + + /posts/fourthpost/ + This is my fourth post. + + + /a11y-errors-page/ + A page with some errors - /contact-me/ - Contact me + /posts/ + / @@ -64,6 +79,18 @@

netlify-plugin-a11y

/tags/another-tag/ Tagged “another tag” + + /tags/second-tag/ + Tagged “second tag” + + + /tags/posts-with-two-tags/ + Tagged “posts with two tags” + + + /tags/number-2/ + Tagged “number 2” + diff --git a/demo/posts/firstpost/index.html b/demo/posts/firstpost/index.html new file mode 100644 index 0000000..2101a07 --- /dev/null +++ b/demo/posts/firstpost/index.html @@ -0,0 +1,56 @@ + + + + + + This is my first post. + + + + + + + + + + + + + +
+ +
+ +
+
+

This site is a testing ground for netlify-plugin-a11y. It has a few intentional accessibility errors!

+

This is an Eleventy project created from the eleventy-base-blog repo.

+
+ + +
+

This is my first post.

+ +

Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.

+

Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.

+

Section Header

+

Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.

+
// this is a command
function myCommand() {
let counter = 0;
counter++;
}

// Test with a line break above this line.
console.log('Test');
+ +
+ + +
+ + + diff --git a/demo/posts/fourthpost/index.html b/demo/posts/fourthpost/index.html new file mode 100644 index 0000000..9c981ca --- /dev/null +++ b/demo/posts/fourthpost/index.html @@ -0,0 +1,55 @@ + + + + + + This is my fourth post. + + + + + + + + + + + + + +
+ +
+ +
+
+

This site is a testing ground for netlify-plugin-a11y. It has a few intentional accessibility errors!

+

This is an Eleventy project created from the eleventy-base-blog repo.

+
+ + +
+

This is my fourth post.

+ +

Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.

+

Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.

+

Section Header

+

Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.

+ +
+ + +
+ + + diff --git a/demo/posts/index.html b/demo/posts/index.html index 0110855..c3d90d7 100644 --- a/demo/posts/index.html +++ b/demo/posts/index.html @@ -12,6 +12,9 @@ + + +
@@ -20,7 +23,7 @@

netlify-plugin-a11y

@@ -37,10 +40,40 @@

netlify-plugin-a11y

Archive

-
    +
    1. - Would you get a load of these cats + This is my fourth post. + + + + + +
    2. + +
    3. + This is my third post. + + + + + + + + +
    4. + +
    5. + This is my second post. + + + + + +
    6. + +
    7. + This is my first post. diff --git a/demo/posts/secondpost/index.html b/demo/posts/secondpost/index.html new file mode 100644 index 0000000..abf5d0f --- /dev/null +++ b/demo/posts/secondpost/index.html @@ -0,0 +1,57 @@ + + + + + + This is my second post. + + + + + + + + + + + + + +
      + +
      + +
      +
      +

      This site is a testing ground for netlify-plugin-a11y. It has a few intentional accessibility errors!

      +

      This is an Eleventy project created from the eleventy-base-blog repo.

      +
      + + +
      +

      This is my second post.

      + +

      Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.

      +

      Section Header

      +

      First post
      +Third post

      +

      Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.

      +

      Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.

      + +
      + + +
      + + + diff --git a/demo/posts/thirdpost/index.html b/demo/posts/thirdpost/index.html new file mode 100644 index 0000000..dd70de4 --- /dev/null +++ b/demo/posts/thirdpost/index.html @@ -0,0 +1,56 @@ + + + + + + This is my third post. + + + + + + + + + + + + + +
      + +
      + +
      +
      +

      This site is a testing ground for netlify-plugin-a11y. It has a few intentional accessibility errors!

      +

      This is an Eleventy project created from the eleventy-base-blog repo.

      +
      + + +
      +

      This is my third post.

      + +

      Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.

      +
      // this is a command
      function myCommand() {
      let counter = 0;

      counter++;

      }

      // Test with a line break above this line.
      console.log('Test');
      +

      Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.

      +

      Section Header

      +

      Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.

      + +
      + + +
      + + + diff --git a/demo/sitemap.xml b/demo/sitemap.xml index 8fe3de9..0d6031d 100644 --- a/demo/sitemap.xml +++ b/demo/sitemap.xml @@ -2,37 +2,67 @@ - https://example.com/posts/2018-05-01/ + https://example.com/posts/firstpost/ 2018-05-01 - https://example.com/posts/ - 2021-09-29 + https://example.com/posts/secondpost/ + 2018-07-04 + + + + https://example.com/posts/thirdpost/ + 2018-08-24 + + + + https://example.com/posts/fourthpost/ + 2018-09-30 + + + + https://example.com/a11y-errors-page/ + 2021-09-21 - https://example.com/contact-me/ - 2021-09-29 + https://example.com/posts/ + 2021-09-21 https://example.com/ - 2021-09-29 + 2021-09-21 https://example.com/page-list/ - 2021-09-29 + 2021-09-21 https://example.com/tags/ - 2021-09-29 + 2021-09-21 https://example.com/tags/another-tag/ - 2021-09-29 + 2021-09-21 + + + + https://example.com/tags/second-tag/ + 2021-09-21 + + + + https://example.com/tags/posts-with-two-tags/ + 2021-09-21 + + + + https://example.com/tags/number-2/ + 2021-09-21 diff --git a/demo/tags/another-tag/index.html b/demo/tags/another-tag/index.html index 8efede0..06ee487 100644 --- a/demo/tags/another-tag/index.html +++ b/demo/tags/another-tag/index.html @@ -12,6 +12,9 @@ + + +
      @@ -20,7 +23,7 @@

      netlify-plugin-a11y

      @@ -38,7 +41,7 @@

      Tagged “another tag”

      1. - Would you get a load of these cats + This is my first post. diff --git a/demo/tags/index.html b/demo/tags/index.html index 5f4a3c8..6928cab 100644 --- a/demo/tags/index.html +++ b/demo/tags/index.html @@ -12,6 +12,9 @@ + + +
        @@ -20,7 +23,7 @@

        netlify-plugin-a11y

        @@ -38,6 +41,15 @@

        Tags

        + + + + + + + + + diff --git a/demo/tags/number-2/index.html b/demo/tags/number-2/index.html new file mode 100644 index 0000000..0878229 --- /dev/null +++ b/demo/tags/number-2/index.html @@ -0,0 +1,61 @@ + + + + + + Tagged “number 2” + + + + + + + + + + + + + +
        + +
        + +
        +
        +

        This site is a testing ground for netlify-plugin-a11y. It has a few intentional accessibility errors!

        +

        This is an Eleventy project created from the eleventy-base-blog repo.

        +
        + + +

        Tagged “number 2”

        + + +
          + +
        1. + This is my second post. + + + + + +
        2. + +
        + + +

        See all tags.

        + + +
        + + + diff --git a/demo/tags/posts-with-two-tags/index.html b/demo/tags/posts-with-two-tags/index.html new file mode 100644 index 0000000..5423d84 --- /dev/null +++ b/demo/tags/posts-with-two-tags/index.html @@ -0,0 +1,64 @@ + + + + + + Tagged “posts with two tags” + + + + + + + + + + + + + +
        + +
        + +
        +
        +

        This site is a testing ground for netlify-plugin-a11y. It has a few intentional accessibility errors!

        +

        This is an Eleventy project created from the eleventy-base-blog repo.

        +
        + + +

        Tagged “posts with two tags”

        + + +
          + +
        1. + This is my third post. + + + + + + + + +
        2. + +
        + + +

        See all tags.

        + + +
        + + + diff --git a/demo/tags/second-tag/index.html b/demo/tags/second-tag/index.html new file mode 100644 index 0000000..529cfa3 --- /dev/null +++ b/demo/tags/second-tag/index.html @@ -0,0 +1,73 @@ + + + + + + Tagged “second tag” + + + + + + + + + + + + + +
        + +
        + +
        +
        +

        This site is a testing ground for netlify-plugin-a11y. It has a few intentional accessibility errors!

        +

        This is an Eleventy project created from the eleventy-base-blog repo.

        +
        + + +

        Tagged “second tag”

        + + +
          + +
        1. + This is my fourth post. + + + + + +
        2. + +
        3. + This is my third post. + + + + + + + + +
        4. + +
        + + +

        See all tags.

        + + +
        + + + From 510d339f14324f228765b4e1bc64134926313732 Mon Sep 17 00:00:00 2001 From: EJ Mason <13525251+mxmason@users.noreply.github.com> Date: Mon, 29 Nov 2021 12:53:30 -0800 Subject: [PATCH 2/3] Chore: Ignore thirdpost directory and on-page hash links --- netlify.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netlify.toml b/netlify.toml index ba7665a..e2ec601 100644 --- a/netlify.toml +++ b/netlify.toml @@ -7,4 +7,6 @@ package = "./lib/index.js" [plugins.inputs] checkPaths = ['/'] + ignoreDirectories = ['thirdpost'] + ignoreElements = '.direct-link' failWithIssues = false # true by default From 20e08bb48e52b964a5b0704f375a526cf155eaeb Mon Sep 17 00:00:00 2001 From: EJ Mason <13525251+mxmason@users.noreply.github.com> Date: Mon, 29 Nov 2021 12:55:18 -0800 Subject: [PATCH 3/3] Omit both leading and trailing slash from ignoreDirectories --- src/pluginCore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pluginCore.js b/src/pluginCore.js index a74b269..c7cf032 100644 --- a/src/pluginCore.js +++ b/src/pluginCore.js @@ -50,8 +50,8 @@ exports.generateFilePaths = async function ({ ignoreDirectories.length === 0 ? ASTERISK : ignoreDirectories.map( - // add ! and strip leading slash - (dir) => `!${dir.replace(/^\/+/, '')}`, + // add ! and strip leading and trailing slashes + (dir) => `!${dir.replace(/^\/|\/$/g, '')}`, ) const htmlFilePaths = await Promise.all( fileAndDirPaths.map((fileAndDirPath) => findHtmlFiles(`${publishDir}${fileAndDirPath}`, directoryFilter)),