mirror of
https://github.com/inventree/inventree-website.git
synced 2026-11-23 22:56:12 +00:00
* refactor into zensical * adjust nav layout * more nav changes * update features page * open external hero links in new tab * consolidate small pages * add legacy page redirects * tweak content * further cleanup * adjust netlify config * disable redirect * remove redirect script * fix tag splitting for plugins * Display plugin metadata on left-hand side * revert icon changes * move gallery to index page * Add page deascriptions * fix image size for carousel * adjust theme
129 lines
5.2 KiB
HTML
129 lines
5.2 KiB
HTML
{#- Template for entries in the plugin list (docs/plugins/<name>.md) -#}
|
|
{% extends "main.html" %}
|
|
|
|
{#- Anchors match slugify() in main.py for the tag values in use (letters, digits and spaces) -#}
|
|
{#- A plain string (rather than a list) is shown as a single chip, not split into letters -#}
|
|
{% macro chip_list(items, page_url, extra_class='') -%}
|
|
{%- if items is string %}{% set items = [items] %}{% endif -%}
|
|
{%- for item in items or [] -%}
|
|
<a href="{{ (page_url ~ '#' ~ (item | trim | lower | replace(' ', '-'))) | url }}" class="iv-chip {{ extra_class }}">{{ item | trim }}</a>
|
|
{% endfor -%}
|
|
{%- endmacro %}
|
|
|
|
{#- Plugin details - shown in the left sidebar on wide screens, and above the content otherwise -#}
|
|
{% macro plugin_meta(meta, extra_class) -%}
|
|
<aside class="iv-plugin-meta md-typeset {{ extra_class }}">
|
|
<a href="{{ 'plugins/community/' | url }}" class="iv-plugin-meta__back"><i class="ti ti-arrow-left"></i> All Plugins</a>
|
|
<h2 class="iv-plugin-meta__title">{{ meta.name }}</h2>
|
|
|
|
{% if meta.author %}
|
|
<div class="iv-plugin-meta__row">
|
|
<span class="iv-plugin-meta__label">Publisher</span>
|
|
<a href="{{ ('plugins/publishers/#' ~ (meta.author | lower)) | url }}" class="iv-plugin-meta__author">
|
|
<img src="https://github.com/{{ meta.author }}.png?size=40" alt="" class="iv-avatar" width="20" height="20" loading="lazy">
|
|
{{ meta.author }}
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="iv-plugin-meta__row">
|
|
<span class="iv-plugin-meta__label">License</span>
|
|
<span>
|
|
{% if meta.open_source %}<i class="ti ti-brand-open-source" title="Open source"></i>{% else %}<i class="ti ti-lock" title="Not open source"></i>{% endif %}
|
|
{{ meta.license | d('Unknown', true) }}
|
|
</span>
|
|
</div>
|
|
|
|
<div class="iv-plugin-meta__row">
|
|
<span class="iv-plugin-meta__label">Status</span>
|
|
<span>
|
|
{% if meta.stable %}<span class="iv-status iv-status--ok"><i class="ti ti-circle-check"></i> Stable</span>{% else %}<span class="iv-status iv-status--warn"><i class="ti ti-alert-triangle"></i> Unstable</span>{% endif %}
|
|
{% if meta.maintained %}<span class="iv-status iv-status--ok"><i class="ti ti-circle-check"></i> Maintained</span>{% else %}<span class="iv-status iv-status--warn"><i class="ti ti-alert-circle"></i> Unmaintained</span>{% endif %}
|
|
</span>
|
|
</div>
|
|
|
|
{% if meta.pypi and meta.package_name %}
|
|
<div class="iv-plugin-meta__row">
|
|
<span class="iv-plugin-meta__label">PyPI Package</span>
|
|
<a href="https://pypi.org/project/{{ meta.package_name }}/"><code>{{ meta.package_name }}</code></a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% set links = [
|
|
(meta.website, 'ti-world', 'Website'),
|
|
(meta.issue_tracker, 'ti-bug', 'Issue Tracker'),
|
|
(meta.github, 'ti-brand-github', 'Source on GitHub'),
|
|
(meta.gitlab, 'ti-brand-gitlab', 'Source on GitLab'),
|
|
(meta.source, 'ti-code', 'Source Code'),
|
|
] %}
|
|
<ul class="iv-plugin-meta__links">
|
|
{% for href, icon, label in links if href %}
|
|
<li><a href="{{ href }}"><i class="ti {{ icon }}"></i> {{ label }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
{% if meta.categories %}
|
|
<div class="iv-plugin-meta__row">
|
|
<span class="iv-plugin-meta__label">Categories</span>
|
|
<span>{{ chip_list(meta.categories, 'plugins/categories/', 'iv-chip--category') }}</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if meta.tags %}
|
|
<div class="iv-plugin-meta__row">
|
|
<span class="iv-plugin-meta__label">Tags</span>
|
|
<span>{{ chip_list(meta.tags, 'plugins/tags/') }}</span>
|
|
</div>
|
|
{% endif %}
|
|
</aside>
|
|
{%- endmacro %}
|
|
|
|
{#- Use the plugin name (rather than the title derived from the file name) for the page title -#}
|
|
{% block htmltitle %}
|
|
<title>{{ page.meta.name | d(page.title, true) }} - {{ config.site_name }}</title>
|
|
{% endblock htmltitle %}
|
|
|
|
{% block site_nav %}
|
|
{#- The primary sidebar also holds the navigation drawer on narrow screens, so keep nav.html -#}
|
|
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation">
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div class="md-sidebar__inner">
|
|
{% include "partials/nav.html" %}
|
|
{{ plugin_meta(page.meta, 'iv-plugin-meta--sidebar') }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{#- Table of contents - as in the theme's base.html -#}
|
|
{% if page.meta and page.meta.hide %}
|
|
{% set hidden = "hidden" if "toc" in page.meta.hide %}
|
|
{% endif %}
|
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" {{ hidden }}>
|
|
<div class="md-sidebar__scrollwrap">
|
|
{% set toc = page.toc %}
|
|
{% set first = toc | first %}
|
|
{% if first and first.level == 1 %}
|
|
{% set toc = first.children %}
|
|
{% endif %}
|
|
{% if toc %}
|
|
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
|
|
<div class="md-sidebar-button__wrapper">
|
|
<label class="md-sidebar-button" for="__toc"></label>
|
|
</div>
|
|
{% endif %}
|
|
<div class="md-sidebar__inner">
|
|
{% include "partials/toc.html" %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock site_nav %}
|
|
|
|
{% block content %}
|
|
{% if "<h1" not in page.content %}
|
|
<h1>{{ page.meta.name | d(page.title, true) }}</h1>
|
|
{% endif %}
|
|
|
|
{{ plugin_meta(page.meta, 'iv-plugin-meta--content') }}
|
|
|
|
{{ page.content }}
|
|
{% endblock content %}
|