-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change hardcoded markdown and fish files to notion cms
- Loading branch information
1 parent
f171b65
commit 224c6b1
Showing
4 changed files
with
57 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
import { CodePreview } from '@/components/CodePreview' | ||
import { getCodeBlockFromNotion } from '@/lib/notion-client' | ||
import shiki from 'shiki' | ||
|
||
export const metadata = { | ||
title: 'Dev Setup', | ||
} | ||
|
||
const markdown = ` | ||
# Dev Setup | ||
// const markdown = ` | ||
// # Dev Setup | ||
|
||
- MacBook M1 Max (64gb Memory) | ||
- LG 25" UltraWide Display | ||
// - MacBook M1 Max (64gb Memory) | ||
// - LG 25" UltraWide Display | ||
|
||
That's it, nothing more. | ||
`.trim() | ||
// That's it, nothing more. | ||
// `.trim() | ||
|
||
export default async function DevSetup() { | ||
const { content } = await getCodeBlockFromNotion("3ef135df776c4b359c3c2a5974c31c06") | ||
|
||
const highlighter = await shiki.getHighlighter({ | ||
theme: 'rose-pine-moon', | ||
}) | ||
|
||
const code = highlighter.codeToHtml(markdown, { lang: 'md' }) | ||
const code = highlighter.codeToHtml(content, { lang: 'md' }) | ||
|
||
return <CodePreview code={code} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,39 @@ | ||
import { CodePreview } from '@/components/CodePreview' | ||
import { getCodeBlockFromNotion } from '@/lib/notion-client' | ||
import shiki from 'shiki' | ||
|
||
export const metadata = { | ||
title: 'Gaming Setup', | ||
} | ||
|
||
const markdown = ` | ||
# Gaming Setup | ||
// const markdown = ` | ||
// # Gaming Setup | ||
|
||
- Intel Core i5-9600KF 3.7Ghz | ||
- 2x HyperX Fury 16GB 3000Mhz | ||
- Gigabyte Z390M Gaming | ||
- Cooler Master ATX 500W 80 Plus | ||
- 2x Corsair SSD MP510 480GB NVMe | ||
- Gigabyte NVIDIA GeForce RTX 2060 6G | ||
// - Intel Core i5-9600KF 3.7Ghz | ||
// - 2x HyperX Fury 16GB 3000Mhz | ||
// - Gigabyte Z390M Gaming | ||
// - Cooler Master ATX 500W 80 Plus | ||
// - 2x Corsair SSD MP510 480GB NVMe | ||
// - Gigabyte NVIDIA GeForce RTX 2060 6G | ||
|
||
|
||
## Peripherals | ||
// ## Peripherals | ||
|
||
- Logitech G PRO Wireless Mouse | ||
- Keychron K2 Keyboard (Brown Switch) | ||
- Samsung 23.5" Curved 144hz 1ms Display | ||
// - Logitech G PRO Wireless Mouse | ||
// - Keychron K2 Keyboard (Brown Switch) | ||
// - Samsung 23.5" Curved 144hz 1ms Display | ||
|
||
That's it, nothing more. | ||
`.trim() | ||
// That's it, nothing more. | ||
// `.trim() | ||
|
||
export default async function GamingSetup() { | ||
const { content } = await getCodeBlockFromNotion("1e3d4fc933cf4d30917acf99437e3a83") | ||
|
||
const highlighter = await shiki.getHighlighter({ | ||
theme: 'rose-pine-moon', | ||
}) | ||
|
||
const code = highlighter.codeToHtml(markdown, { lang: 'md' }) | ||
const code = highlighter.codeToHtml(content, { lang: 'md' }) | ||
|
||
return <CodePreview code={code} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
import { CodePreview } from '@/components/CodePreview' | ||
import { getCodeBlockFromNotion } from '@/lib/notion-client' | ||
import shiki from 'shiki' | ||
|
||
export const metadata = { | ||
title: 'Fish', | ||
} | ||
|
||
const fishConfig = `if status is-interactive | ||
# Commands to run in interactive sessions can go here | ||
end | ||
// const fishConfig = `if status is-interactive | ||
// # Commands to run in interactive sessions can go here | ||
// end | ||
|
||
set SPACEFISH_PROMPT_ADD_NEWLINE false | ||
// set SPACEFISH_PROMPT_ADD_NEWLINE false | ||
|
||
starship init fish | source | ||
// starship init fish | source | ||
|
||
# Aliases | ||
# alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"` | ||
// # Aliases | ||
// # alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"` | ||
|
||
export default async function FishConfig() { | ||
const { content } = await getCodeBlockFromNotion("801ef0fa04c542ec828881fb41382537") | ||
|
||
const highlighter = await shiki.getHighlighter({ | ||
theme: 'rose-pine-moon', | ||
}) | ||
|
||
const code = highlighter.codeToHtml(fishConfig, { lang: 'fish' }) | ||
const code = highlighter.codeToHtml(content, { lang: 'fish' }) | ||
|
||
return <CodePreview code={code} raw={fishConfig} /> | ||
return <CodePreview code={code} raw={content} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
import { CodePreview } from '@/components/CodePreview' | ||
import { getCodeBlockFromNotion } from '@/lib/notion-client' | ||
import shiki from 'shiki' | ||
|
||
|
||
export const metadata = { | ||
title: 'Terminal', | ||
} | ||
|
||
const markdown = ` | ||
# General | ||
// const markdown = ` | ||
// # General | ||
|
||
Currently I'm using the combo Fish + Starship in my terminal. | ||
// Currently I'm using the combo Fish + Starship in my terminal. | ||
|
||
Fish Shell: https://fishshell.com/ | ||
Starship: https://starship.rs/ | ||
// Fish Shell: https://fishshell.com/ | ||
// Starship: https://starship.rs/ | ||
|
||
--- | ||
// --- | ||
|
||
I'm also using Warp as my terminal emulator. | ||
// I'm also using Warp as my terminal emulator. | ||
|
||
Warp: https://www.warp.dev/ | ||
// Warp: https://www.warp.dev/ | ||
|
||
--- | ||
// --- | ||
|
||
For the theme, I chose Rosé Pine Moon variant: | ||
// For the theme, I chose Rosé Pine Moon variant: | ||
|
||
Theme: https://github.com/austintraver/warp-theme/blob/main/base16_rose_pine_moon.yaml | ||
`.trim() | ||
// Theme: https://github.com/austintraver/warp-theme/blob/main/base16_rose_pine_moon.yaml | ||
// `.trim() | ||
|
||
export default async function General() { | ||
const { content } = await getCodeBlockFromNotion("19308817500d4b3ca1f48b4b928911be") | ||
|
||
const highlighter = await shiki.getHighlighter({ | ||
theme: 'rose-pine-moon', | ||
}) | ||
|
||
const code = highlighter.codeToHtml(markdown, { lang: 'md' }) | ||
const code = highlighter.codeToHtml(content, { lang: 'md' }) | ||
|
||
return <CodePreview code={code} /> | ||
} |