From 93a375b48277a7f84e375b09707c4d3cc2b351ea Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 13 Feb 2024 23:16:21 +0000 Subject: [PATCH] Use mkdocs-mateiral --- .github/workflows/ci.yml | 34 +++- .gitignore | 187 ++++++++++++++++-- config.yml | 9 - docs/README.md | 1 + docs/colophon.md | 0 .../notes}/database/long-running-queries.md | 2 +- .../notes}/database/redis-monitor.md | 0 .../notes}/database/running-queries.md | 0 .../notes}/database/truncate-database.md | 0 {content => docs/notes}/example-note.md | 2 +- .../notes}/github-force-detect-language.md | 0 .../infrastructure/assume-role-credentials.md | 0 .../infrastructure/cross-account-transfer.md | 0 {content => docs/notes}/mitm-port-forward.md | 0 {content => docs/notes}/rebase-onto.md | 0 .../notes}/shell/ffmpeg-downmixing-audio.md | 0 .../notes}/shell/ffmpeg-remove-stream.md | 0 {content => docs/notes}/shell/rename-cli.md | 0 .../notes}/shell/stop-saving-history.md | 0 docs/tags.md | 1 + go.mod | 5 - go.sum | 2 - justfile | 9 - mkdocs.yml | 80 ++++++++ requirements.txt | 6 + 25 files changed, 288 insertions(+), 50 deletions(-) delete mode 100644 config.yml create mode 100644 docs/README.md create mode 100644 docs/colophon.md rename {content => docs/notes}/database/long-running-queries.md (93%) rename {content => docs/notes}/database/redis-monitor.md (100%) rename {content => docs/notes}/database/running-queries.md (100%) rename {content => docs/notes}/database/truncate-database.md (100%) rename {content => docs/notes}/example-note.md (95%) rename {content => docs/notes}/github-force-detect-language.md (100%) rename {content => docs/notes}/infrastructure/assume-role-credentials.md (100%) rename {content => docs/notes}/infrastructure/cross-account-transfer.md (100%) rename {content => docs/notes}/mitm-port-forward.md (100%) rename {content => docs/notes}/rebase-onto.md (100%) rename {content => docs/notes}/shell/ffmpeg-downmixing-audio.md (100%) rename {content => docs/notes}/shell/ffmpeg-remove-stream.md (100%) rename {content => docs/notes}/shell/rename-cli.md (100%) rename {content => docs/notes}/shell/stop-saving-history.md (100%) create mode 100644 docs/tags.md delete mode 100644 go.mod delete mode 100644 go.sum delete mode 100644 justfile create mode 100644 mkdocs.yml create mode 100644 requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78012ab..75388fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,13 @@ name: CI -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + + # Allow running manually + workflow_dispatch: permissions: contents: read @@ -11,23 +18,36 @@ concurrency: group: "pages" cancel-in-progress: true +defaults: + run: + shell: bash + jobs: build: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v3 - - name: Run Hugo - uses: crazy-max/ghaction-hugo@v2 + - name: Set up Python + uses: actions/setup-python@v4 with: - version: latest - extended: true - args: --minify --verbose + python-version: '3.11' + cache: 'pip' + + - run: pip install -r requirements.txt + + - name: Setup Pages + uses: actions/configure-pages@v1 + + - name: Build + run: | + mkdocs build -v - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: ./public + path: ./site deploy: environment: diff --git a/.gitignore b/.gitignore index eaadabb..ad4a1f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,176 @@ -# Created by https://www.toptal.com/developers/gitignore/api/hugo -# Edit at https://www.toptal.com/developers/gitignore?templates=hugo +# Created by https://www.toptal.com/developers/gitignore/api/python +# Edit at https://www.toptal.com/developers/gitignore?templates=python -### Hugo ### -# Generated files by hugo -/public/ -/resources/_gen/ -/assets/jsconfig.json -hugo_stats.json +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class -# Executable may be added to repository -hugo.exe -hugo.darwin -hugo.linux +# C extensions +*.so -# Temporary lock file while building -/.hugo_build.lock +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST -# End of https://www.toptal.com/developers/gitignore/api/hugo +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec -/resources +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +# End of https://www.toptal.com/developers/gitignore/api/python diff --git a/config.yml b/config.yml deleted file mode 100644 index f612784..0000000 --- a/config.yml +++ /dev/null @@ -1,9 +0,0 @@ -baseURL: https://notes.theorangeone.net -title: Notes -enableGitInfo: true - -cleanDestinationDir: true - -module: - imports: - - path: github.com/RealOrangeOne/hugo-theme-notes diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..17e0f0d --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +# Notes diff --git a/docs/colophon.md b/docs/colophon.md new file mode 100644 index 0000000..e69de29 diff --git a/content/database/long-running-queries.md b/docs/notes/database/long-running-queries.md similarity index 93% rename from content/database/long-running-queries.md rename to docs/notes/database/long-running-queries.md index 20c3085..182790e 100644 --- a/content/database/long-running-queries.md +++ b/docs/notes/database/long-running-queries.md @@ -19,7 +19,7 @@ FROM pg_stat_activity WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes'; ``` -Also see [running queries](../running-queries). +Also see [running queries](./running-queries.md). # Stopping a given connection diff --git a/content/database/redis-monitor.md b/docs/notes/database/redis-monitor.md similarity index 100% rename from content/database/redis-monitor.md rename to docs/notes/database/redis-monitor.md diff --git a/content/database/running-queries.md b/docs/notes/database/running-queries.md similarity index 100% rename from content/database/running-queries.md rename to docs/notes/database/running-queries.md diff --git a/content/database/truncate-database.md b/docs/notes/database/truncate-database.md similarity index 100% rename from content/database/truncate-database.md rename to docs/notes/database/truncate-database.md diff --git a/content/example-note.md b/docs/notes/example-note.md similarity index 95% rename from content/example-note.md rename to docs/notes/example-note.md index 58777e4..205d9a2 100644 --- a/content/example-note.md +++ b/docs/notes/example-note.md @@ -6,7 +6,7 @@ modified: 2022-09-09 This is an example note, see below for some code. -```js +```javascript { resolve: 'gatsby-theme-code-notes', options: { diff --git a/content/github-force-detect-language.md b/docs/notes/github-force-detect-language.md similarity index 100% rename from content/github-force-detect-language.md rename to docs/notes/github-force-detect-language.md diff --git a/content/infrastructure/assume-role-credentials.md b/docs/notes/infrastructure/assume-role-credentials.md similarity index 100% rename from content/infrastructure/assume-role-credentials.md rename to docs/notes/infrastructure/assume-role-credentials.md diff --git a/content/infrastructure/cross-account-transfer.md b/docs/notes/infrastructure/cross-account-transfer.md similarity index 100% rename from content/infrastructure/cross-account-transfer.md rename to docs/notes/infrastructure/cross-account-transfer.md diff --git a/content/mitm-port-forward.md b/docs/notes/mitm-port-forward.md similarity index 100% rename from content/mitm-port-forward.md rename to docs/notes/mitm-port-forward.md diff --git a/content/rebase-onto.md b/docs/notes/rebase-onto.md similarity index 100% rename from content/rebase-onto.md rename to docs/notes/rebase-onto.md diff --git a/content/shell/ffmpeg-downmixing-audio.md b/docs/notes/shell/ffmpeg-downmixing-audio.md similarity index 100% rename from content/shell/ffmpeg-downmixing-audio.md rename to docs/notes/shell/ffmpeg-downmixing-audio.md diff --git a/content/shell/ffmpeg-remove-stream.md b/docs/notes/shell/ffmpeg-remove-stream.md similarity index 100% rename from content/shell/ffmpeg-remove-stream.md rename to docs/notes/shell/ffmpeg-remove-stream.md diff --git a/content/shell/rename-cli.md b/docs/notes/shell/rename-cli.md similarity index 100% rename from content/shell/rename-cli.md rename to docs/notes/shell/rename-cli.md diff --git a/content/shell/stop-saving-history.md b/docs/notes/shell/stop-saving-history.md similarity index 100% rename from content/shell/stop-saving-history.md rename to docs/notes/shell/stop-saving-history.md diff --git a/docs/tags.md b/docs/tags.md new file mode 100644 index 0000000..b2b5551 --- /dev/null +++ b/docs/tags.md @@ -0,0 +1 @@ +# Tags diff --git a/go.mod b/go.mod deleted file mode 100644 index 6b5b132..0000000 --- a/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module git.theorangeone.net/jake/notes - -go 1.20 - -require github.com/RealOrangeOne/hugo-theme-notes v0.0.0-20230724125946-aaef005ab72e // indirect diff --git a/go.sum b/go.sum deleted file mode 100644 index ec8d9db..0000000 --- a/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/RealOrangeOne/hugo-theme-notes v0.0.0-20230724125946-aaef005ab72e h1:Bl4Ff7S7pPFkdX0pLA7YAbXDR1wqQVq7YxVA3PLIfws= -github.com/RealOrangeOne/hugo-theme-notes v0.0.0-20230724125946-aaef005ab72e/go.mod h1:ZMXpRbmG28r6mLfK/Nm93LgqjXCgUv+4ySLF3rkjSTo= diff --git a/justfile b/justfile deleted file mode 100644 index a64ba47..0000000 --- a/justfile +++ /dev/null @@ -1,9 +0,0 @@ -# Recipes -@default: - just --list - -start: - hugo server - -build: - hugo diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..15aa607 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,80 @@ +site_name: Notes +repo_url: https://github.com/RealOrangeOne/notes +repo_name: RealOrangeOne/notes + +extra: + social: + - icon: fontawesome/solid/globe + link: https://theorangeone.net + +theme: + name: material + features: + - navigation.top + - navigation.sections + - navigation.index + icon: + logo: fontawesome/regular/note-sticky + favicon: https://theorangeone.net/favicon.ico + palette: + # Palette toggle for light mode + - scheme: default + primary: deep orange + accent: orange + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - scheme: slate + primary: deep orange + accent: orange + toggle: + icon: material/brightness-4 + name: Switch to light mode + + +# Extensions +markdown_extensions: + - attr_list + - abbr + - pymdownx.highlight + - pymdownx.superfences + - footnotes + - markdown.extensions.admonition + - markdown.extensions.def_list + - markdown.extensions.toc: + permalink: true + - pymdownx.betterem: + smart_enable: all + - pymdownx.caret + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.inlinehilite + - pymdownx.keys + - pymdownx.magiclink + - pymdownx.mark + - pymdownx.progressbar + - pymdownx.smartsymbols + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + - mdx_include: + base_path: docs + + +plugins: + - search + - awesome-pages + - glightbox + - tags: + enabled: true + tags_file: tags.md + - git-revision-date-localized: + enable_creation_date: true + fallback_to_build_date: true + exclude: + - tags.md + - README.md diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..243558d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +mkdocs +mkdocs-material +mdx-include +mkdocs-awesome-pages-plugin +mkdocs-glightbox +mkdocs-git-revision-date-localized-plugin