diff --git a/hack/mkdocs-copy-docs.py b/hack/mkdocs-copy-docs.py new file mode 100644 index 00000000000..7b32ed5e46a --- /dev/null +++ b/hack/mkdocs-copy-docs.py @@ -0,0 +1,24 @@ +# Copyright 2023 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. + +import shutil +import logging +from mkdocs import plugins + +log = logging.getLogger('mkdocs') + +@plugins.event_priority(100) +def on_pre_build(config, **kwargs): + log.info("copying docs") + shutil.copytree("docs","site-src/docs", dirs_exist_ok=True) diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000000..75e5d08ae2e --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,86 @@ +site_name: OVN Kubernetes +repo_url: https://github.com/ovn-org/ovn-kubernetes +repo_name: ovn-org/ovn-kubernetes +site_dir: site +docs_dir: site-src +hooks: +- hack/mkdocs-copy-docs.py +watch: +- docs +theme: + name: material + icon: + repo: fontawesome/brands/git-alt + logo: images/ovn-inside-k8s.png + favicon: images/ovn-inside-k8s.png + features: + - search.highlight + - navigation.tabs + - navigation.top +edit_uri: edit/master/site-src/ +plugins: + - search + - awesome-pages + - macros: + #include_dir: examples + j2_line_comment_prefix: "#$" + - blog: + # NOTE: configuration options can be found at + # https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/ + blog_dir: blog + blog_toc: true + #post_excerpt: required + post_excerpt_max_authors: 2 +markdown_extensions: + - admonition + - meta + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.details + - pymdownx.highlight + - pymdownx.inlinehilite + - pymdownx.superfences + - pymdownx.snippets: + base_path: site-src + check_paths: true + - toc: + permalink: true +nav: + - Introduction: index.md + #- Overview: + # - User Stories: user-stories.md + # - Resources: api-overview.md + # - Versioning: versioning.md + # - Conformance: conformance.md + # - Implementations: implementations.md + #- Guides: + # - Getting started: getting-started.md + #- Reference: + # - Examples: reference/examples.md + # - API Reference: reference/spec.md + # - Enhancement Proposals: + # - Overview: enhancements.md + # - Template: npeps/npep-95.md + # - Provisional: + # - npeps/npep-122.md + # - npeps/npep-133.md + # - Implementable: + # - Experimental: + # - npeps/npep-126-egress-traffic-control.md + # - Standard: + # - npeps/npep-137-conformance-profiles.md + # - Declined: + #- Blog: + - blog/index.md + +plugins: + - blog: + # NOTE: configuration options can be found at + # https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/ + blog_dir: blog + blog_toc: true + post_excerpt: required + post_excerpt_max_authors: 2 + - search + - mike diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000000..8b1c10d2f07 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,7 @@ +[build] +publish = "site" +environment = { PYTHON_VERSION = "3.8" } +command = """ +pip3 install -r requirements.txt && +mkdocs build -d site +""" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000000..f248ed43a77 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,19 @@ +Click==8.1.3 +htmlmin==0.1.12 +Jinja2==3.1.2 +jsmin==3.0.0 +livereload==2.6.1 +Markdown==3.3.4 +MarkupSafe==2.1.3 +mkdocs==1.5.2 +mkdocs-awesome-pages-plugin==2.9.2 +mkdocs-macros-plugin==1.0.5 +mkdocs-material==9.5.9 +mkdocs-material-extensions==1.3.1 +mike==1.1.2 +pep562==1.1 +Pygments==2.17.2 +pymdown-extensions==10.7 +PyYAML==6.0.1 +six==1.16.0 +tornado==6.4 diff --git a/site-src/index.md b/site-src/index.md new file mode 100644 index 00000000000..000ea3455fa --- /dev/null +++ b/site-src/index.md @@ -0,0 +1,17 @@ +# Welcome to MkDocs + +For full documentation visit [mkdocs.org](https://www.mkdocs.org). + +## Commands + +* `mkdocs new [dir-name]` - Create a new project. +* `mkdocs serve` - Start the live-reloading docs server. +* `mkdocs build` - Build the documentation site. +* `mkdocs -h` - Print help message and exit. + +## Project layout + + mkdocs.yml # The configuration file. + docs/ + index.md # The documentation homepage. + ... # Other markdown pages, images and other files. diff --git a/site-src/ovn-inside-k8s.png b/site-src/ovn-inside-k8s.png new file mode 100644 index 00000000000..ac7fad1845f Binary files /dev/null and b/site-src/ovn-inside-k8s.png differ