forked from luizdepra/hugo-coder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And notice shortcodes (luizdepra#537)
* Added information panel shortcodes (luizdepra#437) * Added information panel shortcodes * Fixed dark mixin * Moved mixin location to correct location Co-authored-by: Luiz F. A. de Prá <[email protected]> * Fix SCSS styling * Update generated files * Fix notice HTML * Fix Makefile * Rename JS file * Adsd emoji support for lang selectors * Fix notices and other things * Fix JS on template * Update example content * Update images * Update generated files * Fix netlify preview * Fix netlify preview build * Fix netlify theme path Co-authored-by: Jian Liew <[email protected]>
- Loading branch information
Showing
72 changed files
with
8,661 additions
and
2,164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
**/themes/ | ||
demo/ | ||
.hugo/* | ||
!.hugo/version | ||
exampleSite/public/ | ||
exampleSite/resources/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
HUGO_BIN=hugo | ||
|
||
.PHONY: prepare release build demo clean | ||
.PHONY: build demo release | ||
|
||
build: prepare | ||
$(HUGO_BIN) --source demo | ||
build: | ||
$(HUGO_BIN) --themesDir=../.. --source=exampleSite | ||
|
||
demo: prepare | ||
$(HUGO_BIN) server --buildDrafts --source demo | ||
demo: | ||
$(HUGO_BIN) server -D --themesDir=../.. --source=exampleSite | ||
|
||
release: build | ||
rm -rf ./resources && cp -r ./demo/resources ./resources | ||
|
||
prepare: clean | ||
mkdir -p demo/themes/hugo-coder | ||
rsync -av exampleSite/ demo | ||
rsync -av --exclude='demo' --exclude='exampleSite' --exclude='.git' . demo/themes/hugo-coder | ||
|
||
clean: | ||
rm -rf demo | ||
rm -rf ./resources && cp -r ./exampleSite/resources ./resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const body = document.body; | ||
const darkModeToggle = document.getElementById('dark-mode-toggle'); | ||
const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); | ||
|
||
// Check if user preference is set, if not check value of body class for light or dark else it means that colorscheme = auto | ||
if (localStorage.getItem("colorscheme")) { | ||
setTheme(localStorage.getItem("colorscheme")); | ||
} else if (body.classList.contains('colorscheme-light') || body.classList.contains('colorscheme-dark')) { | ||
setTheme(body.classList.contains("colorscheme-dark") ? "dark" : "light"); | ||
} else { | ||
setTheme(darkModeMediaQuery.matches ? "dark" : "light"); | ||
} | ||
|
||
darkModeToggle.addEventListener('click', () => { | ||
setTheme(body.classList.contains("colorscheme-dark") ? "light" : "dark"); | ||
}); | ||
|
||
darkModeMediaQuery.addListener((event) => { | ||
setTheme(event.matches ? "dark" : "light"); | ||
}); | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
let node = document.querySelector('.preload-transitions'); | ||
node.classList.remove('preload-transitions'); | ||
}); | ||
|
||
function setTheme(theme) { | ||
body.classList.remove('colorscheme-auto'); | ||
inverse = theme === 'dark' ? 'light' : 'dark'; | ||
localStorage.setItem('colorscheme', theme); | ||
body.classList.remove('colorscheme-' + inverse); | ||
body.classList.add('colorscheme-' + theme); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.