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