Zobrazování barev sekcí v primární navigaci

Barva sekce je definována v hlavičce Markdown dokumentu pomocí
`extra.color`.
remotes/1722757888236843906/tmp_refs/heads/search
Emil Miler 4 years ago
parent 325f2527d7
commit 23883a13c6

@ -1,4 +1,7 @@
+++
title = "Katedra"
[extra]
color = "#B48EAD"
+++

@ -1,4 +1,7 @@
+++
title = "Studenti"
[extra]
color = "#D08770"
+++

@ -1,4 +1,7 @@
+++
title = "Uchazeči"
[extra]
color = "#A3BE8C"
+++

@ -1,4 +1,7 @@
+++
title = "Vědecká činnost"
[extra]
color = "#8FBCBB"
+++

@ -50,7 +50,7 @@ header {
position: relative;
a { padding: .9rem }
a:hover, li:hover { color: #5E81AC }
li:hover { color: var(--color) }
li:hover ul { display: grid }
@ -64,7 +64,7 @@ header {
margin-top: .9rem;
padding: 1rem;
background-color: #FFF;
border-top: 5px solid #5E81AC;
border-top: 5px solid var(--color);
box-shadow: 0px 1px 9px #00000033;
font-size: 1rem;
font-weight: normal;
@ -74,7 +74,7 @@ header {
display: block;
padding: .5em;
&:hover { color: #5E81AC }
&:hover { color: var(--color) }
}
}

@ -12,8 +12,14 @@
{% if items %}
<ul>
{% for item in items %}
<li>
{% set section = get_section(path=item.path~"/_index.md") %}
{% set section = get_section(path=item.path~"/_index.md") %}
<li
{% if section.extra.color %}
style="--color: {{ section.extra.color }}"
{% else %}
style="--color: #5E81AC"
{% endif %}
>
<a href="{{ section.permalink }}">{{ section.title }}</a>
{% if section.subsections %}
<ul>

Loading…
Cancel
Save