Skip to content

Commit

Permalink
当文章中不存在 Status 原数据时, 默认为 published
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaojieluo committed Feb 3, 2018
1 parent 2401575 commit 369a53c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions pelican_manager/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ <h2>Article list.</h2>
"status": function(){
{% if article.meta['status'] == 'draft' %}
return '<span class="label label-warning">draft</span>'
{% elif article.meta['status'] == 'published' %}
return '<span class="label label-success">published</span>'
{% else %}
return ''
return '<span class="label label-success">published</span>'
{% endif %}
}(),
"action": "<a href='{{ url_for('article.edit', path=article.path) }}'>Edit</a>"
Expand Down
4 changes: 4 additions & 0 deletions tests/pelicanconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@


COPYRIGHT = '&copy; 2017-2018 Powered by <a href="https://blog.getpelican.com/" target="_blank">Pelican</a> Theme &copy; <a href="https://github.com/xiaojieluo" target="_blank">LuoXiaojie</a>'

SERVER_DEBUG = '0'
# Server running port.
SERVER_PORT = 5000

0 comments on commit 369a53c

Please sign in to comment.