Skip to content

Commit

Permalink
start netlify experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
tssurya committed Mar 11, 2024
1 parent 19520c5 commit b56196e
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 0 deletions.
24 changes: 24 additions & 0 deletions hack/mkdocs-copy-docs.py
Original file line number Diff line number Diff line change
@@ -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)
86 changes: 86 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build]
publish = "site"
environment = { PYTHON_VERSION = "3.8" }
command = """
pip3 install -r requirements.txt &&
mkdocs build -d site
"""
19 changes: 19 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions site-src/index.md
Original file line number Diff line number Diff line change
@@ -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.
Binary file added site-src/ovn-inside-k8s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b56196e

Please sign in to comment.