create an example folder

This commit is contained in:
Guy Godfroy 2020-12-09 17:11:47 +01:00
parent c70307e999
commit 6f6c856229
11 changed files with 99 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,2 +1 @@
config.py
__pycache__

View File

@ -2,19 +2,19 @@
# It is not intended to be executed.
# locale (for templates, for example dates rendering)
locale = "fr_FR.utf8"
locale = "en_US.utf8"
# path to directory containing markdonw files to convert
md_path = "/srv/my-site-content/posts"
md_path = "/srv/gemini/example/md"
# path to gemini blog root directory
gmi_path = "/srv/gemini/my-site"
gmi_path = "/srv/gemini/example/gmi"
# directory within gmi_path which will contains converted posts
posts_dir = "posts"
# path to directory containing templates
tpl_path = "/srv/gemini/templates"
tpl_path = "/srv/gemini/example/templates"
# list of markdown files extensions
# Any file with a different extension will be ignored.
@ -40,7 +40,7 @@ gmi_extension = ".gmi"
# Some CMS make you use some placeholders (for instance for assets URL).
# You have to inform geminer of them here.
replace = [
("%assets_url%", "https://hashtagueule.fr/assets")
("%assets_url%", "https://example.com/assets")
]
# md2gemini settings

9
example/md/firt_post.md Normal file
View File

@ -0,0 +1,9 @@
---
title: "First post"
author: raspbeguy
date: 2020-12-09
tags: foo,bar
---
# I am a post
Look at me!

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>My blog</title>
<subtitle>Les gentils du net</subtitle>
<link href="gemini://example.com/atom.xml" rel="self"/>
<link href="gemini://example.com" rel="alternate"/>
<updated>{{ now().strftime('%FT%TZ') }}</updated>
<author>
<name>raspbeguy</name>
</author>
<category term="tech" />
<id>gemini://example.com</id>
{%- for post in posts|sort(attribute="date",reverse=True) %}
<entry>
<title>{{ post.title }}</title>
<id>gemini://example.com/{{ post.path }}</id>
<link href="gemini://example.com/{{ post.path }}" rel="alternate"/>
<updated>{{ post.date.strftime('%FT%TZ') }}</updated>
<published>{{ post.date.strftime('%FT%TZ') }}</published>
<author>
<name>{{ post.author.name }}</name>
</author>
{%- for tag in post.tags %}
<category term="{{ tag.name }}"/>
{%- endfor %}
</entry>
{%- endfor %}
</feed>

View File

@ -0,0 +1,5 @@
# Posts by {{ prop_item.name }}
{% for post in prop_item.posts|sort(attribute="date",reverse=True) -%}
=> /{{ post.path }} [{{ post.date.strftime('%d/%m/%Y') }}] {{ post.title }}
{% endfor %}

View File

@ -0,0 +1,5 @@
# Authors list
{% for author, value in prop.items()|sort(attribute='1.name') -%}
=> /authors/{{ author }}.gmi {{ value.name }} ({{ value.posts | length }} articles)
{% endfor %}

View File

@ -0,0 +1,18 @@
# My blog
## I deserve all your attention.
This is my blog. Please read it and like it.
Last posts :
{% for post in (posts|sort(attribute="date",reverse=True))[:30] -%}
=> /{{ post.path }} {{ post.date.strftime('%Y-%m-%d') }} - {{ post.title }}
{% endfor %}
=> /posts.gmi All posts
=> /tags.gmi Tag list
=> /authors.gmi Authors list
=> /atom.xml Atom feed
This capsule has been generated by Geminer.
=> https://git.gugod.fr/raspbeguy/geminer Dépôt de Geminer

View File

@ -0,0 +1,14 @@
# {{ post.title }}
by {{ post.author.name }}, on {{ post.date.strftime('%d %B %Y') }}
{% set tags = [] %}{% for tag in post.tags %}{{ tags.append(tag.name) or "" }}{% endfor %}{{ tags|join(", ") }}
{{ post.content }}
=> / Back to home
=> /authors/{{ post.author.slug }}.gmi More posts by {{ post.author.name }}
Posts having those tags:
{% for tag in post.tags|sort(attribute="name") -%}
=> /tags/{{ tag.slug }}.gmi {{ tag.name }}
{% endfor %}

View File

@ -0,0 +1,5 @@
# Posts list
{% for post in posts|sort(attribute="date",reverse=True) -%}
=> /{{ post.path }} [{{ post.date.strftime('%d/%m/%Y') }}] {{ post.title }}
{% endfor %}

View File

@ -0,0 +1,5 @@
# Posts with tag "{{ prop_item.name }}"
{% for post in prop_item.posts|sort(attribute="date",reverse=True) -%}
=> /{{ post.path }} [{{ post.date.strftime('%d/%m/%Y') }}] {{ post.title }}
{% endfor %}

View File

@ -0,0 +1,5 @@
# Tags list
{% for tag, value in prop.items()|sort(attribute='1.name') -%}
=> /tags/{{ tag }}.gmi {{ value.name }} ({{ value.posts | length }} articles)
{% endfor %}