Giter Site home page Giter Site logo

mkdocs-blog's Introduction

mkdocs-blog

Allows mkdocs to be used as a simple blog.

Features:

  • Provides timestamps based on folder structure
  • Enables jinja2 templating
  • Generates a simple RSS feed for recent content

Content layout

Assumes blog content is laid out in a standardized format with numeric years and months as follows:

docs/<year>/<month>/page.md

Within a month, file modification time is used to provide chronological ordering.

Examples

mkdocs-blog's People

Contributors

andyoakley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mkdocs-blog's Issues

Can this be used to create a specific overview page?

Looking at this plugin, I was wondering if it can be used to create a overview page of current blog posts in a similar fashion to what Squidfunk has for his "blog" shown here: https://squidfunk.github.io/mkdocs-material/blog/

Unfortunately is that page there a manual thing, so if there is a way to use this plugin to make an automated generation of such a page, or a similar one, would I appreciate any help with doing this.

The source of the above page, if needed, is here: https://github.com/squidfunk/mkdocs-material/blob/master/docs/blog/index.md

more documentation

This concept seems really useful and I want to give it a try, but documentation is sparse. Can you add more details on how to install and run mkdocs-blog? Maybe provide an example project?

Titles are "None"

When following the example "archive.md"

This is a list of posts, first grouped by year, then month, then sorted by age.

{% set chronological = config['chronological'] %}

{% for year in chronological|sort(reverse=True) %}
  <h3>{{ year | strftime("%Y") }}</h3>
  {% for month in chronological[year] %}
    <h4>{{ month | strftime("%B")  }}</h4>
    {% for mtime in chronological[year][month]|sort(reverse=True) %}
      {% set page = chronological[year][month][mtime] %}
      <a href="/{{ page.url }}">{{ page.title }}</a>
      <br />
    {% endfor %}
  {% endfor %}

{% endfor %}

the page titles are shown as None.
image

I debugged it a little and printed page.meta which was an empty dictionary when printed to the jinja template, although I have set it using YAML syntax (also tried without setting the metadata title since I guess it should be set from the filename). I checked using a breakpoint() inside the mkdocs source code that the page.meta (and also page.title) is read correctly (inside the Page class code), so something happens between that point of code and passing the page to the jinja template.

Workaround

At time being, seems that replacing {{ page.title }} with {{ page.file.url[:-5].split('/')[-1] }} or {{ page.file.url[:-5] }} gives a desired output.

Versions

  • Python 3.8.5 64-bit on Windows with
mkdocs                       1.1.2
mkdocs-blog                  0.1.0
mkdocs-bootstrap4            0.1.4
mkdocs-git-committers-plugin 0.1.10

(tried also while disabling the mkdocs-bootstrap4 theme).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.