-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63648a0
commit 38a98d3
Showing
15 changed files
with
184 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: Code Test | ||
description: Code Test | ||
date: '2024-7-25' | ||
categories: | ||
- programming | ||
published: true | ||
--- | ||
|
||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum | ||
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum | ||
|
||
```ts | ||
import * as config from '$lib/config' | ||
import type { Post } from '$lib/types' | ||
|
||
export async function GET({ fetch }) { | ||
const response = await fetch('api/posts') | ||
const posts: Post[] = 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 }) | ||
} | ||
``` | ||
|
||
```python | ||
# Long variable scroll test | ||
longvariablename = "longvariablename_longvariablename_longvariablename_longvariablename_longvariablename_longvariablename_longvariablename_longvariablename_longvariablename_longvariablename" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: How.This.Blog.Developed | ||
description: How.This.Blog.Developed | ||
date: '2024-7-22' | ||
categories: | ||
- sveltekit | ||
- optimization | ||
published: true | ||
--- | ||
|
||
## Contents | ||
|
||
## General | ||
|
||
- | ||
- Built using SvelteKit | ||
|
||
## Optimizations | ||
|
||
- Enable pre-render | ||
- Unlike other SSGs, prerendered SvelteKit still allows for client-side hydration, so I can still use smooth client-side routing and transitions. | ||
- Use static adapter | ||
- For images, use AVIF / WebP instead of PNG / JPEG | ||
- Use Sveltekit [enhanced:img](https://kit.svelte.dev/docs/images#sveltejs-enhanced-img-srcset-and-sizes) | ||
- Optimize fonts by reducing their size | ||
- Only import the necessary weights and subsets for each font | ||
- use woff2 files | ||
- For hosting fonts, Fontsource can be used | ||
- Use inline CSS | ||
- It eliminates the need for an extra request to fetch an external CSS file | ||
- However, it prevents the browser from caching the CSS file | ||
- So while the initial load time can be faster, subsequent navigations may be slower. | ||
- This is a worthy trade-off for blog pages where initial load time is much more important |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.