Skip to content

Commit

Permalink
Merge branch 'release/1.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
tenkeyless committed Nov 28, 2024
2 parents 95a7b03 + 3a2ea06 commit e407747
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
9 changes: 0 additions & 9 deletions hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Hugo configuration file
title: Keras Deep Learning

# import hextra as module
module:
imports:
- path: github.com/imfing/hextra
Expand All @@ -11,7 +9,6 @@ markup:
goldmark:
renderer:
unsafe: true

# enable hextra syntax highlight
highlight:
noClasses: false
Expand Down Expand Up @@ -49,19 +46,13 @@ params:
displayLogo: true
logo:
path: images/logo.png

footer:
displayCopyright: false
displayPoweredBy: true

editURL:
enable: false
base: "https://github.com/tenkeyless/keras_site/edit/main/content"

theme:
default: system
displayToggle: true

defaultContentLanguage: en
languages:
en:
Expand Down
27 changes: 27 additions & 0 deletions layouts/partials/custom/head-end.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script>
(function () {
// 시스템 테마 변경 감지 객체 생성
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");

// 시스템 테마와 저장된 테마를 비교하여 필요하면 localStorage에서 항목 제거
function checkAndRemoveStoredTheme() {
const systemThemeIsDark = mediaQuery.matches;
const storedTheme = localStorage.getItem("color-theme");

if (
(systemThemeIsDark && storedTheme === "dark") ||
(!systemThemeIsDark && storedTheme === "light")
) {
localStorage.removeItem("color-theme");
}
}

// 페이지 로드 시 초기 실행
checkAndRemoveStoredTheme();

// 시스템 테마 변경 시 이벤트 리스너 등록
mediaQuery.addEventListener("change", function () {
checkAndRemoveStoredTheme();
});
})();
</script>

0 comments on commit e407747

Please sign in to comment.