Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add docs tools #18

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
website/site/404.html
website/site/index.html
website/site/sitemap.xml
website/site/sitemap.xml.gz
website/site/assets/images/favicon.png
website/site/assets/javascripts/bundle.c8d2eff1.min.js
website/site/assets/javascripts/bundle.c8d2eff1.min.js.map
website/site/assets/javascripts/lunr/tinyseg.js
website/site/assets/javascripts/lunr/wordcut.js
website/site/assets/javascripts/lunr/min/lunr.ar.min.js
website/site/assets/javascripts/lunr/min/lunr.da.min.js
website/site/assets/javascripts/lunr/min/lunr.de.min.js
website/site/assets/javascripts/lunr/min/lunr.du.min.js
website/site/assets/javascripts/lunr/min/lunr.el.min.js
website/site/assets/javascripts/lunr/min/lunr.es.min.js
website/site/assets/javascripts/lunr/min/lunr.fi.min.js
website/site/assets/javascripts/lunr/min/lunr.fr.min.js
website/site/assets/javascripts/lunr/min/lunr.he.min.js
website/site/assets/javascripts/lunr/min/lunr.hi.min.js
website/site/assets/javascripts/lunr/min/lunr.hu.min.js
website/site/assets/javascripts/lunr/min/lunr.hy.min.js
website/site/assets/javascripts/lunr/min/lunr.it.min.js
website/site/assets/javascripts/lunr/min/lunr.ja.min.js
website/site/assets/javascripts/lunr/min/lunr.jp.min.js
website/site/assets/javascripts/lunr/min/lunr.kn.min.js
website/site/assets/javascripts/lunr/min/lunr.ko.min.js
website/site/assets/javascripts/lunr/min/lunr.multi.min.js
website/site/assets/javascripts/lunr/min/lunr.nl.min.js
website/site/assets/javascripts/lunr/min/lunr.no.min.js
website/site/assets/javascripts/lunr/min/lunr.pt.min.js
website/site/assets/javascripts/lunr/min/lunr.ro.min.js
website/site/assets/javascripts/lunr/min/lunr.ru.min.js
website/site/assets/javascripts/lunr/min/lunr.sa.min.js
website/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js
website/site/assets/javascripts/lunr/min/lunr.sv.min.js
website/site/assets/javascripts/lunr/min/lunr.ta.min.js
website/site/assets/javascripts/lunr/min/lunr.te.min.js
website/site/assets/javascripts/lunr/min/lunr.th.min.js
website/site/assets/javascripts/lunr/min/lunr.tr.min.js
website/site/assets/javascripts/lunr/min/lunr.vi.min.js
website/site/assets/javascripts/lunr/min/lunr.zh.min.js
website/site/assets/javascripts/workers/search.b8dbb3d2.min.js
website/site/assets/javascripts/workers/search.b8dbb3d2.min.js.map
website/site/assets/stylesheets/main.7e359304.min.css
website/site/assets/stylesheets/main.7e359304.min.css.map
website/site/assets/stylesheets/palette.06af60db.min.css
website/site/assets/stylesheets/palette.06af60db.min.css.map
website/site/blog/index.html
website/site/overrides/home.html
website/site/overrides/main.html
website/site/search/search_index.json
website/site/static/extra.css
website/site/static/favicon.ico
website/site/static/kyverno-chainsaw-horizontal.png
website/site/static/kyverno-chainsaw-logo.png
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ COMMA := ,
$(KIND):
@echo Install kind... >&2
@GOBIN=$(TOOLS_DIR) go install sigs.k8s.io/kind@$(KIND_VERSION)
@

.PHONY: install-tools
install-tools: ## Install tools
install-tools: $(TOOLS)
Expand All @@ -61,9 +61,6 @@ $(PACKAGE_SHIM): $(GOPATH_SHIM)

.PHONY: codegen-mkdocs
codegen-mkdocs: ## Generate mkdocs website
codegen-mkdocs: codegen-cli-docs
codegen-mkdocs: codegen-api-docs
codegen-mkdocs: codegen-jp-docs
@echo Generate mkdocs website... >&2
@$(PIP) install mkdocs
@$(PIP) install --upgrade pip
Expand All @@ -72,14 +69,7 @@ codegen-mkdocs: codegen-jp-docs

.PHONY: codegen
codegen: ## Rebuild all generated code and docs
codegen: codegen-api-docs
codegen: codegen-cli-docs
codegen: codegen-crds
codegen: codegen-deepcopy
codegen: codegen-mkdocs
codegen: codegen-register
codegen: codegen-schemas-json
codegen: codegen-tests-catalog

.PHONY: verify-codegen
verify-codegen: ## Verify all generated code and docs are up to date
Expand Down
2 changes: 2 additions & 0 deletions website/docs/blog/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Blog

4 changes: 4 additions & 0 deletions website/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
template: home.html
title: chainsaw
---
124 changes: 124 additions & 0 deletions website/docs/overrides/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{% extends "main.html" %}
{% block tabs %}
{{ super() }}
<style>
:root {
--kyverno-primary-color: #72533b;
}
.md-header {
position: initial
}
.md-main .md-main__inner {
display: none
}
.md-content {
display: none
}
[data-md-color-scheme=slate] .tx-container {
padding-top: 1rem;
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1123 258'><path d='M1124,2c0,0 0,256 0,256l-1125,0l0,-48c0,0 16,5 55,5c116,0 197,-92 325,-92c121,0 114,46 254,46c140,0 214,-167 572,-166Z' style='fill: hsla(232, 15%, 21%, 1)'/></svg>") no-repeat bottom, linear-gradient(to bottom, var(--md-primary-fg-color), var(--kyverno-primary-color) 99%, #fff 99%);
}
.tx-container {
padding-top: 1rem;
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1123 258'><path d='M1124,2c0,0 0,256 0,256l-1125,0l0,-48c0,0 16,5 55,5c116,0 197,-92 325,-92c121,0 114,46 254,46c140,0 214,-167 572,-166Z' style='fill: white' /></svg>") no-repeat bottom, linear-gradient(to bottom, var(--md-primary-fg-color), var(--kyverno-primary-color) 99%, #fff 99%);
height: calc(100vh - 4.8rem);
}
.tx-hero {
margin: 0 .8rem;
color: var(--md-primary-bg-color)
}
.tx-hero h1 {
margin-bottom: 1rem;
color: currentColor;
font-weight: 700
}
.tx-hero a {
color: currentColor;
}
.tx-hero__content {
padding-bottom: 6rem
}
.tx-hero .md-button {
margin-top: .5rem;
margin-right: .5rem;
color: var(--md-primary-bg-color)
}
.tx-hero .md-button--primary {
background-color: var(--md-primary-bg-color);
color: var(--kyverno-primary-color);
border-color: var(--md-primary-bg-color)
}
.tx-hero .md-button:focus,
.tx-hero .md-button:hover {
background-color: var(--md-accent-fg-color);
color: var(--md-default-bg-color);
border-color: var(--md-accent-fg-color)
}
@media screen and (max-width:70em) {
.tx-hero h1 {
font-size: 1.4rem
}
.tx-hero__image {
text-align: center;
}
.tx-hero__image img {
max-width: 10rem;
}
}
@media screen and (min-width:70em) {
.md-sidebar--secondary {
display: none
}
.tx-hero {
display: flex;
align-items: stretch
}
.tx-hero__content {
max-width: 30rem;
margin-top: 3.5rem;
padding-bottom: 14vw
}
.tx-hero__image {
order: 1;
margin-left: auto;
margin-top: 3.5rem;
}
.tx-hero__image img {
max-width: 15rem;
}
}
@media screen and (min-width:76.25em) {
.md-sidebar--primary {
display: none
}
.tx-hero__image {
margin-left: auto;
}
.tx-hero__image img {
max-width: 20rem;
}
}
</style>
<section class="tx-container">
<div class="md-grid md-typeset">
<div class="tx-hero">
<div class="tx-hero__image">
<img src="static/kyverno-chainsaw-logo.png" alt="" draggable="false" style="border-radius: 10%; border: 5px solid #555;">
</div>
<div class="tx-hero__content">
<h1>Kyverno Envoy plugin</h1>
<h2><a href="https://kyverno.io">Kyverno</a> based authz in a mesh !</h2>
<a href="{{ page.next_page.url | url }}" title="{{ page.next_page.title | striptags }}" class="md-button md-button--primary">
Get started
</a>
<!-- <a href="./community" class="md-button md-button--secondary">
Join the community
</a> -->
</div>
</div>
</div>
</section>
{% endblock %}
{% block main %}{% endblock %}
{% block content %}{% endblock %}
{% block footer %}{% endblock %}
30 changes: 30 additions & 0 deletions website/docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends "base.html" %}

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}

{% block extrahead %}
{% set title = config.site_name %}
{% if page and page.title and not page.is_homepage %}
{% set title = config.site_name ~ " - " ~ page.title | striptags %}
{% endif %}
{% set image = config.site_url ~ '/static/card.png' %}
<meta property="og:type" content="website">
<meta property="og:title" content="{{ title }}">
<meta property="og:description" content="{{ config.site_description }}">
<meta property="og:url" content="{{ page.canonical_url }}">
<meta property="og:image" content="{{ image }}">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@goreleaser">
<meta name="twitter:creator" content="@goreleaser">
<meta name="twitter:title" content="{{ title }}">
<meta name="twitter:description" content="{{ config.site_description }}">
<meta name="twitter:image" content="{{ image }}">
{% endblock %}
4 changes: 4 additions & 0 deletions website/docs/static/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body > header > nav > a > img {
border-radius: 10%;
border: 1px solid #555;
}
Binary file added website/docs/static/favicon.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/docs/static/kyverno-chainsaw-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions website/mkdocs.base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# site
site_name: Kyverno Envoy plugin
site_url: https://github.io/kyverno/kyverno-envoy-plugin/
site_description: Kyverno based authz in a mesh

# repo
repo_name: kyverno/kyverno-envoy-plugin
repo_url: https://github.com/kyverno/kyverno-envoy-plugin

# edit
edit_uri: edit/main/website/docs/

# copyright
copyright: Made with ❤️ by Kyverno contributors.

# strictness
strict: true

# style
extra_css:
- static/extra.css

# version
extra:
version:
provider: mike

theme:
name: material
custom_dir: docs/overrides
language: en
logo: static/kyverno-chainsaw-logo.png
favicon: static/favicon.ico
include_search_page: false
search_index_only: true
features:
- announce.dismiss
- search.suggest
- search.highlight
- search.share
- content.code.copy
- content.action.edit
- navigation.footer
- navigation.instant
- navigation.tracking
- navigation.tabs
palette:
- media: "(prefers-color-scheme: light)" # Light mode
scheme: default
toggle:
icon: material/lightbulb-outline
name: Switch to light mode
- media: "(prefers-color-scheme: dark)" # Dark mode
scheme: slate
primary: light blue
accent: indigo
toggle:
icon: material/lightbulb
name: Switch to dark mode

plugins:
- search
# - redirects:
# redirect_maps:
# discord.md: https://discord.gg/RGEBtg8vQ6
# github.md: https://github.com/goreleaser
# linkedin.md: https://www.linkedin.com/company/goreleaser/
# mastodon.md: https://fosstodon.org/@goreleaser
# twitter.md: https://twitter.com/goreleaser
# d.md: https://discord.gg/RGEBtg8vQ6
# g.md: https://github.com/goreleaser
# l.md: https://www.linkedin.com/company/goreleaser/
# m.md: https://fosstodon.org/@goreleaser
# t.md: https://twitter.com/goreleaser
# "customization/build.md": customization/builds.md
- minify:
minify_html: true
- include-markdown
- tags
- blog:
post_url_format: "{slug}"

markdown_extensions:
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- admonition
- codehilite
- meta
- toc:
permalink: true
- pymdownx.tabbed:
alternate_style: true
- pymdownx.superfences
- pymdownx.tasklist:
custom_checkbox: true
- footnotes
4 changes: 4 additions & 0 deletions website/mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INHERIT: ./mkdocs.base.yaml

nav:
- Home: index.md