1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-11-27 22:18:22 +02:00

Use a template to replace the version tag

This commit is contained in:
kaiyou
2017-11-06 13:24:40 +01:00
parent 8c71037d3d
commit 5831221c0e
3 changed files with 8 additions and 21 deletions

4
docs/_templates/page.html vendored Normal file
View File

@@ -0,0 +1,4 @@
{%- extends "layout.html" %}
{% block body %}
{{ body|replace("VERSION_TAG", version) }}
{% endblock %}

View File

@@ -19,12 +19,12 @@ Docker Compose configuration is stored in a file named
:download:`docker-compose.yml`. Additionally, Mailu :download:`docker-compose.yml`. Additionally, Mailu
relies on a :download:`.env` file for various settings. Download relies on a :download:`.env` file for various settings. Download
the proper template files from the git repository. To download the configuration the proper template files from the git repository. To download the configuration
for the ``{{ github_version }}`` branch, use: for the ``VERSION_TAG`` branch, use:
.. code-block:: bash .. code-block:: bash
wget https://mailu.io/{{ github_version }}/_downloads/docker-compose.yml wget https://mailu.io/VERSION_TAG/_downloads/docker-compose.yml
wget https://mailu.io/{{ github_version }}/_downloads/.env wget https://mailu.io/VERSION_TAG/_downloads/.env
Then open the ``.env`` file to setup the mail server. Modify the ``ROOT`` setting Then open the ``.env`` file to setup the mail server. Modify the ``ROOT`` setting
to match your setup directory if different from ``/mailu``. to match your setup directory if different from ``/mailu``.

View File

@@ -2,10 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
import os, sys, docutils extensions = ['sphinx.ext.imgmath', 'sphinx.ext.viewcode']
sys.path.append(os.path.dirname(__file__))
extensions = ['sphinx.ext.imgmath', 'sphinx.ext.viewcode', 'conf']
templates_path = ['_templates'] templates_path = ['_templates']
source_suffix = '.rst' source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
@@ -40,20 +37,6 @@ html_context = {
} }
def setup(app):
""" The conf itself is an extension for parsing rst.
"""
def rstjinja(app, docname, source):
""" Render our pages as a jinja template for fancy templating.
"""
if app.builder.format != 'html':
return
source[0] = app.builder.templates.render_string(
source[0], app.config.html_context)
app.connect("source-read", rstjinja)
# Upload function when the script is called directly # Upload function when the script is called directly
if __name__ == "__main__": if __name__ == "__main__":
import os, sys, paramiko import os, sys, paramiko