Skip to content

Expose post content rendering helper in PostExtension #175

@halostatue

Description

@halostatue

I've got a couple of extensions, TableauExcerptExtension and an as-yet-unpublished revisions tracking extension where I've got meta-content in frontmatter that should be written in the same format as the main content.

Right now, that only works reasonably well for markdown posts because Tableau.markdown/2 exists. However, if each post has a render_content/1 function included (similar to the renderer function attribute), this could be handled for extended content types without special handling‡.

Tableau.PostExtension.post() would need to be updated to include a render_content, function, and Tableau.Page.t() would need to be updated so the same function is exposed for use just like page.template.

This would allow post rendering to do something like this (Temple example in a index page):

div do
  post.render_content.(post.excerpt)
end

‡ There is special handling in an upcoming version of TableauExcerptExtension because it has to do some processing of the content, but that's something separate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions