-
-
-
Profiles
-
+const IndexPage = (props: { profiles: SocialButton[]; posts: Array
}) => {
+ // console.log(props.posts);
+ return (
+ <>
+
-
-
- >
-);
+
+ >
+ );
+};
export default IndexPage;
diff --git a/posts/second-post.mdx b/posts/second-post.mdx
new file mode 100644
index 0000000..6a331da
--- /dev/null
+++ b/posts/second-post.mdx
@@ -0,0 +1,20 @@
+---
+title: "Second Post"
+date: "2020-01-03"
+tag: "random"
+---
+
+We recommend using **Static Generation** (with and without data) whenever possible because your page can be built once and served by CDN, which makes it much faster than having a server render the page on every request.
+
+You can use Static Generation for many types of pages, including:
+
+- Marketing pages
+- Blog posts
+- E-commerce product listings
+- Help and documentation
+
+You should ask yourself: "Can I pre-render this page **ahead** of a user's request?" If the answer is yes, then you should choose Static Generation.
+
+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.
\ No newline at end of file
diff --git a/posts/ssg-ssr.mdx b/posts/ssg-ssr.mdx
new file mode 100644
index 0000000..aeb2018
--- /dev/null
+++ b/posts/ssg-ssr.mdx
@@ -0,0 +1,19 @@
+---
+title: "First Post"
+date: "2020-01-02"
+---
+
+We recommend using **Static Generation** (with and without data) whenever possible because your page can be built once and served by CDN, which makes it much faster than having a server render the page on every request.
+
+You can use Static Generation for many types of pages, including:
+
+- Marketing pages
+- Blog posts
+- E-commerce product listings
+- Help and documentation
+
+You should ask yourself: "Can I pre-render this page **ahead** of a user's request?" If the answer is yes, then you should choose Static Generation.
+
+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.
\ No newline at end of file
diff --git a/public/logos/dark.svg b/public/logos/dark.svg
new file mode 100644
index 0000000..5dcd77a
--- /dev/null
+++ b/public/logos/dark.svg
@@ -0,0 +1,3 @@
+
diff --git a/public/logos/light.svg b/public/logos/light.svg
new file mode 100644
index 0000000..3b8559a
--- /dev/null
+++ b/public/logos/light.svg
@@ -0,0 +1,3 @@
+
diff --git a/styles/Button.module.sass b/styles/Button.module.sass
index 1d9a4bf..e4386b6 100644
--- a/styles/Button.module.sass
+++ b/styles/Button.module.sass
@@ -1,13 +1,27 @@
+@import "./_variables"
+
.button
display: flex
- background-color: #191919
align-items: center
transition: all .2s
- &:hover
- background-color: white
- color: black
- transform: translateY(-0.3em)
+ background: $background-dark-buttons
+ color: $text-dark-buttons
+ &[data-theme="light"]
+ background: $background-light-buttons
+ color: $text-light-buttons
+.button:hover
+ transform: translateY(-0.3em)
+ background: $background-dark-buttons-hover
+ color: $text-dark-buttons-hover
+ &[data-theme="light"]
+ background: $background-light-buttons-hover
+ color: $text-light-buttons-hover
+ // & > .platform_username > .username
+ // color: $username-dark-hover
+ // &[data-theme="light"]
+ // color: $username-light-hover
+// TODO: FIX THE HOVER FOR USERNAMES
.icon
padding: 10px
@@ -21,7 +35,9 @@
.platform
font-weight: lighter
.username
- color: grey
+ color: $username-dark
+ &[data-theme="light"]
+ color: $username-light
.grid
display: grid
diff --git a/styles/Lanyard.module.sass b/styles/Lanyard.module.sass
index 37465b2..97c91d1 100644
--- a/styles/Lanyard.module.sass
+++ b/styles/Lanyard.module.sass
@@ -1,3 +1,6 @@
+@import "./_variables"
+
+
.container
position: absolute
bottom: 0
@@ -5,10 +8,13 @@
margin: 10px
display: inline-flex
align-items: center
- background-color: #222
max-width: 50rem
- border-radius: .5rem
- animation: skeleton-loading 2s linear infinite alternate
+ background: $background-dark-lanyard
+ color: $text-dark-lanyard
+ &[data-theme="light"]
+ background: $background-light-lanyard
+ color: $text-light-lanyard
+
.albumart
border-radius: 20px
@@ -34,7 +40,7 @@
text-align: center
line-height: 18px
border-radius: 50%
- box-shadow: 0 0 1px #333
+ // box-shadow: 0 0 1px #333
animation: pulse 4s linear infinite alternate
@keyframes pulse
diff --git a/styles/Link.module.sass b/styles/Link.module.sass
new file mode 100644
index 0000000..e69de29
diff --git a/styles/Navbar.module.sass b/styles/Navbar.module.sass
new file mode 100644
index 0000000..6977a2d
--- /dev/null
+++ b/styles/Navbar.module.sass
@@ -0,0 +1,7 @@
+.center
+ align-content: center
+ justify-content: center
+ margin-top: 2rem
+ padding-top: 3rem
+ padding-bottom: 2.5rem
+ border-radius: .5rem
\ No newline at end of file
diff --git a/styles/Posts.module.sass b/styles/Posts.module.sass
new file mode 100644
index 0000000..f248054
--- /dev/null
+++ b/styles/Posts.module.sass
@@ -0,0 +1,48 @@
+@import "./_variables"
+
+.post
+ display: flex
+ align-items: center
+ transition: all .2s
+ background: $background-dark-buttons
+ color: $text-dark-buttons
+ &[data-theme="light"]
+ background: $background-light-buttons
+ color: $text-light-buttons
+
+.post:hover
+ transform: translateY(-0.3em)
+ background: $background-dark-buttons-hover
+ color: $text-dark-buttons-hover
+ &[data-theme="light"]
+ background: $background-light-buttons-hover
+ color: $text-light-buttons-hover
+ > .tag
+ color: $tag-text-dark-hover
+ &[data-theme="light"]
+ color: $tag-text-light-hover
+
+.icon
+ padding: 10px
+
+.tag
+ padding-right: 2rem
+ margin-left: auto
+ color: $tag-text-dark
+ &[data-theme="light"]
+ color: $tag-text-light
+
+.title_date
+ line-height: .5rem
+ padding-left: 1rem
+ .title
+ font-weight: lighter
+ .date
+ color: $username-dark
+ &[data-theme="light"]
+ color: $username-light
+
+.grid
+ display: grid
+ gap: .5rem
+ grid-template-columns: 1
diff --git a/styles/Title.module.sass b/styles/Title.module.sass
index 00f7e7d..0f45b38 100644
--- a/styles/Title.module.sass
+++ b/styles/Title.module.sass
@@ -1,5 +1,5 @@
.title
- display: inline-flex
- font-size: 3rem
+ // display: inline-flex
+ // font-size: 3rem
margin-top: 5rem
- background-image: linear-gradient(to top, transparent 0.15em, rgb(0, 0, 0) 0.15em, rgb(0, 0, 0) 0.6em, transparent 0.6em)
\ No newline at end of file
+ // background-image: linear-gradient(to top, transparent 0.15em, rgb(0, 0, 0) 0.15em, rgb(0, 0, 0) 0.6em, transparent 0.6em)
\ No newline at end of file
diff --git a/styles/_variables.sass b/styles/_variables.sass
new file mode 100644
index 0000000..ef35d28
--- /dev/null
+++ b/styles/_variables.sass
@@ -0,0 +1,29 @@
+$text-light: #222
+$text-dark: #ccc
+$background-light: #ededed
+$background-dark: #111
+
+$text-light-lanyard: #222
+$text-dark-lanyard: #ccc
+$background-light-lanyard: #b5b5b5
+$background-dark-lanyard: #222
+
+$text-light-buttons: #000000
+$text-dark-buttons: #ccc
+$background-light-buttons: #b5b5b5
+$background-dark-buttons: #191919
+
+$text-light-buttons-hover: #ccc
+$text-dark-buttons-hover: #222
+$background-light-buttons-hover: #191919
+$background-dark-buttons-hover: #b5b5b5
+
+$username-light: black
+$username-dark: grey
+$username-light-hover: blue
+$username-dark-hover: red
+
+$tag-text-dark: grey
+$tag-text-light: black
+$tag-text-dark-hover: black
+$tag-text-light-hover: grey
diff --git a/styles/main.sass b/styles/main.sass
index 77e27f3..071d832 100644
--- a/styles/main.sass
+++ b/styles/main.sass
@@ -1,3 +1,5 @@
+@import "./_variables"
+
a
text-decoration: none
color: white
@@ -5,11 +7,13 @@ a
// padding: 0
// margin: 0
-body
- background: #111
- color: white
+html
font-family: "Flachbau"
-
+ background: $background-dark
+ color: $text-dark
+ &[data-theme="light"]
+ background: $background-light
+ color: $text-light
@font-face
font-family: "Flachbau"
diff --git a/utils/shared/posts.ts b/utils/shared/posts.ts
new file mode 100644
index 0000000..940e292
--- /dev/null
+++ b/utils/shared/posts.ts
@@ -0,0 +1,46 @@
+import { remark } from "remark";
+import html from "remark-html";
+import fs from "fs";
+import path from "path";
+import matter from "gray-matter";
+
+export async function getPostData(slug) {
+ const fullPath = path.join("posts", `${slug}.mdx`);
+ const fileContents = fs.readFileSync(fullPath, "utf8");
+
+ // Use gray-matter to parse the post metadata section
+ const matterResult = matter(fileContents);
+
+ // Use remark to convert markdown into HTML string
+ const processedContent = await remark()
+ .use(html)
+ .process(matterResult.content);
+ const contentHtml = processedContent.toString();
+
+ // Combine the data with the id and contentHtml
+ return {
+ slug,
+ content: contentHtml,
+ ...matterResult.data,
+ };
+}
+
+export async function getSortedPosts() {
+ const allPosts = getAllPostIDs()
+ let Posts = []
+ for (const Post of allPosts) {
+ Posts.push(await getPostData(Post.params.slug))
+ }
+ return Posts
+}
+
+export function getAllPostIDs() {
+ const n = fs.readdirSync("posts/");
+ return n.map((f) => {
+ return {
+ params: {
+ slug: f.replace(/\.mdx$/, ""),
+ },
+ };
+ });
+}