-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added example for a stand-alone blog #14
Open
alexvoss
wants to merge
1
commit into
master
Choose a base branch
from
standaloneblog
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Creating a standalone blog | ||
|
||
Sometimes it is desirable to set up a website that has a blog as its central | ||
feature. Rather than being embedded into a wider website with its own complex | ||
structure, the blog structure organizes most of the content. | ||
|
||
This example shows how set up such a blog using the [blog plugin]. | ||
|
||
It shows how to: | ||
|
||
- configure the `mkdocs.yml` to activate and configure the plugin | ||
- set up navigation to prominently feature the blog structure | ||
- 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 plugin]: https://squidfunk.github.io/mkdocs-material/plugins/blog/ | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# About... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 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: Standalone blog example | ||
|
||
# Theme | ||
theme: | ||
name: material | ||
features: | ||
- navigation.tabs | ||
- navigation.indexes | ||
|
||
# Plugins | ||
plugins: | ||
- search | ||
- blog: | ||
blog_dir: demo | ||
|
||
nav: | ||
- Our Blog: | ||
- demo/index.md | ||
- About: | ||
- demo/about/index.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the blog contained in the
demo
directory? IMHO, by definition, a standalone blog lives at the root 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I was going to ask. The
demo/
directory is not my invention but something I copied from earlier examples. The way I made sense of it was that it putsREADME.md
in thedocs/
folder as the main page for the example, which may be doing things that have nothing to do with the example itself, such as showing bits of the code used. Am just realizing that I have not been consistent in this, either - should have asked about it earlier. Perhaps it made sense for some examples for some specific reason?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaaah you're absolutey right, forgot about that. Long time since I've created an example. The idea was that the README.md is the main entrypoint that gives the opportunity to explain the example, while the example itself is entirely contained in the demo section. However, I think for the standalone blog, this is questionable. Maybe we should create a recipe for this and make a distinction that recipes don't have a demo section but are themselves runnable and usable from the start. However, let's start here and move stuff out once we created a recipe section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is something of an issue in that MkDocs does not seen to like a
README.md
to be sitting alongside anindex.md
. Perhaps that was the original motivation fordemo/
? I tried to renameindex.md
toblog.md
and point that navigation at that but this causes an exception without further explanation. It also causes anindex.md
file to be magically created indocs/
. Whaa???There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is, of course, the option to exclude
README.md
from the build or to move it to anabout
folder but then it would only show up there on GitHub. Note that all this is a problem only for the stand-alone blog. It is actually here (I think) that thedemo/
is needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe we should really move this into a new section called recipes, cookbooks, or whatever, then. We should definitely keep the demo for examples, but this doesn't really work for the standalone blog. The standalone blog could then also feature a full-blown setup with tags, social cards, etc., basically everything that's in the free version.´, and we could slowly extend it to be a good starter. What do you think?
Maybe we should call it starters, albeit that makes me hungry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just came to realize that everything is about food 😂 Starters, cookbooks, recipes, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me. I will start working on this. TBH, I always felt that the examples are a bit too minimalistic to be of much help to many people but I have no empirical evidence to back that up. Definitely happy to do more to show what amazing things are possible if you put things together in the right way. I keep doing bits of work now and then on the tutorial (recipe, starter, entrée, smorgasbord...) and, no doubt will add more as I pick up useful things while looking at the blog functionality.
One question, though: should we publish the blog-standalone example even if it is a bit odd? We could mention that in the README.
Another one: I have started to write a contributors.md file to document how the examples work. Put a note on us not accepting community contributions just now. If you don't like publishing it (yet) then I could stick the text in to the internal repo for now so we can at least look at it and refine it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they are very barebone, but don't forget that sometimes people have trouble setting up even the simplest features. In the end, examples help us reduce the number of issues and provide a good starting point for minimal reproductions. They are not intended to be complete, but be as minimalistic as possible.
Yes, let's keep it as an example for now, and build it into something more advanced later.
We can publish it as a CONTRIBUTING.md in this repository and give it more visibility (e.g. in the README or on the docs) once we have figured out how we want to build examples and recipes in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing: if you're on the contributing.md, it would be perfect if you could find some time to work on squidfunk/mkdocs-material#6153, which we're desperately missing in our docs. I guess there might be some overlap.