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";
return base + path;
const prefix = "/tenkuma/web";
return base + prefix + url;
});
eleventyConfig.addFilter("postDate", (dateObj) => {

View file

@ -13,23 +13,31 @@
<meta charset="UTF-8">
<title>Adrian Victor{% if pageTitle or postTitle %} - {{ pageTitle or postTitle }}{% endif %}</title>
<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>
<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/tips.js" defer></script>
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="manifest" href="/static/site.webmanifest">
<link rel="stylesheet" href="{{ '/static/main.css?fixcache=1' | url }}">
<script type="module" src="{{ '/static/scripts/ccd.js' | url }}"></script>
<script type="module" src="{{ '/static/scripts/music.js' | url }}" defer></script>
<script type="module" src="{{ '/static/scripts/88x31.js' | url }}" defer></script>
<script type="module" src="{{ '/static/scripts/tips.js' | url }}" defer></script>
<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>
<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:type" content="article">
<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>
<body>
<script>
const rootPrefix = "{{ '/' | url }}";
</script>
<style>
.bg {
opacity: {{ backgroundOpacity or ".4" }}!important;
@ -43,7 +51,7 @@
</style>
</noscript>
<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" %}
<div id="mainHelper">
{{ content | safe }}

View file

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

View file

@ -1,5 +1,9 @@
{% 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 %}
{% macro videoCard(videoLink, videoTitle, videoImage, videoWebsite, videoDuration, videoAccent) %}
@ -7,13 +11,15 @@
<div class="youtubeCardHolder">
<a href="{{ videoLink }}">
<div class="blogpostYoutubeVideo" {% if videoAccent %}style="border-color: {{ videoAccent }};"{% endif %}>
<img src="/static/images{{ videoImage }}">
<img src="{{ ('/static/images' ~ videoImage) | url }}">
<div class="videoHeader">
<!-- <p class="alsoAvailable">{{ i18n[langKey].alsoAvailableAsVideo }}:</p> -->
<h2 class="videoTitle" {% if videoAccent %}style="color: {{ videoAccent }};"{% endif %}>{{ videoTitle }}</h2>
{# <p class="alsoAvailable">{{ i18n[langKey].alsoAvailableAsVideo }}:</p> #}
<h2 class="videoTitle" {% if videoAccent %}style="color: {{ videoAccent }};"{% endif %}>
{{ videoTitle }}
</h2>
<p>{{ videoWebsite }}{% if videoDuration %} ({{ videoDuration }}){% endif %}</p>
</div>
<!-- <p class="goLabel">ir</p> -->
{# <p class="goLabel">ir</p> #}
</div>
</a>
</div>
@ -23,9 +29,11 @@
{% macro projectCard(projectName, projectDescription, projectLink, projectImage, projectImageAlt) %}
<div class="hsProject">
<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">
<img src="/static/visual/github.svg" class="invertedc">
<img src="{{ '/static/visual/github.svg' | url }}" class="invertedc">
</a>
</div>
<div class="hsProjectContent">

View file

@ -15,7 +15,7 @@ title: Adrian Victor:Blog
{% if post.data.langKey == langKey %}
<li>
<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 %}
</p>
</li>

View file

@ -12,21 +12,26 @@ layout: base.njk
<div id="homeSquares">
</div>
<main>
<script src="/static/scripts/home.js" defer></script>
<noscript><style>
<script src="{{ '/static/scripts/home.js' | url }}" defer></script>
<noscript>
<style>
.hs {
display: unset !important;
}
#homeSquares {
display: none;
}
</style></noscript>
</style>
</noscript>
<div class="hs" id="hsDefault">
<div class="box pageHeaderBox">
<h1 id="homeTitle">{{ i18n[langKey].welcome | smartTitle }}</h1>
<p>{{ i18n[langKey].homeWelcomeParagraph | safe }}</p>
<div class="homeBadgesBox">
{{ i88x31("tenkuma.gif") }}
{{ i88x31("anybrowser6.gif") }}
@ -39,11 +44,14 @@ layout: base.njk
{{ i88x31("gnu-linux.gif") }}
</div>
</div>
<hr>
<h2>{{ i18n[langKey].aboutMe | smartTitle }}</h1>
<h2>{{ i18n[langKey].aboutMe | smartTitle }}</h2>
<p>{{ i18n[langKey].homeAboutMeParagraph | 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].homeSocialsAndContactParagraphTwo | safe }}</p>
</div>
@ -53,12 +61,15 @@ layout: base.njk
<h1>{{ i18n[langKey].myMusic | smartTitle }}</h1>
<p>{{ i18n[langKey].homeMyMusicParagraph | safe }}</p>
<p>{{ i18n[langKey].homeMyMusicParagraphTwo | safe }}</p>
<div class="homeBadgesBox">
{{ i88x31("rave.gif") }}
{{ i88x31("happymix.gif") }}
</div>
</div>
<hr>
<div class="hsMusicCard">
{{
videoCard(
@ -78,7 +89,9 @@ layout: base.njk
<h1>{{ i18n[langKey].myVideos | smartTitle }}</h1>
<p>{{ i18n[langKey].homeMyVideoParagraph | safe }}</p>
</div>
<hr>
{{
videoCard(
i18n["global"].homeVideoLink,
@ -94,14 +107,50 @@ layout: base.njk
<div class="box pageHeaderBox">
<h1>{{ i18n[langKey].mySoftware | smartTitle }}</h1>
<p>{{ i18n[langKey].homeMySoftwareParagraph | safe }}</p>
{# <p>{{ i18n[langKey].homeMySoftwareNotableProjects | safe }}</p> #}
</div>
<hr>
<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("Eye of Nemesis", i18n[langKey].eyeofnemesisProjectDesctiption, "https://github.com/adrianvic/NemesisEye", "/static/images/eye_of_nemesis.png") }}
{{ projectCard("PestoWiki", i18n[langKey].pestoProjectDesctiption, "https://github.com/Margarina-not-butter/PestoWiki", "/static/images/pestowikifullwhite.png") }}
{{
projectCard(
"Jamfish",
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>
</main>

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@ let info = [
]
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;
});

View file

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