adjustments to behavior and specifications #3
|
@ -17,6 +17,8 @@ FROM node:22-slim
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ./articles ./articles
|
||||||
|
|
||||||
COPY --from=builder /app/build ./build
|
COPY --from=builder /app/build ./build
|
||||||
COPY --from=builder /app/package.json .
|
COPY --from=builder /app/package.json .
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
<img src={data.image} alt="" />
|
<img src={data.image} alt="" />
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
<main>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<h1>{data.title}</h1>
|
<h1>{data.title}</h1>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
|
@ -51,18 +52,28 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<main>
|
|
||||||
<div class="document">
|
<div class="document">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</main>
|
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
:global(body) {
|
:global(body) {
|
||||||
|
overflow: hidden;
|
||||||
background-color: var(--background-primary);
|
background-color: var(--background-primary);
|
||||||
|
background-size: cover;
|
||||||
|
background-blend-mode: overlay;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100dvh;
|
||||||
|
backdrop-filter: blur(2px);
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
.back {
|
.back {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -80,15 +91,19 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
.container {
|
main {
|
||||||
|
border: 1px solid var(--line-primary);
|
||||||
|
border-top: none;
|
||||||
|
border-bottom: none;
|
||||||
|
box-sizing: border-box;
|
||||||
color: white;
|
color: white;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
padding: 20px;
|
||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
width: 1000px;
|
width: 1000px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
h1 {
|
h1 {
|
||||||
|
@ -138,14 +153,6 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
main {
|
|
||||||
padding: 20px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 1000px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
@media (max-width: 1000px) {
|
@media (max-width: 1000px) {
|
||||||
.container {
|
.container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -155,8 +162,5 @@
|
||||||
padding: 8px 20px;
|
padding: 8px 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
main {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import pg from 'pg';
|
import pg from 'pg';
|
||||||
import { Pool } from 'pg';
|
const { Pool } = pg;
|
||||||
import { getConnection } from './database/get_connection';
|
import { getConnection } from './database/get_connection';
|
||||||
|
|
||||||
export class Postgres {
|
export class Postgres {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// initialize
|
// initialize
|
||||||
import PG from '$lib/server/database';
|
|
||||||
import type { Postgres } from '$lib/server/database';
|
import type { Postgres } from '$lib/server/database';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { compile } from 'mdsvex';
|
import { compile } from 'mdsvex';
|
||||||
|
@ -108,6 +107,7 @@ export default async function init(db: Postgres) {
|
||||||
for (const { path, id } of articleFiles) {
|
for (const { path, id } of articleFiles) {
|
||||||
const res = await db.query('select * from article where id = $1', [id]);
|
const res = await db.query('select * from article where id = $1', [id]);
|
||||||
const compiled = await compile(fs.readFileSync(path, 'utf-8'));
|
const compiled = await compile(fs.readFileSync(path, 'utf-8'));
|
||||||
|
|
||||||
const title = compiled.data.fm.title;
|
const title = compiled.data.fm.title;
|
||||||
const category = path.split('/')[3];
|
const category = path.split('/')[3];
|
||||||
const tags: string[] = compiled.data.fm.tags;
|
const tags: string[] = compiled.data.fm.tags;
|
||||||
|
@ -127,8 +127,8 @@ export default async function init(db: Postgres) {
|
||||||
} else if (res.rows[0].updated_at < updated_at) {
|
} else if (res.rows[0].updated_at < updated_at) {
|
||||||
console.log(`Update article: ${id}`);
|
console.log(`Update article: ${id}`);
|
||||||
await db.query(
|
await db.query(
|
||||||
'update article set title = $2, updated_at = $4, tags = $5, content = $6 where id = $1',
|
'update article set title = $2, category = $3, released_at = $4, updated_at = $5, tags = $6, image = $7, publish = $8, content = $9 where id = $1',
|
||||||
[id, title, updated_at, tags, content]
|
[id, title, category, released_at, updated_at, tags, image, publish, content]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log(`Article ${id} is already up-to-date`);
|
console.log(`Article ${id} is already up-to-date`);
|
||||||
|
|
|
@ -41,7 +41,10 @@
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
:global(body) {
|
:global(body) {
|
||||||
|
overflow: hidden;
|
||||||
background-color: var(--background-primary);
|
background-color: var(--background-primary);
|
||||||
|
background-size: cover;
|
||||||
|
background-blend-mode: overlay;
|
||||||
}
|
}
|
||||||
.back {
|
.back {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
|
@ -114,8 +114,8 @@
|
||||||
</div>
|
</div>
|
||||||
<Footer />
|
<Footer />
|
||||||
</main>
|
</main>
|
||||||
<Cursor />
|
|
||||||
</div>
|
</div>
|
||||||
|
<Cursor />
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
:global(body) {
|
:global(body) {
|
||||||
|
@ -129,7 +129,8 @@
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100dvh;
|
height: 100dvh;
|
||||||
backdrop-filter: blur(2px);
|
backdrop-filter: blur(2px);
|
||||||
overflow: hidden;
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
.controls {
|
.controls {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -146,12 +147,10 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 1000px;
|
max-width: 1000px;
|
||||||
height: 100dvh;
|
|
||||||
color: white;
|
color: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow-x: hidden;
|
overflow: visible;
|
||||||
overflow-y: auto;
|
|
||||||
> div {
|
> div {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user