Make current tab bold

This commit is contained in:
Joscha 2023-08-05 21:17:46 +02:00
parent db814b6d40
commit 52e2d74b96
3 changed files with 7 additions and 2 deletions

View file

@ -18,6 +18,7 @@ struct Ref {
struct IndexTemplate { struct IndexTemplate {
base: String, base: String,
repo_name: String, repo_name: String,
current: String,
refs: Vec<Ref>, refs: Vec<Ref>,
} }
@ -43,6 +44,7 @@ pub async fn get(
Ok(IndexTemplate { Ok(IndexTemplate {
base: config.web.base(), base: config.web.base(),
repo_name: config.repo.name(), repo_name: config.repo.name(),
current: "index".to_string(),
refs, refs,
}) })
} }

View file

@ -23,7 +23,6 @@ nav>* {
} }
nav> :first-child { nav> :first-child {
font-weight: bold;
padding-left: 0; padding-left: 0;
border: none; border: none;
} }
@ -34,6 +33,10 @@ nav> :last-child {
border: none; border: none;
} }
nav>.current {
font-weight: bold;
}
nav a { nav a {
color: black; color: black;
} }

View file

@ -11,7 +11,7 @@
<body> <body>
<nav> <nav>
<a href="{{ base }}/"> <a href="{{ base }}/" {% if current=="index" %} class="current" {% endif %}>
<img src="{{ base }}/logo.svg"> <img src="{{ base }}/logo.svg">
{{ repo_name }} {{ repo_name }}
</a> </a>