diff --git a/pyproger/blog/blog.py b/pyproger/blog/blog.py index 0efc94d..baa6a90 100644 --- a/pyproger/blog/blog.py +++ b/pyproger/blog/blog.py @@ -4,6 +4,7 @@ bp = Blueprint( "bp_blog", __name__, template_folder="templates/blog", + static_folder="static", ) from . import urls diff --git a/pyproger/blog/urls.py b/pyproger/blog/urls.py index 59f7906..5db58fa 100644 --- a/pyproger/blog/urls.py +++ b/pyproger/blog/urls.py @@ -14,7 +14,7 @@ locale.setlocale(locale.LC_ALL, "") @bp.route("/", methods=["GET"]) def index(page=1): session["back_url"] = request.url - per_page = 2 + per_page = 4 posts, total_pages = get_paginated_posts(page, per_page) list_pages = [ x for x in range(1, total_pages + 1) if x >= page - 2 and x <= page + 2 diff --git a/pyproger/static/css/style.css b/pyproger/static/css/style.css new file mode 100644 index 0000000..d654fc9 --- /dev/null +++ b/pyproger/static/css/style.css @@ -0,0 +1,20 @@ +html, body { + box-sizing: border-box; + height: 100%; + padding: 0; + margin: 0; +} +.wrapper { + box-sizing: border-box; + min-height: 100%; + display: flex; + flex-direction: column; +} +.page-header, .page-footer { + flex-grow: 0; + flex-shrink: 0; +} +.page-body { + flex-grow: 1; +} + diff --git a/pyproger/templates/blog/base.html b/pyproger/templates/blog/base.html index d0d435c..d7553f0 100644 --- a/pyproger/templates/blog/base.html +++ b/pyproger/templates/blog/base.html @@ -4,6 +4,7 @@ + {% block title %} {% endblock title %} @@ -13,9 +14,9 @@ </head> <body> - <div id="main-container" class="container-fluid"> + <div id="main-container" class="container-fluid wrapper"> - <nav class="navbar p-2 navbar-expand-lg bg-dark border-bottom border-bottom-dark rounded-bottom-4" + <nav class="page-header navbar p-2 navbar-expand-lg bg-dark border-bottom border-bottom-dark rounded-bottom-4" data-bs-theme="dark"> <div class="container-fluid"> <a class="navbar-brand" href="{{ url_for(".index")}}"> @@ -35,12 +36,19 @@ </div> </nav> - <div id="content-container" class="container-fluid"> + + <div id="content-container" class="page-body container-fluid"> {% block content %} {% endblock %} </div> </div> - + <footer class="page-footer navbar p-2 navbar-expand-lg bg-dark border-bottom border-bottom-dark rounded-top-4" + data-bs-theme="dark"> + <div class="container-fluid"> + <div class="navbar-text fs-6">pi3c</div> + </div> + </footer> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script> diff --git a/pyproger/templates/site/index.html b/pyproger/templates/site/index.html deleted file mode 100755 index ef60fdd..0000000 --- a/pyproger/templates/site/index.html +++ /dev/null @@ -1,9 +0,0 @@ -<html> - -<body> - <div> - <a href="{{ url_for('admin.index') }}">админ панель</a> - </div> -</body> - -</html>