-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic markdown rendering for about-us page
- Loading branch information
1 parent
b7e4fd5
commit 1f75c87
Showing
7 changed files
with
70 additions
and
5 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,3 +1,25 @@ | ||
import { | ||
lazy, | ||
LocationProvider, | ||
ErrorBoundary, | ||
Router, | ||
Route, | ||
} from 'preact-iso' | ||
|
||
import aboutUsUrl from './routes/about-us.md' | ||
import { renderMarkdownRoute } from './utils/renderMarkdownRoute' | ||
|
||
const AboutUs = lazy(() => renderMarkdownRoute(aboutUsUrl)) | ||
|
||
export default function App() { | ||
return <div>Hello World!</div> | ||
return ( | ||
<LocationProvider> | ||
<ErrorBoundary> | ||
<Router> | ||
<Route path="/about-us" component={AboutUs} /> | ||
<Route default component={() => 'Not found'} /> | ||
</Router> | ||
</ErrorBoundary> | ||
</LocationProvider> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module '*.md' { | ||
const url: string | ||
export default url | ||
} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: About Us | ||
excerpt: SeattleJS is a safe and inclusive event for everyone | ||
--- | ||
|
||
 | ||
|
||
SeattleJS is the largest JavaScript and web developer meetup in Seattle. | ||
|
||
We are an inclusive community and welcome everyone, including folks who are just getting started in tech. | ||
|
||
Our mission is to help folks: | ||
|
||
<i class="fa-solid fa-battery-bolt"></i> Level up their skills | ||
|
||
<i class="fa-solid fa-handshake-simple"></i> Grow their network | ||
|
||
<i class="fa-solid fa-briefcase"></i> Get connected to job opportunities | ||
|
||
<i class="fa-solid fa-globe"></i> Advocate for the open web | ||
|
||
Our meetings are the 2nd Wednesday of each month, we hope you can join us! |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export async function renderMarkdownRoute( | ||
markdownPath: string | ||
): Promise<preact.ComponentType> { | ||
const [frontMatter, marked] = await Promise.all([ | ||
import('front-matter'), | ||
import('marked'), | ||
]) | ||
|
||
const res = await fetch(markdownPath) | ||
const text = await res.text() | ||
|
||
const { attributes, body } = frontMatter.default(text) | ||
const html = await marked.marked(body) | ||
|
||
return () => <div dangerouslySetInnerHTML={{ __html: html }}></div> | ||
} |
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
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