Make source_url and issues_url optional and adapt content if not set

This commit is contained in:
David Lapshin
2024-05-21 16:23:18 +03:00
parent 39d75b08c7
commit b32c51b71a
3 changed files with 8 additions and 4 deletions

View File

@ -8,10 +8,12 @@
<h1>Page Not Found</h1> <h1>Page Not Found</h1>
<p>The requested page could not be found. If you feel this is not normal, then you can create an issue on the issue tracker.</p> <p>The requested page could not be found.{% if config.extra.issues_url %} If you feel this is not normal, then you can create an issue on the issue tracker.{% endif %}</p>
<p class="dialog-buttons"> <p class="dialog-buttons">
<a onclick="window.history.go(-1)" class="inline-button">Go Back</a> <a onclick="window.history.go(-1)" class="inline-button">Go Back</a>
{% if config.extra.issues_url %}
<a class="inline-button colored" href="{{ config.extra.issues_url }}">File an Issue</a> <a class="inline-button colored" href="{{ config.extra.issues_url }}">File an Issue</a>
{% endif %}
</p> </p>
{% endblock content %} {% endblock content %}

View File

@ -105,6 +105,8 @@
<p class="dialog-buttons"> <p class="dialog-buttons">
<a class="inline-button" href="#top">Go to Top</a> <a class="inline-button" href="#top">Go to Top</a>
{% if config.extra.issues_url %}
<a class="inline-button colored" href="{{ config.extra.issues_url }}">File an Issue</a> <a class="inline-button colored" href="{{ config.extra.issues_url }}">File an Issue</a>
{% endif %}
</p> </p>
{% endblock content %} {% endblock content %}

View File

@ -21,7 +21,7 @@
<p title="Last built at {{ now() | date(format='%F %a %R') }}">&copy; {{ config.title }}, {{ now() | date(format="%Y") }}</p> <p title="Last built at {{ now() | date(format='%F %a %R') }}">&copy; {{ config.title }}, {{ now() | date(format="%Y") }}</p>
{% endif %} {% endif %}
{% if config.extra.footer.show_source %} {% if config.extra.source_url and config.extra.footer.show_source %}
<p> <p>
<a href="{{ config.extra.source_url | safe }}">Website source</a> <a href="{{ config.extra.source_url | safe }}">Website source</a>
</p> </p>