aboutsummaryrefslogtreecommitdiff
path: root/config/config.py
blob: 1d2471661ecb4b86e1851b2d6dfaf25349093bd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/python3

import os
import toml

ROOTDIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))


config_blog = toml.load(os.path.join(ROOTDIR, "config/blog.toml"))
config_generator = toml.load(os.path.join(ROOTDIR, "config/generator.toml"))


config = {**config_blog, **config_generator}

# Blog configuration
BLOG_HOME = config["blog"]["BLOG_HOME"]
CUSTOM_DOMAIN = config["blog"]["CUSTOM_DOMAIN"]
BLOG_TITLE = config["blog"]["BLOG_TITLE"]
BLOG_DESCRIPTION = config["blog"]["BLOG_DESCRIPTION"]
LANGUAGE = config["blog"]["LANGUAGE"]
AUTHOR = config["blog"]["AUTHOR"]
AUTHOR_EMAIL = config["blog"]["AUTHOR_EMAIL"]
ATOM_ICON_PATH = config["blog"]["ATOM_ICON_PATH"]
RSS_ICON_PATH = config["blog"]["RSS_ICON_PATH"]
RSS_ICON_WIDTH = config["blog"]["RSS_ICON_WIDTH"]
RSS_ICON_HEIGHT = config["blog"]["RSS_ICON_HEIGHT"]

#generator configurations
GENERATOR_NAME = config["generator"]["GENERATOR_NAME"]
GENERATOR_HOME_PAGE = config["generator"]["GENERATOR_HOME_PAGE"]
DEFAULTLANG = config["generator"]["DEFAULTLANG"]
LANGUAGES = config["generator"]["LANGUAGES"]

SOURCEDIR = os.path.join(ROOTDIR, config["generator"]["SOURCEDIR"])
POSTSDIR = os.path.join(SOURCEDIR, config["generator"]["POSTSDIR"])
INDEXMD = os.path.join(SOURCEDIR, config["generator"]["INDEXMD"])
GENERATORSOURCE = os.path.join(ROOTDIR, config["generator"]["GENERATORSOURCE"])
HTMLTEMPLATE = os.path.join(SOURCEDIR, config["generator"]["HTMLTEMPLATE"])
BUILDDIR = os.path.join(ROOTDIR, config["generator"]["BUILDDIR"])
ATOM = os.path.join(BUILDDIR, config["generator"]["ATOM"])
RSS = os.path.join(BUILDDIR, config["generator"]["RSS"])
INDEXHTML = os.path.join(BUILDDIR, config["generator"]["INDEXHTML"])
EXCLUDELIST = os.path.join(SOURCEDIR, config["generator"]["EXCLUDELIST"])

FEED_MAX_ENTRIES = config["generator"]["FEED_MAX_ENTRIES"]
CODE_LINE_HEIGHT = config["generator"]["CODE_LINE_HEIGHT"]


# declare the global foreground ANSI codes
BLACK = ""
BLUE = ""
CYAN = ""
GREEN = ""
MAGENTA = ""
RED = ""
WHITE = ""
YELLOW = ""
RESET = ""