mirror of
https://github.com/ProjectSegfault/website.git
synced 2025-05-31 14:12:04 +05:30
comment blog out for now
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { env } from "$env/dynamic/private";
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
return {
|
||||
state: await fetch(env.VITE_API_URL + "/api/v1/state/blog").then(
|
||||
(res) => res.json()
|
||||
).catch(() => ({}))
|
||||
};
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
<script lang="ts">
|
||||
import type { PageData } from "./$types";
|
||||
|
||||
export let data: PageData
|
||||
</script>
|
||||
|
||||
{#if data.state.enabled}
|
||||
<slot />
|
||||
{:else}
|
||||
<div class="flex items-center gap-2 text-center justify-center mt-16">
|
||||
<div class="i-fa6-solid:circle-info" />
|
||||
<span>The blog is currently disabled.</span>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { env } from "$env/dynamic/private";
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
return {
|
||||
posts: await fetch(env.VITE_API_URL + "/api/v1/blog").then(
|
||||
(res) => res.json()
|
||||
).catch(() => ({}))
|
||||
};
|
||||
};
|
||||
@@ -1,61 +0,0 @@
|
||||
<script lang="ts">
|
||||
import dayjs from "dayjs";
|
||||
import Hero from "$lib/Hero.svelte";
|
||||
import LinkButton from "$lib/LinkButton.svelte";
|
||||
import type { PageData } from "./$types";
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Timeline | Project Segfault</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Timeline of Project Segfault's history."
|
||||
/>
|
||||
</svelte:head>
|
||||
|
||||
<Hero marginTop="4">
|
||||
<h1 class="text-5xl font-800">
|
||||
<span class="text-accent">Project Segfault</span> blog
|
||||
</h1>
|
||||
<div
|
||||
class="flex flex-col sm:flex-row justify-center items-center gap-4 m-4"
|
||||
>
|
||||
<LinkButton
|
||||
url="/blog/tags"
|
||||
title="Tags"
|
||||
icon="i-fa6-solid:tags"
|
||||
/>
|
||||
<LinkButton
|
||||
url="/blog/authors"
|
||||
title="Authors"
|
||||
icon="i-fa6-solid:user"
|
||||
/>
|
||||
</div>
|
||||
</Hero>
|
||||
|
||||
<div class="flex flex-col gap-10 mt-16">
|
||||
{#each data.posts as post}
|
||||
<div class="flex flex-col gap-4 bg-secondary p-4 rounded-2">
|
||||
<span class="text-xl font-bold">{post.title}</span>
|
||||
<div class="flex flex-col md:(flex-row gap-4) gap-2">
|
||||
{#if post.tags.length > 0}
|
||||
<div class="flex flex-row items-center gap-2">
|
||||
<div class="i-fa6-solid:tags" />
|
||||
{#each post.tags as tag}
|
||||
<a href="/blog/tags/{tag}" class="no-underline">{tag}</a>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
<a href="/blog/authors/{post.author}" class="flex items-center gap-2 no-underline"><div class="i-fa6-solid:user" />{post.author}</a>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:calendar" /> {dayjs
|
||||
.unix(post.created)
|
||||
.format("ddd, DD MMM YYYY HH:mm")}</span>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:pencil" /> {post.words} words</span>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:book-open-reader" /> {post.readingTime} minute read</span>
|
||||
</div>
|
||||
<span>{post.content.split(" ").slice(0, 20).join(" ") + "..."}</span>
|
||||
<a href="/blog/{post.title}">Read more...</a>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -1,16 +0,0 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { env } from "$env/dynamic/private";
|
||||
import { compile } from "mdsvex";
|
||||
|
||||
export const load: PageServerLoad = async ({ params }) => {
|
||||
return {
|
||||
post: await fetch(env.VITE_API_URL + "/api/v1/blog/" + params.title).then(
|
||||
(res) => res.json()
|
||||
).catch(() => ({})),
|
||||
content: await fetch(env.VITE_API_URL + "/api/v1/blog/" + params.title)
|
||||
.then((res) => res.json())
|
||||
.then((res) => compile(res.content))
|
||||
.then((res) => res?.code)
|
||||
.catch(() => ({})),
|
||||
};
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
<script lang="ts">
|
||||
import dayjs from "dayjs";
|
||||
import type { PageData } from "./$types";
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-4 bg-secondary p-4 rounded-2">
|
||||
<span class="text-xl font-bold flex flex-row items-center gap-2"><a href="/blog" class="flex flex-row items-center gap-2"><div class="i-fa6-solid:arrow-left" /> Back</a> - {data.post.title}</span>
|
||||
<div class="flex flex-col md:(flex-row gap-4) gap-2">
|
||||
{#if data.post.tags.length > 0}
|
||||
<div class="flex flex-row items-center gap-2">
|
||||
<div class="i-fa6-solid:tags" />
|
||||
{#each data.post.tags as tag}
|
||||
<a href="/blog/tags/{tag}" class="no-underline">{tag}</a>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
<a href="/blog/authors/{data.post.author}" class="flex items-center gap-2 no-underline"><div class="i-fa6-solid:user" />{data.post.author}</a>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:calendar" /> {dayjs
|
||||
.unix(data.post.created)
|
||||
.format("ddd, DD MMM YYYY HH:mm")}</span>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:pencil" /> {data.post.words} words</span>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:book-open-reader" /> {data.post.readingTime} minute read</span>
|
||||
</div>
|
||||
{@html data.content}
|
||||
</div>
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { env } from "$env/dynamic/private";
|
||||
|
||||
export const load: PageServerLoad = async ({ params }) => {
|
||||
return {
|
||||
authors: await fetch(env.VITE_API_URL + "/api/v1/blog/authors").then(
|
||||
(res) => res.json()
|
||||
).catch(() => ({})),
|
||||
};
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
<script lang="ts">
|
||||
import type { PageData } from "./$types";
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
<h1>Blog authors</h1>
|
||||
|
||||
<div class="flex flex-col gap-4">
|
||||
{#each data.authors as author}
|
||||
<a href="/blog/authors/{author}" class="bg-secondary w-fit p-2 rounded-2 no-underline">{author}</a>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -1,11 +0,0 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { env } from "$env/dynamic/private";
|
||||
|
||||
export const load: PageServerLoad = async ({ params }) => {
|
||||
return {
|
||||
posts: await fetch(env.VITE_API_URL + "/api/v1/blog/authors/" + params.author).then(
|
||||
(res) => res.json()
|
||||
).catch(() => ({})),
|
||||
authorName: params.author
|
||||
};
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
<script lang="ts">
|
||||
import dayjs from "dayjs";
|
||||
import type { PageData } from "./$types";
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
<h1>Blog author {data.authorName}</h1>
|
||||
|
||||
<div class="flex flex-col gap-10">
|
||||
{#each data.posts as post}
|
||||
<div class="flex flex-col gap-4 bg-secondary p-4 rounded-2">
|
||||
<span class="text-xl font-bold">{post.title}</span>
|
||||
<div class="flex flex-col md:(flex-row gap-4) gap-2">
|
||||
{#if post.tags.length > 0}
|
||||
<div class="flex flex-row items-center gap-2">
|
||||
<div class="i-fa6-solid:tags" />
|
||||
{#each post.tags as tag}
|
||||
<a href="/blog/tags/{tag}" class="no-underline">{tag}</a>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
<a href="/blog/authors/{post.author}" class="flex items-center gap-2 no-underline"><div class="i-fa6-solid:user" />{post.author}</a>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:calendar" /> {dayjs
|
||||
.unix(post.created)
|
||||
.format("ddd, DD MMM YYYY HH:mm")}</span>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:pencil" /> {post.words} words</span>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:book-open-reader" /> {post.readingTime} minute read</span>
|
||||
</div>
|
||||
<span>{post.content.split(" ").slice(0, 20).join(" ") + "..."}</span>
|
||||
<a href="/blog/{post.title}">Read more...</a>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { env } from "$env/dynamic/private";
|
||||
|
||||
export const load: PageServerLoad = async ({ params }) => {
|
||||
return {
|
||||
tags: await fetch(env.VITE_API_URL + "/api/v1/blog/tags").then(
|
||||
(res) => res.json()
|
||||
).catch(() => ({})),
|
||||
};
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
<script lang="ts">
|
||||
import type { PageData } from "./$types";
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
<h1>Blog tags</h1>
|
||||
|
||||
<div class="flex flex-col gap-4">
|
||||
{#each data.tags as tag}
|
||||
<a href="/blog/tags/{tag}" class="bg-secondary w-fit p-2 rounded-2 no-underline">{tag}</a>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -1,11 +0,0 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { env } from "$env/dynamic/private";
|
||||
|
||||
export const load: PageServerLoad = async ({ params }) => {
|
||||
return {
|
||||
posts: await fetch(env.VITE_API_URL + "/api/v1/blog/tags/" + params.tag).then(
|
||||
(res) => res.json()
|
||||
).catch(() => ({})),
|
||||
tagName: params.tag
|
||||
};
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
<script lang="ts">
|
||||
import dayjs from "dayjs";
|
||||
import type { PageData } from "./$types";
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
<h1>Blog tag {data.tagName}</h1>
|
||||
|
||||
<div class="flex flex-col gap-10">
|
||||
{#each data.posts as post}
|
||||
<div class="flex flex-col gap-4 bg-secondary p-4 rounded-2">
|
||||
<span class="text-xl font-bold">{post.title}</span>
|
||||
<div class="flex flex-col md:(flex-row gap-4) gap-2">
|
||||
{#if post.tags.length > 0}
|
||||
<div class="flex flex-row items-center gap-2">
|
||||
<div class="i-fa6-solid:tags" />
|
||||
{#each post.tags as tag}
|
||||
<a href="/blog/tags/{tag}" class="no-underline">{tag}</a>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
<a href="/blog/authors/{post.author}" class="flex items-center gap-2 no-underline"><div class="i-fa6-solid:user" />{post.author}</a>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:calendar" /> {dayjs
|
||||
.unix(post.created)
|
||||
.format("ddd, DD MMM YYYY HH:mm")}</span>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:pencil" /> {post.words} words</span>
|
||||
<span class="flex items-center gap-2"><div class="i-fa6-solid:book-open-reader" /> {post.readingTime} minute read</span>
|
||||
</div>
|
||||
<span>{post.content.split(" ").slice(0, 20).join(" ") + "..."}</span>
|
||||
<a href="/blog/{post.title}">Read more...</a>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
Reference in New Issue
Block a user