fix last updated script

This commit is contained in:
Gen 2024-03-19 16:01:42 -07:00
parent f22a6b68a0
commit 2a339ddbc8
No known key found for this signature in database
GPG key ID: CE5EAD50DD5E2278
3 changed files with 21 additions and 5 deletions

8
build.js Normal file
View file

@ -0,0 +1,8 @@
const fs = require("fs");
let file = fs.readFileSync("index.html", "utf-8");
file = file.replace(
'<span class="last-updated"></span>',
new Date().toUTCString(),
);
fs.writeFileSync("index.html", file);

View file

@ -49,7 +49,7 @@
<a href="mailto:genshibe@gmail.com">Email</a> <a href="mailto:genshibe@gmail.com">Email</a>
</div> </div>
<span <span
>Last updated at <span class="last-updated"></span> | ©️ >Last updated at Tue, 19 Mar 2024 22:56:19 GMT | ©️
Licensed under GPL V3 | Licensed under GPL V3 |
<a href="https://github.com/GenShibe/genshibe.github.io/" <a href="https://github.com/GenShibe/genshibe.github.io/"
>Source code</a >Source code</a
@ -63,10 +63,6 @@
</select> </select>
</footer> </footer>
</main> </main>
<script>
document.querySelector(".last-updated").innerHTML =
document.lastModified;
</script>
<script> <script>
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
const selector = document.querySelector(".theme-selector"); const selector = document.querySelector(".theme-selector");

12
package.json Normal file
View file

@ -0,0 +1,12 @@
{
"name": "genshibe.github.io",
"version": "1.0.0",
"description": "my personal website lol, it's horrible, but at least it doesn't hurt your eyes :p ### License - everything is licensed under: [GPLv3](https://www.gnu.org/licenses/gpl-3.0#license-text)",
"main": "index.js",
"scripts": {
"build": "node ./build.js"
},
"keywords": [],
"author": "",
"license": "ISC"
}