diff --git a/src/assets/posts/pulex_leg.webp b/src/assets/posts/pulex_leg.webp new file mode 100644 index 0000000..6797ce7 Binary files /dev/null and b/src/assets/posts/pulex_leg.webp differ diff --git a/src/components/Music.astro b/src/components/Music.astro index ab9de0b..9fd2a39 100644 --- a/src/components/Music.astro +++ b/src/components/Music.astro @@ -23,7 +23,7 @@ import leg from "../assets/leg.webp"; const request = await fetch("https://lastfm-last-played.biancarosa.com.br/Fluffy_Bean_/latest-song"); const data = await request.json(); - ( document.querySelector("#music-image") as HTMLImageElement ).src = data["track"]["image"][1]["#text"]; + ( document.querySelector("#music-image") as HTMLImageElement ).src = data["track"]["image"][2]["#text"]; ( document.querySelector("#music-title") as HTMLParagraphElement ).innerText = `${data["track"]["name"]}`; ( document.querySelector("#music-artist") as HTMLParagraphElement ).innerText = `by ${data["track"]["artist"]["#text"]}`; ( document.querySelector("#music-album") as HTMLParagraphElement ).innerText = `on ${data["track"]["album"]["#text"]}`; diff --git a/src/content/posts/2023_06_19-Hello-Django.mdx b/src/content/posts/2023_06_19-Hello-Django.mdx index df169bb..3dc4b44 100644 --- a/src/content/posts/2023_06_19-Hello-Django.mdx +++ b/src/content/posts/2023_06_19-Hello-Django.mdx @@ -1,12 +1,13 @@ --- title: Hello, Django! -description: Imported blog from old website +description: Django is fun! pubDate: 2023-06-19 tags: - python - django - caddy - networking + - webdev --- import Note from "../../components/Note.astro"; diff --git a/src/content/posts/2024_05_28-Astro_is_hard.mdx b/src/content/posts/2024_05_28-Astro_is_hard.mdx index 657e76f..d2395dd 100644 --- a/src/content/posts/2024_05_28-Astro_is_hard.mdx +++ b/src/content/posts/2024_05_28-Astro_is_hard.mdx @@ -5,6 +5,7 @@ pubDate: 2024-05-28 tags: - astro - typescript + - webdev --- Hello! Welcome to my new website, or at least as of writing this blog. @@ -15,20 +16,106 @@ So where do I start, maybe _why_ I have chosen Astro over other existing options ## Why Astro TLDR: I don't know :3 -- I've been trying to learn typescript through trying astro -- Astro is hard, due to all the issues I've encountered +I've been trying to learn Typescript for about a month now, mainly to broaden my skill set, but to also help me with job +searching. Firstly through Svelte for a college project (which I may write about), but now Astro. + +I've chosen Astro for two main reasons +1. It's statically compiled, meaning that I don't ship any smelly Javascript to the browser, which I detest doing when not needed +2. It looked simple enough compared to other options + +So, what was the experience like so far you may be asking, ehh... ## The problems -- Issue with Astros `getEntries()` not working, thus having to implement my own method -- Fighting with Astro to display banner images, it won -- Using external plugins for images/slides - - Specifically passing variables into scripts + +### `Image` and `Picture` + +The first and biggest hurdle I faced was the `Image` and `Picture` elements from Astro. I could not for the life of me, +figure out a good solution for using both a file path, and a URL for the `frontmatter` data. I tried: +- `getImage()` +- Checking if the start of the string begins with `https://` +- Loading the image using `getImage()` on every page that passed the image data into the `Layout.astro` to set as the banner image + +**NOTHING FUCKING WORKED.** + +I spent a good few hours trying to get that working, until I came across the `image()` schema helper. I followed the +documentation, I followed videos, I copied code from existing repositories, nothing worked, it refused to load images +by file path, instead returning a string every time... + +So I simply gave up, and I think that's for the best considering I want to keep my hair, and I had better things todo. +You win Astro, you win. + +### PhotoSwipe + +When working on the Refsheet part of this website, I wanted to use a library to be able to view images fullscreen. Maybe +I'm stupid, maybe I'm dumb, but I could not get [PhotoSwipe](https://photoswipe.com/) to work, at least when using +multiple sets of images on a page. + +I tried stupid things such as creating unique IDs for each gallery element, but when +passing them into a `