forked from AlanDecode/Maverick
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f33143
commit 338ab8a
Showing
12 changed files
with
210 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ cached_imgs | |
tmp | ||
temp | ||
test_dist | ||
config.py | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Configuration | ||
""" | ||
|
||
import os | ||
import sys | ||
|
||
|
||
class Config(object): | ||
def update_fromfile(self, filepath=None): | ||
if filepath is None: | ||
return | ||
|
||
sys.path.append(os.path.dirname(filepath)) | ||
|
||
name, _ = os.path.splitext(os.path.basename(filepath)) | ||
module = __import__(name) | ||
|
||
attrs = dir(module) | ||
for attr in attrs: | ||
if attr.startswith('__'): | ||
continue | ||
setattr(self, attr, getattr(module, attr)) | ||
|
||
def update_fromenv(self): | ||
attrs = dir(self) | ||
for attr in attrs: | ||
if attr.startswith('__'): | ||
continue | ||
setattr(self, attr, os.getenv(attr, getattr(self, attr))) | ||
|
||
# For Maverick | ||
site_prefix = "/" | ||
source_dir = "./test_src/" | ||
build_dir = "./test_dist/" | ||
template = "Galileo" | ||
index_page_size = 10 | ||
archives_page_size = 30 | ||
fetch_remote_imgs = False | ||
locale = "Asia/Shanghai" | ||
|
||
# For site | ||
site_name = "" | ||
site_logo = "" | ||
site_build_date = "" | ||
author = "" | ||
email = "" | ||
author_homepage = "" | ||
description = "" | ||
key_words = [] | ||
language = "english" | ||
background_img = "" | ||
external_links = [] | ||
nav = [] | ||
|
||
social_links = [] | ||
|
||
valine = { | ||
"enable": False, | ||
"appId": "", | ||
"appKey": "", | ||
"notify": "false", | ||
"visitor": "false", | ||
"recordIP": "false", | ||
"serverURLs": None, | ||
"placeholder": "Just go go~" | ||
} | ||
|
||
head_addon = "" | ||
|
||
footer_addon = "" | ||
|
||
body_addon = "" | ||
|
||
g_conf = Config() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Sample Configuration | ||
""" | ||
|
||
# For Maverick | ||
site_prefix = "/" | ||
source_dir = "./test_src/" | ||
build_dir = "./test_dist/" | ||
template = "Galileo" | ||
index_page_size = 10 | ||
archives_page_size = 30 | ||
fetch_remote_imgs = False | ||
locale = "Asia/Shanghai" | ||
|
||
# For site | ||
site_name = "Maverick" | ||
site_logo = "${site_prefix}android-chrome-512x512.png" | ||
site_build_date = "2019-12-06T12:00+08:00" | ||
author = "AlanDecode" | ||
email = "[email protected]" | ||
author_homepage = "https://www.imalan.cn" | ||
description = "This is Maverick, Theme Galileo." | ||
key_words = ["Maverick", "AlanDecode", "Galileo", "blog"] | ||
language = 'english' | ||
background_img = '${site_prefix}bg/The_Great_Wave_off_Kanagawa.jpg' | ||
external_links = [ | ||
{ | ||
"name": "AlanDecode/Maverick", | ||
"url": "https://github.com/AlanDecode/Maverick", | ||
"brief": "🏄 Go My Own Way." | ||
}, | ||
{ | ||
"name": "Triple NULL", | ||
"url": "https://www.imalan.cn", | ||
"brief": "Home page for AlanDecode." | ||
} | ||
] | ||
nav = [ | ||
{ | ||
"name": "Home", | ||
"url": "${site_prefix}", | ||
"target": "_self" | ||
}, | ||
{ | ||
"name": "Archives", | ||
"url": "${site_prefix}archives/", | ||
"target": "_self" | ||
}, | ||
{ | ||
"name": "About", | ||
"url": "${site_prefix}about/", | ||
"target": "_self" | ||
} | ||
] | ||
|
||
social_links = [ | ||
{ | ||
"name": "Twitter", | ||
"url": "https://twitter.com/AlanDecode", | ||
"icon": "gi gi-twitter" | ||
}, | ||
{ | ||
"name": "GitHub", | ||
"url": "https://github.com/AlanDecode", | ||
"icon": "gi gi-github" | ||
}, | ||
{ | ||
"name": "Weibo", | ||
"url": "https://weibo.com/5245109677/", | ||
"icon": "gi gi-weibo" | ||
} | ||
] | ||
|
||
valine = { | ||
"enable": False, | ||
"appId": "", | ||
"appKey": "", | ||
"notify": "false", | ||
"visitor": "false", | ||
"recordIP": "false", | ||
"serverURLs": None, | ||
"placeholder": "Just go go~" | ||
} | ||
|
||
head_addon = r""" | ||
<!-- Content here will be added before </head>. --> | ||
""" | ||
|
||
footer_addon = r""" | ||
<!-- Content here will be added to <footer> tag.--> | ||
""" | ||
|
||
body_addon = r""" | ||
<!-- Content here will be added before </body>. --> | ||
""" |
Oops, something went wrong.