Compare commits

...
5 Commits
7 changed files with 48 additions and 21 deletions
+11 -6
View File
@@ -1,19 +1,24 @@
# For Build # For Build
FROM node:22-slim as builder FROM node:22-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app WORKDIR /app
COPY package.json ./ COPY package.json ./
COPY package-lock.json ./ COPY pnpm-lock.yaml ./
COPY tsconfig.json ./ COPY tsconfig.json ./
RUN npm ci
FROM base AS builder
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY . . COPY . .
RUN pnpm run build
RUN npm run build
# For Run FROM base
FROM node:22-slim RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
WORKDIR /app WORKDIR /app
+5 -3
View File
@@ -1,13 +1,15 @@
// See https://kit.svelte.dev/docs/types#app // See https://kit.svelte.dev/docs/types#app
// for information about these interfaces // for information about these interfaces
import { Database } from 'pg'; import { Pool } from "pg";
import type { SimpleGit } from "simple-git";
declare global { declare global {
namespace App { namespace App {
// interface Error {} // interface Error {}
interface Locals { interface Locals {
db: any; db: Pool;
} git: SimpleGit;
}
// interface PageData {} // interface PageData {}
// interface PageState {} // interface PageState {}
// interface Platform {} // interface Platform {}
+5 -3
View File
@@ -7,15 +7,16 @@
color: var(--color-text); color: var(--color-text);
padding-left: 2rem; padding-left: 0rem;
box-sizing: border-box; box-sizing: border-box;
h1 { h1 {
position: relative; position: relative;
width: auto; width: auto;
font-size: 1.8rem; font-size: 1.8rem;
margin-bottom: 0.5rem; padding: 1.5rem 0 0.25rem 0;
margin-left: -1rem; margin: 0 0 0.75rem 0rem;
border-bottom: 1px solid var(--color-outline);
} }
hr { hr {
@@ -27,6 +28,7 @@
} }
h2 { h2 {
padding: 1rem 0 0.25rem 0;
font-size: 1.5rem; font-size: 1.5rem;
position: relative; position: relative;
+1
View File
@@ -44,6 +44,7 @@
margin-left: 0.5em; margin-left: 0.5em;
padding-left: 0.25em; padding-left: 0.25em;
border-left: 1px solid var(--line-primary); border-left: 1px solid var(--line-primary);
box-sizing: border-box;
} }
ul { ul {
border-left: none; border-left: none;
+7 -8
View File
@@ -115,15 +115,14 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: start; align-items: start;
.content { .content {
border: 1px solid var(--line-primary); border: 1px solid var(--line-primary);
border-top: none; border-top: none;
border-bottom: none; border-bottom: none;
min-height: 100%; min-height: 100%;
padding: 20px; padding: 100px 100px 0 100px;
padding-top: 100px; max-width: 900px;
max-width: 800px;
margin: 0; margin: 0;
} }
} }
@@ -131,17 +130,17 @@
.card-container { .card-container {
position: sticky; position: sticky;
top: 0; top: 0;
overflow-y: auto;
background-color: var(--background-primary); background-color: var(--background-primary);
box-sizing: border-box; box-sizing: border-box;
padding: 20px; padding: 20px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
overflow: visible;
.card { .card {
width: 300px; width: 100px;
padding: 0.5em 0; padding: 0.5em 0;
overflow: visible; overflow: visible;
} }
} }
@@ -149,7 +148,7 @@
h1 { h1 {
font-size: 2rem; font-size: 2rem;
text-align: center; text-align: center;
margin: 0; margin: 0 -30px 0 -30px;
padding: 12px; padding: 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.3); border-bottom: 1px solid rgba(255, 255, 255, 0.3);
box-sizing: border-box; box-sizing: border-box;
+1 -1
View File
@@ -20,6 +20,6 @@ export default async function compileArticle(code: string) {
return html; return html;
}, },
}, },
rehypePlugins: [rehypeSlug], rehypePlugins: [rehypeAutolinkHeadings, rehypeSlug],
}); });
} }
+18
View File
@@ -0,0 +1,18 @@
import { json } from '@sveltejs/kit';
import { error } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
export const GET: RequestHandler = async ({ url, locals }) => {
const category = String(url.searchParams.get('category'));
if (!category) {
error(400, 'Bad request');
}
const db = await locals.db;
const article = await db.query(
'SELECT * FROM article WHERE category = $1',
[category]
);
return new Response();
};