Skip to content

Commit

Permalink
Update title and more
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Sep 4, 2024
1 parent 296a297 commit cc8ca77
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ul {

}

.ensip-list li[data-X=true] a {
.ensip-list li[data-x=true] a {
color: #DE5999;
}

Expand Down
10 changes: 5 additions & 5 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import type { FC } from 'react';

import type { ENSIPData } from '.';
import { Header } from './components/Header';
import { Navbar } from './components/Navbar';
import { Frame } from './Frame';
import type { Frontmatter } from './specs/validateFrontmatter';

export const App: FC<{ markdown: string; frontmatter: Frontmatter }> = ({
markdown,
frontmatter,
}) => {
export const App: FC<{ data: ENSIPData }> = ({ data }) => {
const { path, title, frontmatter, markdown } = data;

return (
<Frame>
<article>
<Navbar />
<Header frontmatter={frontmatter} />
<h1>{title}</h1>
<div dangerouslySetInnerHTML={{ __html: markdown }} />
</article>
</Frame>
Expand Down
2 changes: 1 addition & 1 deletion app/src/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Home: FC<{ ensips: ENSIPData[] }> = ({ ensips }) => {
{ensips.map(({ path, title }) => (
<li
key={path}
data-X={title.toLowerCase().startsWith('ensip-x')}
data-x={title.toLowerCase().startsWith('ensip-x')}
>
<a href={`/${path}`} className="link">
{title}
Expand Down
13 changes: 5 additions & 8 deletions app/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,16 @@ for (const file of files) {
)
.process(fileData);

ensips.push({
const data: ENSIPData = {
path: directPath.split('/').pop()!.replace('.md', ''),
title: title!,
frontmatter: frontmatter!,
markdown: result.value.toString(),
});
};

const x = renderToStaticMarkup(
<App
markdown={result.value.toString()}
frontmatter={frontmatter!}
/>
);
ensips.push(data);

const x = renderToStaticMarkup(<App data={data} />);

// write to file
await writeFile(
Expand Down

0 comments on commit cc8ca77

Please sign in to comment.