diff options
| author | Eltrac <eltrac233@gmail.com> | 2024-11-24 22:40:24 +0800 |
|---|---|---|
| committer | Eltrac <eltrac233@gmail.com> | 2024-11-24 22:40:24 +0800 |
| commit | f17c8316a9333e8f52856196ea1f3516fe097c19 (patch) | |
| tree | 7b7fc4915c8c3949045b3bd4db3d4a82eb1bb9f4 | |
| parent | 90a357d76bc8c45175ba3599399984da6786eb98 (diff) | |
perf(waline): disable pageview in localhost
| -rw-r--r-- | hugo.toml | 10 | ||||
| -rw-r--r-- | themes/yinyang/assets/css/index.css | 2 |
2 files changed, 9 insertions, 3 deletions
@@ -23,12 +23,18 @@ postFooterContent = ''' <script type="module"> import { init } from '/js/waline.js'; - init({ + const options = { el: '#waline', serverURL: 'https://waline.geedea.pro', dark: 'auto', pageview: true, - }); + }; + + if (location.href.includes('localhost') || location.href.includes('127.0.0.1')) { + options.pageview = false; + } + + init(options); </script> ''' favicon = "/favicon.png" diff --git a/themes/yinyang/assets/css/index.css b/themes/yinyang/assets/css/index.css index b8f4a771..6eb98820 100644 --- a/themes/yinyang/assets/css/index.css +++ b/themes/yinyang/assets/css/index.css @@ -42,7 +42,7 @@ body { -webkit-font-smoothing: antialiased; margin: 0 20px; background-color: var(--background-color); - color: var(--text-color) + color: var(--text-color); } body::before { |
