Skip to content

Commit

Permalink
Merge pull request #40 from 0x7d8/main
Browse files Browse the repository at this point in the history
maybe fix?
  • Loading branch information
prplwtf authored Jan 10, 2025
2 parents 10402d7 + 3543054 commit c8feb40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion browse/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ <h1 class="modal-title fs-5" id="filterModalLabel"><i class="bi bi-filter"></i>
listItem.className =
"col-sm-12 col-md-6 col-lg-4 mb-4 " + categoryClass;
listItem.innerHTML = `
<a href="./extensions/#${product.identifier}" class="text-decoration-none text-body">
<a href="/browse/extensions/#${product.identifier}" class="text-decoration-none text-body">
<div class="card overflow-hidden bg-dark-subtle">
<img src="${
product.banner
Expand Down
9 changes: 7 additions & 2 deletions functions/[[any]].js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ export const onRequest = async(context) => {
}

if (url.pathname.startsWith('/browse')) {
if (url.hash.startsWith('#')) {
const data = await fetch(`https://api.blueprintframe.work/api/extensions/${url.hash.slice(1)}`).then((res) => res.json()).catch(() => null)
if (url.pathname.startsWith('/browse/extensions')) {
const extension = url.hash.slice(1)

const data = await fetch(`https://api.blueprintframe.work/api/extensions/${extension}`).then((res) => res.json()).catch(() => null)
if (!data) return Response.redirect('/browse', 301)

return new Response(insertMetadata({
Expand All @@ -50,6 +52,9 @@ export const onRequest = async(context) => {
})
}

meta['og:image'] = '/.assets/brand/og-browse.jpg'
meta['twitter:image'] = '/.assets/brand/og-browse.jpg'

const data = await fetch('https://api.blueprintframe.work/api/extensions').then((res) => res.json()).catch(() => null)
if (data) {
return new Response(insertMetadata({
Expand Down

0 comments on commit c8feb40

Please sign in to comment.