diff options
| -rw-r--r-- | layout/_partial/head.ejs | 1 | ||||
| -rw-r--r-- | layout/_partial/scripts.ejs | 27 | ||||
| -rw-r--r-- | layout/post.ejs | 2 | ||||
| -rw-r--r-- | source/css/style.css | 2 | 
4 files changed, 17 insertions, 15 deletions
| diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 1206434..3d4ee79 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -21,5 +21,6 @@      <!-- Scripts and styles -->      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma/css/bulma.min.css">      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css"> +    <link rel="stylesheet" type="text/css" href="https://unpkg.com/bulma-prefers-dark" />      <%- css("css/style.css") %>  </head>
\ No newline at end of file diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index a60011f..c07d83d 100644 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -11,7 +11,6 @@  <% } %>  <!-- Darkmode support --> -<link rel="stylesheet" type="text/css" href="https://unpkg.com/bulma-prefers-dark" />  <%- js('js/darkmode.js') %>  <script>      var darklistener = new DarkmodeListener(); @@ -25,18 +24,20 @@      <link id="highlight-dark-theme" rel="stylesheet"          href="https://cdn.jsdelivr.net/npm/highlightjs@9.16.2/styles/<%= theme.highlight.darkmode %>.min.css">      <script> -        const theme_selector = (mode) => { -            if (mode === SystemDarkmodePrefrence.dark) { -                document.getElementById("highlight-light-theme").setAttribute("disabled", "disabled"); -                document.getElementById("highlight-dark-theme").removeAttribute("disabled"); -            } else { -                document.getElementById("highlight-dark-theme").setAttribute("disabled", "disabled"); -                document.getElementById("highlight-light-theme").removeAttribute("disabled"); -            } -        }; -        theme_selector(darklistener.mode()); -        darklistener.add(theme_selector); -        hljs.initHighlightingOnLoad(); +        window.addEventListener("load", () => { +            const theme_selector = (mode) => { +                if (mode === SystemDarkmodePrefrence.dark) { +                    document.getElementById("highlight-light-theme").setAttribute("disabled", "disabled"); +                    document.getElementById("highlight-dark-theme").removeAttribute("disabled"); +                } else { +                    document.getElementById("highlight-dark-theme").setAttribute("disabled", "disabled"); +                    document.getElementById("highlight-light-theme").removeAttribute("disabled"); +                } +            }; +            theme_selector(darklistener.mode()); +            darklistener.add(theme_selector); +            hljs.initHighlightingOnLoad(); +        }, false);      </script>  <% } %> diff --git a/layout/post.ejs b/layout/post.ejs index e0eed90..ae30353 100644 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -1,4 +1,4 @@ -<article class="post"> +<article class="post content">      <!-- Post thumbnail with lazayload support -->      <div class="post-thumbnail" style="background-image: url('<%= page.thumbnail %>');"></div> diff --git a/source/css/style.css b/source/css/style.css index 1fe0a0e..60e5df1 100644 --- a/source/css/style.css +++ b/source/css/style.css @@ -1,3 +1,3 @@  pre { -    background-color: inherit !important; +    background-color: none !important;  }
\ No newline at end of file | 
