reverse proxy for uploads
This commit is contained in:
parent
0eb91d67dd
commit
ce50f8a6d6
8 changed files with 44 additions and 48 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import type { PageServerLoad } from "./$types";
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async ({ locals, params }) => {
|
||||
const { slug } = params;
|
||||
|
|
@ -12,16 +12,16 @@ export const load: PageServerLoad = async ({ locals, params }) => {
|
|||
image: {
|
||||
url: post.Header.url,
|
||||
alt: post.Header.alternativeText,
|
||||
caption: post.Header.caption,
|
||||
caption: post.Header.caption
|
||||
},
|
||||
title: post.Title,
|
||||
body: post.Body,
|
||||
topics: post.Topics.map((topic: { id: string; Topic: string }) => ({
|
||||
id: topic.id,
|
||||
name: topic.Topic,
|
||||
name: topic.Topic
|
||||
})),
|
||||
published: post.publishedAt,
|
||||
published: post.publishedAt
|
||||
},
|
||||
meta,
|
||||
meta
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<script lang="ts">
|
||||
import { env } from '$env/dynamic/public';
|
||||
import dayjs from 'dayjs';
|
||||
import { compile } from 'mdsvex';
|
||||
import type { PageProps } from './$types';
|
||||
|
|
@ -14,11 +13,7 @@
|
|||
<p class="text-gray-500">{dayjs(post.published).format('DD MMMM YYYY')}</p>
|
||||
<h1 class="text-4xl font-light">{post.title}</h1>
|
||||
</div>
|
||||
<img
|
||||
class="aspect-4/2 w-full object-cover"
|
||||
src={`${env.PUBLIC_STRAPI_HOST}${post.image.url}`}
|
||||
alt={post.image.alt}
|
||||
/>
|
||||
<img class="aspect-4/2 w-full object-cover" src={post.image.url} alt={post.image.alt} />
|
||||
<div class="w-full max-w-5xl px-4">
|
||||
{#await compile(post.body)}
|
||||
<div class="skeleton h-48 w-full"></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue