Moving between tags or articles now works
This commit is contained in:
parent
2328812858
commit
cbd187bd21
@ -44,7 +44,6 @@ export async function load({ params }) {
|
||||
|
||||
function renderMarkdown(md: string, renderer: _Renderer): string {
|
||||
const rawHtml = marked(md, { renderer });
|
||||
console.log(rawHtml);
|
||||
const sanitizedHtml = sanitizeHtml(rawHtml, {
|
||||
allowedTags: ['a', 'br', 'code', 'figcaption', 'figure', 'img', 'p', 'pre'],
|
||||
allowedAttributes: {
|
||||
@ -52,6 +51,5 @@ function renderMarkdown(md: string, renderer: _Renderer): string {
|
||||
img: ['alt', 'class', 'src', 'title']
|
||||
}
|
||||
});
|
||||
console.log(sanitizedHtml);
|
||||
return sanitizedHtml;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import LatestPosts from '$lib/card-collections/LatestPosts.svelte';
|
||||
import Projects from '$lib/card-collections/Projects.svelte';
|
||||
import Header from '$lib/header.svelte';
|
||||
import PostTag from '$lib/posts/PostTag.svelte';
|
||||
@ -7,7 +8,9 @@
|
||||
|
||||
export let data: any;
|
||||
|
||||
const post: Article = data.data;
|
||||
let post: Article;
|
||||
|
||||
$: post = data.data;
|
||||
|
||||
afterUpdate(() => {
|
||||
const codeBlocks = document.querySelectorAll('article pre');
|
||||
@ -59,7 +62,7 @@
|
||||
<div class="side-column">
|
||||
<h2>Projects</h2>
|
||||
|
||||
<Projects />
|
||||
<LatestPosts />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -4,9 +4,11 @@
|
||||
import type { ArticleSummary } from '$lib/posts/types.js';
|
||||
|
||||
export let data;
|
||||
const posts: ArticleSummary[] = JSON.parse(data.data);
|
||||
let posts: ArticleSummary[];
|
||||
$: posts = JSON.parse(data.data);
|
||||
|
||||
const title = `tag: ${data.tag}`;
|
||||
let title: string;
|
||||
$: title = `tag: ${data.tag}`;
|
||||
</script>
|
||||
|
||||
<Header {title} />
|
||||
|
Loading…
Reference in New Issue
Block a user