Use eleventy's url function to apply pathPrefix.
All checks were successful
Build Eleventy Forgero / build (24.x) (push) Successful in 37s

This commit is contained in:
天クマ 2026-05-14 14:59:13 -03:00
commit 6b8635defe
11 changed files with 172 additions and 102 deletions

View file

@ -40,9 +40,10 @@ module.exports = function(eleventyConfig) {
})) }))
}); });
eleventyConfig.addFilter("absoluteUrl", function(path) { eleventyConfig.addFilter("absoluteUrl", function(url) {
const base = "https://adrianvic.github.io"; const base = "https://adrianvic.github.io";
return base + path; const prefix = "/tenkuma/web";
return base + prefix + url;
}); });
eleventyConfig.addFilter("postDate", (dateObj) => { eleventyConfig.addFilter("postDate", (dateObj) => {

View file

@ -11,25 +11,33 @@
<html lang="{{ langKey }}"> <html lang="{{ langKey }}">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Adrian Victor{% if pageTitle or postTitle %} - {{pageTitle or postTitle}}{% endif %}</title> <title>Adrian Victor{% if pageTitle or postTitle %} - {{ pageTitle or postTitle }}{% endif %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/main.css?fixcache=1">
<script type="module" src="/static/scripts/ccd.js"></script> <link rel="stylesheet" href="{{ '/static/main.css?fixcache=1' | url }}">
<script type="module" src="/static/scripts/music.js" defer></script>
<script type="module" src="/static/scripts/88x31.js" defer></script> <script type="module" src="{{ '/static/scripts/ccd.js' | url }}"></script>
<script type="module" src="/static/scripts/tips.js" defer></script> <script type="module" src="{{ '/static/scripts/music.js' | url }}" defer></script>
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png"> <script type="module" src="{{ '/static/scripts/88x31.js' | url }}" defer></script>
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png"> <script type="module" src="{{ '/static/scripts/tips.js' | url }}" defer></script>
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="manifest" href="/static/site.webmanifest"> <link rel="apple-touch-icon" sizes="180x180" href="{{ '/static/apple-touch-icon.png' | url }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ '/static/favicon-32x32.png' | url }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ '/static/favicon-16x16.png' | url }}">
<link rel="manifest" href="{{ '/static/site.webmanifest' | url }}">
<script src="https://keepandroidopen.org/banner.js" defer></script> <script src="https://keepandroidopen.org/banner.js" defer></script>
<meta property="og:title" content="Adrian Victor{% if pageTitle or postTitle %} - {{ pageTitle or postTitle }}{% endif %}"> <meta property="og:title" content="Adrian Victor{% if pageTitle or postTitle %} - {{ pageTitle or postTitle }}{% endif %}">
<meta property="og:description" content="{{ description or i18n[langKey].websiteDescription }}"> <meta property="og:description" content="{{ description or i18n[langKey].websiteDescription }}">
<meta property="og:type" content="article"> <meta property="og:type" content="article">
<meta property="og:url" content="{{ page.url | url | absoluteUrl }}"> <meta property="og:url" content="{{ page.url | url | absoluteUrl }}">
<meta property="og:image" content="{{ ('/static/images/' ~ (background or 'bear.jpg')) | absoluteUrl }}"> <meta property="og:image" content="{{ ('/static/images/' ~ (background or 'bear.jpg')) | url | absoluteUrl }}">
</head> </head>
<body> <body>
<script>
const rootPrefix = "{{ '/' | url }}";
</script>
<style> <style>
.bg { .bg {
opacity: {{ backgroundOpacity or ".4" }}!important; opacity: {{ backgroundOpacity or ".4" }}!important;
@ -43,7 +51,7 @@
</style> </style>
</noscript> </noscript>
<div id="everythingHelper"> <div id="everythingHelper">
<img src="/static/images/{{ background or "bear.jpg" }}" class="bg"> <img src="{{ ('/static/images/' ~ (background or 'bear.jpg')) | url }}" class="bg">
{% include "header.njk" %} {% include "header.njk" %}
<div id="mainHelper"> <div id="mainHelper">
{{ content | safe }} {{ content | safe }}

View file

@ -16,12 +16,12 @@
</script> </script>
</div> </div>
<div id="linksHelper"> <div id="linksHelper">
<div id="music"> <div id="music"></div>
</div>
<ul id="headerLinks"> <ul id="headerLinks">
<a href="/{{ langKey }}/">{{ i18n[langKey].home }}</a> <a href="{{ ('/' ~ langKey ~ '/') | url }}">{{ i18n[langKey].home }}</a>
<a href="/{{ langKey }}/blog/">blog</a> <a href="{{ ('/' ~ langKey ~ '/blog/') | url }}">blog</a>
<a href="/{{ langKey }}/misc/">misc</a> <a href="{{ ('/' ~ langKey ~ '/misc/') | url }}">misc</a>
</ul> </ul>
</div> </div>
</header> </header>

View file

@ -1,31 +1,39 @@
{% macro i88x31(link) %} {% macro i88x31(link) %}
<img class="i88x31" src="/static/images/88x31/{{ link }}" data-tip="<b>{{ i18n[langKey].i88x31hover }}</b> ({{ link }})"> <img
class="i88x31"
src="{{ ('/static/images/88x31/' ~ link) | url }}"
data-tip="<b>{{ i18n[langKey].i88x31hover }}</b> ({{ link }})"
>
{% endmacro %} {% endmacro %}
{% macro videoCard(videoLink, videoTitle, videoImage, videoWebsite, videoDuration, videoAccent) %} {% macro videoCard(videoLink, videoTitle, videoImage, videoWebsite, videoDuration, videoAccent) %}
<div class="youtubeCardHolderHelper"> <div class="youtubeCardHolderHelper">
<div class="youtubeCardHolder"> <div class="youtubeCardHolder">
<a href="{{ videoLink }}"> <a href="{{ videoLink }}">
<div class="blogpostYoutubeVideo" {% if videoAccent %}style="border-color: {{ videoAccent }};"{% endif %}> <div class="blogpostYoutubeVideo" {% if videoAccent %}style="border-color: {{ videoAccent }};"{% endif %}>
<img src="/static/images{{ videoImage }}"> <img src="{{ ('/static/images' ~ videoImage) | url }}">
<div class="videoHeader"> <div class="videoHeader">
<!-- <p class="alsoAvailable">{{ i18n[langKey].alsoAvailableAsVideo }}:</p> --> {# <p class="alsoAvailable">{{ i18n[langKey].alsoAvailableAsVideo }}:</p> #}
<h2 class="videoTitle" {% if videoAccent %}style="color: {{ videoAccent }};"{% endif %}>{{ videoTitle }}</h2> <h2 class="videoTitle" {% if videoAccent %}style="color: {{ videoAccent }};"{% endif %}>
<p>{{ videoWebsite }}{% if videoDuration %} ({{ videoDuration }}){% endif %}</p> {{ videoTitle }}
</div> </h2>
<!-- <p class="goLabel">ir</p> --> <p>{{ videoWebsite }}{% if videoDuration %} ({{ videoDuration }}){% endif %}</p>
</div>
{# <p class="goLabel">ir</p> #}
</div>
</a>
</div> </div>
</a>
</div>
</div> </div>
{% endmacro %} {% endmacro %}
{% macro projectCard(projectName, projectDescription, projectLink, projectImage, projectImageAlt) %} {% macro projectCard(projectName, projectDescription, projectLink, projectImage, projectImageAlt) %}
<div class="hsProject"> <div class="hsProject">
<div class="hsProjectHeader"> <div class="hsProjectHeader">
<div class="hsProjectImage"><img src="{{ projectImage }}" alt="{{ projectImageAlt or projectName }}"></div> <div class="hsProjectImage">
<img src="{{ projectImage | url }}" alt="{{ projectImageAlt or projectName }}">
</div>
<a href="{{ projectLink }}" class="hsProjectHeaderIcon"> <a href="{{ projectLink }}" class="hsProjectHeaderIcon">
<img src="/static/visual/github.svg" class="invertedc"> <img src="{{ '/static/visual/github.svg' | url }}" class="invertedc">
</a> </a>
</div> </div>
<div class="hsProjectContent"> <div class="hsProjectContent">

View file

@ -15,7 +15,7 @@ title: Adrian Victor:Blog
{% if post.data.langKey == langKey %} {% if post.data.langKey == langKey %}
<li> <li>
<p> <p>
<a href="{{ post.url }}">{{ post.data.postTitle }}</a><br> <a href="{{ post.url | url }}">{{ post.data.postTitle }}</a><br>
<b>{{ post.data.date | postDate }}</b>{% if post.data.lastModified | postDate !== post.data.date | postDate %} ({{ i18n[langKey].lastEditedIn }} {{ post.data.lastModified | postDate}}){% endif %} <b>{{ post.data.date | postDate }}</b>{% if post.data.lastModified | postDate !== post.data.date | postDate %} ({{ i18n[langKey].lastEditedIn }} {{ post.data.lastModified | postDate}}){% endif %}
</p> </p>
</li> </li>

149
index.njk
View file

@ -12,73 +12,86 @@ layout: base.njk
<div id="homeSquares"> <div id="homeSquares">
</div> </div>
<main> <main>
<script src="/static/scripts/home.js" defer></script> <script src="{{ '/static/scripts/home.js' | url }}" defer></script>
<noscript><style>
.hs { <noscript>
display: unset!important; <style>
} .hs {
#homeSquares { display: unset !important;
display: none; }
} #homeSquares {
</style></noscript> display: none;
}
</style>
</noscript>
<div class="hs" id="hsDefault"> <div class="hs" id="hsDefault">
<div class="box pageHeaderBox"> <div class="box pageHeaderBox">
<h1 id="homeTitle">{{ i18n[langKey].welcome | smartTitle }}</h1> <h1 id="homeTitle">{{ i18n[langKey].welcome | smartTitle }}</h1>
<p>{{ i18n[langKey].homeWelcomeParagraph | safe }}</p> <p>{{ i18n[langKey].homeWelcomeParagraph | safe }}</p>
<div class="homeBadgesBox">
{{ i88x31("tenkuma.gif") }} <div class="homeBadgesBox">
{{ i88x31("anybrowser6.gif") }} {{ i88x31("tenkuma.gif") }}
{{ i88x31("ai.gif") }} {{ i88x31("anybrowser6.gif") }}
{{ i88x31("WEBP.gif") }} {{ i88x31("ai.gif") }}
{{ i88x31("rainbowrain.gif") }} {{ i88x31("WEBP.gif") }}
{{ i88x31("blasphemy.gif") }} {{ i88x31("rainbowrain.gif") }}
{{ i88x31("css3.gif") }} {{ i88x31("blasphemy.gif") }}
{{ i88x31("best_viewed_with_open_eyes.gif") }} {{ i88x31("css3.gif") }}
{{ i88x31("gnu-linux.gif") }} {{ i88x31("best_viewed_with_open_eyes.gif") }}
</div> {{ i88x31("gnu-linux.gif") }}
</div>
</div> </div>
<hr> <hr>
<h2>{{ i18n[langKey].aboutMe | smartTitle }}</h1>
<h2>{{ i18n[langKey].aboutMe | smartTitle }}</h2>
<p>{{ i18n[langKey].homeAboutMeParagraph | safe }}</p> <p>{{ i18n[langKey].homeAboutMeParagraph | safe }}</p>
<p>{{ i18n[langKey].homeAboutMeParagraphTwo | safe }}</p> <p>{{ i18n[langKey].homeAboutMeParagraphTwo | safe }}</p>
<h2>{{ i18n[langKey].socialsAndContact | smartTitle }}</h1>
<h2>{{ i18n[langKey].socialsAndContact | smartTitle }}</h2>
<p>{{ i18n[langKey].homeSocialsAndContactParagraph | safe }}</p> <p>{{ i18n[langKey].homeSocialsAndContactParagraph | safe }}</p>
<p>{{ i18n[langKey].homeSocialsAndContactParagraphTwo | safe }}</p> <p>{{ i18n[langKey].homeSocialsAndContactParagraphTwo | safe }}</p>
</div> </div>
<div class="hs" id="hsMusic"> <div class="hs" id="hsMusic">
<div class="box pageHeaderBox"> <div class="box pageHeaderBox">
<h1>{{ i18n[langKey].myMusic | smartTitle }}</h1> <h1>{{ i18n[langKey].myMusic | smartTitle }}</h1>
<p>{{ i18n[langKey].homeMyMusicParagraph | safe }}</p> <p>{{ i18n[langKey].homeMyMusicParagraph | safe }}</p>
<p>{{ i18n[langKey].homeMyMusicParagraphTwo | safe }}</p> <p>{{ i18n[langKey].homeMyMusicParagraphTwo | safe }}</p>
<div class="homeBadgesBox">
{{ i88x31("rave.gif") }} <div class="homeBadgesBox">
{{ i88x31("happymix.gif") }} {{ i88x31("rave.gif") }}
</div> {{ i88x31("happymix.gif") }}
</div>
</div> </div>
<hr> <hr>
<div class="hsMusicCard"> <div class="hsMusicCard">
{{ {{
videoCard( videoCard(
i18n["global"].homeSongLink, i18n["global"].homeSongLink,
i18n["global"].homeSongTitle, i18n["global"].homeSongTitle,
i18n["global"].homeSongImage, i18n["global"].homeSongImage,
i18n["global"].homeSongWebsite, i18n["global"].homeSongWebsite,
i18n["global"].homeSongDuration, i18n["global"].homeSongDuration,
i18n["global"].homeSongAccent i18n["global"].homeSongAccent
) )
}} }}
</div> </div>
</div> </div>
<div class="hs" id="hsVideo"> <div class="hs" id="hsVideo">
<div class="box pageHeaderBox"> <div class="box pageHeaderBox">
<h1>{{ i18n[langKey].myVideos | smartTitle }}</h1> <h1>{{ i18n[langKey].myVideos | smartTitle }}</h1>
<p>{{ i18n[langKey].homeMyVideoParagraph | safe }}</p> <p>{{ i18n[langKey].homeMyVideoParagraph | safe }}</p>
</div> </div>
<hr> <hr>
{{ {{
videoCard( videoCard(
i18n["global"].homeVideoLink, i18n["global"].homeVideoLink,
@ -86,22 +99,58 @@ layout: base.njk
i18n["global"].homeVideoImage, i18n["global"].homeVideoImage,
i18n["global"].homeVideoWebsite, i18n["global"].homeVideoWebsite,
i18n["global"].homeVideoDuration i18n["global"].homeVideoDuration
) )
}} }}
</div> </div>
<div class="hs" id="hsCode"> <div class="hs" id="hsCode">
<div class="box pageHeaderBox"> <div class="box pageHeaderBox">
<h1>{{ i18n[langKey].mySoftware | smartTitle }}</h1> <h1>{{ i18n[langKey].mySoftware | smartTitle }}</h1>
<p>{{ i18n[langKey].homeMySoftwareParagraph | safe }}</p> <p>{{ i18n[langKey].homeMySoftwareParagraph | safe }}</p>
{# <p>{{ i18n[langKey].homeMySoftwareNotableProjects | safe }}</p> #}
</div> </div>
<hr> <hr>
<div class="hsProjects"> <div class="hsProjects">
{{ projectCard("Jamfish", i18n[langKey].jamfishProjectDesctiption, "https://github.com/adrianvic/jamfish", "/static/images/jamfish-wide.png") }} {{
{{ projectCard("ItemEconomy", i18n[langKey].itemeconomyProjectDesctiption, "https://github.com/adrianvic/ItemEconomy", "/static/images/itemeconomy2-wide.png") }} projectCard(
{{ projectCard("Eye of Nemesis", i18n[langKey].eyeofnemesisProjectDesctiption, "https://github.com/adrianvic/NemesisEye", "/static/images/eye_of_nemesis.png") }} "Jamfish",
{{ projectCard("PestoWiki", i18n[langKey].pestoProjectDesctiption, "https://github.com/Margarina-not-butter/PestoWiki", "/static/images/pestowikifullwhite.png") }} i18n[langKey].jamfishProjectDesctiption,
"https://github.com/adrianvic/jamfish",
'/static/images/jamfish-wide.png',
"Jamfish"
)
}}
{{
projectCard(
"ItemEconomy",
i18n[langKey].itemeconomyProjectDesctiption,
"https://github.com/adrianvic/ItemEconomy",
'/static/images/itemeconomy2-wide.png',
"ItemEconomy"
)
}}
{{
projectCard(
"Eye of Nemesis",
i18n[langKey].eyeofnemesisProjectDesctiption,
"https://github.com/adrianvic/NemesisEye",
'/static/images/eye_of_nemesis.png',
"Eye of Nemesis"
)
}}
{{
projectCard(
"PestoWiki",
i18n[langKey].pestoProjectDesctiption,
"https://github.com/Margarina-not-butter/PestoWiki",
'/static/images/pestowikifullwhite.png',
"PestoWiki"
)
}}
</div> </div>
</div> </div>
</main> </main>

View file

@ -3,7 +3,7 @@ permalink: "/index.html"
layout: base.njk layout: base.njk
langKey: "en" langKey: "en"
--- ---
<script src="/static/scripts/language.js" defer></script> <script src="{{ '/static/scripts/language.js' | url }}" defer></script>
<style> <style>
#headerLinks { #headerLinks {
display: none!important; display: none!important;
@ -12,7 +12,7 @@ langKey: "en"
<main> <main>
<h1 id="languageTitle">Pick a language</h1> <h1 id="languageTitle">Pick a language</h1>
<ul id="languageList"> <ul id="languageList">
<li><a href="/en/">English</a></li> <li><a href="{{ '/en/' | url }}">English</a></li>
<li><a href="/pt/">Português Brasileiro</a></li> <li><a href="{{ '/pt/' | url }}">Português Brasileiro</a></li>
</ul> </ul>
</main> </main>

View file

@ -10,21 +10,25 @@ title: Adrian Victor:Misc
<main> <main>
<h1>{{ i18n[langKey].miscellaneous }}</h1> <h1>{{ i18n[langKey].miscellaneous }}</h1>
<ul> <ul>
<dl> <dl>
{% for page in collections.misc %} {% for page in collections.misc %}
{% set t = page | getTranslation(langKey) %} {% set t = page | getTranslation(langKey) %}
<dt> <dt>
<a href="/{{ langKey }}/misc/{{ page.fileSlug }}/"> <a href="{{ ('/' ~ langKey ~ '/misc/' ~ page.fileSlug ~ '/') | url }}">
{{ page.data.pageTitle or t.pageTitle }} {{ page.data.pageTitle or t.pageTitle }}
</a> </a>
</dt> </dt>
<dd> <dd>
{% if page.data["88x31"] %} {% if page.data["88x31"] %}
<img src="/static/images/88x31/{{ page.data["88x31"] }}"><br> <img
src="{{ ('/static/images/88x31/' ~ page.data['88x31']) | url }}"
><br>
{% endif %} {% endif %}
{{ t.pageDescription }} {{ t.pageDescription }}
</dd> </dd>
{% endfor %} {% endfor %}

View file

@ -5,7 +5,7 @@ document.addEventListener('keydown', function(event) {
if (event.code === konamiCode[keyIndex]) { if (event.code === konamiCode[keyIndex]) {
keyIndex++; keyIndex++;
if (keyIndex === konamiCode.length) { if (keyIndex === konamiCode.length) {
window.location.href = '/static/toyourdreams.txt' window.location.href = `${rootPrefix}static/toyourdreams.txt`
keyIndex = 0; keyIndex = 0;
} }
} else { } else {

View file

@ -9,7 +9,7 @@ let info = [
] ]
info.forEach(square => { info.forEach(square => {
let rawHTML = `<div class='headerSquare' id='${square[1]}'><img src='/static/images/${square[2]}' alt='${square[3]}'></div>`; let rawHTML = `<div class='headerSquare' id='${square[1]}'><img src='${rootPrefix}static/images/${square[2]}' alt='${square[3]}'></div>`;
_homeSquares.innerHTML += rawHTML; _homeSquares.innerHTML += rawHTML;
}); });

View file

@ -4,8 +4,8 @@ const body = document.querySelector("body");
const musicdiv = document.getElementById("music"); const musicdiv = document.getElementById("music");
musicdiv.innerHTML = ` musicdiv.innerHTML = `
<img src="/static/images/gears.svg" class="optionsToggle invertedc"> <img src="${rootPrefix}static/images/gears.svg" class="optionsToggle invertedc">
<img src="/static/images/sound-on.png" id="sound"> <img src="${rootPrefix}static/images/sound-on.png" id="sound">
<select name="song" id="songSelection"></select> <select name="song" id="songSelection"></select>
` `
const linksHelper = document.getElementById("linksHelper"); const linksHelper = document.getElementById("linksHelper");
@ -89,7 +89,7 @@ songs.forEach(song => {
songElement.classList.add("drawerSong"); songElement.classList.add("drawerSong");
songElement.dataset.song = song.file; songElement.dataset.song = song.file;
const songImage = document.createElement("img"); const songImage = document.createElement("img");
songImage.src = `/static/images/songs/${song.artwork}`; songImage.src = `${rootPrefix}static/images/songs/${song.artwork}`;
songElement.appendChild(songImage); songElement.appendChild(songImage);
songElement.addEventListener('click', () => { songElement.addEventListener('click', () => {
changeSong(song.file); changeSong(song.file);
@ -146,7 +146,7 @@ optionsButton.forEach(button => {
}); });
// Create the audio object using the current select value // Create the audio object using the current select value
let audio = new Audio(`/static/music/${audioSelect.value}`); let audio = new Audio(`${rootPrefix}static/music/${audioSelect.value}`);
const savedTime = localStorage.getItem("audioTime"); const savedTime = localStorage.getItem("audioTime");
const savedVolume = localStorage.getItem("volume"); const savedVolume = localStorage.getItem("volume");
@ -166,14 +166,14 @@ function play() {
showNotification(headeri18n.permissionIssue, headeri18n.permissionIssueNotificationContent, 5000); showNotification(headeri18n.permissionIssue, headeri18n.permissionIssueNotificationContent, 5000);
});; });;
localStorage.setItem("audioPlaying", "true") localStorage.setItem("audioPlaying", "true")
toggleIMG.src = "/static/images/sound-on.png" toggleIMG.src = `${rootPrefix}static/images/sound-on.png`
console.log(`[Music Player] playing ${audioSelect.value}`) console.log(`[Music Player] playing ${audioSelect.value}`)
} }
function stop() { function stop() {
audio.pause(); audio.pause();
localStorage.setItem("audioPlaying", "false") localStorage.setItem("audioPlaying", "false")
toggleIMG.src = "/static/images/sound-off.png" toggleIMG.src = `${rootPrefix}static/images/sound-off.png`
} }
function setVolume(volume) { function setVolume(volume) {
@ -198,7 +198,7 @@ function changeSong(song) {
const wasPlaying = !audio.paused; const wasPlaying = !audio.paused;
stop(); stop();
localStorage.removeItem("audioTime"); localStorage.removeItem("audioTime");
audio = new Audio(`/static/music/${song}`); audio = new Audio(`${rootPrefix}static/music/${song}`);
if (savedVolume) setVolume(savedVolume); if (savedVolume) setVolume(savedVolume);
console.log(`[Music Player] changing song to ${song}`) console.log(`[Music Player] changing song to ${song}`)
localStorage.setItem("song", song); localStorage.setItem("song", song);