mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
Template for child pages; auto-footer; etc.
This commit is contained in:
18
5layers.yml
18
5layers.yml
@@ -66,7 +66,7 @@ pages:
|
||||
doc_type: Concepts
|
||||
category: Payment System
|
||||
html: concept-payment-system.html
|
||||
template: template-cat-landing.html
|
||||
template: template-landing-category.html
|
||||
targets:
|
||||
- local
|
||||
|
||||
@@ -113,7 +113,7 @@ pages:
|
||||
doc_type: Concepts
|
||||
category: Consensus Network
|
||||
html: concept-consensus-network.html
|
||||
template: template-cat-landing.html
|
||||
template: template-landing-category.html
|
||||
targets:
|
||||
- local
|
||||
|
||||
@@ -143,7 +143,7 @@ pages:
|
||||
doc_type: References
|
||||
category: rippled API Public Methods
|
||||
html: reference-rippled-public.html
|
||||
template: template-cat-landing.html
|
||||
template: template-landing-category.html
|
||||
targets:
|
||||
- local
|
||||
|
||||
@@ -222,7 +222,7 @@ pages:
|
||||
doc_type: References
|
||||
category: rippled API Admin Methods
|
||||
html: reference-rippled-admin.html
|
||||
template: template-cat-landing.html
|
||||
template: template-landing-category.html
|
||||
targets:
|
||||
- local
|
||||
|
||||
@@ -231,7 +231,7 @@ pages:
|
||||
doc_type: References
|
||||
category: rippled API Admin Methods
|
||||
subcategory: Server Control Methods
|
||||
template: template-cat-landing.html
|
||||
template: template-landing-category.html
|
||||
targets:
|
||||
- local
|
||||
|
||||
@@ -240,21 +240,21 @@ pages:
|
||||
doc_type: References
|
||||
category: Test Empty Category
|
||||
html: reference-rippled-conventions.html
|
||||
template: template-cat-landing.html
|
||||
template: template-landing-category.html
|
||||
targets:
|
||||
- local
|
||||
|
||||
- name: Use Cases
|
||||
funnel: Use Cases
|
||||
html: use-cases.html
|
||||
template: template-cat-landing.html # TODO: use-cases landing
|
||||
template: template-landing-category.html # TODO: use-cases landing
|
||||
targets:
|
||||
- local
|
||||
|
||||
- name: Dev Tools
|
||||
funnel: Dev Tools
|
||||
html: dev-tools.html
|
||||
template: template-cat-landing.html # TODO: dev tools landing
|
||||
template: template-landing-category.html # TODO: dev tools landing
|
||||
targets:
|
||||
- local
|
||||
|
||||
@@ -301,7 +301,7 @@ pages:
|
||||
- name: News
|
||||
funnel: News
|
||||
html: news.html
|
||||
template: template-cat-landing.html # TODO: news landing
|
||||
template: template-landing-category.html # TODO: news landing
|
||||
targets:
|
||||
- local
|
||||
|
||||
|
||||
@@ -421,6 +421,7 @@ th {
|
||||
line-height: 38px;
|
||||
color: #27a2db;
|
||||
text-decoration: none;
|
||||
transition: 0.5s;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav .active a {
|
||||
@@ -955,12 +956,8 @@ th {
|
||||
font-size:
|
||||
}
|
||||
|
||||
.foot-nav-col .children-display ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
.foot-nav-col .children-display li {
|
||||
.children-display ul {
|
||||
padding-left: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
.foot-nav-col .children-display li:before {
|
||||
content: "";
|
||||
|
||||
@@ -1,23 +1,32 @@
|
||||
<footer class="content-info" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-1"> </div>
|
||||
{% set funnels = [] %}
|
||||
{% for page in pages %}
|
||||
{% if page.funnel is defined and page.funnel not in funnels %}
|
||||
{% set parent_page = pages|selectattr('funnel', 'equalto', page.funnel)|first %}
|
||||
|
||||
<!--{#<li class="nav-item{% if currentpage == thisfunneltop %} active{% elif currentpage.funnel == thisfunneltop.name %} active-parent{% endif %}">
|
||||
<a class="nav-link" href="{{ thisfunneltop.html }}">{{ thisfunneltop.name }}</a>
|
||||
</li>#}-->
|
||||
|
||||
<div class="col-sm-3 foot-nav-col">
|
||||
<div class="col-sm-2 foot-nav-col">
|
||||
<h5><a class="foot-nav-link" href="{{ parent_page.html }}">{{ parent_page.name }}</a></h5>
|
||||
{% set depth=1 %}
|
||||
{% include 'template-page-children.html' %}
|
||||
</div><!--/.foot-nav-col -->
|
||||
|
||||
{% set _ = funnels.append(page.funnel) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="col-sm-2 foot-nav-col">
|
||||
<h5><a class="foot-nav-link" href="https://ripple.com/">Ripple <i class="fa fa-external-link"></i></a></h5>
|
||||
<div class="children-display">
|
||||
<ul>
|
||||
<li class="level-1"><a class="foot-nav-link" href="https://ripple.com/company/">Our Company <i class="fa fa-external-link"></i></a></li>
|
||||
<li class="level-1"><a class="foot-nav-link" href="https://ripple.com/company/careers/">Careers <i class="fa fa-external-link"></i></a></li>
|
||||
<li class="level-1"><a href="https://ripple.com/collateral/#xrp">XRP Resources <i class="fa fa-external-link"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!--/.foot-nav-col -->
|
||||
</div><!--/.row-->
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,16 +11,27 @@
|
||||
{% block main %}
|
||||
<h1 class="main-page-header">{{ currentpage.name }}</h1>
|
||||
|
||||
<section>
|
||||
{% for grouper, docpages in pages|selectattr("doc_type", "defined")|groupby("doc_type") %}
|
||||
<section class="container">
|
||||
<div class="row">
|
||||
{% set doc_types = [] %}
|
||||
{% for page in pages %}
|
||||
{% if page.doc_type is defined and page.doc_type not in doc_types %}
|
||||
{% set doc_type_top = pages|selectattr('doc_type', 'equalto', page.doc_type)|first %}
|
||||
<div class="col-sm-3">
|
||||
<div class="panel panel-default">
|
||||
<h3><a href="{{(docpages|list)[0].html}}">{{ grouper }}</a></h3>
|
||||
<ul>
|
||||
{% for cat, catpages in docpages|selectattr("category", "defined")|groupby("category") %}
|
||||
<li><a href="{{(catpages|first).html}}">{{ (catpages|first).name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><a href="{{doc_type_top.html}}">{{doc_type_top.name}}</a></h3>
|
||||
</div><!--/.panel-heading-->
|
||||
<div class="panel-body">
|
||||
{% set parent_page = doc_type_top %}
|
||||
{% set depth = 3 %}
|
||||
{% include 'template-page-children.html' %}
|
||||
</div><!--/.panel-body-->
|
||||
</div><!--/.panel-->
|
||||
</div><!--/.col-sm-3-->
|
||||
{% set _ = doc_types.append(page.doc_type) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div><!--/.row-->
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,60 +1,73 @@
|
||||
{% if parent_page is undefined %}
|
||||
{% set parent_page = currentpage %}
|
||||
{% endif %}
|
||||
{% if depth is undefined %}
|
||||
{% set depth = 5 %}
|
||||
{% endif %}
|
||||
|
||||
{% if parent_level is undefined %}
|
||||
{% if parent_page.funnel is undefined %}
|
||||
<!-- TEMPLATE ERROR: need funnel for children-display -->
|
||||
{% elif parent_page == pages|selectattr("funnel", "equalto", parent_page.funnel)|first %}
|
||||
{% set parent_level = "funnel" %}
|
||||
{% set level_2 = "doc_type" %}
|
||||
{% set level_3 = "category" %}
|
||||
{% elif parent_page == pages|selectattr("doc_type", "equalto", parent_page.doc_type)|first %}
|
||||
{% set parent_level = "doc_type" %}
|
||||
{% set level_2 = "category" %}
|
||||
{% set level_3 = "subcategory" %}
|
||||
{% elif parent_page == pages|selectattr("category", "equalto", parent_page.category)|first %}
|
||||
{% set parent_level = "category" %}
|
||||
{% set level_2 = "subcategory" %}
|
||||
{% set level_3 = None %}
|
||||
{% elif parent_page == pages|selectattr("subcategory", "equalto", parent_page.subcategory)|first %}
|
||||
{% set parent_level = "subcategory" %}
|
||||
{% set level_2 = None %}
|
||||
{% set level_3 = None %}
|
||||
{% else %}
|
||||
<!-- TEMPLATE ERROR: page {{parent_page.name}} is not the parent of anything? -->
|
||||
{% endif %}
|
||||
<!-- parent_level is {{parent_level}} -->
|
||||
{% set childpages = pages|selectattr(parent_level, "equalto", parent_page[parent_level])|list %}
|
||||
{% endif %}
|
||||
|
||||
<div class="children-display">
|
||||
<ul>
|
||||
{% set printed_subcategories = [] %}
|
||||
{% set printed_level2s = [] %}
|
||||
{% for page in childpages %}
|
||||
{% if page == parent_page %}{# skip parent #}
|
||||
|
||||
{% elif parent_level == "funnel" %}
|
||||
{% if page.doc_type is defined and page in childpages|selectattr("category", "undefined") %}
|
||||
{% elif level_2 == None or page[level_2] is undefined %}
|
||||
<li class="level-1"><a href="{{page.html}}">{{page.name}}</a></li>
|
||||
{% elif not childpages|selectattr("category", "defined")|list %}
|
||||
{# no categories in this funnel #}
|
||||
<li class="level-1"><a href="{{page.html}}">{{page.name}}</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% elif parent_level == "category" %}
|
||||
{% if page.subcategory is defined and (depth is undefined or depth > 1) %}
|
||||
{% if page.subcategory not in printed_subcategories %}
|
||||
{% for subpage in childpages|selectattr("subcategory", "equalto", page.subcategory) %}
|
||||
{% elif page[level_2] is defined %}
|
||||
{% if page[level_2] not in printed_level2s %}
|
||||
{% set printed_level3s = [] %}
|
||||
{% set subpages = childpages|selectattr(level_2, "equalto", page[level_2])|list %}
|
||||
{% for subpage in subpages %}
|
||||
{% if loop.index == 1 %}
|
||||
<li class="level-1"><a href="{{subpage.html}}">{{subpage.name}}</a></li>
|
||||
{% else %}
|
||||
{% if depth > 1 %}
|
||||
{% if level_3 == None or subpage[level_3] is undefined %}
|
||||
<li class="level-2"><a href="{{subpage.html}}">{{subpage.name}}</a></li>
|
||||
{% elif subpage[level_3] is defined %}
|
||||
{% if subpage[level_3] not in printed_level3s %}
|
||||
{% for subsubpage in subpages|selectattr(level_3, "equalto", subpage[level_3])|list %}
|
||||
{% if loop.index == 1 %}
|
||||
<li class="level-2"><a href="{{subsubpage.html}}">{{subsubpage.name}}</a></li>
|
||||
{% elif depth > 2 %}
|
||||
<li class="level-3"><a href="{{subsubpage.html}}">{{subsubpage.name}}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% set _ = printed_subcategories.append(page.subcategory) %}
|
||||
{% set _ = printed_level3s.append(subpage[level_3]) %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{# non-subcategory page #}
|
||||
<li class="level-1"><a href="{{page.html}}">{{page.name}}</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<!-- TEMPLATE WARNING: unhandled case -->
|
||||
<li class="level-1"><a href="{{page.html}}">{{page.name}}</a></li>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% set _ = printed_level2s.append(page[level_2]) %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<!-- TEMPLATE warning: else case -->
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user