Allow loading additional scripts (hopefully people won't do anything horrible with this)

This commit is contained in:
David Lapshin
2024-05-27 22:11:03 +03:00
parent 82a3e6c0ed
commit 0b9ea98cba
2 changed files with 16 additions and 5 deletions

View File

@ -42,12 +42,17 @@ date_format = "%d %B %Y"
issues_url = "https://codeberg.org/daudix/duckquill/issues" issues_url = "https://codeberg.org/daudix/duckquill/issues"
# URL to website's source code # URL to website's source code
source_url = "https://codeberg.org/daudix/duckquill" source_url = "https://codeberg.org/daudix/duckquill"
# Additional stylesheets; expects it to be in the "./static/" directory. # Additional CSS stylesheets; expects them to be in the "./static/" directory.
# If you are using Sass it will be generated there automatically. # If you are using Sass it will be generated there automatically.
# stylesheets = [ # stylesheets = [
# "YOUR_STYLE.css", # "YOUR_STYLE.css",
# "ALSO_YOUR_STYLE.css" # "ALSO_YOUR_STYLE.css"
# ] # ]
# Additional JavaScript scripts; expects them to be in the "./static/" directory.
# scripts = [
# "YOUR_SCRIPT.js",
# "ALSO_YOUR_SCRIPT.js"
# ]
# Whether to display "copy code" button on all code blocks # Whether to display "copy code" button on all code blocks
# that have the language set. # that have the language set.
# See https://www.getzola.org/documentation/content/syntax-highlighting/ # See https://www.getzola.org/documentation/content/syntax-highlighting/

View File

@ -33,15 +33,21 @@
} }
</style> </style>
{% if config.extra.show_copy_button %}
<script src="{{ get_url(path='copy-button.js') }}"></script>
{% endif %}
{% if config.extra.goatcounter %} {% if config.extra.goatcounter %}
<script data-goatcounter="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count" async src="//gc.zgo.at/count.js"></script> <script data-goatcounter="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count" async src="//gc.zgo.at/count.js"></script>
<noscript><img src="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count?p={{ current_path | default(value='/') | safe }}"></noscript> <noscript><img src="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count?p={{ current_path | default(value='/') | safe }}"></noscript>
{% endif %} {% endif %}
{% if config.extra.show_copy_button %}
<script src="{{ get_url(path='copy-button.js') }}"></script>
{% endif %}
{% if config.extra.scripts %}
{% for script in config.extra.scripts %}
<script src="{{ get_url(path=script) }}"></script>
{% endfor %}
{% endif %}
{% if config.extra.comments %} {% if config.extra.comments %}
<link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" /> <link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" />
{% endif %} {% endif %}