split header and footer

python script now generates index html
This commit is contained in:
2021-11-23 15:49:46 +01:00
parent 78f7db194b
commit 574d24b636
3 changed files with 102 additions and 6 deletions

21
footer.html Normal file
View File

@@ -0,0 +1,21 @@
<footer>
<div class="container">
<div class="row justify-content-center border-0">
<div class="col-xl-12 mt-5 mb-5">
<div class="container">
<div class="row col-md-12">
<div class="col-12 col-md pl-5">
<h6 class="text-light">
Du findest es fehlt ein link oder ein text? Schicke eine mail an linke-menner@systemli.org
</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
</body>

View File

@@ -2,6 +2,18 @@
import json import json
def print_file(file_name):
f = open(file_name,)
for line in f:
print(line)
def generate_divs(file_name):
f = open(file_name,)
data = json.load(f)
for element in data["links"]:
print(generate_div(element))
def generate_div(data): def generate_div(data):
return """ return """
@@ -29,9 +41,6 @@ def generate_div(data):
</div> </div>
""".format(data["link"], data["title"], data["author"], data["tags"], data["description"]) """.format(data["link"], data["title"], data["author"], data["tags"], data["description"])
print_file("header.html")
f = open('data.json',) generate_divs("data.json")
data = json.load(f) print_file("footer.html")
for element in data["links"]:
print(generate_div(element))

66
header.html Normal file
View File

@@ -0,0 +1,66 @@
<!-- Header template for most static websites -->
<head>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="custom.css">
<style>
{ margin: 0; padding: 0; }
body {
background-image: url('background.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
min-height: 100vh;
display: flex;
flex-direction: column;
}
footer{
margin-top: auto;
}
.h-divider{
margin-left: auto;
margin-right: auto;
height:1px;
width:80%;
border-top:1px solid gray;
}
@media (min-width: 768px) {
.row.equal {
display: flex;
flex-wrap: wrap;
}
}
.inherit_height
{
width:inherit;
height:100%;
}
</style>
</head>
<body>
<div class="container">
<div class="row justify-content-center border-0">
<div class="col-xl-12 mt-5 mb-5">
<div class="container">
<div class="row col-md-12">
<div class="col-12 col-md pl-5">
<h3 class='text-light'>linke-menner.de</h3>
<small class='text-light'>
hier findest du links zu texten, podcasts, vorträgen und mehr zum thema männlichkeit im linken spektrum
</small>
</div>
</div>
</div>
</div>
</div>
</div>