From 7d5b4d93068f4d8c4afe2116a171433003a3085c Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Tue, 14 Jun 2022 10:08:22 +0200 Subject: [PATCH] Fixup styles --- doc/docs/index.md | 2 +- doc/docs/statics/addons.js | 30 +------------- doc/docs/statics/main.css | 22 ++++++++--- doc/mkdocs.yml | 17 ++++++++ doc/overrides/partials/footer.html | 63 ++++++++++++++++++++++++++++++ 5 files changed, 98 insertions(+), 36 deletions(-) create mode 100644 doc/overrides/partials/footer.html diff --git a/doc/docs/index.md b/doc/docs/index.md index 80bcb7f..d77acf5 100644 --- a/doc/docs/index.md +++ b/doc/docs/index.md @@ -20,7 +20,7 @@ You'll be able to deploy your project in [:material-kubernetes: Kubernetes](http It uses your current file and optionnaly labels to configure the result. -It's an opensource project, under MIT licence, partially developped at [Smile](https://smile.eu). The project source code is hosted on the [:fontawesome-brands-github: Katenary GitHub Repository](https://github.com/metal3d/katenary). +It's an opensource project, under MIT licence, partially developped at [Smile](https://www.smile.eu). The project source code is hosted on the [:fontawesome-brands-github: Katenary GitHub Repository](https://github.com/metal3d/katenary). ## Install Katenary diff --git a/doc/docs/statics/addons.js b/doc/docs/statics/addons.js index ba50f1d..a4e87bf 100644 --- a/doc/docs/statics/addons.js +++ b/doc/docs/statics/addons.js @@ -1,30 +1,3 @@ -function addSmileLogo() { - const logo = document.createElement("img"); - logo.src = "/statics/Logo_Smile.png"; - logo.classList.add("smile-logo"); - logo.alt = "Smile logo"; - - const link = document.createElement("a"); - link.href = "https://www.smile.eu"; - link.target = "_blank"; - link.title = "Smile website"; - link.classList.add("smile-logo"); - link.appendChild(logo); - - const text = document.createElement("p"); - text.innerHTML = "Sponsored by Smile"; - - const div = document.createElement("div"); - div.classList.add("smile-logo"); - div.appendChild(text); - div.appendChild(link); - - logo.addEventListener("load", () => { - let side = document.querySelector(".md-footer-meta__inner"); - side.appendChild(div); - }); -} - function hljsInstall() { const version = "11.5.1"; const theme = "github-dark"; @@ -36,13 +9,12 @@ function hljsInstall() { style.rel = "stylesheet"; style.href = `//cdnjs.cloudflare.com/ajax/libs/highlight.js/${version}/styles/${theme}.min.css`; document.head.appendChild(style); - hljs.initHighlightingOnLoad(); + hljs.highlightAll(); }; document.head.appendChild(script); } document.addEventListener("DOMContentLoaded", () => { - addSmileLogo(); hljsInstall(); }); diff --git a/doc/docs/statics/main.css b/doc/docs/statics/main.css index 0bc62b2..12a3d0b 100644 --- a/doc/docs/statics/main.css +++ b/doc/docs/statics/main.css @@ -1,17 +1,21 @@ :root { - --md-primary-fg-color: #333333; + --code-bg-color: var(--lt-color-gray-800); + --code-fg-color: var(--lt-color-gray-300); + --md-primary-fg-color: var(--lt-color-gray-900); } + +[data-md-color-scheme="default"] { + --md-primary-fg-color: var(--md-code-fg-color); +} + div.smile-logo { display: flex; font-size: 0.7rem; } -img.smile-logo { + +div.smile-logo img { width: 100px; } -pre code.hljs { - background-color: var(--md-primary-fg-color); - color: var(--md-primary-bg-color); -} button.md-clipboard::after { transition: all 0.5s ease; @@ -38,3 +42,9 @@ article a:visited { .go-logo { font-size: 4em; } + +/* HLJS */ +pre code.hljs { + background-color: var(--code-bg-color); + color: var(--code-fg-color); +} diff --git a/doc/mkdocs.yml b/doc/mkdocs.yml index 3354a42..3409b25 100644 --- a/doc/mkdocs.yml +++ b/doc/mkdocs.yml @@ -2,7 +2,18 @@ site_name: Katenary documentation docs_dir: ./docs theme: name: material + custom_dir: overrides logo: statics/logo.png + palette: + - scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to light mode + + - scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode markdown_extensions: - admonition - attr_list @@ -17,6 +28,12 @@ extra_css: - statics/main.css extra_javascript: - statics/addons.js +copyright: Copyright © 2021 - 2022 - Katenary authors +extra: + generator: false + social: + - icon: fontawesome/brands/github + link: https://github.com/metal3d/katenary nav: - "Home": index.md - usage.md diff --git a/doc/overrides/partials/footer.html b/doc/overrides/partials/footer.html new file mode 100644 index 0000000..3f4c3e7 --- /dev/null +++ b/doc/overrides/partials/footer.html @@ -0,0 +1,63 @@ +{#- This file was automatically generated - do not edit -#} +