Compare commits

...
5 Commits
7 changed files with 48 additions and 21 deletions
+11 -6
View File
@@ -1,19 +1,24 @@
# 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
COPY package.json ./
COPY package-lock.json ./
COPY pnpm-lock.yaml ./
COPY tsconfig.json ./
RUN npm ci
FROM base AS builder
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
RUN npm run build
# For Run
FROM node:22-slim
FROM base
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
WORKDIR /app
+4 -2
View File
@@ -1,12 +1,14 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
import { Database } from 'pg';
import { Pool } from "pg";
import type { SimpleGit } from "simple-git";
declare global {
namespace App {
// interface Error {}
interface Locals {
db: any;
db: Pool;
git: SimpleGit;
}
// interface PageData {}
// interface PageState {}
+5 -3
View File
@@ -7,15 +7,16 @@
color: var(--color-text);
padding-left: 2rem;
padding-left: 0rem;
box-sizing: border-box;
h1 {
position: relative;
width: auto;
font-size: 1.8rem;
margin-bottom: 0.5rem;
margin-left: -1rem;
padding: 1.5rem 0 0.25rem 0;
margin: 0 0 0.75rem 0rem;
border-bottom: 1px solid var(--color-outline);
}
hr {
@@ -27,6 +28,7 @@
}
h2 {
padding: 1rem 0 0.25rem 0;
font-size: 1.5rem;
position: relative;
+1
View File
@@ -44,6 +44,7 @@
margin-left: 0.5em;
padding-left: 0.25em;
border-left: 1px solid var(--line-primary);
box-sizing: border-box;
}
ul {
border-left: none;
+5 -6
View File
@@ -121,9 +121,8 @@
border-top: none;
border-bottom: none;
min-height: 100%;
padding: 20px;
padding-top: 100px;
max-width: 800px;
padding: 100px 100px 0 100px;
max-width: 900px;
margin: 0;
}
}
@@ -131,15 +130,15 @@
.card-container {
position: sticky;
top: 0;
overflow-y: auto;
background-color: var(--background-primary);
box-sizing: border-box;
padding: 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: visible;
.card {
width: 300px;
width: 100px;
padding: 0.5em 0;
overflow: visible;
}
@@ -149,7 +148,7 @@
h1 {
font-size: 2rem;
text-align: center;
margin: 0;
margin: 0 -30px 0 -30px;
padding: 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
box-sizing: border-box;
+1 -1
View File
@@ -20,6 +20,6 @@ export default async function compileArticle(code: string) {
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();
};