Skip to content

Commit 1d24982

Browse files
New content page + re-format files
1 parent 606a77a commit 1d24982

18 files changed

+170
-78
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ try {
7979
app.use(
8080
helmet.contentSecurityPolicy({
8181
directives: {
82-
defaultSrc: ["'self'"],
82+
defaultSrc: ["'self'", "https://static.cloudflareinsights.com/"],
8383
scriptSrc: ["'self'", "'unsafe-inline'", "https://static.cloudflareinsights.com/"],
8484
styleSrc: ["'self'", "'unsafe-inline'"],
8585
imgSrc: ["'self'", "data:", "https://i.ytimg.com"],

public/css/main.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/css/tailwind.css

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
@font-face {
66
font-family: "PP Agrandir";
7-
src: local("PP Agrandir Regular"), local("PPAgrandir-Regular"),
8-
url("/fonts/PPAgrandir-Regular.woff2") format("woff2");
7+
src: local("PP Agrandir Regular"), local("PPAgrandir-Regular"), url("/fonts/PPAgrandir-Regular.woff2") format("woff2");
98
font-weight: normal;
109
font-style: normal;
1110
font-display: swap;
@@ -168,8 +167,7 @@ body::-webkit-scrollbar-thumb:hover {
168167
}
169168

170169
a {
171-
transition: background-color 0.25s ease-in-out, transform 0.25s ease-in-out,
172-
color 0.25s ease-in-out;
170+
transition: background-color 0.25s ease-in-out, transform 0.25s ease-in-out, color 0.25s ease-in-out;
173171
}
174172

175173
header {

public/js/admin/calmanager.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ document.addEventListener("DOMContentLoaded", function () {
2929

3030
// Enviar el formulario de añadir evento
3131
document.getElementById("submitAddEventForm").addEventListener("click", function () {
32-
var formData = new URLSearchParams(
33-
new FormData(document.getElementById("addEventForm"))
34-
).toString();
32+
var formData = new URLSearchParams(new FormData(document.getElementById("addEventForm"))).toString();
3533

3634
fetch("/addEvent", {
3735
method: "POST",
@@ -52,9 +50,7 @@ document.addEventListener("DOMContentLoaded", function () {
5250

5351
// Enviar el formulario de eliminar evento
5452
document.getElementById("submitDeleteEventForm").addEventListener("click", function () {
55-
var formData = new URLSearchParams(
56-
new FormData(document.getElementById("deleteEventForm"))
57-
).toString();
53+
var formData = new URLSearchParams(new FormData(document.getElementById("deleteEventForm"))).toString();
5854

5955
fetch("/removeEvent", {
6056
method: "POST",

public/js/admin/links.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ document.addEventListener("DOMContentLoaded", function () {
3434

3535
// Enviar el formulario de crear enlace
3636
document.getElementById("submitCreateLinkForm").addEventListener("click", function () {
37-
var formData = new URLSearchParams(
38-
new FormData(document.getElementById("createLinkForm"))
39-
).toString();
37+
var formData = new URLSearchParams(new FormData(document.getElementById("createLinkForm"))).toString();
4038

4139
fetch("/addLink", {
4240
method: "POST",
@@ -59,9 +57,7 @@ document.addEventListener("DOMContentLoaded", function () {
5957

6058
// Enviar el formulario de editar enlace
6159
document.getElementById("submitEditLinkForm").addEventListener("click", function () {
62-
var formData = new URLSearchParams(
63-
new FormData(document.getElementById("editLinkForm"))
64-
).toString();
60+
var formData = new URLSearchParams(new FormData(document.getElementById("editLinkForm"))).toString();
6561

6662
fetch("/editLink", {
6763
method: "POST",
@@ -84,9 +80,7 @@ document.addEventListener("DOMContentLoaded", function () {
8480

8581
// Enviar el formulario de eliminar enlace
8682
document.getElementById("submitDeleteLinkForm").addEventListener("click", function () {
87-
var formData = new URLSearchParams(
88-
new FormData(document.getElementById("deleteLinkForm"))
89-
).toString();
83+
var formData = new URLSearchParams(new FormData(document.getElementById("deleteLinkForm"))).toString();
9084

9185
fetch("/removeLink", {
9286
method: "POST",

public/js/content/calendar.js

+4-12
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,12 @@ document.addEventListener("DOMContentLoaded", async function () {
9292
</div>
9393
<div class="grid grid-cols-7 gap-4 text-center">
9494
${[...Array(firstDayIndex).keys()]
95-
.map(
96-
(i) => `<div class="text-gray-500 py-2">${prevLastDay - firstDayIndex + 1 + i}</div>`
97-
)
95+
.map((i) => `<div class="text-gray-500 py-2">${prevLastDay - firstDayIndex + 1 + i}</div>`)
9896
.join("")}
9997
${[...Array(lastDay).keys()]
10098
.map((i) => {
10199
const day = i + 1;
102-
const dateString = `${year}-${month + 1 < 10 ? "0" : ""}${month + 1}-${
103-
day < 10 ? "0" : ""
104-
}${day}`;
100+
const dateString = `${year}-${month + 1 < 10 ? "0" : ""}${month + 1}-${day < 10 ? "0" : ""}${day}`;
105101
const isToday =
106102
dateString ===
107103
`${currentDate.getFullYear()}-${currentDate.getMonth() + 1 < 10 ? "0" : ""}${
@@ -118,9 +114,7 @@ document.addEventListener("DOMContentLoaded", async function () {
118114
`;
119115
})
120116
.join("")}
121-
${[...Array(nextDays).keys()]
122-
.map((i) => `<div class="text-gray-500 py-2">${i + 1}</div>`)
123-
.join("")}
117+
${[...Array(nextDays).keys()].map((i) => `<div class="text-gray-500 py-2">${i + 1}</div>`).join("")}
124118
</div>
125119
`;
126120

@@ -147,9 +141,7 @@ document.addEventListener("DOMContentLoaded", async function () {
147141
eventDetails.classList.remove("hidden");
148142
platformIcon.className = getEventIcon(event.type) + " mr-3 text-gray-300";
149143
platformName.textContent = event.type;
150-
eventDescription.textContent = `${event.description} el ${formatDate(event.date)} a las ${
151-
event.time
152-
}`;
144+
eventDescription.textContent = `${event.description} el ${formatDate(event.date)} a las ${event.time}`;
153145
}
154146
});
155147
});

public/js/content/youtube.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const loadVideo = (liteYT) => {
22
const cid = "UCxcD9py3y1df8CWzT5VsZMw";
3-
const channelURL = encodeURIComponent(
4-
`https://www.youtube.com/feeds/videos.xml?channel_id=${cid}`
5-
);
3+
const channelURL = encodeURIComponent(`https://www.youtube.com/feeds/videos.xml?channel_id=${cid}`);
64
const reqURL = `https://api.rss2json.com/v1/api.json?rss_url=${channelURL}`;
75

86
fetch(reqURL)

public/json/timeline.json

+7
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@
179179
"description": "Creación y programación de un feed de vtubers hispanos en BlueSky.",
180180
"url": "https://alexdevuwu.com/l/vt-feed"
181181
}
182+
],
183+
"Noviembre": [
184+
{
185+
"title": "LiberTeis",
186+
"description": "Reestructuración de la base de datos y reescritura de la API y backend completo.",
187+
"url": "https://github.com/AlexDeveloperUwU/LiberTeis"
188+
}
182189
]
183190
}
184191
}

routes/api.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,14 @@ router.get("/latestLog", authenticateDiscord, async (req, res) => {
165165
const latestLogFile = logFiles[0];
166166
const latestLogFilePath = path.join(logsDirectory, latestLogFile);
167167

168-
const logContent = fs.readFileSync(latestLogFilePath, "utf-8");
168+
let logContent = fs.readFileSync(latestLogFilePath, "utf-8");
169169

170-
res.setHeader('Content-Type', 'text/plain');
170+
logContent = logContent
171+
.split("\n")
172+
.filter(line => !line.includes("HetrixTools Uptime Monitoring Bot. https://hetrix.tools/uptime-monitoring-bot.html"))
173+
.join("\n");
174+
175+
res.setHeader("Content-Type", "text/plain");
171176
res.status(200).send(logContent);
172177
} catch (error) {
173178
console.error("Error fetching latest log file:", error);

routes/public.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ router.get("/l/:id?", async (req, res) => {
8787
const destinationUrl = new URL(linkData);
8888
destinationUrl.searchParams.set("referrer", "alexdevuwu.com");
8989

90-
if (
91-
destinationUrl.hostname === "www.youtube.com" ||
92-
destinationUrl.hostname === "youtube.com"
93-
) {
90+
if (destinationUrl.hostname === "www.youtube.com" || destinationUrl.hostname === "youtube.com") {
9491
res.setHeader("X-Robots-Tag", "noindex, nofollow");
9592
res.setHeader("Referrer-Policy", "no-referrer");
9693
} else {

serverUtils/js/auth.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ passport.deserializeUser((obj, done) => done(null, obj));
3434
const FileStoreSession = FileStore(session);
3535

3636
const setupAuth = (app) => {
37-
const sessionPath = path.join(
38-
path.dirname(fileURLToPath(import.meta.url)),
39-
"..",
40-
"..",
41-
"data",
42-
"sessions"
43-
);
37+
const sessionPath = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "..", "data", "sessions");
4438

4539
app.use(
4640
session({

serverUtils/js/ratelimiter.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
import rateLimit from "express-rate-limit";
22

3-
const EXCLUDED_IPS = new Set([
4-
"91.116.216.221",
5-
"144.24.196.201",
6-
"144.24.204.85",
7-
"127.0.0.1",
8-
"::1",
9-
]);
3+
const EXCLUDED_IPS = new Set(["91.116.216.221", "144.24.196.201", "144.24.204.85", "127.0.0.1", "::1"]);
104

115
const EXCLUDED_USER_AGENTS = new Set(["HetrixTools Uptime Monitoring Bot"]);
126

137
const isExcluded = (ip, userAgent) => {
14-
return (
15-
EXCLUDED_IPS.has(ip) || Array.from(EXCLUDED_USER_AGENTS).some((ua) => userAgent.includes(ua))
16-
);
8+
return EXCLUDED_IPS.has(ip) || Array.from(EXCLUDED_USER_AGENTS).some((ua) => userAgent.includes(ua));
179
};
1810

1911
const rateLimiter = rateLimit({

serverUtils/json/contentRoutes.json

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
"view": "youtube",
2525
"title": "YouTube",
2626
"folder": "content/youtube"
27+
},
28+
{
29+
"view": "links",
30+
"title": "Enlaces",
31+
"folder": "content/links"
2732
}
2833
]
2934
}

utils/audit.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ const fetchAndSaveScores = async (url, key, strategy) => {
2424
const categories = data.lighthouseResult.categories;
2525
const scores = {
2626
performance: categories.performance ? Math.round(categories.performance.score * 100) : null,
27-
accessibility: categories.accessibility
28-
? Math.round(categories.accessibility.score * 100)
29-
: null,
30-
"best-practices": categories["best-practices"]
31-
? Math.round(categories["best-practices"].score * 100)
32-
: null,
27+
accessibility: categories.accessibility ? Math.round(categories.accessibility.score * 100) : null,
28+
"best-practices": categories["best-practices"] ? Math.round(categories["best-practices"].score * 100) : null,
3329
seo: categories.seo ? Math.round(categories.seo.score * 100) : null,
3430
};
3531

views/content/aboutme.ejs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<main class="container mx-auto mt-10 flex-grow px-8 sm:px-24 lg:px-64 hidden">
22
<!-- Sección Un poco sobre mí -->
3-
<section class="mx-auto mt-10 max-w-4xl text-center">
4-
<div class="items-center flex flex-col">
5-
<div class="items-center flex text-left">
6-
<img src="/img/logoSmall.webp" alt="Alex Verde" class="h-24 w-24 rounded-full border-4 border-blue-400" />
7-
<div class="ml-4">
3+
<section class="mx-auto mt-10 max-w-4xl text-left">
4+
<div class="items-left flex flex-col">
5+
<div class="items-left flex text-left">
6+
<div class="relative">
7+
<img id="profileImage" src="/img/logoSmall.webp" alt="AlexDevUwU" class="h-24 w-24 rounded-full border-4 border-blue-400" />
8+
</div>
9+
<div class="ml-4 flex flex-col justify-center">
810
<h2 class="text-3xl font-semibold">Alex Verde</h2>
11+
<p class="text-base text-blue-400">@alexdevuwu</p>
912
</div>
1013
</div>
1114
</div>
1215
</section>
13-
1416
<!-- Sección Un poco sobre mí -->
1517
<section class="mx-auto mt-10 max-w-4xl text-left">
1618
<h3 class="mb-4 text-2xl font-bold flex items-center">

views/content/index.ejs

+10-7
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,24 @@
1212
<p id="birthday-message" class="text-base text-gray-300"></p>
1313
</div>
1414
<div id="icons" class="mt-2 flex space-x-4">
15-
<a href="https://github.com/alexdeveloperuwu" aria-label="GitHub" class="text-xl text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
15+
<a href="https://github.com/alexdeveloperuwu" aria-label="GitHub" class="text-lg text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
1616
<i class="fab fa-github"></i>
1717
</a>
18-
<a href="https://twitter.com/alexdevuwu" aria-label="Twitter" class="text-xl text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
18+
<a href="https://x.com/AlexDevUwU" aria-label="Twitter" class="text-lg text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
1919
<i class="fab fa-twitter"></i>
2020
</a>
21-
<a href="https://twitch.tv/alexdevuwu" aria-label="Twitch" class="text-xl text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
22-
<i class="fab fa-twitch"></i>
21+
<a href="https://bsky.app/profile/alexdevuwu.com" aria-label="BlueSky" class="text-lg text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
22+
<i class="fab fa-bluesky"></i>
2323
</a>
24-
<a href="https://kick.com/alexdevuwu" aria-label="Kick" class="text-xl text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
25-
<i class="fa-brands fa-kickstarter-k"></i>
24+
<a href="https://twitch.tv/alexdevuwu" aria-label="Twitch" class="text-lg text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
25+
<i class="fab fa-twitch"></i>
2626
</a>
27-
<a href="https://www.youtube.com/channel/UCxcD9py3y1df8CWzT5VsZMw" aria-label="YouTube" class="text-xl text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
27+
<a href="https://www.youtube.com/channel/UCxcD9py3y1df8CWzT5VsZMw" aria-label="YouTube" class="text-lg text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
2828
<i class="fab fa-youtube"></i>
2929
</a>
30+
<a href="https://kick.com/alexdevuwu" aria-label="Kick" class="text-lg text-gray-300 transition duration-300 ease-in-out transform hover:text-white hover:scale-110">
31+
<i class="fa-brands fa-kickstarter-k"></i>
32+
</a>
3033
</div>
3134
</div>
3235
</div>

0 commit comments

Comments
 (0)