Adds footer for website
This commit is contained in:
parent
68f7d612e2
commit
0cba0d886c
3 changed files with 80 additions and 0 deletions
7
app.py
7
app.py
|
@ -3,6 +3,12 @@ from typing import List
|
|||
from shiny import App, ui, Inputs, Outputs, Session
|
||||
from shiny.types import NavSetArg
|
||||
from src import mod_welcome
|
||||
from src.util import load_html_str_from_file
|
||||
|
||||
import os
|
||||
|
||||
|
||||
footer_html: str = load_html_str_from_file(os.path.join("www", "footer.html"))
|
||||
|
||||
|
||||
def nav_controls() -> List[NavSetArg]:
|
||||
|
@ -31,6 +37,7 @@ app_ui = ui.page_navbar(
|
|||
bg="#ba289f",
|
||||
inverse=True,
|
||||
id="Intro",
|
||||
footer=ui.div(ui.HTML(footer_html), inline=False),
|
||||
)
|
||||
|
||||
|
||||
|
|
11
src/util.py
Normal file
11
src/util.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def load_html_str_from_file(file_name: str) -> str:
|
||||
if not os.path.isfile(file_name):
|
||||
print(f"HTML File {file_name} does not exist!")
|
||||
sys.exit(1)
|
||||
|
||||
with open(file_name, "r") as f:
|
||||
return str(f.read())
|
62
www/footer.html
Normal file
62
www/footer.html
Normal file
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<style>
|
||||
.tab-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.footer {
|
||||
background-color: #ba289f;
|
||||
color: #fff;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
|
||||
.footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer table {
|
||||
margin: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.footer th {
|
||||
padding-right: 3em;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.footer a {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<footer class="footer">
|
||||
<table>
|
||||
<tr>
|
||||
<th><a href="https://ag-link.xyz/impressum">Impressum</a> </th>
|
||||
<th><a href="https://ag-link.xyz/feed.xml">RSS</a> </th>
|
||||
<th><a href="https://lediver.se/@link">Mastodon</a> </th>
|
||||
<th><a href="https://git.ag-link.xyz/">Git</a> </th>
|
||||
</tr>
|
||||
</table>
|
||||
<p>2023 AG Link. Die von uns verfassten Inhalte stehen, soweit nicht anders vermerkt, unter der Lizenz <a
|
||||
href="https://creativecommons.org/licenses/by-nc-sa/4.0/"> Creative Commons BY-NC-SA 4.0</a>. </p>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue