2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 13:46:54 +00:00

Merge pull request #190 from inventree/404-fix-2

404 fix 2
This commit is contained in:
Oliver 2021-10-11 20:50:09 +11:00 committed by GitHub
commit ee445a8ef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 42 deletions

View File

@ -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 %} {% if 'http' in url %}
{% set doc_url = url %} {% set img_url = url %}
{% else %} {% else %}
{% set doc_url = assets + '/images/' + url %} {% set img_url = config.assets_dir + '/images/' + url %}
{% endif %} {% endif %}
<figure class='image image-inventree'> <figure class='image image-inventree'>
{% if id %} {% if id %}
<!-- The link that, when clicked, will display the image in full screen --> <!-- The link that, when clicked, will display the image in full screen -->
<a href="#{{ id }}"> <a href="#{{ id }}">
{% elif doc_url %} {% elif img_url %}
<a href="{{ doc_url }}"> <a href="{{ img_url }}">
{% endif %} {% 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 or maxheight %}style='
{% if maxwidth %} max-width:{{ maxwidth }};{% endif %} {% if maxwidth %} max-width:{{ maxwidth }};{% endif %}
{% if maxheight %} max-height: {{ maxheight }};{% endif %} {% if maxheight %} max-height: {{ maxheight }};{% endif %}
'{% endif %} '{% endif %}
> >
{% if id or doc_url %} {% if id or img_url %}
</a> </a>
{% endif %} {% endif %}
{% if id %} {% if id %}
<!-- The full screen image, hidden by default --> <!-- The full screen image, hidden by default -->
<a href="#_" class="overlay" id="{{ id }}"> <a href="#_" class="overlay" id="{{ id }}">
<img src="{{ doc_url }}" alt="{{ description }}" /> <img src="{{ img_url }}" alt="{{ description }}" />
</a> </a>
{% endif %} {% endif %}
</figure> </figure>

View File

@ -1,7 +1,29 @@
{% extends "main.html" %} {% extends "base.html" %}
{% block content %}
<h1> {% block tabs %}
<span class="twemoji">{% include ".icons/fontawesome/regular/sad-tear.svg" %}</span> {{ super() }}
Uh oh - Page not found...
</h1> {% endblock %}
{% block site_nav %}
{% endblock %}
{% block content %}
<style>
h1 {
font-family: Arial, Helvetica, sans-serif;
display: block;
}
</style>
<section class="mdx-container">
<div class="md-grid md-typeset">
<div class="mdx-hero"></div>
<h1>
<span class='fas fa-search'></span>
Page not found
</h1>
</div>
</section>
{% endblock %} {% endblock %}

View File

@ -23,10 +23,10 @@
<!-- Hero content --> <!-- Hero content -->
<div class="mdx-hero__content"> <div class="mdx-hero__content">
<a href="features" title="InvenTree features" class="md-button md-button"> <a href="features" title="InvenTree features" class="md-button md-button">
Features <span class='fas fa-star'></span> Features
</a> </a>
<a href="start/intro" title="Install InvenTree" class="md-button md-button"> <a href="start/intro" title="Install InvenTree" class="md-button md-button">
Install <span class='fas fa-server'></span> Install
</a> </a>
<a href="https://github.com/inventree/inventree" title="Explore InvenTree source code" class="md-button md-button"> <a href="https://github.com/inventree/inventree" title="Explore InvenTree source code" class="md-button md-button">
<span class='fab fa-github'></span> Source Code <span class='fab fa-github'></span> Source Code

View File

@ -1,13 +1,8 @@
{% if 'readthedocs.org' in config.docs_dir %}
{% set assets = '/en/latest/assets' %}
{% else %}
{% set assets = '/assets' %}
{% endif %}
{% if 'http' in src %} {% if 'http' in src %}
{% set img_url = src %} {% set img_url = src %}
{% else %} {% else %}
{% set img_url = assets + '/images/' + src %} {% set img_url = config.assets_dir + '/images/' + src %}
{% endif %} {% endif %}
<li class='splide__slide'> <li class='splide__slide'>

View File

@ -36,15 +36,9 @@ If you see any sections of the documentation that require work (i.e. denoted wit
### Donate ### Donate
{% if 'readthedocs.org' in config.docs_dir %}
{% set assets = '/en/latest/assets' %}
{% else %}
{% set assets = '/assets' %}
{% endif %}
Finally, if you are unable to provide contributions as listed above, or you find InvenTree to be useful, please consider donating to support its ongoing development. Finally, if you are unable to provide contributions as listed above, or you find InvenTree to be useful, please consider donating to support its ongoing development.
[ Donate <span class='fas fa-smile'></span> ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=T4M976M5URSUE&currency_code=AUD){: .md-button .md-button--primary } [ Donate <span class='fas fa-smile'></span> ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=T4M976M5URSUE&currency_code=AUD){: .md-button .md-button--primary }
<img src="{{ assets }}/paypal-logo-small-min-300x136.png" border="0" alt="PayPal Logo" style="width: 136px; length:300px; vertical-align:middle; padding-left: 20px"> <img src="{{ config.assets_dir }}/paypal-logo-small-min-300x136.png" border="0" alt="PayPal Logo" style="width: 136px; length:300px; vertical-align:middle; padding-left: 20px">
Financial donations directly support the ongoing development of the InvenTree project. If you benefit from the InvenTree project, please consider contributing to maintain vibrant development of this software! Financial donations directly support the ongoing development of the InvenTree project. If you benefit from the InvenTree project, please consider contributing to maintain vibrant development of this software!

View File

@ -27,17 +27,42 @@ def on_config(config, *args, **kwargs):
rtd = os.environ.get('READTHEDOCS', False) rtd = os.environ.get('READTHEDOCS', False)
if not rtd: if rtd:
print("'READTHEDOCS' environment variable not found")
print("Building for localhost configuration!")
else:
rtd_version = os.environ['READTHEDOCS_VERSION'] rtd_version = os.environ['READTHEDOCS_VERSION']
rtd_language = os.environ['READTHEDOCS_LANGUAGE'] rtd_language = os.environ['READTHEDOCS_LANGUAGE']
url = f"https://inventree.readthedocs.io/{rtd_language}/{rtd_version}" site_url = f"https://inventree.readthedocs.io/{rtd_language}/{rtd_version}"
assets_dir = f"/{rtd_language}/{rtd_version}/assets"
config['site_url'] = url print("Building within READTHEDOCS environment!")
print(f" - Version: {rtd_version}")
print(f" - Language: {rtd_language}")
# Add *all* readthedocs related keys
readthedocs = {}
for key in os.environ.keys():
if key.startswith('READTHEDOCS_'):
k = key.replace('READTHEDOCS_', '').lower()
readthedocs[k] = os.environ[key]
# Supply this to the context
config['readthedocs'] = readthedocs
else:
print("'READTHEDOCS' environment variable not found")
print("Building for localhost configuration!")
assets_dir = '/assets'
site_url = config['site_url']
config['readthedocs'] = False
config['assets_dir'] = assets_dir
config['site_url'] = site_url
print(f"config.site_url = '{site_url}'")
print(f"config.assets_dir = '{assets_dir}'")
return config return config

View File

@ -4,8 +4,6 @@ title: Parts
## Part ## Part
<b>config.site_url:</b> {{ config.site_url }}
The *Part* is the core element of the InvenTree ecosystem. A Part object is the archetype of any stock item in your inventory. Parts are arranged in heirarchical categories which are used to organise and filter parts by function. The *Part* is the core element of the InvenTree ecosystem. A Part object is the archetype of any stock item in your inventory. Parts are arranged in heirarchical categories which are used to organise and filter parts by function.
## Part Category ## Part Category