diff options
author | Botond Hende <nettingman@gmail.com> | 2024-09-04 20:05:51 +0200 |
---|---|---|
committer | Botond Hende <nettingman@gmail.com> | 2024-09-04 20:05:51 +0200 |
commit | bea80928f694671010bc99493d31879df7d42836 (patch) | |
tree | afb71282df8f01ce4b2dd87a292febe7ad8e3537 /config.py |
initial commit
Diffstat (limited to 'config.py')
-rw-r--r-- | config.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/config.py b/config.py new file mode 100644 index 0000000..2e57f6f --- /dev/null +++ b/config.py @@ -0,0 +1,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) |