mirror of
https://github.com/inventree/inventree-docs.git
synced 2025-06-16 04:05:27 +00:00
Merge pull request #190 from inventree/404-fix-2
404 fix 2
(cherry picked from commit ee445a8ef6
)
This commit is contained in:
@ -1,36 +1,30 @@
|
||||
{% if 'readthedocs.org' in config.docs_dir %}
|
||||
{% set assets = '/en/latest/assets' %}
|
||||
{% else %}
|
||||
{% set assets = '/assets' %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'http' in url %}
|
||||
{% set doc_url = url %}
|
||||
{% set img_url = url %}
|
||||
{% else %}
|
||||
{% set doc_url = assets + '/images/' + url %}
|
||||
{% set img_url = config.assets_dir + '/images/' + url %}
|
||||
{% endif %}
|
||||
|
||||
<figure class='image image-inventree'>
|
||||
{% if id %}
|
||||
<!-- The link that, when clicked, will display the image in full screen -->
|
||||
<a href="#{{ id }}">
|
||||
{% elif doc_url %}
|
||||
<a href="{{ doc_url }}">
|
||||
{% elif img_url %}
|
||||
<a href="{{ img_url }}">
|
||||
{% endif %}
|
||||
<img class='img-inline' src='{{ doc_url }}' alt='{{ description }}' title='{{ description }}'
|
||||
<img class='img-inline' src='{{ img_url }}' alt='{{ description }}' title='{{ description }}'
|
||||
{% if maxwidth or maxheight %}style='
|
||||
{% if maxwidth %} max-width:{{ maxwidth }};{% endif %}
|
||||
{% if maxheight %} max-height: {{ maxheight }};{% endif %}
|
||||
'{% endif %}
|
||||
>
|
||||
{% if id or doc_url %}
|
||||
{% if id or img_url %}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if id %}
|
||||
<!-- The full screen image, hidden by default -->
|
||||
<a href="#_" class="overlay" id="{{ id }}">
|
||||
<img src="{{ doc_url }}" alt="{{ description }}" />
|
||||
<img src="{{ img_url }}" alt="{{ description }}" />
|
||||
</a>
|
||||
{% endif %}
|
||||
</figure>
|
||||
|
Reference in New Issue
Block a user