Skip to content

Commit

Permalink
fix: set default values for config
Browse files Browse the repository at this point in the history
  • Loading branch information
not-matthias committed Jul 9, 2024
1 parent f20ab87 commit bee8dd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<link rel="alternate" type="application/atom+xml" title="{{ config.title }}" href="{{ get_url(path="atom.xml", trailing_slash=false) }}">


{% set theme = config.extra.theme %}
{% set theme = config.extra.theme | default(value="toggle") %}
{% if theme == "dark" %}
<link rel="stylesheet" type="text/css" href="{{ get_url(path='theme/dark.css') }}" />
{% elif theme == "light" %}
Expand Down
6 changes: 3 additions & 3 deletions templates/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<a href={{ config.base_url }}>{{ config.title }}</a>

<div class="socials">
{% for social in config.extra.socials %}
{% for social in config.extra.socials | default(value=[]) %}
<a rel="me" href="{{ social.url }}" class="social">
<img alt={{ social.name }} src={{ get_url(path="social_icons/" ~ social.icon ~ ".svg") }}>
</a>
Expand All @@ -12,11 +12,11 @@
</div>

<nav>
{% for menu in config.extra.menu %}
{% for menu in config.extra.menu | default(value=[]) %}
<a href={{ get_url(path=menu.url) }} style="margin-left: 0.5em">{{ menu.name }}</a>
{% endfor %}

{% if config.extra.theme == "toggle" %}
{% if config.extra.theme | default(value="toggle") == "toggle" %}
<a id="dark-mode-toggle" onclick="toggleTheme(); event.preventDefault();" href="#">
<img src={{ get_url(path="feather/sun.svg") }} id="sun-icon" style="filter: invert(1);" alt="Light" />
<img src={{ get_url(path="feather/moon.svg") }} id="moon-icon" alt="Dark" />
Expand Down

0 comments on commit bee8dd9

Please sign in to comment.