-
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.
updated htmx-hyperscript and refactored index.html
- Loading branch information
Nico Bakomihalis
committed
Dec 12, 2023
1 parent
9bf11a3
commit 885d830
Showing
4 changed files
with
19 additions
and
6 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
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 |
---|---|---|
|
@@ -6,13 +6,13 @@ | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<title>nicobako.dev</title> | ||
<title>nicobako.github.io</title> | ||
|
||
<!-- md-block : markdown rendering --> | ||
<script type="module" src="https://md-block.verou.me/md-block.js"></script> | ||
|
||
<!-- htmx : SPA-like functionality --> | ||
<script src="https://unpkg.com/[email protected].2"></script> | ||
<script src="https://unpkg.com/[email protected].9"></script> | ||
|
||
<!-- hyperscript : JavaScript, hold the JavaScript --> | ||
<script src="https://unpkg.com/[email protected]"></script> | ||
|
@@ -33,12 +33,21 @@ | |
</head> | ||
|
||
<body class="column"> | ||
<script type="text/hyperscript"> | ||
def render_markdown(src) | ||
set templ to `<md-block src=${src}>Failed to load ${src}</md-block>` | ||
then put templ into #content.innerHTML | ||
end | ||
</script> | ||
|
||
<h1><a href="/">Nico Bako</a></h1> | ||
<button _="on click toggle @data-theme='light' on <:root/>">Dark/Light</button> | ||
<div class="row"> | ||
<button hx-get="/pages/about_me/index.html" hx-target="#content" hx-trigger="load,click">About Me</button> | ||
<button hx-get="./pages/about_site/index.html" hx-target="#content">About Site</button> | ||
<button | ||
_= "on click or load render_markdown('/pages/about_me.md')" | ||
>About Me</button> | ||
<button | ||
_= "on click render_markdown('/README.md')">About Site</button> | ||
</div> | ||
<div id="content"></div> | ||
|
||
|
File renamed without changes.
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 |
---|---|---|
|
@@ -16,8 +16,8 @@ self.addEventListener("install", (event) => { | |
"/pages/about_me/index.html", | ||
"/pages/about_site/index.html", | ||
"https://md-block.verou.me/md-block.js", | ||
"https://unpkg.com/[email protected].2", | ||
"https://unpkg.com/[email protected].8", | ||
"https://unpkg.com/[email protected].9", | ||
"https://unpkg.com/[email protected].12", | ||
]), | ||
), | ||
); | ||
|