Skip to content

Commit

Permalink
feat: migrate to mkdocs + material (#19)
Browse files Browse the repository at this point in the history
* init mkdocs

* wip

* add images

* update publish workflow

* almost mvp

* mvp migrate to mkdocs

---------

Co-authored-by: Ken Payne <[email protected]>
  • Loading branch information
kgpayne and Ken Payne authored Feb 26, 2024
1 parent d6339dd commit 716ac13
Show file tree
Hide file tree
Showing 28 changed files with 380 additions and 711 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
- name: Copy to S3
run: |
s3cmd rm --recursive --force s3://blog.kenpayne.co.uk/
s3cmd put --recursive _build/html/ s3://blog.kenpayne.co.uk/ --acl-public --guess-mime-type --no-mime-magic --add-header='Cache-Control:max-age=0'
s3cmd put --recursive site/ s3://blog.kenpayne.co.uk/ --acl-public --guess-mime-type --no-mime-magic --add-header='Cache-Control:max-age=0'
s3cmd sync s3://static.kenpayne.co.uk/ s3://blog.kenpayne.co.uk/_static/ --acl-public --guess-mime-type --no-mime-magic --add-header='Cache-Control:max-age=0'
- run: echo "Done 🚀"
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.vscode

# sphinx build folder
_build
# mkdocs build folder
site/

# Compiled source #
###################
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
serve:
poetry run mkdocs serve

html:
poetry run sphinx-build -b html . _build/html

serve:
python -m http.server --bind 127.0.0.1 8000 -d _build/html
poetry run mkdocs build
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
## Build

```bash
make html
make build
```

## Serve Locally

```bash
cd _build/
python -m http.server 8000
make serve
```

Checkout http://localhost:8000
Go to http://localhost:8000
Empty file removed _static/.gitkeep
Empty file.
66 changes: 0 additions & 66 deletions conf.py

This file was deleted.

2 changes: 2 additions & 0 deletions docs/blog/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Blog

10 changes: 9 additions & 1 deletion blog/2023-01-17.md → docs/blog/posts/2023-01-17.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# 2023-01-17 (Singerlake)
---
title: Singerlake (Part 1)
summary: Storing Singer messages in a structured way.
date: 2023-01-17
categories:
- technology
---

# Singerlake (Part 1)

> Edit: 2023-02-15
>
Expand Down
10 changes: 9 additions & 1 deletion blog/2023-02-15.md → docs/blog/posts/2023-02-15.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# 2023-02-15 (Singerlake Pt. 2)
---
title: Singerlake (Part 2)
summary: Storing Singer messages in a structured way.
date: 2023-02-15
categories:
- technology
---

# Singerlake (Part 2)

## Improving the Singerlake Spec

Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Life. Documented.

Welcome to _yet another personal blog_ 👋
File renamed without changes.
88 changes: 15 additions & 73 deletions stoves/optimus_111.md → docs/stoves/articles/optimus-111/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```yaml
date_aquired: 07/08/2022
date_manufactured: TBD
manufactured_by: Optimus, Sweden
manufactured_by: Optimus, Sweden
fuel_type: Paraffin (Kerosene) & Petrol (Gasoline)
```
Expand All @@ -23,82 +23,24 @@ All in all, I am very happy with how this stove has turned out and look forward
## Refurbished Condition
```{thumbnail} /_images/stoves/optimus_111/refurbished/optimus_2.jpeg
:group: refurbished
```
``````{dropdown} All Photos
`````{grid} 1 2 2 4
:gutter: 1

````{grid-item}

```{thumbnail} /_images/stoves/optimus_111/refurbished/optimus_1.jpeg
:group: refurbished
```
````

````{grid-item}
<div class="grid cards" markdown>
```{thumbnail} /_images/stoves/optimus_111/refurbished/optimus_3.jpeg
:group: refurbished
```
````

````{grid-item}

```{thumbnail} /_images/stoves/optimus_111/refurbished/optimus_4.jpeg
:group: refurbished
```
````

````{grid-item}

```{thumbnail} /_images/stoves/optimus_111/refurbished/optimus_5.jpeg
:group: refurbished
```
````
- ![](img/refurbished/optimus-1.jpeg)
- ![](img/refurbished/optimus-2.jpeg)
<!-- - ![](img/refurbished/optimus-3.jpeg) -->
- ![](img/refurbished/optimus-4.jpeg)
- ![](img/refurbished/optimus-5.jpeg)
``````
</div>
## Purchased Condition
```{thumbnail} /_images/stoves/optimus_111/purchased/optimus_1.jpeg
:group: purchased
```

``````{dropdown} All Photos

`````{grid} 1 2 2 4
:gutter: 1
````{grid-item}
```{thumbnail} /_images/stoves/optimus_111/purchased/optimus_3.jpeg
:group: purchased
```
````
````{grid-item}
<div class="grid cards" markdown>
```{thumbnail} /_images/stoves/optimus_111/purchased/optimus_4.jpeg
:group: purchased
```
````
````{grid-item}
```{thumbnail} /_images/stoves/optimus_111/purchased/optimus_5.jpeg
:group: purchased
```
````
````{grid-item}
```{thumbnail} /_images/stoves/optimus_111/purchased/optimus_2.jpeg
:group: purchased
```
````
- ![](img/purchased/optimus-1.jpeg)
- ![](img/purchased/optimus-2.jpeg)
<!-- - ![](img/purchased/optimus-3.jpeg) -->
- ![](img/purchased/optimus-4.jpeg)
- ![](img/purchased/optimus-5.jpeg)
``````
</div>
5 changes: 5 additions & 0 deletions docs/stoves/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Stoves

> "Everyone needs a hobby..."
>
> Me: "You mispelled obsession."
11 changes: 0 additions & 11 deletions index.md

This file was deleted.

57 changes: 57 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
site_name: Life. Documented.
repo_url: https://github.com/kgpayne/blog
theme:
name: material
features:
- navigation.indexes
- navigation.instant
- navigation.sections
- navigation.expand
- navigation.path
- navigation.tabs
- navigation.tabs.sticky
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: black
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: white
toggle:
icon: material/brightness-4
name: Switch to system preference
plugins:
- glightbox:
slide_effect: slide
width: 100%
height: auto
zoomable: true
draggable: true
touchNavigation: true
markdown_extensions:
- attr_list
- md_in_html

nav:
- Home: index.md
- Blog:
- blog/index.md
- 2023:
- blog/posts/2023-01-17.md
- blog/posts/2023-02-15.md
- Stoves:
- stoves/index.md
- stoves/articles/british-military-no-6/index.md
- stoves/articles/optimus-111/index.md
Loading

0 comments on commit 716ac13

Please sign in to comment.