Skip to content

Commit

Permalink
added support for custom wiki title
Browse files Browse the repository at this point in the history
  • Loading branch information
fuggla committed Aug 14, 2024
1 parent 96409ec commit 5eb9c52
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/wikmd/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
REMOTE_URL_DEFAULT = ""

WIKI_DIRECTORY_DEFAULT = "wiki"
WIKI_TITLE_DEFAULT = "Wiki"
HOMEPAGE_DEFAULT = "homepage.md"
HOMEPAGE_TITLE_DEFAULT = "homepage"
IMAGES_ROUTE_DEFAULT = "img"
Expand Down Expand Up @@ -88,6 +89,7 @@ def __init__(self):
self.remote_url = os.getenv("REMOTE_URL") or yaml_config.get("remote_url", REMOTE_URL_DEFAULT)

self.wiki_directory = os.getenv("WIKI_DIRECTORY") or yaml_config.get("wiki_directory", WIKI_DIRECTORY_DEFAULT)
self.wiki_title = os.getenv("WIKI_TITLE") or yaml_config.get("wiki_title", WIKI_TITLE_DEFAULT)
self.homepage = os.getenv("HOMEPAGE") or yaml_config.get("homepage", HOMEPAGE_DEFAULT)
self.homepage_title = os.getenv("HOMEPAGE_TITLE") or yaml_config.get("homepage_title", HOMEPAGE_TITLE_DEFAULT)
self.images_route = os.getenv("IMAGES_ROUTE") or yaml_config.get("images_route", IMAGES_ROUTE_DEFAULT)
Expand Down
4 changes: 2 additions & 2 deletions src/wikmd/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
}
</style>

<title>Wiki</title>
<title>{{ system.wiki_title }}</title>
</head>

<body>
<!-- Navbar top -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
<div class="container-fluid mx-2">
<a class="navbar-brand" href="/">Wiki</a>
<a class="navbar-brand" href="/">{{ system.wiki_title }}</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
Expand Down
3 changes: 2 additions & 1 deletion src/wikmd/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"darktheme": False,
"listsortMTime": False,
"web_deps": web_deps,
"plugins": plugins
"plugins": plugins,
"wiki_title": cfg.wiki_title
}

def process(content: str, page_name: str):
Expand Down
1 change: 1 addition & 0 deletions src/wikmd/wikmd-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sync_with_remote: 0
remote_url: ""

wiki_directory: "wiki"
wiki_title: "Wiki"
homepage: "homepage.md"
homepage_title: "homepage"
images_route: "img"
Expand Down

0 comments on commit 5eb9c52

Please sign in to comment.