render page content based on tokens; ignore rendered content field

This commit is contained in:
tmshv committed 2020-03-19 22:34:28 +03:00
1 parent 32d304b26f
commit bb393becc4
8 files changed
+188 -15

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { Html } from 'src/components/Html'
import MarkdownIt from 'markdown-it'
import Typograf from 'typograf'
import { memo } from 'react'
const tp = new Typograf({ locale: ['ru'] })
const md = new MarkdownIt({
html: true,
})
export type MarkdownProps = {
data: string
}
export const Markdown: React.SFC<MarkdownProps> = memo(props => (
<Html
html={tp.execute(md.render(props.data))}
/>
))
+1 -7
View File
@@ -7,19 +7,13 @@ import { ITag } from 'src/types'
export type PageProps = {
style?: React.CSSProperties
children: string
date: Date
tags: ITag[]
}
export const Page: React.FC<PageProps> = props => (
<div className={'page'} style={props.style}>
<Html
as={'article'}
className={'article'}
html={props.children}
/>
{props.children}
<hr />
<Share />