diff options
author | Matt Arnold | 2025-04-06 21:06:53 -0400 |
---|---|---|
committer | Matt Arnold | 2025-04-06 21:06:53 -0400 |
commit | c26d3c09abea8aac5cdad752e23f19e5c8e98cd9 (patch) | |
tree | 2d4a2ad21ab4f5dfb33420a77f0b28b2b3b23c47 /templates |
have gpt start us off
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.html | 17 | ||||
-rw-r--r-- | templates/index.html | 11 | ||||
-rw-r--r-- | templates/post.html | 8 |
3 files changed, 36 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..48b4d9c --- /dev/null +++ b/templates/base.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Blog</title> + <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> +</head> +<body> + <header> + <h1><a href="{{ url_for('index') }}">My Blog</a></h1> + </header> + <main> + {% block content %}{% endblock %} + </main> +</body> +</html> \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..9a05e7a --- /dev/null +++ b/templates/index.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} + +{% block content %} + <h2>Posts</h2> + <ul> + {% for post in posts %} + <li><a href="{{ url_for('post', post_id=post.id) }}">{{ post.title }}</a> - {{ post.created_at.strftime('%Y-%m-%d') }}</li> + {% endfor %} + </ul> + <a href="{{ url_for('create') }}">Create a new post</a> +{% endblock %} \ No newline at end of file diff --git a/templates/post.html b/templates/post.html new file mode 100644 index 0000000..5a28b2b --- /dev/null +++ b/templates/post.html @@ -0,0 +1,8 @@ +{% extends 'base.html' %} + +{% block content %} + <h2>{{ post.title }}</h2> + <p>{{ post.created_at.strftime('%Y-%m-%d %H:%M') }}</p> + <div>{{ post.content }}</div> + <a href="{{ url_for('index') }}">Back to posts</a> +{% endblock %} \ No newline at end of file |