文章xml添加markdown内容
This commit is contained in:
parent
a1e7c3dc07
commit
79bdef1e9d
@ -2,7 +2,7 @@ const nunjucks = require('nunjucks')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
const env = new nunjucks.Environment()
|
||||
const env = new nunjucks.configure({ autoescape: false })
|
||||
env.addFilter('noControlChars', function(str) {
|
||||
return str && str.replace(/[\x00-\x1F\x7F]/g, '')
|
||||
})
|
||||
|
||||
@ -30,9 +30,7 @@ search:
|
||||
<link href="/文章URL地址/"/>
|
||||
<url>/文章URL地址/</url>
|
||||
<content type="html">
|
||||
<![CDATA[
|
||||
<p>这里是文章内容</p>
|
||||
]]>
|
||||
</content>
|
||||
<categories>
|
||||
<category>分类1</category>
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
{% if post.date %}
|
||||
<date>{{ +post.date }}</date>
|
||||
{% endif %}
|
||||
<md type="html"><![CDATA[{{post._content}}]]></md>
|
||||
<content type="html"><![CDATA[{{ post.content | noControlChars | safe }}]]></content>
|
||||
</entry>
|
||||
{% endif %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user