From 659f44bf386b472dc613d1a7ba650f34e9e6f7d2 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Fri, 15 Sep 2023 13:54:51 -0400 Subject: [PATCH] Added GHA workflows. --- .github/CODEOWNERS | 2 + .github/CONTENTS.md | 11 + .github/ISSUE_TEMPLATE/README.md | 7 + .github/ISSUE_TEMPLATE/bug_report.yaml | 50 +++++ .github/ISSUE_TEMPLATE/feature_request.yaml | 41 ++++ .github/ISSUE_TEMPLATE/question.yaml | 14 ++ .github/PULL_REQUEST_TEMPLATE.yaml | 19 ++ .github/dependabot.yml | 17 ++ .github/issue_template.md | 1 + .github/labels.json | 12 ++ .github/workflows/config/.env | 1 + .github/workflows/config/.lycheeignore | 2 + .../config/.markdown-link-check/config.json | 34 +++ .github/workflows/config/.nvmrc | 1 + .github/workflows/generate-website.yml | 36 ---- .github/workflows/labels.yml | 18 ++ .github/workflows/link-check.yml | 62 ++++++ .github/workflows/status-ci-cd.yml | 28 +++ .../workflows/workflow-generate-website.yml | 168 +++++++++++++++ .../workflow-validate-repo-markdown.yml | 72 +++++++ .../workflow-validate-website-content.yml | 64 ++++++ package-lock.json | 197 +++++++++++++----- package.json | 1 + {docs => website}/.gitignore | 0 .../assets/scss/hugo-uswds-custom.scss | 0 {docs => website}/config.yaml | 0 {docs => website}/content/_index.md | 0 .../content/documentation/_index.md | 0 .../documentation/components/_index.md | 0 .../content/documentation/hugo/_index.md | 0 .../hugo/configuration-parameters.md | 0 .../hugo/customizing-css-and-js.md | 0 .../content/documentation/hugo/shortcodes.md | 0 .../content/documentation/hugo/templates.md | 0 {docs => website}/content/examples/_index.md | 0 .../content/examples/homepage.md | 0 .../content/examples/shortcodes.md | 0 .../content/examples/syntax-highlighting.md | 0 {docs => website}/go.mod | 0 {docs => website}/layouts/partials/foot.html | 0 {docs => website}/layouts/partials/head.html | 0 41 files changed, 775 insertions(+), 83 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/CONTENTS.md create mode 100644 .github/ISSUE_TEMPLATE/README.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml create mode 100644 .github/ISSUE_TEMPLATE/question.yaml create mode 100644 .github/PULL_REQUEST_TEMPLATE.yaml create mode 100644 .github/dependabot.yml create mode 100644 .github/issue_template.md create mode 100644 .github/labels.json create mode 100644 .github/workflows/config/.env create mode 100644 .github/workflows/config/.lycheeignore create mode 100644 .github/workflows/config/.markdown-link-check/config.json create mode 100644 .github/workflows/config/.nvmrc delete mode 100644 .github/workflows/generate-website.yml create mode 100644 .github/workflows/labels.yml create mode 100644 .github/workflows/link-check.yml create mode 100644 .github/workflows/status-ci-cd.yml create mode 100644 .github/workflows/workflow-generate-website.yml create mode 100644 .github/workflows/workflow-validate-repo-markdown.yml create mode 100644 .github/workflows/workflow-validate-website-content.yml rename {docs => website}/.gitignore (100%) rename {docs => website}/assets/scss/hugo-uswds-custom.scss (100%) rename {docs => website}/config.yaml (100%) rename {docs => website}/content/_index.md (100%) rename {docs => website}/content/documentation/_index.md (100%) rename {docs => website}/content/documentation/components/_index.md (100%) rename {docs => website}/content/documentation/hugo/_index.md (100%) rename {docs => website}/content/documentation/hugo/configuration-parameters.md (100%) rename {docs => website}/content/documentation/hugo/customizing-css-and-js.md (100%) rename {docs => website}/content/documentation/hugo/shortcodes.md (100%) rename {docs => website}/content/documentation/hugo/templates.md (100%) rename {docs => website}/content/examples/_index.md (100%) rename {docs => website}/content/examples/homepage.md (100%) rename {docs => website}/content/examples/shortcodes.md (100%) rename {docs => website}/content/examples/syntax-highlighting.md (100%) rename {docs => website}/go.mod (100%) rename {docs => website}/layouts/partials/foot.html (100%) rename {docs => website}/layouts/partials/head.html (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..5cb58c51 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# directory specific owners +* @david-waltermire-nist diff --git a/.github/CONTENTS.md b/.github/CONTENTS.md new file mode 100644 index 00000000..0c40f2ad --- /dev/null +++ b/.github/CONTENTS.md @@ -0,0 +1,11 @@ +# GitHub Files + +This directory contains supporting files for GitHub repository use. The structure and contents of the directory are as follows: + +* [CODEOWNERS](CODEOWNERS): Defines which individuals are responsible for code in this repository. See [GitHub code owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners). +* [dependabot.yml](dependabot.yml): Configures [Github Dependabot](https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates) to manage security and version updates. +* [ISSUE_TEMPLATE](ISSUE_TEMPLATE): This directory contains several templates for creating new issues in GitHub. +* [issue_template.md](issue_template.md): Default issue template. +* [labels.json](labels.json): Configures the issue labels used by this repository. This is supported by the [labels workflow](workflows/labels.yml). +* [PULL_REQUEST_TEMPLATE.md](issue_template.md): This file contains a template to be filled out for each GitHub pull request by the person submitting it. +* [workflows](workflows): The configured [GHitHub actions workflows](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions) for this repository. diff --git a/.github/ISSUE_TEMPLATE/README.md b/.github/ISSUE_TEMPLATE/README.md new file mode 100644 index 00000000..15481ebf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/README.md @@ -0,0 +1,7 @@ +# GitHub Issue Template Files + +This directory contains templates for creating new project issues in GitHub. The structure and contents of the directory are as follows: + +* [bug_report.md](bug_report.yaml): This file contains a template for creating a new issue in GitHub to report a bug. +* [question.md](question.yaml): This file contains a template for creating a new issue in GitHub containing a general question about the project. +* [feature_request.md](feature_request.yaml): This file contains a template for creating a new issue in GitHub containing a user story. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 00000000..eab0f76f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,50 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["bug"] +projects: ["usnistgov/49"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + value: "A bug happened!" + validations: + required: true + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + value: "A bug happened!" + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: textarea + id: howto-replicate + attributes: + label: How do we replicate this issue? + description: What are the steps to reproduce this behavior (use screenshots if applicable)? + placeholder: | + 1. Do this... + 2. Then this... + 3. See error... + validations: + required: true + - type: textarea + id: other + attributes: + label: Other relevant details + description: Anything else we should know? diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 00000000..c27680c8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,41 @@ +name: Feature request +description: Suggest an idea for this project +labels: ["user story", "enhancement"] +projects: ["usnistgov/49"] +body: +- type: textarea + id: user-story + attributes: + label: User Story + description: Describe why the new feature is needed. + placeholder: | + As a Vulntology *stakeholder*, I *provide a clear and concise description of what the problem is.* Ex. I need to be able to do + validations: + required: true +- type: textarea + id: goals + attributes: + label: Goals + description: Describe what needs to be accomplished to address the User Story. + placeholder: | + A clear and concise description of what you want to happen. This should be outcome focused. Include concise description of any alternative solutions or features you've considered. Feel free to include screenshots or examples about the feature request here. + validations: + required: true +- type: textarea + id: dependencies + attributes: + label: Dependencies + description: Describe any previous issues or related work that must be completed to start or complete this issue. + placeholder: | + Describe any previous issues or related work that must be completed to start or complete this issue. + validations: + required: false +- type: textarea + id: acceptance-criteria + attributes: + label: Acceptance Criteria + description: Describe the artifacts and additional work that must be completed to resolve this issue. + placeholder: | + Describe anything else that must be completed for this issue to be considered resolved. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/question.yaml b/.github/ISSUE_TEMPLATE/question.yaml new file mode 100644 index 00000000..8cacb4a0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yaml @@ -0,0 +1,14 @@ +name: Question +description: Ask your question +labels: ['question'] +body: + - type: markdown + attributes: + value: Please note, the [Q&A discussion board](https://github.com/usnistgov/vulntology/discussions/categories/q-a) is a more appropriate place for asking most questions. + - type: textarea + id: question-text + attributes: + label: Question + description: Please enter your question + validations: + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.yaml b/.github/PULL_REQUEST_TEMPLATE.yaml new file mode 100644 index 00000000..4eef8b22 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.yaml @@ -0,0 +1,19 @@ +# Committer Notes + +{Please provide a brief description of what this PR accomplishes. Be sure to reference any issues addressed. If the PR is a work-in-progress submitted for early review, please mark the PR as DRAFT.} + +## All Submissions: + +- [ ] Have you selected the correct base branch per [Contributing](https://github.com/usnistgov/vulntology/blob/main/CONTRIBUTING.md) guidance? +- [ ] Have you set "[Allow edits and access to secrets by maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)"? +- [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/usnistgov/vulntology/pulls) for the same update/change? +- [ ] Have you squashed any non-relevant commits and commit messages? \[[instructions](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History)\] + +By submitting a pull request, you are agreeing to provide this contribution under the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/). + +## For Changes + +- [ ] Have you added an explanation of what your changes do and why you'd like us to include them? +- [ ] Have you written new tests for your core changes, as applicable? +- [ ] Have you included examples of how to use your new feature(s)? +- [ ] Have you updated all [website](https://pages.nist.gov/vulntology) and readme documentation affected by the changes you made? Changes to the website can be made in the `website/content` directory of your branch. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..30f4561b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + target-branch: "develop" + - package-ecosystem: "gomod" + directory: "/website" + schedule: + interval: "daily" + target-branch: "develop" + - package-ecosystem: "npm" + directory: / + schedule: + interval: "daily" + target-branch: "develop" diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 00000000..c616e0a7 --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1 @@ +{Please describe the nature of your issue} diff --git a/.github/labels.json b/.github/labels.json new file mode 100644 index 00000000..fb5f0fe8 --- /dev/null +++ b/.github/labels.json @@ -0,0 +1,12 @@ +[ + { "name": "bug", "color":"d73a4a", "description":"The issue is a bug report."}, + { "name": "documentation", "color":"0075ca", "description":"The issue relates to improvements of additions to documentation."}, + { "name": "duplicate", "color":"cfd3d7", "description":"The issue duplicates another issue."}, + { "name": "enhancement", "color":"a2eeef", "description":"The issue adds a new feature, capability, or artifact to the repository."}, + { "name": "good first issue", "color":"7057ff", "description":"Good issue for newcomers to work on."}, + { "name": "help wanted", "color":"008672", "description":"Help from the community is needed with this issue."}, + { "name": "invalid", "color":"e4e669", "description":"The issue is not resolvable in any way."}, + { "name": "question", "color":"d876e3", "description":"The issue contains a question that needs to be answered."}, + { "name": "user story", "color":"73b3e7", "description":"The issue is a user story for a development task."}, + { "name": "wontfix", "color":"ffffff", "description":"The issue will not be addressed."} +] diff --git a/.github/workflows/config/.env b/.github/workflows/config/.env new file mode 100644 index 00000000..e9eb6d29 --- /dev/null +++ b/.github/workflows/config/.env @@ -0,0 +1 @@ +HUGO_VERSION=0.118.2 diff --git a/.github/workflows/config/.lycheeignore b/.github/workflows/config/.lycheeignore new file mode 100644 index 00000000..f1c0505a --- /dev/null +++ b/.github/workflows/config/.lycheeignore @@ -0,0 +1,2 @@ +https://search.usa.gov/search +https://github.com/usnistgov/hugo-uswds/tree/master/website/content/* \ No newline at end of file diff --git a/.github/workflows/config/.markdown-link-check/config.json b/.github/workflows/config/.markdown-link-check/config.json new file mode 100644 index 00000000..ee5da802 --- /dev/null +++ b/.github/workflows/config/.markdown-link-check/config.json @@ -0,0 +1,34 @@ +{ + "ignorePatterns": [ + { + "pattern": "https://docs.github.com" + }, + { + "pattern": "https://guides.github.com" + }, + { + "pattern": "https://help.github.com" + }, + { + "pattern": "https://www.bottlecaps.de/rex/" + } + ], + "replacementPatterns": [ + { + "pattern": "^../../issues", + "replacement": "https://github.com/usnistgov/hugo-uswds/issues" + }, + { + "pattern": "^../../projects", + "replacement": "https://github.com/usnistgov/hugo-uswds/projects" + }, + { + "pattern": "^../../releases", + "replacement": "https://github.com/usnistgov/hugo-uswds/releases" + }, + { + "pattern": "^../../tree", + "replacement": "https://github.com/usnistgov/hugo-uswds/tree" + } + ] +} diff --git a/.github/workflows/config/.nvmrc b/.github/workflows/config/.nvmrc new file mode 100644 index 00000000..6f7f377b --- /dev/null +++ b/.github/workflows/config/.nvmrc @@ -0,0 +1 @@ +v16 diff --git a/.github/workflows/generate-website.yml b/.github/workflows/generate-website.yml deleted file mode 100644 index ed7dd50e..00000000 --- a/.github/workflows/generate-website.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Generate Website -on: - push: - branches: - - master -jobs: - build-and-push: - name: Build and Push `docs/` site - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - with: - # Fetch all history for .GitInfo and .Lastmod - fetch-depth: 0 - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: "0.110.0" - extended: true - - name: Build - run: | - hugo --minify - working-directory: ./docs - - name: Deploy - uses: peaceiris/action-gh-pages@v3 - # only deploy if on master branch - if: github.ref == 'refs/heads/master' - with: - github_token: ${{ secrets.COMMIT_TOKEN }} - enable_jekyll: false - publish_dir: ./docs/public - publish_branch: nist-pages - commit_user_name: OSCAL GitHub Actions Bot - commit_user_email: oscal@nist.gov - commit_author: OSCAL GitHub Actions Bot - commit_message: Deploying website [ci deploy skip] diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 00000000..668edbfa --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,18 @@ +on: + label: + types: [created,deleted,edited] + push: + branches: + - main + paths: + - '.github/labels.json' +name: Create Default Labels +jobs: + labels: + name: DefaultLabelsActions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + - uses: lannonbr/issue-label-manager-action@7890981d0e8f2922211a7fe2c391c53cb3037cb4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 00000000..34a14768 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,62 @@ +name: Link Check + +on: + schedule: + - cron: "00 8 * * *" # 0800 UTC is 0400 AM EDT + repository_dispatch: + workflow_dispatch: + inputs: + ignorePattern: + description: 'a pattern provided to grep for files/directories to ignore' + required: false + default: '^website/' + type: string + markdownLinkCheckConfig: + description: 'the path to the markdown link check config file' + required: false + default: 'build/config/.markdown-link-check/config.json' + type: string + site_git_ref: + description: 'git ref, a SHA commit or branch or tag, for the published HTML content' + required: true + default: 'nist-pages' + type: string + site_git_ref_path: + description: 'the subdirectory to check out git ref and check links in website content' + required: true + default: 'published' + type: string + linkcheck_create_issue: + description: 'create new GitHub issue if broken links found' + required: false + default: true + type: boolean +jobs: + schedule-validate-repo-markdown-links: + uses: ./.github/workflows/workflow-validate-repo-markdown.yml + if: github.event_name != 'workflow_dispatch' + with: + ignorePattern: '^website/' + markdownLinkCheckConfig: 'build/config/.markdown-link-check/config.json' + linkcheck_create_issue: true + schedule-validate-repo-markdown-links-debug: + uses: ./.github/workflows/workflow-validate-repo-markdown.yml + if: github.event_name == 'workflow_dispatch' + with: + ignorePattern: ${{ github.event.inputs.ignorePattern }} + markdownLinkCheckConfig: ${{ github.event.inputs.markdownLinkCheckConfig }} + linkcheck_create_issue: ${{ contains('true', github.event.inputs.linkcheck_create_issue) }} + schedule-validate-website-links: + uses: ./.github/workflows/workflow-validate-website-content.yml + if: github.event_name != 'workflow_dispatch' + with: + site_git_ref: 'nist-pages' + site_git_ref_path: 'published' + linkcheck_create_issue: true + schedule-validate-website-links-debug: + uses: ./.github/workflows/workflow-validate-website-content.yml + if: github.event_name == 'workflow_dispatch' + with: + site_git_ref: ${{ github.event.inputs.site_git_ref }} + site_git_ref_path: ${{ github.event.inputs.site_git_ref_path }} + linkcheck_create_issue: ${{ contains('true', github.event.inputs.linkcheck_create_issue) }} diff --git a/.github/workflows/status-ci-cd.yml b/.github/workflows/status-ci-cd.yml new file mode 100644 index 00000000..d5e94108 --- /dev/null +++ b/.github/workflows/status-ci-cd.yml @@ -0,0 +1,28 @@ +name: Metaschema CI/CD +on: + push: + branches: + - main + - develop + - "feature-*" + - "release-*" + pull_request: + branches: + - main + - develop + - "feature-*" + - "release-*" + workflow_dispatch: +jobs: + validate-repo-markdown: + uses: ./.github/workflows/workflow-validate-repo-markdown.yml + validate-website: + if: github.event_name == 'pull_request' + uses: ./.github/workflows/workflow-generate-website.yml + with: + commit_resources: false + push-website: + if: github.event_name == 'push' + uses: ./.github/workflows/workflow-generate-website.yml + with: + commit_resources: true diff --git a/.github/workflows/workflow-generate-website.yml b/.github/workflows/workflow-generate-website.yml new file mode 100644 index 00000000..e5999bb6 --- /dev/null +++ b/.github/workflows/workflow-generate-website.yml @@ -0,0 +1,168 @@ +name: Generate Website +on: + workflow_call: + inputs: + commit_resources: + description: 'commit the resources after generating them. Requires the access_token to be passed' + required: false + default: false + type: boolean + linkcheck_fail_on_error: + description: 'a boolean flag that determines if bad links found by the link checker fail fast and stop a complete build' + required: false + default: true + type: boolean + workflow_dispatch: + branches: + - main + - develop + - "release-*" + inputs: + commit_resources: + description: 'commit the resources after generating them. Requires a PAT defined as secrets.COMMIT_TOKEN' + required: true + default: false + type: boolean + linkcheck_fail_on_error: + description: 'a boolean flag that determines if bad links found by the link checker fail fast and stop a complete build' + required: false + default: true + type: boolean + linkcheck_create_issue: + description: 'create new GitHub issue if broken links found' + required: false + default: false + type: boolean +env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} +jobs: + build-and-push-website: + name: Build and Push Website + runs-on: ubuntu-20.04 + env: + BUILD_PATH: ./build + permissions: + contents: write + steps: + - name: Manage GH_TOKEN + if: env.GH_TOKEN == '' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV + - id: checkout_latest_workflow + name: Checkout Latest + if: (github.event_name == 'workflow_dispatch' && github.event.inputs.commit_resources == 'true') || (github.event_name == 'push' && inputs.commit_resources == true) + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + with: + token: ${{ env.GH_TOKEN }} + submodules: recursive + # use this for overything else (i.e., pull requests) where publication is not needed + - name: Checkout Latest + if: steps.checkout_latest_workflow.conclusion == 'skipped' + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + with: + submodules: recursive + - name: Setup Swap Space + # Since Hugo is requiring more memory + uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c + with: + swap-size-gb: 10 + # Install Hugo + - name: Read .env + id: hugo-version + run: | + . .github/workflows/config/.env + echo "HUGO_VERSION=${HUGO_VERSION}" >> "${GITHUB_OUTPUT}" + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}' + extended: true + - name: Set up NodeJS + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d + with: + node-version-file: '.github/workflows/config/.nvmrc' + cache: 'npm' + cache-dependency-path: package-lock.json + - name: Setup Dependencies + run: | + # NodeJS + # If you are a developer and need to modify the workflow, be sure to review + # the package.json and package-lock.json to ensure the following deps are + # at least installed (they will be updated by dependabot): + # - ajv-cli + # - ajv-formats + # - markdown-link-check + # - yaml-convert + npm install --loglevel verbose + echo "$PWD/node_modules/.bin/" >> $GITHUB_PATH + # Dart-Sass + sudo snap install dart-sass + # cache hugo modules + - uses: actions/cache@v2 + with: + path: /tmp/hugo_cache + key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-hugomod- + - name: Run Hugo + run: | + hugo mod vendor + hugo -e production --logLevel debug --minify + working-directory: ${{ github.workspace }}/website + - name: Zip Artifacts for Upload + run: | + zip ${{ runner.temp }}/website.zip -r public/ + working-directory: ${{ github.workspace }}/website + - name: Upload generated site + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + with: + name: website + path: | + ${{ runner.temp }}/website.zip + retention-days: 5 + - id: linkchecker + name: Link Checker + uses: lycheeverse/lychee-action@ec3ed119d4f44ad2673a7232460dc7dff59d2421 + with: + args: --exclude-file .github/workflows/config/.lycheeignore --verbose --no-progress --accept 200,206,429 './website/public/**/*.html' --remap "https://pages.nist.gov/hugo-uswds/ file://${GITHUB_WORKSPACE}/website/public/" --exclude-mail + format: markdown + output: html-link-report.md + debug: true + fail: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + continue-on-error: true + - name: Upload link check report + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + with: + name: html-link-report + path: html-link-report.md + retention-days: 5 + - name: Create issue if bad links detected + if: ${{ !cancelled() && env.lychee_exit_code != 0 && inputs.linkcheck_create_issue }} + uses: peter-evans/create-issue-from-file@433e51abf769039ee20ba1293a088ca19d573b7f + with: + title: Scheduled Check of Website Content Found Bad Hyperlinks + content-filepath: ./lychee/out.md + labels: | + bug + documentation + - name: Fail on link check error + if: ${{ !cancelled() && env.lychee_exit_code != 0 && (github.event.inputs.linkcheck_fail_on_error == 'true' || inputs.linkcheck_fail_on_error == true) }} + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 + with: + script: | + core.setFailed('Link checker detected broken or invalid links, read attached report.') + - name: Deploy Website + uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 + if: github.ref_name == 'main' && ((github.event_name == 'push' && inputs.commit_resources == true) || (github.event_name == 'workflow_dispatch' && github.event.inputs.commit_resources == 'true')) + with: + github_token: ${{ env.GH_TOKEN }} + enable_jekyll: false + publish_dir: ./website/public + publish_branch: nist-pages + commit_user_name: GitHub Actions Bot + commit_user_email: metaschema@nist.gov + commit_author: GitHub Actions Bot + commit_message: Deploying website [ci deploy skip] diff --git a/.github/workflows/workflow-validate-repo-markdown.yml b/.github/workflows/workflow-validate-repo-markdown.yml new file mode 100644 index 00000000..8318970f --- /dev/null +++ b/.github/workflows/workflow-validate-repo-markdown.yml @@ -0,0 +1,72 @@ +name: Validate Repo Markdown +on: + workflow_call: + inputs: + ignorePattern: + description: 'a pattern provided to grep for files/directories to ignore' + required: false + default: '^website/' + type: string + markdownLinkCheckConfig: + description: 'the path to the markdown link check config file' + required: false + default: '.github/workflows/config/.markdown-link-check/config.json' + type: string + linkcheck_create_issue: + description: 'create new GitHub issue if broken links found' + required: false + default: false + type: boolean +jobs: + validate-repo-markdown: + name: Validate Repo Markdown + runs-on: ubuntu-20.04 + permissions: + contents: read + issues: write + steps: + # use this for pulls where checkout is anonymous + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + with: + submodules: recursive + # Setup runtime environment + # ------------------------- + - name: Set up NodeJS + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d + with: + node-version-file: '.github/workflows/config/.nvmrc' + cache: 'npm' + cache-dependency-path: 'package-lock.json' + - name: Setup Dependencies + run: | + # NodeJS + # If you are a developer and need to modify the workflow, be sure to review + # the package.json and package-lock.json to ensure the following deps are + # at least installed (they will be updated by dependabot): + # - ajv-cli + # - ajv-formats + # - markdown-link-check + # - yaml-convert + npm install --loglevel verbose + echo "$PWD/node_modules/.bin/" >> $GITHUB_PATH + # Build Artifacts + # --------------- + - name: Validate repo Markdown content instances + run: | + # this command will filter out any docs Markdown files, which are checked in a different job + git ls-files "*.md" -z | \ + grep --null-data -v "${{ inputs.ignorePattern }}" | \ + xargs -0 markdown-link-check -c "${{ inputs.markdownLinkCheckConfig }}" | \ + tee mlc_report.log + # Exit code of xargs and markdown-link-check, not git or grep or tee pipe elements + exit ${PIPESTATUS[2]} + id: linkchecker + - name: Create issue if bad links detected in repo + if: failure() && inputs.linkcheck_create_issue == true + uses: peter-evans/create-issue-from-file@433e51abf769039ee20ba1293a088ca19d573b7f # v3.0.0 + with: + title: Scheduled Check of Markdown Documents Found Bad Hyperlinks + content-filepath: mlc_report.log + labels: | + bug + documentation diff --git a/.github/workflows/workflow-validate-website-content.yml b/.github/workflows/workflow-validate-website-content.yml new file mode 100644 index 00000000..026d4d7c --- /dev/null +++ b/.github/workflows/workflow-validate-website-content.yml @@ -0,0 +1,64 @@ +name: Validate Website Content +on: + workflow_call: + inputs: + site_git_ref: + description: 'git ref, a SHA commit or branch or tag, for the published HTML content' + required: true + default: 'nist-pages' + type: string + site_git_ref_path: + description: 'the subdirectory to check out git ref and check links in website content' + required: true + default: 'published' + type: string + linkcheck_create_issue: + description: 'create new GitHub issue if broken links found' + required: false + default: false + type: boolean + linkcheck_fail_on_error: + description: 'create new GitHub issue if broken links found' + required: false + default: false + type: boolean +jobs: + schedule-validate-website-links: + runs-on: ubuntu-20.04 + permissions: + contents: read + issues: write + steps: + - name: Checkout Latest + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + with: + fetch-depth: 0 # this ensures that the tag and commit history are available + - name: Checkout git ref of published website content + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + with: + ref: ${{ inputs.site_git_ref }} + path: ${{ inputs.site_git_ref_path }} + - name: Check website HTML content links + id: linkchecker + uses: lycheeverse/lychee-action@ec3ed119d4f44ad2673a7232460dc7dff59d2421 + with: + args: --exclude-file .github/workflows/config/.lycheeignore --verbose --no-progress --accept 200,206,429 './${{ inputs.site_git_ref_path }}/**/*.html' --exclude-mail + fail: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + continue-on-error: true + - name: Create issue if bad links detected + if: ${{ !cancelled() && env.lychee_exit_code != 0 && inputs.linkcheck_create_issue }} + uses: peter-evans/create-issue-from-file@433e51abf769039ee20ba1293a088ca19d573b7f + with: + title: Scheduled Check of Website Content Found Bad Hyperlinks + content-filepath: ./lychee/out.md + labels: | + bug + documentation + - name: Check coverage tolerance + if: ${{ env.lychee_exit_code != 0 && inputs.linkcheck_fail_on_error }} + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 + with: + script: | + core.setFailed('Link checker detected broken or invalid links, read attached report.') diff --git a/package-lock.json b/package-lock.json index fdb377f3..2f8e87e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,14 +7,13 @@ "": { "name": "hugo-uswds", "version": "2.0.0", - "hasInstallScript": true, "license": "CC0-1.0", "dependencies": { "@uswds/uswds": "^3.6.0", "image-map-resizer": "^1.0.10", "jquery": "^3.6.4", - "mermaid": "^10.1.0", - "uswds": "^2.14.0" + "markdown-link-check": "^3.11.2", + "mermaid": "^10.1.0" }, "devDependencies": { "@types/jquery": "^3.5.16", @@ -1045,6 +1044,11 @@ "node": ">=0.10.0" } }, + "node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + }, "node_modules/async-done": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", @@ -1266,8 +1270,7 @@ "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" }, "node_modules/brace-expansion": { "version": "2.0.1", @@ -1458,7 +1461,6 @@ "version": "1.0.0-rc.12", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "dev": true, "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -1479,7 +1481,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dev": true, "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -1961,7 +1962,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -1991,7 +1991,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true, "engines": { "node": ">= 6" }, @@ -2492,7 +2491,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -2759,7 +2757,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -2773,7 +2770,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, "funding": [ { "type": "github", @@ -2785,7 +2781,6 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, "dependencies": { "domelementtype": "^2.3.0" }, @@ -2801,16 +2796,10 @@ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.5.tgz", "integrity": "sha512-F9e6wPGtY+8KNMRAVfxeCOHU0/NPWMSENNq4pQctuXRqqdEPW7q3CrLbR5Nse044WwacyjHGOMlvNsBe1y6z9A==" }, - "node_modules/domready": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/domready/-/domready-1.0.8.tgz", - "integrity": "sha512-uIzsOJUNk+AdGE9a6VDeessoMCzF8RrZvJCX/W8QtyfgdR6Uofn/MvRonih3OtCO79b2VDzDOymuiABrQ4z3XA==" - }, "node_modules/domutils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -2911,7 +2900,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, "engines": { "node": ">=0.12" }, @@ -4157,11 +4145,18 @@ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, + "node_modules/html-link-extractor": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/html-link-extractor/-/html-link-extractor-1.0.5.tgz", + "integrity": "sha512-ADd49pudM157uWHwHQPUSX4ssMsvR/yHIswOR5CUfBdK9g9ZYGMhVSE6KZVHJ6kCkR0gH4htsfzU6zECDNVwyw==", + "dependencies": { + "cheerio": "^1.0.0-rc.10" + } + }, "node_modules/htmlparser2": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", - "dev": true, "funding": [ "https://github.com/fb55/htmlparser2?sponsor=1", { @@ -4299,6 +4294,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-absolute-url": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-4.0.1.tgz", + "integrity": "sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -4514,6 +4520,20 @@ "node": ">=0.10.0" } }, + "node_modules/is-relative-url": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-relative-url/-/is-relative-url-4.0.0.tgz", + "integrity": "sha512-PkzoL1qKAYXNFct5IKdKRH/iBQou/oCC85QhXj6WKtUQBliZ4Yfd3Zk27RHu9KQG8r6zgvAA2AQKC9p+rqTszg==", + "dependencies": { + "is-absolute-url": "^4.0.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", @@ -4556,6 +4576,17 @@ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, + "node_modules/isemail": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz", + "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", + "dependencies": { + "punycode": "2.x.x" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -4781,6 +4812,17 @@ "node": ">=10" } }, + "node_modules/link-check": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/link-check/-/link-check-5.2.0.tgz", + "integrity": "sha512-xRbhYLaGDw7eRDTibTAcl6fXtmUQ13vkezQiTqshHHdGueQeumgxxmQMIOmJYsh2p8BF08t8thhDQ++EAOOq3w==", + "dependencies": { + "is-relative-url": "^4.0.0", + "isemail": "^3.2.0", + "ms": "^2.1.3", + "needle": "^3.1.0" + } + }, "node_modules/load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -4894,6 +4936,63 @@ "node": ">=0.10.0" } }, + "node_modules/markdown-link-check": { + "version": "3.11.2", + "resolved": "https://registry.npmjs.org/markdown-link-check/-/markdown-link-check-3.11.2.tgz", + "integrity": "sha512-zave+vI4AMeLp0FlUllAwGbNytSKsS3R2Zgtf3ufVT892Z/L6Ro9osZwE9PNA7s0IkJ4onnuHqatpsaCiAShJw==", + "dependencies": { + "async": "^3.2.4", + "chalk": "^5.2.0", + "commander": "^10.0.1", + "link-check": "^5.2.0", + "lodash": "^4.17.21", + "markdown-link-extractor": "^3.1.0", + "needle": "^3.2.0", + "progress": "^2.0.3" + }, + "bin": { + "markdown-link-check": "markdown-link-check" + } + }, + "node_modules/markdown-link-check/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/markdown-link-check/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "engines": { + "node": ">=14" + } + }, + "node_modules/markdown-link-extractor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/markdown-link-extractor/-/markdown-link-extractor-3.1.0.tgz", + "integrity": "sha512-r0NEbP1dsM+IqB62Ru9TXLP/HDaTdBNIeylYXumuBi6Xv4ufjE1/g3TnslYL8VNqNcGAGbMptQFHrrdfoZ/Sug==", + "dependencies": { + "html-link-extractor": "^1.0.5", + "marked": "^4.1.0" + } + }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/matchdep": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", @@ -5766,8 +5865,7 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/mute-stdout": { "version": "1.0.1", @@ -5922,6 +6020,22 @@ "node": ">=0.10.0" } }, + "node_modules/needle": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.2.0.tgz", + "integrity": "sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==", + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -6006,7 +6120,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, "dependencies": { "boolbase": "^1.0.0" }, @@ -6387,7 +6500,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", - "dev": true, "dependencies": { "entities": "^4.4.0" }, @@ -6399,7 +6511,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", - "dev": true, "dependencies": { "domhandler": "^5.0.2", "parse5": "^7.0.0" @@ -6738,6 +6849,14 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", @@ -6763,7 +6882,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, "engines": { "node": ">=6" } @@ -7500,6 +7618,11 @@ "node": ">=14.0.0" } }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, "node_modules/schema-utils": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", @@ -8699,26 +8822,6 @@ "node": ">=0.10.0" } }, - "node_modules/uswds": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/uswds/-/uswds-2.14.0.tgz", - "integrity": "sha512-r5ebL3av9jOPcbXTxKnGiT5k5NVIAWmtYcO8LeJkA5Svh2qc90YRhzCUWbz9TbGdXJriMCPb7whiULPDxmRhxg==", - "dependencies": { - "classlist-polyfill": "1.2.0", - "domready": "1.0.8", - "object-assign": "4.1.1", - "receptor": "1.0.0", - "resolve-id-refs": "0.1.0" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/uswds/node_modules/classlist-polyfill": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/classlist-polyfill/-/classlist-polyfill-1.2.0.tgz", - "integrity": "sha512-GzIjNdcEtH4ieA2S8NmrSxv7DfEV5fmixQeyTmqmRmRJPGpRBaSnA2a0VrCjyT8iW8JjEdMbKzDotAJf+ajgaQ==" - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index d3b2b611..de0ae682 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@types/jquery": "^3.5.16", "@uswds/compile": "^1.0.0", "cpy-cli": "^5.0.0", + "markdown-link-check": "^3.11.2", "rimraf": "^5.0.1", "terser-webpack-plugin": "^5.3.9", "ts-loader": "^9.4.4", diff --git a/docs/.gitignore b/website/.gitignore similarity index 100% rename from docs/.gitignore rename to website/.gitignore diff --git a/docs/assets/scss/hugo-uswds-custom.scss b/website/assets/scss/hugo-uswds-custom.scss similarity index 100% rename from docs/assets/scss/hugo-uswds-custom.scss rename to website/assets/scss/hugo-uswds-custom.scss diff --git a/docs/config.yaml b/website/config.yaml similarity index 100% rename from docs/config.yaml rename to website/config.yaml diff --git a/docs/content/_index.md b/website/content/_index.md similarity index 100% rename from docs/content/_index.md rename to website/content/_index.md diff --git a/docs/content/documentation/_index.md b/website/content/documentation/_index.md similarity index 100% rename from docs/content/documentation/_index.md rename to website/content/documentation/_index.md diff --git a/docs/content/documentation/components/_index.md b/website/content/documentation/components/_index.md similarity index 100% rename from docs/content/documentation/components/_index.md rename to website/content/documentation/components/_index.md diff --git a/docs/content/documentation/hugo/_index.md b/website/content/documentation/hugo/_index.md similarity index 100% rename from docs/content/documentation/hugo/_index.md rename to website/content/documentation/hugo/_index.md diff --git a/docs/content/documentation/hugo/configuration-parameters.md b/website/content/documentation/hugo/configuration-parameters.md similarity index 100% rename from docs/content/documentation/hugo/configuration-parameters.md rename to website/content/documentation/hugo/configuration-parameters.md diff --git a/docs/content/documentation/hugo/customizing-css-and-js.md b/website/content/documentation/hugo/customizing-css-and-js.md similarity index 100% rename from docs/content/documentation/hugo/customizing-css-and-js.md rename to website/content/documentation/hugo/customizing-css-and-js.md diff --git a/docs/content/documentation/hugo/shortcodes.md b/website/content/documentation/hugo/shortcodes.md similarity index 100% rename from docs/content/documentation/hugo/shortcodes.md rename to website/content/documentation/hugo/shortcodes.md diff --git a/docs/content/documentation/hugo/templates.md b/website/content/documentation/hugo/templates.md similarity index 100% rename from docs/content/documentation/hugo/templates.md rename to website/content/documentation/hugo/templates.md diff --git a/docs/content/examples/_index.md b/website/content/examples/_index.md similarity index 100% rename from docs/content/examples/_index.md rename to website/content/examples/_index.md diff --git a/docs/content/examples/homepage.md b/website/content/examples/homepage.md similarity index 100% rename from docs/content/examples/homepage.md rename to website/content/examples/homepage.md diff --git a/docs/content/examples/shortcodes.md b/website/content/examples/shortcodes.md similarity index 100% rename from docs/content/examples/shortcodes.md rename to website/content/examples/shortcodes.md diff --git a/docs/content/examples/syntax-highlighting.md b/website/content/examples/syntax-highlighting.md similarity index 100% rename from docs/content/examples/syntax-highlighting.md rename to website/content/examples/syntax-highlighting.md diff --git a/docs/go.mod b/website/go.mod similarity index 100% rename from docs/go.mod rename to website/go.mod diff --git a/docs/layouts/partials/foot.html b/website/layouts/partials/foot.html similarity index 100% rename from docs/layouts/partials/foot.html rename to website/layouts/partials/foot.html diff --git a/docs/layouts/partials/head.html b/website/layouts/partials/head.html similarity index 100% rename from docs/layouts/partials/head.html rename to website/layouts/partials/head.html