Skip to content

Commit

Permalink
refactor: change hardcoded markdown and fish files to notion cms
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-frasz committed Feb 23, 2023
1 parent f171b65 commit 224c6b1
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 44 deletions.
17 changes: 10 additions & 7 deletions src/app/others/dev-setup/page.tsx
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} />
}
33 changes: 18 additions & 15 deletions src/app/others/gaming-setup/page.tsx
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} />
}
21 changes: 12 additions & 9 deletions src/app/terminal/fish/page.tsx
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} />
}
30 changes: 17 additions & 13 deletions src/app/terminal/general/page.tsx
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} />
}

0 comments on commit 224c6b1

Please sign in to comment.