edit post stuff

This commit is contained in:
Joshua 2022-10-17 22:22:30 +02:00
parent d22f7e4ab2
commit d81ec4d50c
3 changed files with 28 additions and 11 deletions

View file

@ -4,20 +4,28 @@ import styles from "styles/Posts.module.sass";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import Date from "./Date"; import Date from "./Date";
const Post = ({ title, date, tag }) => { const Post = ({ title, date, tag, slug }) => {
const { resolvedTheme: theme } = useTheme(); const { resolvedTheme: theme } = useTheme();
return ( return (
<> <>
<div data-theme={theme} className={styles.post}> <Link href={`/blog/${slug}`}>
<div className={styles.title_date}> <a className={styles.link}>
<p className={styles.title}>{title}</p> <div data-theme={theme} className={styles.post}>
<p className={styles.date}> <div className={styles.title_date}>
<Date dateString={date} /> <p className={styles.title}>{title}</p>
</p> <p className={styles.date}>
</div> <Date dateString={date} />
{tag ? <p data-theme={theme} className={styles.tag}>{tag}</p> : undefined} </p>
</div> </div>
{tag ? (
<p data-theme={theme} className={styles.tag}>
{tag}
</p>
) : undefined}
</div>
</a>
</Link>
</> </>
); );
}; };

View file

@ -17,4 +17,8 @@ You should ask yourself: "Can I pre-render this page **ahead** of a user's reque
On the other hand, Static Generation is **not** a good idea if you cannot pre-render a page ahead of a user's request. Maybe your page shows frequently updated data, and the page content changes on every request. On the other hand, Static Generation is **not** a good idea if you cannot pre-render a page ahead of a user's request. Maybe your page shows frequently updated data, and the page content changes on every request.
In that case, you can use **Server-Side Rendering**. It will be slower, but the pre-rendered page will always be up-to-date. Or you can skip pre-rendering and use client-side JavaScript to populate data. In that case, you can use **Server-Side Rendering**. It will be slower, but the pre-rendered page will always be up-to-date. Or you can skip pre-rendering and use client-side JavaScript to populate data.
```js
const uwu = "owo";
```

View file

@ -2,6 +2,8 @@
.post .post
display: flex display: flex
padding-top: .3rem
padding-bottom: .3rem
align-items: center align-items: center
transition: all .2s transition: all .2s
background: $background-dark-buttons background: $background-dark-buttons
@ -46,3 +48,6 @@
display: grid display: grid
gap: .5rem gap: .5rem
grid-template-columns: 1 grid-template-columns: 1
.link
cursor: pointer