Files
xrpl-dev-portal/template/component-breadcrumbs.html.jinja
Rome Reginelli 66b6f951fe Fix various style/template issues (#2103)
* Fix various style/template issues

- Add styles to allow fully invisible headers. These can be used to
  support anchor links in translated pages, so we can move the link_subs
  out of the dactyl-config.yml. Example in transaction-common-fields.md
- Upgrade jQuery to 3.7.1
- Add left nav to references landings for consistent navigation
- Add breadcrumbs template (previously used Dactyl built-in) which
  throws an error if you specify a parent: that doesn't exist.
  (Previously it would write a blank link; the link checker would
  report this as an error, but it wasn't obvious what the cause was.)
- Fix #2014 (special case for code blocks nested in lists).
- Fix #2096.
- Remove excessive spacing between top nav and main content, and
  re-align top of main contents in all 3 columns for docs pages.
- Reorganize _content.scss to be easier to read.

* Upgrade yarn packages (fix dependabot alerts) & rebuild CSS

* Fix NFT broken link in translation

* [ja] Properly fix NFT data link
2023-09-06 13:15:19 -07:00

30 lines
1.2 KiB
Django/Jinja

<nav class="breadcrumbs-wrap" aria-label="breadcrumb">
<ul class="breadcrumb">
{% set ns=namespace(crumbs = []) -%}
{%- macro get_crumbs(page) %}
{% if page.parent is undefined or page.parent == "index.html" %}
{% set homepage = pages|selectattr('html', 'defined_and_equalto', 'index.html')|list|first %}
{% set _ = ns.crumbs.insert(0, homepage) %}
{% else %}
{% set parent = pages|selectattr('html', 'defined_and_equalto', page.parent)|list|first %}
{% if parent is undefined %}
{% include "ERROR: Page "+page.html+" specifies a parent that doesn't exist in this target: "+page.parent %}
{% else %}
{% set _ = ns.crumbs.insert(0, parent) -%}
{{ get_crumbs(parent) }}
{% endif %}
{%- endif -%}
{%- endmacro %}
{{ get_crumbs(currentpage) }}
{% if currentpage.html != "index.html" %}
{%- for page in ns.crumbs %}
<li class="active breadcrumb-item"><a href="
{%- if page is defined and "//" not in page.html %}{{ currentpage.prefix }}{% endif -%}
{{ page.html }}">{{ page.name }}</a></li>
{% endfor %}
{% endif %}
<li class="active breadcrumb-item">{{ currentpage.name }}</li>
</ul>
</nav><!--/.breadcrumbs-wrap-->