|
7 | 7 | <span class='icon-bar'></span> |
8 | 8 | </button> |
9 | 9 | <a class='navbar-brand navbar-logo' href='/index.html'><img src='{{ site.baseurl | append: "/assets/img/site/rse.png" }}'/></a> |
10 | | - {%- # a class='navbar-brand' href='/index.html' de-RSE /a -%} |
| 10 | + <!-- a class='navbar-brand' href='/index.html'>de-RSE</a --> |
11 | 11 | </div> |
12 | 12 | <div id='navbar' class='collapse navbar-collapse'> |
13 | 13 | <ul class='nav navbar-nav'> |
14 | | - {%- # Set variable "lang" to reflect page language -%} |
15 | | - {%- if page.url contains "/en/" -%} |
16 | | - {%- assign lang = "/en/" -%} |
17 | | - {%- assign conf2019_title = "deRSE20 Conference" -%} |
18 | | - {%- elsif page.url contains "/de/"-%} |
19 | | - {%- assign lang ="/de/"-%} |
20 | | - {%- assign conf2019_title = "deRSE20 Konferenz"-%} |
21 | | - {%- endif-%} |
22 | | - {%- # Set variable "page_conf2019" to reflect if we are on a conference page -%} |
23 | | - {%- assign page_conf2019 = false-%} |
24 | | - {%- assign conf2019_link = "../deRSE20"-%} |
25 | | - {%- if page.url contains "/conf2019/"-%} |
26 | | - {%- assign page_conf2019 = true-%} |
27 | | - {%- assign conf2019_link = "index.html"-%} |
| 14 | + <!-- Set variable "lang" to reflect page language --> |
| 15 | + {% if page.url contains "/en/" %} |
| 16 | + {% assign lang = "/en/" %} |
| 17 | + {% assign conf2019_title = "deRSE20 Conference" %} |
| 18 | + {% elsif page.url contains "/de/" %} |
| 19 | + {% assign lang ="/de/" %} |
| 20 | + {% assign conf2019_title = "deRSE20 Konferenz" %} |
| 21 | + {% endif %} |
| 22 | + <!-- Set variable "page_conf2019" to reflect if we are on a conference page --> |
| 23 | + {% assign page_conf2019 = false %} |
| 24 | + {% assign conf2019_link = "../deRSE20" %} |
| 25 | + {% if page.url contains "/conf2019/" %} |
| 26 | + {% assign page_conf2019 = true %} |
| 27 | + {% assign conf2019_link = "index.html" %} |
28 | 28 | <li class='navbar-conflink'><a href='{{ conf2019_link | prepend: site.baseurl }}'>{{ conf2019_title }}</a></li> |
29 | | - {%- endif-%} |
30 | | - {%- # Get a list of pages sorted by the "weight" variable from the YAML header of each page file -%} |
31 | | - {%- assign pg = site.pages | sort: "weight"-%} |
32 | | - {%- for node in pg-%} |
33 | | - {%- # Neglect imprint.html and index.html in either language -%} |
34 | | - {%- unless node.path contains "imprint" or node.path contains "index"-%} |
35 | | - {%- # Set variable "node_conf2019" if node links to a conference page -%} |
36 | | - {%- assign node_conf2019 = false-%} |
37 | | - {%- if node.url contains "/conf2019/"-%} |
38 | | - {%- assign node_conf2019 = true-%} |
39 | | - {%- endif-%} |
40 | | - {%- # Process page only if it's on the same path as the current page regarding language and conference -%} |
41 | | - {%- if node.url contains lang and node_conf2019 == page_conf2019-%} |
42 | | - {%- # node.url does not contain file endings and is relative: make absolute and append file ending -%} |
43 | | - {%- if node_conf2019-%} |
44 | | - {%- # Identify parents and children for dropdown -%} |
45 | | - {%- if node.isparent == true-%} |
46 | | - {%- capture parent_id-%} {{ node.name | remove: ".md" }}{%- endcapture-%} |
| 29 | + {% endif %} |
| 30 | + <!-- Get a list of pages sorted by the "weight" variable from the YAML header of each page file --> |
| 31 | + {% assign pg = site.pages | sort: "weight" %} |
| 32 | + {% for node in pg %} |
| 33 | + <!-- Neglect imprint.html and index.html in either language --> |
| 34 | + {% unless node.path contains "imprint" or node.path contains "index" %} |
| 35 | + <!-- Set variable "node_conf2019" if node links to a conference page --> |
| 36 | + {% assign node_conf2019 = false %} |
| 37 | + {% if node.url contains "/conf2019/" %} |
| 38 | + {% assign node_conf2019 = true %} |
| 39 | + {% endif %} |
| 40 | + <!-- Process page only if it's on the same path as the current page regarding language and conference --> |
| 41 | + {% if node.url contains lang and node_conf2019 == page_conf2019 %} |
| 42 | + <!-- node.url does not contain file endings and is relative: make absolute and append file ending --> |
| 43 | + {% if node_conf2019 %} |
| 44 | + <!-- Identify parents and children for dropdown --> |
| 45 | + {% if node.isparent == true %} |
| 46 | + {% capture parent_id %}{{ node.name | remove: ".md" }}{% endcapture %} |
47 | 47 | <li class='navbar-conflink dropdown'> |
48 | 48 | <a class="nav-link dropdown-toggle" href='{{ node.url | prepend: site.baseurl | append: ".html" }}' id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ node.title }} ▼</a> |
49 | 49 | <div class="dropdown-menu" aria-labelledby="navbarDropdown"> |
50 | | - {%- for node in pg-%} |
51 | | - {%- if node.parent == parent_id and node.url contains lang%} |
| 50 | + {% for node in pg %} |
| 51 | + {% if node.parent == parent_id and node.url contains lang%} |
52 | 52 | <a class="dropdown-item" href="{{ node.url | prepend: site.baseurl | append: ".html" }}">{{ node.title }}</a> |
53 | | - {%- endif-%} |
54 | | - {%- endfor-%} |
| 53 | + {% endif %} |
| 54 | + {% endfor %} |
55 | 55 | </div> |
56 | 56 | </li> |
57 | | - {%- capture parent_id-%} "false"{%- endcapture-%} |
58 | | - {%- elsif node.ischild != true-%} |
| 57 | + {% capture parent_id %}"false"{% endcapture %} |
| 58 | + {% elsif node.ischild != true %} |
59 | 59 | <li class='navbar-conflink'><a href='{{ node.url | prepend: site.baseurl | append: ".html" }}'>{{ node.title }}</a></li> |
60 | | - {%- endif-%} |
61 | | - {%- else-%} |
| 60 | + {% endif %} |
| 61 | + {% else %} |
62 | 62 | <li><a href='{{ node.url | prepend: site.baseurl | append: ".html" }}'>{{ node.title }}</a></li> |
63 | | - {%- endif-%} |
64 | | - {%- endif-%} |
65 | | - {%- endunless-%} |
66 | | - {%- endfor-%} |
| 63 | + {% endif %} |
| 64 | + {% endif %} |
| 65 | + {% endunless %} |
| 66 | + {% endfor %} |
67 | 67 | </ul> |
68 | 68 | <ul class='nav navbar-nav pull-right'> |
69 | | - {%- # Build language-relative URL from current URL -%} |
70 | | - {%- assign en-url = page.url | replace: "/de/", "/en/"-%} |
71 | | - {%- assign de-url = page.url | replace: "/en/", "/de/"-%} |
72 | | - {%- # Ignore index pages, as their URL will always be '/{language}/', not a specific site -%} |
73 | | - {%- unless page.path contains "index"-%} |
74 | | - {%- assign en-url = en-url | append: ".html"-%} |
75 | | - {%- assign de-url = de-url | append: ".html"-%} |
76 | | - {%- endunless-%} |
77 | | - {%- if page.path contains "404"-%} |
78 | | - {%- assign en-url = "/en/"-%} |
79 | | - {%- assign de-url = "/de/"-%} |
80 | | - {%- endif-%} |
| 69 | + <!-- Build language-relative URL from current URL --> |
| 70 | + {% assign en-url = page.url | replace: "/de/", "/en/" %} |
| 71 | + {% assign de-url = page.url | replace: "/en/", "/de/" %} |
| 72 | + <!-- Ignore index pages, as their URL will always be '/{language}/', not a specific site --> |
| 73 | + {% unless page.path contains "index" %} |
| 74 | + {% assign en-url = en-url | append: ".html" %} |
| 75 | + {% assign de-url = de-url | append: ".html" %} |
| 76 | + {% endunless %} |
| 77 | + {% if page.path contains "404" %} |
| 78 | + {% assign en-url = "/en/" %} |
| 79 | + {% assign de-url = "/de/" %} |
| 80 | + {% endif %} |
81 | 81 |
|
82 | | - {%- if lang contains "/en/"-%} |
| 82 | + {% if lang contains "/en/" %} |
83 | 83 | <li><a href='{{ de-url | prepend: site.baseurl }}'>German/Deutsch</a></li> |
84 | | - {%- else-%} |
| 84 | + {% else %} |
85 | 85 | <li><a href='{{ en-url | prepend: site.baseurl }}'>Englisch/English</a></li> |
86 | | - {%- endif-%} |
| 86 | + {% endif %} |
87 | 87 | </ul> |
88 | 88 | </div> |
89 | | - {%- #/.nav-collapse -%} |
| 89 | + <!--/.nav-collapse --> |
90 | 90 | </div> |
91 | 91 | </nav> |
0 commit comments