edit post stuff
This commit is contained in:
parent
d22f7e4ab2
commit
d81ec4d50c
3 changed files with 28 additions and 11 deletions
|
@ -4,20 +4,28 @@ import styles from "styles/Posts.module.sass";
|
|||
import { useTheme } from "next-themes";
|
||||
import Date from "./Date";
|
||||
|
||||
const Post = ({ title, date, tag }) => {
|
||||
const Post = ({ title, date, tag, slug }) => {
|
||||
const { resolvedTheme: theme } = useTheme();
|
||||
|
||||
return (
|
||||
<>
|
||||
<div data-theme={theme} className={styles.post}>
|
||||
<div className={styles.title_date}>
|
||||
<p className={styles.title}>{title}</p>
|
||||
<p className={styles.date}>
|
||||
<Date dateString={date} />
|
||||
</p>
|
||||
</div>
|
||||
{tag ? <p data-theme={theme} className={styles.tag}>{tag}</p> : undefined}
|
||||
</div>
|
||||
<Link href={`/blog/${slug}`}>
|
||||
<a className={styles.link}>
|
||||
<div data-theme={theme} className={styles.post}>
|
||||
<div className={styles.title_date}>
|
||||
<p className={styles.title}>{title}</p>
|
||||
<p className={styles.date}>
|
||||
<Date dateString={date} />
|
||||
</p>
|
||||
</div>
|
||||
{tag ? (
|
||||
<p data-theme={theme} className={styles.tag}>
|
||||
{tag}
|
||||
</p>
|
||||
) : undefined}
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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.
|
||||
|
||||
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";
|
||||
```
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
.post
|
||||
display: flex
|
||||
padding-top: .3rem
|
||||
padding-bottom: .3rem
|
||||
align-items: center
|
||||
transition: all .2s
|
||||
background: $background-dark-buttons
|
||||
|
@ -46,3 +48,6 @@
|
|||
display: grid
|
||||
gap: .5rem
|
||||
grid-template-columns: 1
|
||||
|
||||
.link
|
||||
cursor: pointer
|
||||
|
|
Loading…
Add table
Reference in a new issue