initial save

This commit is contained in:
m
2026-03-12 21:47:01 +01:00
commit f0e1d2cae4
21 changed files with 10122 additions and 0 deletions

13
templates/about.html Normal file
View File

@@ -0,0 +1,13 @@
{% extends "base.html" %} {% block title %}About - Simple Blog Template{%
endblock %} {% block content %}
<div class="row">
<div class="col-lg-12">
<h1>About</h1>
<hr />
<!-- Post Content -->
<div>{{ about_txt.content | safe }}</div>
<p>Last Update : October 2024</p>
<hr />
</div>
</div>
{% endblock %}

63
templates/base.html Normal file
View File

@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>{% block title %}Default Title{% endblock %}</title>
<link
href="{{ url_for('static', filename='css/bootstrap.min.css') }}"
rel="stylesheet"
/>
<link
href="{{ url_for('static', filename='css/simple-blog-template.css') }}"
rel="stylesheet"
/>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button
type="button"
class="navbar-toggle"
data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1"
>
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ url_for('home') }}"
>{{blog_title.title}}</a
>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="{{ url_for('about') }}">About</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">{% block content %} {% endblock %}</div>
<footer>
<div class="container">
<div class="row">
<div class="col-lg-12">
<p></p>
</div>
</div>
</div>
</footer>
<script src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
</body>
</html>

67
templates/index.html Normal file
View File

@@ -0,0 +1,67 @@
{% extends "base.html" %} {% block title %}{{blog_title.title}}{% endblock %} {%
block content %}
<div class="row">
<div class="col-md-12">
{% for post in posts %}
<h2 class="post-title">
<a href="{{ url_for('post_detail', post_id=post.id) }}"
>{{ post.title }}</a
>
</h2>
<!--p class="lead">
by **{{ post.author }}**
</p-->
<p>
<span class="glyphicon glyphicon-time"></span> Posted on {{ post.date }}
</p>
<!-- stytle customed, expanded and unextanded posts have different margin-->
{% if post.displayall %}
<div>{{ post.content | safe }}</div>
<hr
style="
width: 100%;
margin-top: 25px;
margin-bottom: 60px;
border: 1px solid #000;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
"
/>
{% else %}
<div>{{ post.content | striptags | truncate(200) }}</div>
<!--div>{{ post.content[:200] | safe }}...</div-->
<a
class="btn btn-default btn-custom"
href="{{ url_for('post_detail', post_id=post.id) }}"
>Read More</a
>
<hr
style="
width: 100%;
margin-top: 75px;
margin-bottom: 60px;
border: 1px solid #000;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
"
/>
{% endif %} {% endfor %}
<ul class="pager">
{% if prev_url %}
<li class="previous"><a href="{{ prev_url }}">&larr; Older</a></li>
{% else %}
<li class="previous disabled"><a href="#">&larr; Older</a></li>
{% endif %}
<span class="text-muted"
>Page {{ current_page }} of {{ total_pages }}</span
>
{% if next_url %}
<li class="next"><a href="{{ next_url }}">Newer &rarr;</a></li>
{% else %}
<li class="next disabled"><a href="#">Newer &rarr;</a></li>
{% endif %}
</ul>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,90 @@
{% extends "base.html" %} {% block title %}{{ post.title }} - Simple Blog
Template{% endblock %} {% block content %}
<div class="row">
<div class="col-lg-12">
<h1 class="post-title">{{ post.title }}</h1>
<p class="lead">{{ post.subtitle }}</p>
<hr />
<p>
<span class="glyphicon glyphicon-time"></span> Posted on {{ post.date }}
</p>
<hr />
{% if post.id == 8 %}
<div class="background-svg">
<img
src="{{ url_for('static', filename='animation.svg') }}"
alt=""
/>
<br>
<p>tree source: codepen @uchardon</p></div>
{% endif %}
<div class="blog-content">{{ post.content | safe }}</div>
<a href="{{ url_for('home') }}" class="btn btn-default btn-custom"
>← Back to Posts</a
>
<hr style="margin-top: 75px; margin-bottom: 40px" />
<div class="well">
<h4>Leave a Comment:</h4>
<form
role="form"
method="POST"
action="{{ url_for('post_comment', post_id=post.id) }}"
>
<div class="form-group">
<input
type="text"
name="author"
class="form-control"
placeholder="Your Name"
required
style="margin-bottom: 10px"
/>
<input
type="text"
name="honeypot"
style="display: none !important"
tabindex="-1"
autocomplete="off"
/>
<textarea
name="content"
class="form-control"
rows="3"
placeholder="Write something..."
required
></textarea>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<hr />
{% for comment in comments %}
<div class="media">
<a class="pull-left" href="#">
<img
class="media-object"
src="https://ui-avatars.com/api/?name={{ comment.author }}&background=random"
width="64"
height="64"
alt=""
/>
</a>
<div class="media-body">
<h4 class="media-heading">
{{ comment.author }}
<small>{{ comment.date }}</small>
</h4>
{{ comment.content }}
</div>
</div>
{% else %}
<p>No comments yet. Be the first!</p>
{% endfor %}
</div>
</div>
{% endblock %}