Skip to content

Commit

Permalink
Implement dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosschults committed Nov 11, 2024
1 parent a799d15 commit 2f7e36f
Show file tree
Hide file tree
Showing 7 changed files with 583 additions and 375 deletions.
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

{% include footer.html %}
{% include analytics.html %}
<script src="{{ '/js/dark-mode.js' | relative_url }}"></script>
</body>

</html>
23 changes: 10 additions & 13 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,24 @@ <h2 class="postTitle" itemprop="headline">{{ page.title }}</h2>
{% endfor %}
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables
*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
// Store these for reloads
window.disqus_identifier = window.location.pathname;
window.disqus_url = window.location.href;

// Set initial theme - match it with the site's theme
const currentTheme = document.body.getAttribute('data-theme') || 'light';
this.page.theme = currentTheme === 'dark' ? 'dark' : 'light';
};
*/
(function() { // DON'T EDIT BELOW THIS LINE

(function() {
var d = document, s = d.createElement('script');

s.src = '//carlosschultsblog.disqus.com/embed.js';

s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>

<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
</div>

</article>
Loading

0 comments on commit 2f7e36f

Please sign in to comment.