Add sample blog posts and fix rendering

- Add hello-world.md and second-post.md sample posts
- Fix index page: use set:html for links, add charset, import global.css
- Fix post page: add charset meta tag
- Fix remark plugin: use className array, handle leaf directives
- Update CSS: support left/right margin note classes
This commit is contained in:
Lewis Wynne 2026-01-23 00:47:27 +00:00
parent bb1b30fc2d
commit cd7914dc4e
6 changed files with 43 additions and 9 deletions

View file

@ -3,12 +3,12 @@ import type { Root } from 'mdast';
export default function remarkAside() {
return (tree: Root) => {
visit(tree, 'textDirective', (node: any) => {
if (node.name !== 'aside') return;
visit(tree, ['textDirective', 'leafDirective'], (node: any) => {
if (node.name !== 'left' && node.name !== 'right') return;
const data = node.data || (node.data = {});
data.hName = 'span';
data.hProperties = { class: 'aside' };
data.hProperties = { className: [node.name] };
});
};
}