From 233c46e83e9099667396e313f2a466678664f4af Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Mon, 3 Jun 2024 09:18:51 +0200 Subject: [PATCH] mkdocs on root level --- .github/workflows/docs.yaml | 5 ---- LICENSE => LICENSE.md | 0 docs/scripts/copy_docs.sh | 11 -------- docs/scripts/docs.go | 48 ----------------------------------- docs/scripts/requirements.txt | 1 + mkdocs.yml | 42 ++++++++++++++++-------------- 6 files changed, 24 insertions(+), 83 deletions(-) rename LICENSE => LICENSE.md (100%) delete mode 100755 docs/scripts/copy_docs.sh delete mode 100644 docs/scripts/docs.go diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index d1aa2defe..7240f0bcb 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -32,11 +32,6 @@ jobs: - run: | pip install -r docs/scripts/requirements.txt - - name: setup - run: | - ./docs/scripts/copy_docs.sh - go run ./docs/scripts/docs.go - - name: Configure Git user run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/docs/scripts/copy_docs.sh b/docs/scripts/copy_docs.sh deleted file mode 100755 index 114c807e5..000000000 --- a/docs/scripts/copy_docs.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -cp CONTRIBUTING.md code-of-conduct.md ./docs/ - -cp LICENSE ./docs/LICENSE.md - -cp README.md ./docs/index.md - -sed -i -e 's#docs/##g' ./docs/index.md diff --git a/docs/scripts/docs.go b/docs/scripts/docs.go deleted file mode 100644 index 59fdbd43f..000000000 --- a/docs/scripts/docs.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "log" - "os" - "strings" -) - -func removeLinkPrefixInIndex() { - content, err := os.ReadFile("./docs/index.md") - if err != nil { - log.Fatalf("Could not read index.md file. Make sure to run copy_docs.sh script first. Original error: %s", err) - } - - updatedContent := strings.ReplaceAll(string(content), "](./docs/", "](") - updatedContent = strings.ReplaceAll(updatedContent, "](docs/", "](") - updatedContent = strings.ReplaceAll(updatedContent, "docs/img/external-dns.png", "img/external-dns.png") - - f, err := os.OpenFile("./docs/index.md", os.O_RDWR, 0o644) - if err != nil { - log.Fatalf("Could not open index.md file to update content. Original error: %s", err) - } - defer f.Close() - - if _, err := f.WriteString(updatedContent); err != nil { - log.Fatalf("Failed writing links update to index.md. Original error: %s", err) - } -} - -func main() { - removeLinkPrefixInIndex() -} diff --git a/docs/scripts/requirements.txt b/docs/scripts/requirements.txt index 0cd306aee..5564c82cd 100644 --- a/docs/scripts/requirements.txt +++ b/docs/scripts/requirements.txt @@ -2,4 +2,5 @@ mkdocs-git-revision-date-localized-plugin == 1.2.4 mkdocs == 1.5.3 mkdocs-material == 9.5.17 mkdocs-literate-nav == 0.6.1 +mkdocs-same-dir == 0.1.3 mike == 2.0.0 diff --git a/mkdocs.yml b/mkdocs.yml index 9d8762e90..82d55858c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,38 +1,41 @@ site_name: external-dns site_author: external-dns maintainers - repo_name: kubernetes-sigs/external-dns repo_url: https://github.com/kubernetes-sigs/external-dns/ - trademark: https://www.linuxfoundation.org/legal/trademark-usage +docs_dir: . + nav: - - index.md + - README.md + - Chart: + - About: charts/external-dns/README.md + - Changelog: charts/external-dns/CHANGELOG.md - About: - - FAQ: faq.md - - Out of Incubator: 20190708-external-dns-incubator.md + - FAQ: docs/faq.md + - Out of Incubator: docs/20190708-external-dns-incubator.md - Code of Conduct: code-of-conduct.md - License: LICENSE.md - - Tutorials: tutorials/ + - Tutorials: docs/tutorials/* - Annotations: - - About: annotations/annotations.md + - About: docs/annotations/annotations.md - Sources: - - About: sources/sources.md - - Gateway: sources/gateway.md - - Ingress: sources/ingress.md - - Service: sources/service.md + - About: docs/sources/sources.md + - Gateway: docs/sources/gateway.md + - Ingress: docs/sources/ingress.md + - Service: docs/sources/service.md - Registries: - - About: registry/registry.md - - TXT: registry/txt.md - - DynamoDB: registry/dynamodb.md + - About: docs/registry/registry.md + - TXT: docs/registry/txt.md + - DynamoDB: docs/registry/dynamodb.md - Advanced Topics: - - Initial Design: initial-design.md - - TTL: ttl.md - - MultiTarget: proposal/multi-target.md + - Initial Design: docs/initial-design.md + - TTL: docs/ttl.md + - MultiTarget: docs/proposal/multi-target.md - Contributing: - Kubernetes Contributions: CONTRIBUTING.md - - Release: release.md - - contributing/* + - Release: docs/release.md + - docs/contributing/* theme: name: material @@ -94,6 +97,7 @@ markdown_extensions: custom_checkbox: true plugins: + - same-dir - search - literate-nav - git-revision-date-localized: