Commit c86bb7d0 authored by David Hrbáč's avatar David Hrbáč

Algorithm to detect root page

parent 55040cde
......@@ -4,16 +4,25 @@
{% if toc_ | first is defined and "\x3ch1 id=" in page.content %}
{% set toc_ = (toc_ | first).children %}
{% endif %}
{% if page.abs_url.rstrip('index.html').rstrip('/') == '' %}
{% set it4i_link = config.repo_url + '/edit/master/docs.it4i/index.md' %}
{% set it4i_page = '/index.md' %}
{% set it4i_url = 'https://docs.it4i.cz' %}
{% else %}
{% set it4i_link = config.repo_url + '/edit/master/docs.it4i' + page.abs_url.rstrip('index.html').rstrip('/') + '.md' %}
{% set it4i_page = page.abs_url.rstrip('index.html').rstrip('/') + '.md' %}
{% set it4i_url = 'https://docs.it4i.cz' + page.abs_url %}
{% endif %}
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="{{ config.repo_url }}/edit/master/docs.it4i{{ page.abs_url.rstrip('index.html').rstrip('/') }}.md" title="Edit This Page" class="md-nav__link" target="_blank">
<a href="{{ it4i_link }}" title="Edit This Page" class="md-nav__link" target="_blank">
<i class="md-icon md-icon--edit">
</i>
Edit This Page
</a>
</li>
<li class="md-nav__item">
<a href="https://code.it4i.cz/sccs/docs.it4i.cz/issues/new?issue%5Bdescription%5D=Requested change in page [{{ page.abs_url.rstrip('index.html').rstrip('/') }}.md](https://docs.it4i.cz{{ page.abs_url }}) /cc @hrb33 @kru0052" title="Request Change" class="md-nav__link" target="_blank">
<a href="https://code.it4i.cz/sccs/docs.it4i.cz/issues/new?issue%5Bdescription%5D=Requested change in page [{{ it4i_page }}]({{ it4i_url }}) /cc @hrb33 @kru0052" title="Request Change" class="md-nav__link" target="_blank">
<i class="md-icon md-icon--check">
</i>
Request Change
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment