3 次代碼提交 d3ee3f916e ... ba39d9f1ff

作者 SHA1 備註 提交日期
  ahmadnourallah ba39d9f1ff Update readme file 6 年之前
  ahmadnourallah ec3a39ee7f Use 'get' to fetch list elements 6 年之前
  ahmadnourallah 71d69a5ccf Update config file 6 年之前
共有 3 個文件被更改,包括 3 次插入2 次删除
  1. 1 0
      README.md
  2. 1 1
      config.py
  3. 1 1
      wiki/views/wiki.py

+ 1 - 0
README.md

@@ -106,6 +106,7 @@ UPLOAD_FOLDER = join(dirname(abspath(__file__)), 'wiki/static/') # Upload folder
 WEBSITE_LOGO = gettext('images/logo-e.png')
 WEBSITE_NAME = gettext('Uruk Wiki')
 WEBSITE_KEYWORDS = gettext('uruk, wiki, uruk wiki, uruk project, uruk linux, linux, URUK, URUK PROJECT') # Website Keywords (for SEO)
+FRONT_PAGE = gettext('index') # Front Page url, set to False if none
 ```
 
 Also, project must have a config file in *instance* directory. Create *instance/config.py* and fill it with the below template:

+ 1 - 1
config.py

@@ -27,4 +27,4 @@ UPLOAD_FOLDER = join(dirname(abspath(__file__)), 'wiki/static/') # Upload folder
 WEBSITE_LOGO = gettext('images/logo-e.png')
 WEBSITE_NAME = gettext('Uruk Wiki')
 WEBSITE_KEYWORDS = gettext('uruk, wiki, uruk wiki, uruk project, uruk linux, linux, URUK, URUK PROJECT') # Website Keywords (for SEO)
-FRONT_PAGE = gettext('index') # Front Page name, set to False if none
+FRONT_PAGE = gettext('index') # Front Page url, set to False if none

+ 1 - 1
wiki/views/wiki.py

@@ -18,7 +18,7 @@ wiki = Blueprint('wiki', __name__)
 @wiki.route('/')
 @nocache
 def index():
-	if app.config['FRONT_PAGE']:
+	if app.config.get('FRONT_PAGE'):
 		frontpage = WikiPostDB.query.filter_by(default_lang=session['lang'], url=gettext(app.config['FRONT_PAGE'])).first()
 		if frontpage:
 			content = macro_compiler(frontpage.content, 'macros.html')