deleting unused files
This commit is contained in:
parent
bd5276207f
commit
a15c475051
|
@ -1,2 +0,0 @@
|
||||||
// Import styles, initialize component theme here.
|
|
||||||
// import '../src/common.css';
|
|
16
src/hooks.ts
16
src/hooks.ts
|
@ -1,16 +0,0 @@
|
||||||
// import type { Handle } from "@sveltejs/kit";
|
|
||||||
// import * as cookie from "cookie";
|
|
||||||
import { sequence } from "@sveltejs/kit/hooks";
|
|
||||||
import { basename } from "path";
|
|
||||||
|
|
||||||
const handleHeaders = async ({ event, resolve }:{event:any, resolve:any}) => {
|
|
||||||
const response = await resolve(event);
|
|
||||||
// Avoid clickjacking attacks, see https://cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html
|
|
||||||
response.headers.set(
|
|
||||||
"Content-Security-Policy",
|
|
||||||
"frame-ancestors *.mattmor.in *;"
|
|
||||||
);
|
|
||||||
return response;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handle = sequence(handleHeaders);
|
|
|
@ -1,11 +0,0 @@
|
||||||
import { readable } from 'svelte/store';
|
|
||||||
|
|
||||||
export const time = readable(new Date(), function start(set) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
set(new Date());
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
return function stop() {
|
|
||||||
clearInterval(interval);
|
|
||||||
};
|
|
||||||
});
|
|
|
@ -1,18 +0,0 @@
|
||||||
import type { MarkdownMetadata } from '$content/types';
|
|
||||||
|
|
||||||
export type BlogTag = 'DevOps' | 'AI' | 'Updates' | '';
|
|
||||||
|
|
||||||
export interface BlogPost extends MarkdownMetadata {
|
|
||||||
author?: string;
|
|
||||||
date?: string;
|
|
||||||
excerpt: string;
|
|
||||||
image: string;
|
|
||||||
slug?: string;
|
|
||||||
href?: string;
|
|
||||||
tags?: BlogTag[];
|
|
||||||
subtitle?: string;
|
|
||||||
teaserImage: string;
|
|
||||||
title: string;
|
|
||||||
isNotAnActualPost?: boolean;
|
|
||||||
type?: string;
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
export type categories = 'sveltekit' | 'svelte';
|
|
|
@ -1,12 +0,0 @@
|
||||||
import type { MarkdownMetadata } from '$content/types';
|
|
||||||
|
|
||||||
export interface Project extends MarkdownMetadata {
|
|
||||||
title: string;
|
|
||||||
excerpt: string;
|
|
||||||
slug: string;
|
|
||||||
image: string;
|
|
||||||
date: string;
|
|
||||||
pageTitle: string;
|
|
||||||
pageDescription: string;
|
|
||||||
keywords: string;
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
<p>There is nothing to see yet</p>
|
|
|
@ -1,37 +0,0 @@
|
||||||
import * as config from '$lib/config';
|
|
||||||
import type { BlogPost } from '$lib/types';
|
|
||||||
|
|
||||||
export const prerender = true;
|
|
||||||
|
|
||||||
export async function GET({ fetch }) {
|
|
||||||
const response = await fetch('api/posts');
|
|
||||||
const posts: BlogPost[] = await response.json();
|
|
||||||
|
|
||||||
const headers = { 'Content-Type': 'application/xml' };
|
|
||||||
|
|
||||||
const xml = `
|
|
||||||
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
|
|
||||||
<channel>
|
|
||||||
<title>${config.title}</title>
|
|
||||||
<description>${config.description}</description>
|
|
||||||
<link>${config.url}</link>
|
|
||||||
<atom:link href="${config.url}/rss.xml" rel="self" type="application/rss+xml"/>
|
|
||||||
${posts
|
|
||||||
.map(
|
|
||||||
(post) => `
|
|
||||||
<item>
|
|
||||||
<title>${post.title}</title>
|
|
||||||
<description>${post.description}</description>
|
|
||||||
<link>${config.url}/${post.slug}</link>
|
|
||||||
<guid isPermaLink="true">${config.url}/${post.slug}</guid>
|
|
||||||
<pubDate>${new Date(post.date).toUTCString()}</pubDate>
|
|
||||||
</item>
|
|
||||||
`
|
|
||||||
)
|
|
||||||
.join('')}
|
|
||||||
</channel>
|
|
||||||
</rss>
|
|
||||||
`.trim();
|
|
||||||
|
|
||||||
return new Response(xml, { headers });
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
<script lang="ts">
|
|
||||||
import { time } from '$lib/stores/stores';
|
|
||||||
|
|
||||||
const formatter = new Intl.DateTimeFormat('en', {
|
|
||||||
hour12: true,
|
|
||||||
hour: 'numeric',
|
|
||||||
minute: '2-digit',
|
|
||||||
second: '2-digit'
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<h1>The time is {formatter.format($time)}</h1>
|
|
|
@ -1,6 +0,0 @@
|
||||||
/// <reference types="@sveltejs/kit" />
|
|
||||||
/// <reference no-default-lib="true"/>
|
|
||||||
/// <reference lib="esnext" />
|
|
||||||
/// <reference lib="webworker" />
|
|
||||||
|
|
||||||
const sw = /** @type {ServiceWorkerGlobalScope} */ (/** @type {unknown} */ (self));
|
|
Binary file not shown.
Before Width: | Height: | Size: 555 KiB |
Loading…
Reference in New Issue