Skip to content

Commit

Permalink
Merge pull request #101 from sproogen/feature/97-darkmode-never
Browse files Browse the repository at this point in the history
#97 Add dark mode never option
  • Loading branch information
sproogen authored Apr 23, 2020
2 parents 5f33b3a + b45612c commit a85d874
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ A full example of the _config.yml can be found [here](https://github.com/sprooge
##### Dark Mode
Dark mode is configured via _config.yml
```
darkmode: true/false
darkmode: trye (options: true, false, never)
```
When dark mode is `true` the site will show the dark theme for everyone
When dark mode is `false` the site will not show the dark theme, but it will still respect the users device preferences
When dark mode is `never` the site will never be shown in the dark theme

##### _data/education.yml
A list of all your education, each education will follow this format
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ email: Your email (optional)
phone: Your phone number (optional)
website: Your website (eg. https://google.com)(optional)

# Dark Mode (true/false/never)
darkmode: false

# Social links
Expand Down
6 changes: 4 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{%- include head.html -%}

<body class="{% if site.darkmode %}dark{% endif %}">
<body class="{% if site.darkmode == true and site.darkmode != 'never' %}dark{% endif %}">

{%- include header.html -%}

Expand Down Expand Up @@ -36,7 +36,9 @@
</main>

{%- include footer.html -%}
<script src="{{ '/assets/js/index.js' | relative_url }}"></script>
{% if site.darkmode == false %}
<script src="{{ '/assets/js/index.js' | relative_url }}"></script>
{% endif %}
</body>

</html>

0 comments on commit a85d874

Please sign in to comment.