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" title = "Katedra"
[extra]
color = "#B48EAD"
+++ +++

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

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

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

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

@ -12,8 +12,14 @@
{% if items %} {% if items %}
<ul> <ul>
{% for item in items %} {% 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> <a href="{{ section.permalink }}">{{ section.title }}</a>
{% if section.subsections %} {% if section.subsections %}
<ul> <ul>

Loading…
Cancel
Save