master
onebigear 3 years ago
parent 458310345e
commit e01d44e5fd

@ -1,27 +0,0 @@
from flask import Flask
app = Flask(__name__)
HTML_TEMPLATE = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>media archaeology jp multimedia playlist</title>
<style>
img{
display:block;
}
</style>
</head>
<body>
<h1>computer archaeology jp multimedia playlist</h1>
</body>
</html>
"""
@app.route("/")
def homepage():
return HTML_TEMPLATE
if __name__ == '__main__':
app.run(use_reloader=True, debug=True)

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title> text archaeology Test</title> <title> text archaeology</title>
<link rel="stylesheet" type="text/css" href="static/style.css"> <link rel="stylesheet" type="text/css" href="static/style.css">
</head> </head>
<body> <body>

@ -2,16 +2,13 @@ import json
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
with open("playlist.json","r") as d: with open("playlist.json","r") as d:
playlist = json.load(d) playlist_obj = json.load(d)
fileLoader = FileSystemLoader("templates") fileLoader = FileSystemLoader("templates")
env = Environment(loader=fileLoader) env = Environment(loader=fileLoader)
rendered = env.get_template("playlist.html").render(playlist=playlist,title="Test") rendered = env.get_template("playlist.html").render(playlist=playlist_obj,title="text archaeology")
#print(playlist)
# write to html
fileName = "index.html" fileName = "index.html"
with open(f"{fileName}","w") as f: with open(f"{fileName}","w") as f:

@ -3,13 +3,13 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title> text archaeology {{ title }}</title> <title> {{ title }}</title>
<link rel="stylesheet" type="text/css" href="static/style.css"> <link rel="stylesheet" type="text/css" href="static/style.css">
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class ="heading"> <div class ="heading">
<h1 class = "title">text archaeology</h1> <h1 class = "title">{{ title }}</h1>
</div> </div>
<div class="gallery"> <div class="gallery">
{% for item in playlist %} {% for item in playlist %}

Loading…
Cancel
Save