mirror of
https://github.com/mat-1/matdoesdev.git
synced 2025-08-02 14:46:04 +00:00
use blog-preview.json for loading some pages
This commit is contained in:
parent
6064c585fc
commit
abd5c6caf1
6 changed files with 17 additions and 5 deletions
|
@ -11,4 +11,4 @@
|
|||
})
|
||||
</script>
|
||||
|
||||
<img {src} {alt} />
|
||||
<img loading="lazy" {src} {alt} />
|
||||
|
|
|
@ -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
|
||||
[](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.
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
10
src/routes/blog-preview.json/+server.ts
Normal file
10
src/routes/blog-preview.json/+server.ts
Normal 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)
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue