mirror of
https://github.com/Speyll/anemone.git
synced 2024-11-21 20:56:29 +00:00
Merge pull request #13 from HeilAsuka/main
Merged! Thanks you very much for your contribution. Much appreciated 🤗
This commit is contained in:
commit
7cf2f0a817
2 changed files with 51 additions and 23 deletions
|
@ -3,6 +3,7 @@
|
|||
{% block content %}
|
||||
<div><a href="..">..</a>/<span class="metaData">{{ page.slug }}</span></div>
|
||||
<time datetime="{{ page.date }}">Published on: <span class="metaData">{{ page.date }}</span></time>
|
||||
<address rel="author">By <span class="metaData">{{config.extra.author}}</span></address>
|
||||
<h1>{{ page.title }}</h1>
|
||||
|
||||
{% if page.toc and page.extra.toc %}
|
||||
|
|
|
@ -3,12 +3,36 @@
|
|||
{% for nav_item in config.extra.header_nav %}
|
||||
{% set current_nav_item = nav_item[lang] %}
|
||||
{% if current_nav_item and current_nav_item.name %}
|
||||
<a href="{{ get_url(path=current_nav_item.url) }}" {% if current_nav_item.new_tab %}target="_blank" rel="noreferrer noopener"{% endif %}>{{ current_nav_item.name }}</a>
|
||||
<a href="{{ get_url(path=current_nav_item.url) }}" {% if current_nav_item.new_tab %}target="_blank"
|
||||
rel="noreferrer noopener" {% endif %}>{{ current_nav_item.name }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<div class="themeSwitch">
|
||||
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use></svg></button>
|
||||
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use></svg></button>
|
||||
{% if not config.extra.default_mode %}
|
||||
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"><svg
|
||||
class="icons icons__background">
|
||||
<use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use>
|
||||
</svg></button>
|
||||
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background">
|
||||
<use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use>
|
||||
</svg></button>
|
||||
{% elif config.extra.default_mode and config.extra.default_mode == "light" %}
|
||||
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"><svg
|
||||
class="icons icons__background">
|
||||
<use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use>
|
||||
</svg></button>
|
||||
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background">
|
||||
<use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use>
|
||||
</svg></button>
|
||||
{% elif config.extra.default_mode and config.extra.default_mode == "dark" %}
|
||||
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background">
|
||||
<use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use>
|
||||
</svg></button>
|
||||
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"><svg
|
||||
class="icons icons__background">
|
||||
<use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use>
|
||||
</svg></button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
@ -22,4 +46,7 @@
|
|||
theme && setTheme(theme);
|
||||
}
|
||||
getTheme()
|
||||
{% if config.extra.default_mode %}
|
||||
setTheme("{{ config.extra.default_mode }}")
|
||||
{% endif %}
|
||||
</script>
|
Loading…
Reference in a new issue