Skip to content

Commit

Permalink
fix theme_base
Browse files Browse the repository at this point in the history
  • Loading branch information
panjunyong committed Aug 2, 2013
1 parent 7392056 commit fecfbee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ zcms吸取了Jekyll优点,使用python/pyramid开发完成,完全无需任
=========================
在站点根文件夹下面的_config.yaml里面,定义了整个站点的皮肤

theme_base: http://localhost:6543/themes/bootstrap/ # 存放模版的基准位置,这里可能存放了多个模版
theme_base: http://localhost:6543/themes/bootstrap # 存放模版的基准位置,这里可能存放了多个模版
theme: default.html # 默认的模版

外观模版是通过一个网址来指定的,上面的完整外观模版地址是:
Expand Down
2 changes: 1 addition & 1 deletion contents/demo/_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: demo site
description: a demo site
theme_base: http://localhost:6543/themes/bootstrap/
theme_base: http://localhost:6543/themes/bootstrap
theme: default.html
order: [index.rst, tour, blog, about.rst]
exclude: []
4 changes: 2 additions & 2 deletions zcms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _func(context, request):
content = content.decode('utf-8')

# 根据模版来渲染最终效果
theme_base = site.metadata.get('theme_base', 'http://download.zopen.cn/themes/bootstrap/')
theme_base = site.metadata.get('theme_base', 'http://download.zopen.cn/themes/bootstrap')
kw = {
'site_title': site.title,
'site_description': site.metadata.get('description', ''),
Expand All @@ -151,7 +151,7 @@ def _func(context, request):

theme_default = site.metadata.get('theme', 'default.html')
theme = context.metadata.get('theme', theme_default)
template = get_theme_template(theme_base + theme)
template = get_theme_template(theme_base + '/' + theme)
output = template.substitute(kw).encode('utf8')
return Response(output, headerlist=[
('Content-length', str(len(output))),
Expand Down

0 comments on commit fecfbee

Please sign in to comment.