Cache Markdown'ed HTML in database
This is done via coercion rules. To cache the field 'content' in the database, include this in your Eve schema: {'content': {'type': 'string', 'coerce': 'markdown'}, '_content_html': {'type': 'string'}} The `_content_html` field will be filled automatically when saving the document via Eve. To display the cached HTML, and fall back to display-time rendering if it is not there, use `{{ document | markdowned('content') }}` in your template. Still needs unit testing, a CLI command for regenerating the caches, and a CLI command for migrating the node type definitions in existing projects.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
|
||||
| {% if node.description %}
|
||||
.node-details-description
|
||||
| {{ node.description | markdown }}
|
||||
| {{ node | markdowned('description') }}
|
||||
| {% endif %}
|
||||
|
||||
section.node-children.group
|
||||
|
Reference in New Issue
Block a user