diff --git a/plugin/micron/micron.py b/plugin/micron/micron.py index a944c3b..71bdb62 100644 --- a/plugin/micron/micron.py +++ b/plugin/micron/micron.py @@ -208,13 +208,11 @@ class MarkdownToMicronReader(MarkdownReader): metadata = self._parse_metadata(meta) content = '\n'.join(lines) - m2μr = MicronRenderer() m2μ = Markdown(renderer=m2μr) m2μ.inline.register('underlined', UNDERLINED, parse_underlined, before='emphasis') m2μ.renderer.register('underlined', render_underlined_mu) content = m2μ(content) - print(content) return content, metadata # === M I C R O N W R I T E R === @@ -245,9 +243,8 @@ class MicronWriter(Writer): # set localsiteurl for context so that Contents can adjust links if localcontext['localsiteurl']: context['localsiteurl'] = localcontext['localsiteurl'] - output = template.render(localcontext) + output = template.render(localcontext).replace('.html', '.mu') path = sanitised_join(output_path, name) - try: os.makedirs(os.path.dirname(path)) except Exception: diff --git a/theme/templates/article.mu b/theme/templates/article.mu index 5d94f17..bb5dca7 100644 --- a/theme/templates/article.mu +++ b/theme/templates/article.mu @@ -1,17 +1,11 @@ {% extends "base.mu" %} {% block content %} - >{{ article.title }} - - {% import 'translations.mu' as translations with context %} - {{ translations.translations_for(article) }} -{{ article.locale_date }} -{% if article.authors %} - -by {% for author in article.authors %}{{ author }}{% endfor %} - -{% endif %} - +{% import 'translations.mu' as translations with context %} +{{ translations.translations_for(article) }} +{{ article.locale_date }} {% if article.authors %}by {% for author in article.authors %}{{ author }}{% endfor %}{% endif %} + + {{ article.content }} {% endblock %} diff --git a/theme/templates/authors.mu b/theme/templates/authors.mu index 714ce8c..c53cf6d 100644 --- a/theme/templates/authors.mu +++ b/theme/templates/authors.mu @@ -3,7 +3,7 @@ >Authors on {{ SITENAME }} {%- for author, articles in authors|sort %} -+ `[{{ author }}`/{{ author.url }}] ({{ articles|count }}) ++ `[{{ author }}`:/{{ author.url }}] ({{ articles|count }}) {% endfor %} {% endblock %} diff --git a/theme/templates/base.mu b/theme/templates/base.mu index 40c3099..dc48ef1 100644 --- a/theme/templates/base.mu +++ b/theme/templates/base.mu @@ -1,22 +1,9 @@ -`# lang: {{ DEFAULT_LANG }} +# lang: {{ DEFAULT_LANG }} {% block head %} ->{% block title %}{{ SITENAME }}{% endblock title %} +> {% block title %}{{ SITENAME }}{% endblock title %} {% endblock head %} -{% for title, link in MENUITEMS %} -`[{{ title }}`{{ link }}] -{% endfor %} -{% if DISPLAY_PAGES_ON_MENU %} -{% for p in PAGES %} -`[{{ p.title }}`/{{ p.url }}] -{% endfor %} -{% else %} -{% if DISPLAY_CATEGORIES_ON_MENU %} -{% for cat, null in categories %} -`[{% if cat == category %}`_{% endif %}{{ cat }}{% if cat == category %}`_{% endif %}`/{{ cat.url }}] -{% endfor %} -{% endif %} -{% endif %} +{% for title, link in MENUITEMS %}`[{{ title }}`{{ link }}]{% endfor %}{% if DISPLAY_PAGES_ON_MENU %}{% for p in PAGES %}`[{{ p.title }}`/{{ p.url }}]{% endfor %}{% else %}{% if DISPLAY_CATEGORIES_ON_MENU %}{% for cat, null in categories %}`[{% if cat == category %}`_{% endif %}{{ cat }}{% if cat == category %}`_{% endif %}`/{{ cat.url }}]{% endfor %}{% endif %}{% endif %} {% block content %} {% endblock %} diff --git a/theme/templates/categories.mu b/theme/templates/categories.mu index 3961fc6..5393ef7 100644 --- a/theme/templates/categories.mu +++ b/theme/templates/categories.mu @@ -1,6 +1,6 @@ {% extends "base.mu" %} {% block content %} {% for category, articles in categories %} -+ `[{{ category }}`/{{ category.url }}] ++ `[{{ category }}`:/{{ category.url }}] {% endfor %} {% endblock %} diff --git a/theme/templates/index.mu b/theme/templates/index.mu index 5d0c140..84fe50e 100644 --- a/theme/templates/index.mu +++ b/theme/templates/index.mu @@ -2,14 +2,8 @@ {% block content %} {% block content_title %} {% endblock %} - {% for article in articles %} - -+[{{ article.locale_date }}] ->>>>`[`!{{ article.title }}`!`/{{ article.url }}] ->>>>{{ article.summary }} - -- ++ [{{ article.locale_date }}] `!`_`[{{ article.title }}`:/{{ article.url }}]`_`! {% endfor %} diff --git a/theme/templates/pagination.mu b/theme/templates/pagination.mu index 976e703..f2305d9 100644 --- a/theme/templates/pagination.mu +++ b/theme/templates/pagination.mu @@ -1,5 +1,5 @@ {% if DEFAULT_PAGINATION %} - -{% if articles_page.has_previous() %}`[<<`/{{ articles_previous_page.url }}] {% endif %}Page {{ articles_page.number }} / {{ articles_paginator.num_pages }}{% if articles_page.has_next() %} `[>>`/{{ articles_next_page.url }}]{% endif %} +{% if articles_page.has_previous() %}`[<<`:/{{ articles_previous_page.url }}] {% endif %}Page {{ articles_page.number }} / {{ articles_paginator.num_pages }}{% if articles_page.has_next() %} `[>>`:/{{ articles_next_page.url }}]{% endif %} {% endif %} diff --git a/theme/templates/period_archives.mu b/theme/templates/period_archives.mu index 3a15b28..c850265 100644 --- a/theme/templates/period_archives.mu +++ b/theme/templates/period_archives.mu @@ -4,7 +4,7 @@ {% for article in dates %} +[{{ article.locale_date }}] ->>>>`[`!{{ article.title }}`!`/{{ article.url }}] +>>>>`[`!{{ article.title }}`!`:/{{ article.url }}] >>>>{{ article.summary }} {% endfor %} {% endblock %} diff --git a/theme/templates/tags.mu b/theme/templates/tags.mu index 4f8240f..049641b 100644 --- a/theme/templates/tags.mu +++ b/theme/templates/tags.mu @@ -1,6 +1,6 @@ {% extends "base.mu" %} {% block content %} {% for tag, articles in tags %} -+ `[{{ tag }}`/{{ tag.url }}] ++ `[{{ tag }}`:/{{ tag.url }}] {% endfor %} {% endblock %} diff --git a/theme/templates/translations.mu b/theme/templates/translations.mu index e4a6eb6..7bce60d 100644 --- a/theme/templates/translations.mu +++ b/theme/templates/translations.mu @@ -1,7 +1,7 @@ {% macro translations_for(article) %} {% if article.translations %} {% for translation in article.translations %} -`[{{ translation.lang }}`/{{ translation.url }}] +`[{{ translation.lang }}`:/{{ translation.url }}] {% endfor %} {% endif %} {% endmacro %}