Skip to content

Commit

Permalink
+blog examples
Browse files Browse the repository at this point in the history
added examples for the use of the blog plugin, on its own and with the mkdocs-rss-plugin.
---------
Co-authored-by: Martin Donath <[email protected]>
  • Loading branch information
alexvoss authored Oct 11, 2023
2 parents 0c3f04b + 8d9be97 commit 613e76b
Show file tree
Hide file tree
Showing 17 changed files with 330 additions and 6 deletions.
10 changes: 10 additions & 0 deletions examples/blog-basic/.example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
example:
tags:
- public # works without Insiders
- blog # functionality demonstrated
- simple # requires no extra plugins or other magic
authors:
alexvoss:
name: Alex Voss
description: Collaborator
avatar: https://github.com/alexvoss.png
18 changes: 18 additions & 0 deletions examples/blog-basic/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Adding a blog to your site

This example shows how to add a [blog] to your site.

It shows how to:

- configure the `mkdocs.yml` to activate and configure the plugin
- set up a directory structure in your `docs/` folder
- add an `.authors.yml` file with author information

The naming of the files containing the blog posts is just a
suggestion, you can name them any way you like. What matters is the
meta data at in the header.

[blog]: https://squidfunk.github.io/mkdocs-material/plugins/blog/



9 changes: 9 additions & 0 deletions examples/blog-basic/docs/blog/.authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
authors:
squidfunk:
name: Martin Donath
description: Creator
avatar: https://github.com/squidfunk.png
alexvoss:
name: Alex Voss
description: Weltenwanderer
avatar: https://github.com/alexvoss.png
2 changes: 2 additions & 0 deletions examples/blog-basic/docs/blog/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Blog

32 changes: 32 additions & 0 deletions examples/blog-basic/docs/blog/posts/firstpost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
authors:
- alexvoss
date: 2023-10-11
categories:
- meta
---

# My first blog post

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec
maximus ex. Sed consequat, nulla quis malesuada dapibus, elit metus vehicula
erat, ut egestas tellus eros at risus. In hac habitasse platea dictumst.
Phasellus id lacus pulvinar erat consequat pretium. Morbi malesuada arcu mauris
Nam vel justo sem. Nam placerat purus non varius luctus. Integer pretium leo in
sem rhoncus, quis gravida orci mollis. Proin id aliquam est. Vivamus in nunc ac
metus tristique pellentesque. Suspendisse viverra urna in accumsan aliquet.

<!-- more -->

Donec volutpat, elit ac volutpat laoreet, turpis dolor semper nibh, et dictum
massa ex pulvinar elit. Curabitur commodo sit amet dolor sed mattis. Etiam
tempor odio eu nisi gravida cursus. Maecenas ante enim, fermentum sit amet
molestie nec, mollis ac libero. Vivamus sagittis suscipit eros ut luctus.

Nunc vehicula sagittis condimentum. Cras facilisis bibendum lorem et feugiat.
In auctor accumsan ligula, at consectetur erat commodo quis. Morbi ac nunc
pharetra, pellentesque risus in, consectetur urna. Nulla id enim facilisis
arcu tincidunt pulvinar. Vestibulum laoreet risus scelerisque porta congue.
In velit purus, dictum quis neque nec, molestie viverra risus. Nam pellentesque
tellus id elit ultricies, vel finibus erat cursus.

32 changes: 32 additions & 0 deletions examples/blog-basic/docs/blog/posts/secondpost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
authors:
- squidfunk
date: 2023-10-12
categories:
- hello
---

# A second post

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec
maximus ex. Sed consequat, nulla quis malesuada dapibus, elit metus vehicula
erat, ut egestas tellus eros at risus. In hac habitasse platea dictumst.
Phasellus id lacus pulvinar erat consequat pretium. Morbi malesuada arcu mauris
Nam vel justo sem. Nam placerat purus non varius luctus. Integer pretium leo in
sem rhoncus, quis gravida orci mollis. Proin id aliquam est. Vivamus in nunc ac
metus tristique pellentesque. Suspendisse viverra urna in accumsan aliquet.

<!-- more -->

Donec volutpat, elit ac volutpat laoreet, turpis dolor semper nibh, et dictum
massa ex pulvinar elit. Curabitur commodo sit amet dolor sed mattis. Etiam
tempor odio eu nisi gravida cursus. Maecenas ante enim, fermentum sit amet
molestie nec, mollis ac libero. Vivamus sagittis suscipit eros ut luctus.

Nunc vehicula sagittis condimentum. Cras facilisis bibendum lorem et feugiat.
In auctor accumsan ligula, at consectetur erat commodo quis. Morbi ac nunc
pharetra, pellentesque risus in, consectetur urna. Nulla id enim facilisis
arcu tincidunt pulvinar. Vestibulum laoreet risus scelerisque porta congue.
In velit purus, dictum quis neque nec, molestie viverra risus. Nam pellentesque
tellus id elit ultricies, vel finibus erat cursus.

36 changes: 36 additions & 0 deletions examples/blog-basic/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2016-2023 Martin Donath <[email protected]>
# Alex Voss <[email protected]>

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

# -----------------------------------------------------------------------------
# Recommended: set up configuration validation, see https://t.ly/xpZXU
# -----------------------------------------------------------------------------

# Project information
site_name: Basic blog setup example

# Theme
theme:
name: material

# Plugins
plugins:
- search
- blog
21 changes: 21 additions & 0 deletions examples/blog-basic/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2016-2023 Martin Donath <[email protected]>

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

mkdocs-material
10 changes: 10 additions & 0 deletions examples/blog-rss/.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
example:
tags:
- public # works without Insiders
- blog # functionality demonstrated
- integration # demonstrates integration, use of other plugins
authors:
alexvoss:
name: Alex Voss
description: Collaborator
avatar: https://github.com/alexvoss.png
8 changes: 8 additions & 0 deletions examples/blog-rss/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Adding an RSS feed to a blog

This example shows how to [add an RSS feed to a blog]. You should be
able to point any RSS reader at the site and it will pick up the RSS
feed from a declaration in the HTML header.

[add an RSS feed to a blog]: https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/?h=#rss

9 changes: 9 additions & 0 deletions examples/blog-rss/docs/blog/.authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
authors:
squidfunk:
name: Martin Donath
description: Creator
avatar: https://github.com/squidfunk.png
alexvoss:
name: Alex Voss
description: Weltenwanderer
avatar: https://github.com/alexvoss.png
4 changes: 4 additions & 0 deletions examples/blog-rss/docs/blog/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Blog


[Subscribe to this feed](http://localhost:8000/feed_rss_created.xml)
32 changes: 32 additions & 0 deletions examples/blog-rss/docs/blog/posts/firstpost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
authors:
- alexvoss
date: 2023-10-11
categories:
- meta
---

# My first blog post

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec
maximus ex. Sed consequat, nulla quis malesuada dapibus, elit metus vehicula
erat, ut egestas tellus eros at risus. In hac habitasse platea dictumst.
Phasellus id lacus pulvinar erat consequat pretium. Morbi malesuada arcu mauris
Nam vel justo sem. Nam placerat purus non varius luctus. Integer pretium leo in
sem rhoncus, quis gravida orci mollis. Proin id aliquam est. Vivamus in nunc ac
metus tristique pellentesque. Suspendisse viverra urna in accumsan aliquet.

<!-- more -->

Donec volutpat, elit ac volutpat laoreet, turpis dolor semper nibh, et dictum
massa ex pulvinar elit. Curabitur commodo sit amet dolor sed mattis. Etiam
tempor odio eu nisi gravida cursus. Maecenas ante enim, fermentum sit amet
molestie nec, mollis ac libero. Vivamus sagittis suscipit eros ut luctus.

Nunc vehicula sagittis condimentum. Cras facilisis bibendum lorem et feugiat.
In auctor accumsan ligula, at consectetur erat commodo quis. Morbi ac nunc
pharetra, pellentesque risus in, consectetur urna. Nulla id enim facilisis
arcu tincidunt pulvinar. Vestibulum laoreet risus scelerisque porta congue.
In velit purus, dictum quis neque nec, molestie viverra risus. Nam pellentesque
tellus id elit ultricies, vel finibus erat cursus.

32 changes: 32 additions & 0 deletions examples/blog-rss/docs/blog/posts/secondpost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
authors:
- squidfunk
date: 2023-10-12
categories:
- hello
---

# A second post

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec
maximus ex. Sed consequat, nulla quis malesuada dapibus, elit metus vehicula
erat, ut egestas tellus eros at risus. In hac habitasse platea dictumst.
Phasellus id lacus pulvinar erat consequat pretium. Morbi malesuada arcu mauris
Nam vel justo sem. Nam placerat purus non varius luctus. Integer pretium leo in
sem rhoncus, quis gravida orci mollis. Proin id aliquam est. Vivamus in nunc ac
metus tristique pellentesque. Suspendisse viverra urna in accumsan aliquet.

<!-- more -->

Donec volutpat, elit ac volutpat laoreet, turpis dolor semper nibh, et dictum
massa ex pulvinar elit. Curabitur commodo sit amet dolor sed mattis. Etiam
tempor odio eu nisi gravida cursus. Maecenas ante enim, fermentum sit amet
molestie nec, mollis ac libero. Vivamus sagittis suscipit eros ut luctus.

Nunc vehicula sagittis condimentum. Cras facilisis bibendum lorem et feugiat.
In auctor accumsan ligula, at consectetur erat commodo quis. Morbi ac nunc
pharetra, pellentesque risus in, consectetur urna. Nulla id enim facilisis
arcu tincidunt pulvinar. Vestibulum laoreet risus scelerisque porta congue.
In velit purus, dictum quis neque nec, molestie viverra risus. Nam pellentesque
tellus id elit ultricies, vel finibus erat cursus.

48 changes: 48 additions & 0 deletions examples/blog-rss/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2016-2023 Martin Donath <[email protected]>
# Alex Voss <[email protected]>

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

# -----------------------------------------------------------------------------
# Recommended: set up configuration validation, see https://t.ly/xpZXU
# -----------------------------------------------------------------------------

# Project information
site_name: Blog with RSS example # required by RSS plugin
site_description: one of many fine examples # required by RSS plugin
site_url: http://localhost:8080 # required by RSS plugin

# Theme
theme:
name: material

# Plugins
plugins:
- search
- blog # https://squidfunk.github.io/mkdocs-material/plugins/blog/
- rss: # https://pypi.org/project/mkdocs-rss-plugin/
match_path: blog/posts/.*
date_from_meta:
as_creation: date
as_update: false
date_format: "%Y-%m-%d" # specify if the RSS plugin does
# not understand the format you use
categories:
- categories
- tags
23 changes: 23 additions & 0 deletions examples/blog-rss/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2016-2023 Martin Donath <[email protected]>
# Alex Voss <[email protected]>

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

mkdocs-material
mkdocs-rss-plugin
10 changes: 4 additions & 6 deletions examples/page-status/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* Copyright (c) 2016-2023 the authors:
* Copyright (c) 2016-2023 Martin Donath <[email protected]>
* Alex Voss <[email protected]>
*
* Martin Donath <[email protected]>
* Alex Voss <[email protected]>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
Expand Down

0 comments on commit 613e76b

Please sign in to comment.