mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Use more sophisticated link and title includes
This commit is contained in:
parent
c19f9db91c
commit
48f91311b6
3 changed files with 14 additions and 17 deletions
1
_includes/link.html
Normal file
1
_includes/link.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{ include.url | remove: ".html" | prepend: site.baseurl | replace: '//', '/' }}
|
||||
1
_includes/title.html
Normal file
1
_includes/title.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{ include.doc.title | remove_first: include.coll.label | remove_first: "/ " }}
|
||||
|
|
@ -1,26 +1,21 @@
|
|||
---
|
||||
layout: default
|
||||
---
|
||||
{% for coll in site.collections %}
|
||||
{% if coll.sidebar %}
|
||||
<h2>{{ coll.caption }}</h2>
|
||||
{% for page in coll.docs %}
|
||||
<h3>{{ page.title | remove_first: coll.label | remove_first: '/ '}}</h3>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<div class="container" style="padding-top: 24px;">
|
||||
<div class="row">
|
||||
<div class="col-md-3" id="toc" style="padding-top: 16px;">
|
||||
{% for group in site.data.sidebar %}
|
||||
<div class="list-group">
|
||||
<a class="list-group-item active">{{ group[0] }}</a>
|
||||
{% for link in group[1] %}
|
||||
<a class="list-group-item"
|
||||
href="{% if link.first[1] contains 'http' %}{{ link.first[1] }}{% else %}{{ link.first[1] | prepend: site.baseurl | replace: '//', '/'}}{% endif %}">
|
||||
{{ link.first[0] }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% for coll in site.collections %}
|
||||
{% if coll.sidebar %}
|
||||
<div class="list-group">
|
||||
<a class="list-group-item active">{{ coll.caption }}</a>
|
||||
{% for doc in coll.docs %}
|
||||
{% capture url %}/{{ site.collections_dir}}/{{ doc.url }}{% endcapture %}
|
||||
<a class="list-group-item"
|
||||
href="{% include link.html url=url %}">
|
||||
{% include title.html doc=doc coll=coll %}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-md-9" id="content">
|
||||
|
|
|
|||
Loading…
Reference in a new issue