Closed traut closed 2 months ago
@traut Maybe it also needs format
? Usually frontmatter in markdown can be yaml
, toml
or json
@dobarx it is already in the frontmatter
spec -- https://github.com/blackstork-io/fabric/issues/47
Ahh, forgot I already did that 😄
About content placement. Right now plugin call returns object:
Content {
Markdown: string
}
Maybe we could return additional parameter for describing a position where to place content. For example: Pos: "start"
.
As for constraints, maybe those could be configured with ContentProvider
schema.
oh, that's neat! We can start with a simple enum that supports only doc-start
(beginning of the document) and as-defined
(where the block is defined), and rename / extend when needed
@traut I think latest changes cover part of this issue. It places frontmatter always on top of the rendered document. Two things remain:
only one content.frontmatter block can be defined in the document
This can be easaly checked now on plugin level, since we have content tree and info which plugin owns which content. I can throw error if second frontmatter is detected.
blocks can only be defined on the root level of the document block
This can also be checked on plugin level using content tree. I can throw an error if content frontmatter
is detected in section
.
Background
At the moment,
content.frontmatter
blocks in FCL is rendered as a "normal" content block and while it was easy to implement, it is an incorrect behavior. Fabric should implement custom logic for evaluating / renderingcontent.frontmatter
blocks.Design
content.frontmatter
blocks:content.frontmatter
blocks can only be defined on the root level of thedocument
blockcontent.frontmatter
block can be defined in the documentcontent.frontmatter
is placed at the very top of the document -- before any other content output. It doesn't mean that the fontmatter block should be evaluated first, just that the output must be at the beginning of the document.For example,
produces the output: