Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix discord logos load in static production #133

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/src/components/GridLoader.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@ async function prepareItems(items: any)
return src
}

if (src.startsWith('http:') || src.startsWith('https:') || src.startsWith('data:'))
if (
src.startsWith('http:') ||
src.startsWith('https:') ||
src.startsWith('data:') ||
src.startsWith('.') ||
src.startsWith('/')
)
{
return `url(${encodeURI(src)})`
}

if (src.startsWith('.') || src.startsWith('/'))
if (src.startsWith('~'))
{
src = `/src${src.slice(1)}`

try
{
// Try to import local file
Expand Down
2 changes: 1 addition & 1 deletion app/src/data/2021.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon: icon-[fa-brands--discord]
href: https://discordapp.com/invite/WbhavjX
class: tile-wide
background_image: /src/assets/2021-discord-logo.png
background_image: /assets/2021-discord-logo.png
style:
- 'background-color: #202225'

Expand Down
2 changes: 1 addition & 1 deletion app/src/data/2023.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon: icon-[fa-brands--discord]
href: https://discordapp.com/invite/r3vn4U6
class: tile-wide
background_image: /src/assets/2023-discord-logo.webp
background_image: /assets/2023-discord-logo.webp
style:
- 'background-color: #202225'

Expand Down
2 changes: 1 addition & 1 deletion app/src/data/2027.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon: icon-[fa-brands--discord]
href: https://discord.gg/3ZJDy7h9pY
class: tile-wide
background_image: /src/assets/2027-discord-logo.png
background_image: /assets/2027-discord-logo.png
style:
- 'background-color: #202225'

Expand Down
2 changes: 1 addition & 1 deletion app/src/data/2028.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon: icon-[fa-brands--discord]
href: https://discord.gg/AbqK9R2mPW
class: tile-wide
background_image: /src/assets/2028-discord-logo.png
background_image: /assets/2028-discord-logo.png
style:
- 'background-color: #202225'

Expand Down
2 changes: 1 addition & 1 deletion app/src/data/2029.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon: icon-[fa-brands--discord]
href: https://discord.gg/EuXuGTxyc8
class: tile-wide
background_image: /src/assets/2029-discord-logo.png
background_image: /assets/2029-discord-logo.png
style:
- 'background-color: #202225'

Expand Down
4 changes: 2 additions & 2 deletions app/src/data/archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- name: 2021
relurl: /2021
class: tile-medium
background_image: /src/assets/2021-discord-logo.webp
background_image: /assets/2021-discord-logo.png
style:
- 'background-color: #202225'

Expand All @@ -18,7 +18,7 @@
- name: 2023
relurl: /2023
class: tile-medium
background_image: /src/assets/2023-discord-logo.webp
background_image: /assets/2023-discord-logo.webp
style:
- 'background-color: #202225'

Expand Down