Figuring out vite building (no vite building)

This commit is contained in:
marleyrae 2023-06-10 14:49:15 -07:00
parent 46b3bd1d85
commit 7775f3016d
4 changed files with 34 additions and 35 deletions

59
menu.js
View file

@ -1,39 +1,40 @@
/* -------------------------------------------------------------------------------------- find and import config ---- */
const siteRoot = '/' + location.pathname.split('/')[1]
const {wayback} = await import(/* @vite-ignore */`${siteRoot}/config.js`)
/* --------------------------------------------------------------------------------------------- import menu css ---- */
import '/style/menu.css'
/* -------------------------------------------------------------------------------------------------- build menu ---- */
let menu = document.createElement('div')
menu.id = 'archive-menu'
let span = document.createElement('span')
span.id = 'hrt'
span.innerText = '♥'
menu.append(span)
(async () => {
const siteRoot = '/' + location.pathname.split('/')[1]
const {wayback} = await import(/* @vite-ignore */`${siteRoot}/config.js`)
let archiveRoot = document.createElement('a')
archiveRoot.setAttribute('href', '/')
archiveRoot.setAttribute('target', '_top')
archiveRoot.innerText = 'Home'
menu.append(archiveRoot)
let menu = document.createElement('div')
menu.id = 'archive-menu'
let changelog = document.createElement('a')
changelog.setAttribute('href', `/${siteRoot}/CHANGELOG.txt`)
changelog.setAttribute('target', '_blank')
changelog.innerText = 'Changelog'
menu.append(changelog)
let span = document.createElement('span')
span.id = 'hrt'
span.innerText = '♥'
menu.append(span)
if (wayback) {
let waybackLink = document.createElement('a')
waybackLink.setAttribute('href', `https://web.archive.org/web/${wayback}`)
waybackLink.setAttribute('target', '_blank')
waybackLink.innerText = 'Wayback Capture'
menu.append(waybackLink)
}
let archiveRoot = document.createElement('a')
archiveRoot.setAttribute('href', '/')
archiveRoot.setAttribute('target', '_top')
archiveRoot.innerText = 'Home'
menu.append(archiveRoot)
document.body.prepend(menu)
let changelog = document.createElement('a')
changelog.setAttribute('href', `/${siteRoot}/CHANGELOG.txt`)
changelog.setAttribute('target', '_blank')
changelog.innerText = 'Changelog'
menu.append(changelog)
if (wayback) {
let waybackLink = document.createElement('a')
waybackLink.setAttribute('href', `https://web.archive.org/web/${wayback}`)
waybackLink.setAttribute('target', '_blank')
waybackLink.innerText = 'Wayback Capture'
menu.append(waybackLink)
}
document.body.prepend(menu)
})()

View file

@ -4,8 +4,6 @@
"vite": "^4.3.9"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"dev": "vite"
}
}

View file

@ -9,8 +9,8 @@ export default defineConfig({
build: {
rollupOptions: {
input: Object.fromEntries(
globSync('**/index.html').map(file => [
relative('saudade', file.slice(0, file.length - extname(file).length)),
globSync('!(dist)/**/*.html').map(file => [
relative('saudade', file.slice(0, file.length - extname(file).length)).slice(3),
resolve(__dirname, file),
]),
),

View file

@ -167,7 +167,7 @@
<a href="breeds/c_wildz.html" title="Wildz (Catz)">Wildz (Catz)</a><br>
<a href="breeds/c_fantasyz.html" title="Fantasyz (Catz)">Fantasyz (Catz)</a><br>
<a href="breeds/forestfolk.html" title="Forest Folk">Forest Folk</a><br>
<a href="breeds/catzdogz.html" title="Catz Dogz">Catz << >> Dogz</a><br>
<a href="breeds/catzdogz.html" title="Catz Dogz">Catz &lt;&lt; &gt;&gt; Dogz</a><br>
<a href="breeds/caninez.html" title="Caninez">Caninez</a><br>
<a href="breeds/d_wildz.html" title="Wildz (Dogz)">Wildz (Dogz)</a><br>
<a href="breeds/d_fantasyz.html" title="Fantasyz (Dogz)">Fantasyz (Dogz)</a><br>