summaryrefslogtreecommitdiff
path: root/config.py
blob: 2e57f6f92f60877810a6d941b32bef694e183079 (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
import os.path
import datetime


class Config:
    ASSETS_IMPORT_PATH = "/assets"
    ASSETS_IMPORT_PATH_STATIC = "https://static.wazul.moe"
    RSS_FILE_NAME = "feed.xml"
    BLOG_ROOT_URL = "https://blog.wazul.moe"
    TIMEZONE = datetime.timezone(datetime.timedelta(hours=2))

    __DIR = os.path.dirname(__file__)
    ASSETS_SOURCE_DIR = os.path.join(__DIR, "assets")
    TEMPLATES_SOURCE_DIR = os.path.join(__DIR, "templates")
    POST_SOURCE_DIR = os.path.join(__DIR, "posts")

    BLOG_HOSTNAME = "yggdrasil"
    BLOG_NAME = "@{}".format(BLOG_HOSTNAME)
    BLOG_SUBTITLE = "The chronicle of my works and learnings"
    BLOG_USER = "reader"
    BLOG_OWNER = "http"

    @staticmethod
    def get_prompt(path: str, cmd: str) -> str:
        return "<span class=\"green\">{}@{}</span> <span class=\"red\">{} $</span> {}".format(Config.BLOG_USER, Config.BLOG_HOSTNAME, path, cmd)

    @staticmethod
    def get_tag_prompt(tag: str, cmd: str) -> str:
        return Config.get_prompt("~/tags/{}".format("" if tag == "" else tag + "/"), cmd)