Skip to content

Commit

Permalink
final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkrzyskow committed Jun 30, 2024
1 parent 1881b98 commit 0c031ff
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 32 deletions.
60 changes: 36 additions & 24 deletions docs/blog/posts/community-news/welcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ tags:
---
# Introducing Community Posts

> Made possible thanks to the built-in Blog plugin of Material for MkDocs.
> Enabled by the built-in Blog plugin of Material for MkDocs.
> [![Material for MkDocs][badge]{: .gmc-default-img}][mkdocs-material]
This is a blog-like section of GMC, where users can post their tutorials, guides, analytical
articles, useful snippets, promote their modding tools etc.
Welcome to the new blog section of the GMC, where users can share tutorials, guides, analytical
articles, useful snippets, promote their modding tools, and more.

Basically this should allow for more flexibility when it comes to content creation on the website.
This addition brings greater flexibility to content creation on our website.

<!-- more -->

Expand All @@ -26,30 +26,42 @@ Basically this should allow for more flexibility when it comes to content creati

## Why a blog?

Many times over the span of running Gothic Modding Community one issue has resurfaced over and over
again. The issue concerns the fact that some pages don't fit the "docs" idea. Therefore, a new
section was required. At first, we wanted to just put everything into a plain new area, but the Blog
plugin was supposed to be released to the Community version of the Material theme, so we pushed back
the idea and waited for that to happen, but while waiting for it, we started supporting i18n
localization, in hopes of getting new users for both translation and content creation, but after
a year has passed no new members have become regular contributors. Also the GitHub/PayPal fiasco
took place which pushed back the release of the Blog plugin to the public to use.
Throughout the history of the Gothic Modding Community, we've encountered a recurring issue: some
content doesn't fit neatly into the "docs" format. To address this, we needed a new section.
Initially, we considered a simple new area, but then the Blog plugin was announced for the Community
version of the Material theme. We decided to wait for its release.

Finally, the Blog plugin arrived in the Community version, but then it turned out that the
mkdocs-static-i18n plugin unfortunately can't handle the internally generated blog pages of the Blog
plugin. So we waited a bit longer, in hopes of the situation resolving itself via some nifty fix.
Unfortunately, nothing did change, and the initial issue kept resurfacing.
While waiting, we added support for i18n localization to attract new users for translation and
content creation. However, despite our efforts, we didn't gain many regular contributors.
Additionally, delays caused by the GitHub/PayPal issues further postponed the Blog plugin's release.

The Blog plugin eventually arrived in the Community version. Unfortunately, we discovered that the
mkdocs-static-i18n plugin couldn't handle the internally generated blog pages. We hoped for a fix
upstream, but the issue persisted.

## i18n support

!!! failure "Not supported"
As of the day of writing this post (2024-06-09) the i18n plugin doesn't support blog pages.
As of July 02, 2024, the i18n plugin doesn't support blog pages.

Given the complexity of this issue, it likely requires overriding the Blog plugin's internal code.
This could prevent users with localization from updating, creating a problematic situation for
[@ultrabug], who would need to constantly make fixes. The issue is further complicated by different
versions of the Blog plugin for the Community and Insiders editions.

This applies to us as well. Despite many fixes and patches added to our docs on top of other
plugins, we don't plan to add i18n support for the blog ourselves to maintain general flexibility.
Especially since our community is still primarily composed of English speakers.

[@ultrabug]: https://github.com/ultrabug/

## Who can add posts, what topics are allowed?

We don't plan to restrict posts too much. As long as they are not meme content, they will likely be
accepted. For up-to-date guidelines, you can read the [how-to guide].

[how to guide]: ../tutorials/how_to_write_blog_posts.md

Given the skill of the developer maintaining the i18n plugin ([@ultrabug]()) I don't think this is an
easy issue to solve, as it would get solved already. The solution probably requires overriding
internal code of the Blog plugin, and as it updates together with the theme, people using it with
localization could end up blocked from updating and this would create a rather bad situation where
@ultrabug has to constantly make fixes. Add to it different versions of the Blog plugin for the
Community and Insiders version
## Comments

## Comments
Let us know what do you think about the new feature!
32 changes: 29 additions & 3 deletions docs/blog/posts/tutorials/how_to_write_blog_posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ date: 2024-07-01
tags:
- Best Practices
- Documentation
- How To
- How-To
- MkDocs
---
# Guidelines For Community Posts
Expand Down Expand Up @@ -45,10 +45,20 @@ categories:

## Mandatory opinionated requirements

### Keep the posts and assets organized
### Use categories defined in the mkdocs.yml config

Some categories can be used for slugs, some don't, if you want to add a new on with your post please
ask first. To read an up-to-date list check the `categories_allowed` option in the `mkdocs.yml`
file. If you want more granularity, please use [tags], which allow for more leeway. You can check
currently used tags [here][current-tags].

[tags]: https://squidfunk.github.io/mkdocs-material/plugins/tags/
[current-tags]: ../../tags.md

### Keep the files organized

Put posts under the `blog/posts` directory into a subdirectory matching the category `slug`, so
lowercase and with `-` in place of spaces:
lowercase and with `_` in place of spaces:

> The filenames should use `_` for spaces, and should be lowercase.

Expand Down Expand Up @@ -97,9 +107,25 @@ limit, which is a bit narrow. As of the time of writing this post the CSS settin
the content is roughly ~140 characters, which is a bit wide. This Markdown file uses a 100-character
limit. Keep things reasonable and use the same width throughout the file.
### Use alternative link definitions
To add to the previous point, when using the normal Markdown link definitions like `[text](url)` you
will run into problems with too long lines. To mitigate that, define links before the next heading
using this syntax: `[text]: url`. Then you can organically use the `[text]` in your parahraph and it
will be converted to an URL.
### Don't be lazy when a name conflict occurs
If there isn't any better alternative you can add a lazy `-2` at the end of the name, but for better
search-ability your name should be distinct in some way. For example an image with a success message
`result.png` can be quite common, so prepend a slug `blender_modifier_result.png` or the slug of the
blog post you're writing.
### Add a H2 Comments heading at the bottom
This will add an TOC element for users to easily skip the post and read the comments. The RSS plugin
also expects that this heading exists.
## Comments
Let us know what you think about those restrictions!
18 changes: 15 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ extra:
- icon: fontawesome/brands/github
link: https://github.com/Gothic-Modding-Community/gmc
name: Gothic Modding Community GitHub repository
- icon: material/rss
link: /feed_rss_updated.xml
- icon: simple/rss
link: /gmc/feed_rss_updated.xml
name: Subscribe to our RSS Feed

validation:
Expand Down Expand Up @@ -224,6 +224,7 @@ plugins:
- preferences*.md
- genome/index*.md
- zengin/index*.md
- blog/posts/**/*.md
- git-authors:
enabled: !ENV [GMC_ENABLE_ON_PUBLISH, False]
show_email_address: false
Expand All @@ -235,6 +236,17 @@ plugins:
- preferences*.md
- genome/index*.md
- zengin/index*.md
- blog/posts/**/*.md
- git-committers:
enabled: !ENV [GMC_ENABLE_ON_PUBLISH, False]
repository: Gothic-Modding-Community/gmc
branch: dev
exclude:
- index*.md
- preferences*.md
- genome/index*.md
- zengin/index*.md
- blog/posts/**/*.md
- redirects:
# Empty dict to fill with the `meta_redirects.py` hook.
redirect_maps: {}
Expand All @@ -247,7 +259,7 @@ plugins:
categories:
- tags
- categories
comments_path: "#__comments"
comments_path: "#comments" # Needs to be added manually to each file at the end
date_from_meta:
as_creation: date.created
as_update: date.updated
Expand Down
2 changes: 1 addition & 1 deletion overrides/assets/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

/* enforce icon height for emojis in blog author profiles */
/* fix margin that is incorrectly applied here */
.md-post__authors .md-author img {
.md-content__inner .md-author img {
height: 100%;
margin: unset;
}
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ mkdocs-static-i18n==1.2.3
git+https://github.com/kamilkrzyskow/gothic-lexer.git@b5ee7868a7e7397cd129ff1f847daa7d39c0e416#egg=gothic_lexer
mkdocs-awesome-pages-plugin==2.9.2
mkdocs-git-authors-plugin==0.9.0
mkdocs-rss-plugin==1.14.0
mkdocs-rss-plugin==1.14.0
mkdocs-git-committers-plugin-2==2.3.0

0 comments on commit 0c031ff

Please sign in to comment.