Skip to content

Commit

Permalink
Mkdocs Upgrade (#243)
Browse files Browse the repository at this point in the history
* fix links

* actually fix #238

* Feature/mkdocs version bump (#240)

* fix links (#239)

Co-authored-by: hay-kot <[email protected]>

* fix #238

* bump mkdocs version

* light/dark toggle

* light/dark mode css

* API_DOCS defaults to True

* disable build on push for master

Co-authored-by: hay-kot <[email protected]>

Co-authored-by: hay-kot <[email protected]>
  • Loading branch information
hay-kot and hay-kot authored Apr 1, 2021
1 parent 114e878 commit b8cddfd
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 23 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/dockerbuild.prod.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Docker Build Production

on:
push:
branches:
- master
release:
types: [published]

jobs:
build:
Expand Down
16 changes: 11 additions & 5 deletions docs/docs/assets/stylesheets/custom.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
:root {
[data-md-color-scheme="mealie"] {
--md-primary-fg-color: #e58325;
--md-primary-fg-color--light: #e58325;
--md-primary-fg-color--dark: #e58325;
--md-accent-fg-color: #e58325;
--md-custom-h2-color: #333;
--md-accent-fg-color--light: #e58325;
--md-accent-fg-color--dark: #e58325;
--md-default-accent-bg-color: #f7fafc;
}

body {
background: var(--md-primary-bg-color);
[data-md-color-scheme="slate"] {
--md-primary-fg-color: #e58325;
--md-primary-fg-color--dark: #e58325;
--md-accent-fg-color: #e58325;
--md-accent-fg-color--dark: #e58325;
--md-custom-h2-color: rgb(167, 167, 167);
--md-default-bg-color: #1a1b1b;
--md-default-accent-bg-color: #1f1e1e;
}

/* frontpage elements */
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/overrides/api.html

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions docs/docs/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

.tx-container {
padding-top: .0rem;
background: var(--md-primary-bg-color)
}

.tx-hero {
Expand All @@ -27,7 +26,7 @@
.tx-hero h1 {
margin-bottom: 1rem;
font-family: "Roboto";
color: #30353a;
color: var(--md-custom-h2-color);
font-weight: 500
}

Expand Down Expand Up @@ -68,7 +67,7 @@
}

.feature-container {
background-color: #F7FAFC;
background-color: var(--md-default-accent-bg-color);
}

.top-hr {
Expand All @@ -85,7 +84,7 @@
}

.feature-item h2 {
color: #333;
color: var(--md-custom-h2-color);
font-weight: 300;
font-size: 25px;
white-space: nowrap;
Expand All @@ -102,7 +101,7 @@
line-height: 1.8em;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
color: #111;
color: var(--webkit-print-color-adjust);
margin: 0 0 10px;
display: block;
}
Expand Down Expand Up @@ -162,11 +161,6 @@
flex: 1;
min-width: 0;
}

/* .feature-item:hover {
background-color: #fea55247;
border-radius: 3px;
} */
}

.hr {
Expand Down
14 changes: 14 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
site_name: Mealie
demo_url: https://mealie-demo.hay-kot.dev/
theme:
palette:
# Light mode
- media: "(prefers-color-scheme: light)"
scheme: mealie
toggle:
icon: material/weather-night
name: Switch to dark mode
# Dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-sunny
name: Switch to light mode
custom_dir: docs/overrides
features:
- navigation.top
- navigation.instant
- navigation.expand
- navigation.sections
Expand Down
2 changes: 1 addition & 1 deletion mealie/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, app_dirs: AppDirectories) -> None:
self.PRODUCTION = bool(os.environ.get("ENV"))
self.IS_DEMO = os.getenv("DEMO", "False") == "True"
self.API_PORT = int(os.getenv("API_PORT", 9000))
self.API = os.getenv("API_DOCS", "False") == "True"
self.API = os.getenv("API_DOCS", "True") == "True"
self.DOCS_URL = "/docs" if self.API else None
self.REDOC_URL = "/redoc" if self.API else None
self.SECRET = determine_secrets(app_dirs.DATA_DIR, self.PRODUCTION)
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b8cddfd

Please sign in to comment.