Allow markdown in post descriptions
This commit is contained in:
parent
47184b5939
commit
711dcbab53
|
@ -7,6 +7,7 @@ const mdDefList = require("markdown-it-deflist");
|
|||
const mdToc = require("markdown-it-table-of-contents");
|
||||
const mdAnchor = require("markdown-it-anchor");
|
||||
const nunjucksDate = require("nunjucks-date");
|
||||
const markdownIt = require("markdown-it");
|
||||
|
||||
function addEleventyPlugins(eleventyConfig) {
|
||||
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
||||
|
@ -30,6 +31,9 @@ function configureMarkdown(eleventyConfig) {
|
|||
}
|
||||
|
||||
function addFilters(eleventyConfig) {
|
||||
let md = new markdownIt();
|
||||
|
||||
eleventyConfig.addFilter("renderMarkdown", (mdString) => md.render(mdString));
|
||||
eleventyConfig.addFilter("log", (value) => console.log(value));
|
||||
eleventyConfig.addFilter("date", nunjucksDate);
|
||||
eleventyConfig.addFilter("IsNotPage", (collection, url) =>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
</dl>
|
||||
<p>{{ post.data.description }}</p>
|
||||
<p>{{ post.data.description | renderMarkdown | safe }}</p>
|
||||
</section>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
|
|
Loading…
Reference in a new issue