1
0
Fork 0
mirror of https://github.com/mat-1/matdoesdev.git synced 2025-08-02 06:36:04 +00:00

use blog-preview.json for loading some pages

This commit is contained in:
mat 2024-03-19 23:41:10 -05:00
parent 6064c585fc
commit abd5c6caf1
6 changed files with 17 additions and 5 deletions

View file

@ -11,4 +11,4 @@
})
</script>
<img {src} {alt} />
<img loading="lazy" {src} {alt} />

View file

@ -24,7 +24,7 @@ An advantage to using a domain hack is that your domain is much shorter and ther
Finding a good domain isn't always easy, so I've created a tool hosted on [Repl.it](https://repl.it) that helps you find domain hacks
[![Domain Hack Generator](domain-hack-generator.png)](https://repl.it/talk/share/Domain-Hack-Finder/15778)
<iframe frameborder="0" width="100%" height="500px" src="https://replit.com/@mat1/domain-hack-finder?embed=true" title="Domain hack finder"></iframe>
<iframe loading="lazy" frameborder="0" width="100%" height="500px" src="https://replit.com/@mat1/domain-hack-finder?embed=true" title="Domain hack finder"></iframe>
At the moment, it uses every TLD currently in existence, which may not be what you want since some top level domains cannot be used by most people as they require you to live in a certain area or work for a certain organization. You can customize it by adding or removing from the tlds.txt file.

View file

@ -3,7 +3,7 @@ import type { Load } from '@sveltejs/kit'
export const prerender = true
export const load: Load = async ({ fetch }) => {
const posts = await fetch(`/blog.json`).then((r: Response) => r.json())
const posts = await fetch('/blog-preview.json').then((r: Response) => r.json())
return {
posts,

View file

@ -0,0 +1,10 @@
import { json, type RequestHandler } from '@sveltejs/kit'
import { getPosts } from '../blog.json/preview'
export const prerender = true
export const GET: RequestHandler = async () => {
const posts = await getPosts()
return json(posts)
}

View file

@ -3,7 +3,7 @@ import type { Load } from '@sveltejs/kit'
export const prerender = true
export const load: Load = async ({ fetch }) => {
const posts = await fetch('/blog.json').then((r: Response) => r.json())
const posts = await fetch('/blog-preview.json').then((r: Response) => r.json())
const status = await fetch('/status.json').then((r: Response) => r.json())
return {

View file

@ -57,8 +57,10 @@ h2 {
image-rendering: pixelated;
z-index: 2147483647;
position: absolute;
cursor: pointer;
/* default idle sprite */
background-position: -96px -96px;
}
#main-title:after {