Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki title as variable #171

Merged
merged 3 commits into from
Aug 20, 2024
Merged

Wiki title as variable #171

merged 3 commits into from
Aug 20, 2024

Conversation

fuggla
Copy link
Contributor

@fuggla fuggla commented Aug 14, 2024

Summary

Changes from hardcoded "Wiki" as title in head and navbar to a variable.

It would be cool to have a prefix in <title> depending on which page is displayed. E.g. "homepage | Wiki". I could have a look at figuring it out but I'm not sure what would be a clean way to implement it.

Details

  • Adds variable WIKI_TITLE.
  • Defaults to "Wiki".
  • Passes it in all render_template() calls.

Checks

  • In case of new feature, add short overview in docs/<corresponding file>
  • Tested changes

Copy link
Owner

@Linbreux Linbreux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fuggla

Nice implementation. Just got a few things that could be changed.

Thanks

@@ -39,14 +39,14 @@
}
</style>

<title>Wiki</title>
<title>{% if wiki_title %}{{ wiki_title }}{% endif %}</title>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

render failed when the var was empty, but since it has has a default value now it shouldn't be a problem

</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="/">{% if wiki_title %}{{ wiki_title }}{% endif %}</a>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed!

upload_path=cfg.images_route,
image_allowed_mime=cfg.image_allowed_mime,
system=SYSTEM_SETTINGS,
wiki_title=cfg.wiki_title
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you just add it to the system settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's way better, I've pushed changes

@Linbreux Linbreux merged commit 37dec0c into Linbreux:main Aug 20, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants