|
1 | 1 | #!/usr/bin/env python |
2 | 2 | # -*- coding: utf-8 -*- |
3 | | - |
| 3 | +from __future__ import unicode_literals |
4 | 4 | import os, sys, datetime |
5 | 5 |
|
6 | 6 | OctBlogSettings = { |
|
10 | 10 | 'allow_donate': os.environ.get('allow_donate', 'true').lower() == 'true', |
11 | 11 | 'auto_role': os.environ.get('auto_role', 'reader').lower(), |
12 | 12 | 'blog_meta': { |
13 | | - 'name': os.environ.get('name').decode('utf8') if os.environ.get('name') else 'Oct Blog', |
14 | | - 'subtitle': os.environ.get('subtitle').decode('utf8') if os.environ.get('subtitle') else 'Oct Blog Subtitle', |
15 | | - 'description': os.environ.get('description').decode('utf8') if os.environ.get('description') else 'Oct Blog Description', |
16 | | - 'wechat_name': os.environ.get('wechat_name').decode('utf8') if os.environ.get('wechat_name') else 'Oct Blog Wechat Root', |
17 | | - 'wechat_subtitle': os.environ.get('wechat_subtitle').decode('utf8') if os.environ.get('wechat_subtitle') else 'Oct Blog Wechat Subtitle', |
18 | | - 'owner': os.environ.get('owner').decode('utf8') if os.environ.get('owner') else 'Gevin', |
19 | | - 'keywords': os.environ.get('keywords').decode('utf8') if os.environ.get('keywords') else 'python,django,flask,docker,MongoDB', |
| 13 | + 'name': os.environ.get('name') if os.environ.get('name') else 'Oct Blog', |
| 14 | + 'subtitle': os.environ.get('subtitle') if os.environ.get('subtitle') else 'Oct Blog Subtitle', |
| 15 | + 'description': os.environ.get('description') if os.environ.get('description') else 'Oct Blog Description', |
| 16 | + 'wechat_name': os.environ.get('wechat_name') if os.environ.get('wechat_name') else 'Oct Blog Wechat Root', |
| 17 | + 'wechat_subtitle': os.environ.get('wechat_subtitle') if os.environ.get('wechat_subtitle') else 'Oct Blog Wechat Subtitle', |
| 18 | + 'owner': os.environ.get('owner') if os.environ.get('owner') else 'Gevin', |
| 19 | + 'keywords': os.environ.get('keywords') if os.environ.get('keywords') else 'python,django,flask,docker,MongoDB', |
20 | 20 | 'google_site_verification': os.environ.get('google_site_verification') or '12345678', |
21 | 21 | 'baidu_site_verification': os.environ.get('baidu_site_verification') or '87654321', |
22 | 22 | 'sogou_site_verification': os.environ.get('sogou_site_verification') or '87654321', |
|
39 | 39 | }, |
40 | 40 | 'donation': { |
41 | 41 | 'allow_donate': os.environ.get('allow_donate', 'true').lower() == 'true', |
42 | | - 'donation_msg': os.environ.get('donation_msg', 'You can donate to me if the article makes sense to you').decode('utf8') |
| 42 | + 'donation_msg': os.environ.get('donation_msg', 'You can donate to me if the article makes sense to you') |
43 | 43 | }, |
44 | 44 | 'wechat': { |
45 | 45 | 'display_wechat': os.environ.get('display_wechat', 'true').lower() == 'true', |
46 | | - 'wechat_msg': os.environ.get('wechat_msg', 'Welcome to follow my wechat').decode('utf8') |
| 46 | + 'wechat_msg': os.environ.get('wechat_msg', 'Welcome to follow my wechat') |
47 | 47 | }, |
48 | 48 | 'copyright': { |
49 | 49 | 'display_copyright': os.environ.get('allow_display_copyright', 'true').lower() == 'true', |
50 | | - 'copyright_msg': os.environ.get('copyright_msg', 'The article is not allowed to repost unless author authorized').decode('utf8') |
| 50 | + 'copyright_msg': os.environ.get('copyright_msg', 'The article is not allowed to repost unless author authorized') |
51 | 51 | }, |
52 | 52 | 'only_abstract_in_feed': os.environ.get('only_abstract_in_feed', 'false').lower() == 'true', |
53 | 53 | 'allow_share_article': os.environ.get('allow_share_article', 'true').lower() == 'true', |
|
61 | 61 |
|
62 | 62 | } |
63 | 63 |
|
| 64 | +# OctBlogSettings = { |
| 65 | +# 'post_types': ('post', 'page'), # deprecated |
| 66 | +# 'allow_registration': os.environ.get('allow_registration', 'false').lower() == 'true', |
| 67 | +# 'allow_su_creation': os.environ.get('allow_su_creation', 'false').lower() == 'true', |
| 68 | +# 'allow_donate': os.environ.get('allow_donate', 'true').lower() == 'true', |
| 69 | +# 'auto_role': os.environ.get('auto_role', 'reader').lower(), |
| 70 | +# 'blog_meta': { |
| 71 | +# # 'name': os.environ.get('name').decode('utf8') if os.environ.get('name') else 'Oct Blog', |
| 72 | +# 'name': os.environ.get('name') if os.environ.get('name') else 'Oct Blog', |
| 73 | +# 'subtitle': os.environ.get('subtitle').decode('utf8') if os.environ.get('subtitle') else 'Oct Blog Subtitle', |
| 74 | +# 'description': os.environ.get('description').decode('utf8') if os.environ.get('description') else 'Oct Blog Description', |
| 75 | +# 'wechat_name': os.environ.get('wechat_name').decode('utf8') if os.environ.get('wechat_name') else 'Oct Blog Wechat Root', |
| 76 | +# 'wechat_subtitle': os.environ.get('wechat_subtitle').decode('utf8') if os.environ.get('wechat_subtitle') else 'Oct Blog Wechat Subtitle', |
| 77 | +# 'owner': os.environ.get('owner').decode('utf8') if os.environ.get('owner') else 'Gevin', |
| 78 | +# 'keywords': os.environ.get('keywords').decode('utf8') if os.environ.get('keywords') else 'python,django,flask,docker,MongoDB', |
| 79 | +# 'google_site_verification': os.environ.get('google_site_verification') or '12345678', |
| 80 | +# 'baidu_site_verification': os.environ.get('baidu_site_verification') or '87654321', |
| 81 | +# 'sogou_site_verification': os.environ.get('sogou_site_verification') or '87654321', |
| 82 | +# }, |
| 83 | +# 'search_engine_submit_urls':{ |
| 84 | +# 'baidu': os.environ.get('baidu_submit_url') |
| 85 | +# }, |
| 86 | +# 'pagination':{ |
| 87 | +# 'per_page': int(os.environ.get('per_page', 5)), |
| 88 | +# 'admin_per_page': int(os.environ.get('admin_per_page', 10)), |
| 89 | +# 'archive_per_page': int(os.environ.get('admin_per_page', 20)), |
| 90 | +# }, |
| 91 | +# 'blog_comment':{ |
| 92 | +# 'allow_comment': os.environ.get('allow_comment', 'true').lower() == 'true', |
| 93 | +# 'comment_type': os.environ.get('comment_type', 'octblog').lower(), # currently, OctBlog only supports duoshuo comment |
| 94 | +# 'comment_opt':{ |
| 95 | +# 'octblog': 'oct-blog', # shotname of octblog |
| 96 | +# 'duoshuo': 'oct-blog', # shotname of duoshuo |
| 97 | +# } |
| 98 | +# }, |
| 99 | +# 'donation': { |
| 100 | +# 'allow_donate': os.environ.get('allow_donate', 'true').lower() == 'true', |
| 101 | +# 'donation_msg': os.environ.get('donation_msg', 'You can donate to me if the article makes sense to you').decode('utf8') |
| 102 | +# }, |
| 103 | +# 'wechat': { |
| 104 | +# 'display_wechat': os.environ.get('display_wechat', 'true').lower() == 'true', |
| 105 | +# 'wechat_msg': os.environ.get('wechat_msg', 'Welcome to follow my wechat').decode('utf8') |
| 106 | +# }, |
| 107 | +# 'copyright': { |
| 108 | +# 'display_copyright': os.environ.get('allow_display_copyright', 'true').lower() == 'true', |
| 109 | +# 'copyright_msg': os.environ.get('copyright_msg', 'The article is not allowed to repost unless author authorized').decode('utf8') |
| 110 | +# }, |
| 111 | +# 'only_abstract_in_feed': os.environ.get('only_abstract_in_feed', 'false').lower() == 'true', |
| 112 | +# 'allow_share_article': os.environ.get('allow_share_article', 'true').lower() == 'true', |
| 113 | +# 'gavatar_cdn_base': os.environ.get('gavatar_cdn_base', '//cdn.v2ex.com/gravatar/'), |
| 114 | +# 'gavatar_default_image': os.environ.get('gavatar_default_image', 'http://7tsygu.com1.z0.glb.clouddn.com/user-avatar.jpg'), |
| 115 | +# 'background_image': { |
| 116 | +# 'home': os.environ.get('bg_home') or 'http://7d9q7a.com1.z0.glb.clouddn.com/octblog-bg.jpg', |
| 117 | +# 'post': os.environ.get('bg_post') or 'http://7d9q7a.com1.z0.glb.clouddn.com/octblog-bg.jpg', |
| 118 | +# 'about': os.environ.get('bg_about') or 'http://7d9q7a.com1.z0.glb.clouddn.com/octblog_about.jpg' |
| 119 | +# }, |
| 120 | + |
| 121 | +# } |
| 122 | + |
64 | 123 | class Config(object): |
65 | 124 | DEBUG = False |
66 | 125 | TESTING = False |
|
0 commit comments