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:
parent
bb1b30fc2d
commit
cd7914dc4e
6 changed files with 43 additions and 9 deletions
|
|
@ -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] };
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue