From 7732a4d434f1b6d5da2b681d8830d33c6013c7d1 Mon Sep 17 00:00:00 2001 From: H Parra Date: Thu, 12 Sep 2024 10:37:04 -0700 Subject: [PATCH 1/4] Add og:type --- src/steps/extract-metadata.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/steps/extract-metadata.js b/src/steps/extract-metadata.js index 5be526d7..ba2fb4f7 100644 --- a/src/steps/extract-metadata.js +++ b/src/steps/extract-metadata.js @@ -268,6 +268,7 @@ export default function extractMetaData(state, req) { const metadata = { description: meta.description, keywords: meta.keywords, + 'og:type': meta['og:type'] || 'website', 'og:title': meta.title, 'og:description': meta.description, 'og:url': meta.url, From 92654175ad7a6ebac4fd928679dc7b398d6659fa Mon Sep 17 00:00:00 2001 From: H Parra Date: Thu, 12 Sep 2024 10:42:40 -0700 Subject: [PATCH 2/4] Fix tests and praise awk (gpt too) --- test/fixtures/content/description-blockquote.html | 1 + test/fixtures/content/description-long.html | 1 + test/fixtures/content/description.html | 1 + test/fixtures/content/empty-table-row.html | 1 + test/fixtures/content/gt-many-refs.html | 1 + test/fixtures/content/head-with-script.html | 1 + test/fixtures/content/icons-ignored.html | 2 +- test/fixtures/content/icons.html | 2 +- test/fixtures/content/image-from-meta-rewrite-link.html | 1 + test/fixtures/content/image-from-meta-rewrite.html | 1 + test/fixtures/content/image-from-meta.html | 1 + test/fixtures/content/image-no-alt.html | 1 + test/fixtures/content/image-with-title.html | 1 + test/fixtures/content/image.html | 1 + test/fixtures/content/large.html | 1 + test/fixtures/content/meta-response-headers.html | 1 + test/fixtures/content/no-head-html.html | 1 + test/fixtures/content/page-metadata-block-canonical.html | 1 + test/fixtures/content/page-metadata-block-empty-url.html | 1 + test/fixtures/content/page-metadata-block-html.html | 1 + test/fixtures/content/page-metadata-block-multi-a.html | 1 + test/fixtures/content/page-metadata-block-multi-ol.html | 1 + test/fixtures/content/page-metadata-block-multi-p.html | 1 + test/fixtures/content/page-metadata-block-multi-ul.html | 1 + test/fixtures/content/page-metadata-block.html | 1 + test/fixtures/content/page-metadata-content-blocks.html | 1 + test/fixtures/content/page-metadata-json.html | 1 + test/fixtures/content/page-metadata-jsonld-error.html | 1 + test/fixtures/content/page-metadata-jsonld-global.html | 1 + test/fixtures/content/page-metadata-jsonld-list.html | 1 + test/fixtures/content/page-metadata-jsonld-multi.html | 1 + test/fixtures/content/page-metadata-jsonld-xss.html | 1 + test/fixtures/content/page-metadata-jsonld.html | 1 + test/fixtures/content/page-metadata-no-fallback.html | 1 + test/fixtures/content/page-metadata-twitter-fallback.html | 1 + test/fixtures/content/page-with-gridtables.html | 1 + test/fixtures/content/unwrap-images.html | 1 + 37 files changed, 37 insertions(+), 2 deletions(-) diff --git a/test/fixtures/content/description-blockquote.html b/test/fixtures/content/description-blockquote.html index 29cd14f0..3c7af4e0 100644 --- a/test/fixtures/content/description-blockquote.html +++ b/test/fixtures/content/description-blockquote.html @@ -4,6 +4,7 @@ How to Create Branded Stories in Adobe Spark + diff --git a/test/fixtures/content/description-long.html b/test/fixtures/content/description-long.html index e9e57612..6e369678 100644 --- a/test/fixtures/content/description-long.html +++ b/test/fixtures/content/description-long.html @@ -1,6 +1,7 @@ Hello + diff --git a/test/fixtures/content/description.html b/test/fixtures/content/description.html index 3edca738..c11091b9 100644 --- a/test/fixtures/content/description.html +++ b/test/fixtures/content/description.html @@ -4,6 +4,7 @@ Return of the raspberry: New Zealand’s favourite combo: Foo-Bar New Zealand + diff --git a/test/fixtures/content/empty-table-row.html b/test/fixtures/content/empty-table-row.html index c0618648..82009a3e 100644 --- a/test/fixtures/content/empty-table-row.html +++ b/test/fixtures/content/empty-table-row.html @@ -4,6 +4,7 @@ ACME CORP + diff --git a/test/fixtures/content/gt-many-refs.html b/test/fixtures/content/gt-many-refs.html index a9bc373e..a80096d2 100644 --- a/test/fixtures/content/gt-many-refs.html +++ b/test/fixtures/content/gt-many-refs.html @@ -4,6 +4,7 @@ ACME CORP + diff --git a/test/fixtures/content/head-with-script.html b/test/fixtures/content/head-with-script.html index 1bbdcb11..40234a98 100644 --- a/test/fixtures/content/head-with-script.html +++ b/test/fixtures/content/head-with-script.html @@ -3,6 +3,7 @@ ACME CORP + diff --git a/test/fixtures/content/icons-ignored.html b/test/fixtures/content/icons-ignored.html index 47f247b3..9a74aaf5 100644 --- a/test/fixtures/content/icons-ignored.html +++ b/test/fixtures/content/icons-ignored.html @@ -6,4 +6,4 @@

Icons

https://example.test/:urn:

urn:aaid:sc:VA6C2:ac6066f3-fd1d-4e00-bed3-fa3aa6d981d8

- \ No newline at end of file + diff --git a/test/fixtures/content/icons.html b/test/fixtures/content/icons.html index 9ff77789..61dc9499 100644 --- a/test/fixtures/content/icons.html +++ b/test/fixtures/content/icons.html @@ -6,4 +6,4 @@

Icons

Hello mark.

Teamblasting off again.

- \ No newline at end of file + diff --git a/test/fixtures/content/image-from-meta-rewrite-link.html b/test/fixtures/content/image-from-meta-rewrite-link.html index da662f5f..6c230a88 100644 --- a/test/fixtures/content/image-from-meta-rewrite-link.html +++ b/test/fixtures/content/image-from-meta-rewrite-link.html @@ -4,6 +4,7 @@ ACME CORP + diff --git a/test/fixtures/content/image-from-meta-rewrite.html b/test/fixtures/content/image-from-meta-rewrite.html index 74491383..c1aaa5fa 100644 --- a/test/fixtures/content/image-from-meta-rewrite.html +++ b/test/fixtures/content/image-from-meta-rewrite.html @@ -3,6 +3,7 @@ Hero + diff --git a/test/fixtures/content/image-from-meta.html b/test/fixtures/content/image-from-meta.html index 9e4fe3d1..d0d3bc00 100644 --- a/test/fixtures/content/image-from-meta.html +++ b/test/fixtures/content/image-from-meta.html @@ -3,6 +3,7 @@ Hero + diff --git a/test/fixtures/content/image-no-alt.html b/test/fixtures/content/image-no-alt.html index 471f6ad6..423b4f0e 100644 --- a/test/fixtures/content/image-no-alt.html +++ b/test/fixtures/content/image-no-alt.html @@ -3,6 +3,7 @@ Hero + diff --git a/test/fixtures/content/image-with-title.html b/test/fixtures/content/image-with-title.html index a4bbd9c7..b59adb48 100644 --- a/test/fixtures/content/image-with-title.html +++ b/test/fixtures/content/image-with-title.html @@ -3,6 +3,7 @@ Hero + diff --git a/test/fixtures/content/image.html b/test/fixtures/content/image.html index 8ca2abc8..e516601e 100644 --- a/test/fixtures/content/image.html +++ b/test/fixtures/content/image.html @@ -3,6 +3,7 @@ Hero + diff --git a/test/fixtures/content/large.html b/test/fixtures/content/large.html index 1def6126..a20b9b2e 100644 --- a/test/fixtures/content/large.html +++ b/test/fixtures/content/large.html @@ -4,6 +4,7 @@ bin/magento(Magento Open Source) | Adobe Commerce + diff --git a/test/fixtures/content/meta-response-headers.html b/test/fixtures/content/meta-response-headers.html index b2ed39c2..3f5e8bc7 100644 --- a/test/fixtures/content/meta-response-headers.html +++ b/test/fixtures/content/meta-response-headers.html @@ -1,6 +1,7 @@ Hello Meta + diff --git a/test/fixtures/content/no-head-html.html b/test/fixtures/content/no-head-html.html index ab16e5c1..7ea26904 100644 --- a/test/fixtures/content/no-head-html.html +++ b/test/fixtures/content/no-head-html.html @@ -3,6 +3,7 @@ ACME CORP + diff --git a/test/fixtures/content/page-metadata-block-canonical.html b/test/fixtures/content/page-metadata-block-canonical.html index fdc4644e..0582e6e6 100644 --- a/test/fixtures/content/page-metadata-block-canonical.html +++ b/test/fixtures/content/page-metadata-block-canonical.html @@ -2,6 +2,7 @@ Pricing | Adobe Spark + diff --git a/test/fixtures/content/page-metadata-block-empty-url.html b/test/fixtures/content/page-metadata-block-empty-url.html index be5816ee..430167de 100644 --- a/test/fixtures/content/page-metadata-block-empty-url.html +++ b/test/fixtures/content/page-metadata-block-empty-url.html @@ -2,6 +2,7 @@ Pricing | Adobe Spark + diff --git a/test/fixtures/content/page-metadata-block-html.html b/test/fixtures/content/page-metadata-block-html.html index 318d9404..cb5d7f47 100644 --- a/test/fixtures/content/page-metadata-block-html.html +++ b/test/fixtures/content/page-metadata-block-html.html @@ -2,6 +2,7 @@ Pricing | Adobe Spark + diff --git a/test/fixtures/content/page-metadata-block-multi-a.html b/test/fixtures/content/page-metadata-block-multi-a.html index 40f25a3c..6ddae9f4 100644 --- a/test/fixtures/content/page-metadata-block-multi-a.html +++ b/test/fixtures/content/page-metadata-block-multi-a.html @@ -1,5 +1,6 @@ Metadata Block Test + diff --git a/test/fixtures/content/page-metadata-block-multi-ol.html b/test/fixtures/content/page-metadata-block-multi-ol.html index 7eb524ec..67c6402e 100644 --- a/test/fixtures/content/page-metadata-block-multi-ol.html +++ b/test/fixtures/content/page-metadata-block-multi-ol.html @@ -1,5 +1,6 @@ Metadata Block Test + diff --git a/test/fixtures/content/page-metadata-block-multi-p.html b/test/fixtures/content/page-metadata-block-multi-p.html index 0e120462..cdfa6d75 100644 --- a/test/fixtures/content/page-metadata-block-multi-p.html +++ b/test/fixtures/content/page-metadata-block-multi-p.html @@ -1,5 +1,6 @@ Metadata Block Test + diff --git a/test/fixtures/content/page-metadata-block-multi-ul.html b/test/fixtures/content/page-metadata-block-multi-ul.html index d7090498..8eb945cc 100644 --- a/test/fixtures/content/page-metadata-block-multi-ul.html +++ b/test/fixtures/content/page-metadata-block-multi-ul.html @@ -1,5 +1,6 @@ Metadata Block Test + diff --git a/test/fixtures/content/page-metadata-block.html b/test/fixtures/content/page-metadata-block.html index f20a157d..1b9d1bdf 100644 --- a/test/fixtures/content/page-metadata-block.html +++ b/test/fixtures/content/page-metadata-block.html @@ -3,6 +3,7 @@ + diff --git a/test/fixtures/content/page-metadata-content-blocks.html b/test/fixtures/content/page-metadata-content-blocks.html index 6b8676a2..555ae2e1 100644 --- a/test/fixtures/content/page-metadata-content-blocks.html +++ b/test/fixtures/content/page-metadata-content-blocks.html @@ -2,6 +2,7 @@ + diff --git a/test/fixtures/content/page-metadata-json.html b/test/fixtures/content/page-metadata-json.html index f799f529..7f3c90d1 100644 --- a/test/fixtures/content/page-metadata-json.html +++ b/test/fixtures/content/page-metadata-json.html @@ -2,6 +2,7 @@ Metadata JSON Test + diff --git a/test/fixtures/content/page-metadata-jsonld-error.html b/test/fixtures/content/page-metadata-jsonld-error.html index 62bcf180..ddfd144a 100644 --- a/test/fixtures/content/page-metadata-jsonld-error.html +++ b/test/fixtures/content/page-metadata-jsonld-error.html @@ -1,6 +1,7 @@ Home | Helix Project Boilerplate + diff --git a/test/fixtures/content/page-metadata-jsonld-global.html b/test/fixtures/content/page-metadata-jsonld-global.html index 7004bc9a..048b0cc0 100644 --- a/test/fixtures/content/page-metadata-jsonld-global.html +++ b/test/fixtures/content/page-metadata-jsonld-global.html @@ -1,6 +1,7 @@ Global JSON LD Test + diff --git a/test/fixtures/content/page-metadata-jsonld-list.html b/test/fixtures/content/page-metadata-jsonld-list.html index e3e0c285..480162c8 100644 --- a/test/fixtures/content/page-metadata-jsonld-list.html +++ b/test/fixtures/content/page-metadata-jsonld-list.html @@ -1,6 +1,7 @@ Home | Helix Project Boilerplate + diff --git a/test/fixtures/content/page-metadata-jsonld-multi.html b/test/fixtures/content/page-metadata-jsonld-multi.html index e0d9b564..66cd97e6 100644 --- a/test/fixtures/content/page-metadata-jsonld-multi.html +++ b/test/fixtures/content/page-metadata-jsonld-multi.html @@ -1,6 +1,7 @@ Home | Helix Project Boilerplate + diff --git a/test/fixtures/content/page-metadata-jsonld-xss.html b/test/fixtures/content/page-metadata-jsonld-xss.html index 9f3d1388..8f78d773 100644 --- a/test/fixtures/content/page-metadata-jsonld-xss.html +++ b/test/fixtures/content/page-metadata-jsonld-xss.html @@ -1,6 +1,7 @@ Home | Helix Project Boilerplate + diff --git a/test/fixtures/content/page-metadata-jsonld.html b/test/fixtures/content/page-metadata-jsonld.html index 0454a95b..f8ad5bd1 100644 --- a/test/fixtures/content/page-metadata-jsonld.html +++ b/test/fixtures/content/page-metadata-jsonld.html @@ -1,6 +1,7 @@ Home | Helix Project Boilerplate + diff --git a/test/fixtures/content/page-metadata-no-fallback.html b/test/fixtures/content/page-metadata-no-fallback.html index c73514a7..b735d11e 100644 --- a/test/fixtures/content/page-metadata-no-fallback.html +++ b/test/fixtures/content/page-metadata-no-fallback.html @@ -3,6 +3,7 @@ + diff --git a/test/fixtures/content/page-metadata-twitter-fallback.html b/test/fixtures/content/page-metadata-twitter-fallback.html index 0dd23295..fcbd87c4 100644 --- a/test/fixtures/content/page-metadata-twitter-fallback.html +++ b/test/fixtures/content/page-metadata-twitter-fallback.html @@ -4,6 +4,7 @@ Home | Helix Project Boilerplate + diff --git a/test/fixtures/content/page-with-gridtables.html b/test/fixtures/content/page-with-gridtables.html index 4947de3b..162d4ab8 100644 --- a/test/fixtures/content/page-with-gridtables.html +++ b/test/fixtures/content/page-with-gridtables.html @@ -4,6 +4,7 @@ Home | Helix Project Boilerplate + diff --git a/test/fixtures/content/unwrap-images.html b/test/fixtures/content/unwrap-images.html index 3478a2d0..83047222 100644 --- a/test/fixtures/content/unwrap-images.html +++ b/test/fixtures/content/unwrap-images.html @@ -4,6 +4,7 @@ A trio of typographic treats from Adobe Originals|Adobe + From d358d4fac31d72f77dec617abcd036003a242f69 Mon Sep 17 00:00:00 2001 From: H Parra Date: Thu, 12 Sep 2024 11:09:33 -0700 Subject: [PATCH 3/4] ci please --- .github/workflows/main.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 06d9d47f..3bc30bd7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,5 +1,8 @@ name: Build -on: [push] +on: + push: + pull_request: + types: [opened, synchronize, reopened] env: CI_BUILD_NUM: ${{ github.run_id }} @@ -14,7 +17,7 @@ jobs: - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: "20.x" - run: npm ci - run: npm run lint - run: npm test @@ -38,7 +41,7 @@ jobs: - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: "20.x" - run: npm ci - run: npm run semantic-release env: From 3b040ae6891aabaa42868e6b7c318ef9edaa88a5 Mon Sep 17 00:00:00 2001 From: H Parra Date: Thu, 12 Sep 2024 12:39:02 -0700 Subject: [PATCH 4/4] Revert "ci please" This reverts commit d358d4fac31d72f77dec617abcd036003a242f69. --- .github/workflows/main.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3bc30bd7..06d9d47f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,8 +1,5 @@ name: Build -on: - push: - pull_request: - types: [opened, synchronize, reopened] +on: [push] env: CI_BUILD_NUM: ${{ github.run_id }} @@ -17,7 +14,7 @@ jobs: - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: "20.x" + node-version: '20.x' - run: npm ci - run: npm run lint - run: npm test @@ -41,7 +38,7 @@ jobs: - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: "20.x" + node-version: '20.x' - run: npm ci - run: npm run semantic-release env: