From 358d61501ab25dd9849ed13bc9d7b6643606464f Mon Sep 17 00:00:00 2001 From: James Armes Date: Mon, 13 Jan 2025 16:28:38 -0500 Subject: [PATCH] docs: Reorganize docs to remove hard-coded nav. --- .github/workflows/docs.yaml | 2 +- Dockerfile | 2 +- docs/about/index.md | 5 ++++ docs/about/license.md | 5 ++++ .../{architecture.md => index.md} | 2 +- docs/contributing.md | 1 - docs/index.md | 5 +++- docs/license.md | 1 - mkdocs.yaml | 24 +------------------ 9 files changed, 18 insertions(+), 29 deletions(-) create mode 100644 docs/about/index.md create mode 100644 docs/about/license.md rename docs/architecture/{architecture.md => index.md} (99%) delete mode 100644 docs/contributing.md delete mode 100644 docs/license.md diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 747026e..4b30834 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -34,6 +34,6 @@ jobs: path: .cache restore-keys: | mkdocs-material- - - run: pip install mkdocs-material markdown-callouts pymdown-extensions plantuml_markdown + - run: pip install mkdocs-material markdown-callouts mkdocs-nav-weight pymdown-extensions plantuml_markdown - run: mkdocs build - run: aws s3 sync ./site "s3://${{ env.BUCKET_NAME || 'dev.docs.cfa.codes' }}/${{ env.PREFIX || 'tofu-modules' }}" diff --git a/Dockerfile b/Dockerfile index e2c3b9b..d465dbd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM squidfunk/mkdocs-material:9.5 # Install PlantUML so we can render UML diagrams. -RUN pip install markdown-callouts plantuml_markdown +RUN pip install markdown-callouts mkdocs-nav-weight plantuml_markdown RUN apk add --no-cache plantuml --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ && rm -rf /var/cache/apk/* diff --git a/docs/about/index.md b/docs/about/index.md new file mode 100644 index 0000000..1963491 --- /dev/null +++ b/docs/about/index.md @@ -0,0 +1,5 @@ +--- +title: Contributing +weight: 100 +--- +--8<-- "CONTRIBUTING.md" diff --git a/docs/about/license.md b/docs/about/license.md new file mode 100644 index 0000000..f208540 --- /dev/null +++ b/docs/about/license.md @@ -0,0 +1,5 @@ +--- +weight: 100 +index_weight: 100 +--- +--8<-- "LICENSE" diff --git a/docs/architecture/architecture.md b/docs/architecture/index.md similarity index 99% rename from docs/architecture/architecture.md rename to docs/architecture/index.md index fefb142..020581c 100644 --- a/docs/architecture/architecture.md +++ b/docs/architecture/index.md @@ -1,4 +1,4 @@ -# Architecture +# Architecture Overview ## File structure diff --git a/docs/contributing.md b/docs/contributing.md deleted file mode 100644 index ea38c9b..0000000 --- a/docs/contributing.md +++ /dev/null @@ -1 +0,0 @@ ---8<-- "CONTRIBUTING.md" diff --git a/docs/index.md b/docs/index.md index 1262409..d5e46c1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,3 +1,6 @@ +--- +title: Home +--- --8<-- "README.md" [aptible-managed-endpoint]: modules/aptible/managed-endpoint.md @@ -8,5 +11,5 @@ [aws-secrets]: modules/aws/secrets.md [aws-serverless-database]: modules/aws/serverless-database.md [aws-vpc]: modules/aws/vpc.md -[contributing]: contributing.md +[contributing]: about/index.md [datadog-waf]: modules/datadog/waf.md diff --git a/docs/license.md b/docs/license.md deleted file mode 100644 index f409d45..0000000 --- a/docs/license.md +++ /dev/null @@ -1 +0,0 @@ ---8<-- "LICENSE" diff --git a/mkdocs.yaml b/mkdocs.yaml index 36789df..4c47502 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -3,6 +3,7 @@ repo_url: https://github.com/codeforamerica/tofu-modules edit_uri: edit/main/docs/ plugins: + - mkdocs-nav-weight - search markdown_extensions: @@ -60,27 +61,4 @@ extra: link: https://www.threads.net/@codeforamerica name: Code for America on X (formerly Twitter) -nav: - - Home: index.md - - Architecture: - - Overview: architecture/architecture.md - - Create a New Module: architecture/create.md - - GitHub Actions: architecture/github-actions.md - - Modules: - - Aptible: - - Managed Endpoint: modules/aptible/managed-endpoint.md - - AWS: - - Backend: modules/aws/backend.md - - CloudFront WAF: modules/aws/cloudfront-waf.md - - Fargate Service: modules/aws/fargate-service.md - - Logging: modules/aws/logging.md - - Secrets: modules/aws/secrets.md - - Serverless Database: modules/aws/serverless-database.md - - VPC: modules/aws/vpc.md - - Datadog: - - WAF: modules/datadog/waf.md - - About: - - Contributing: contributing.md - - License: license.md - copyright: Produced by Code for America under the MIT license.