From fc5a042049628edd4ed02a633a215efda4daec10 Mon Sep 17 00:00:00 2001 From: winter_x64 <75623356+winter-x64@users.noreply.github.com> Date: Tue, 25 Feb 2025 12:24:35 +0530 Subject: [PATCH 1/3] Update main.py --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 37c86a8..7c196b0 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ -def main(): - print("Hello from nanoblog!") +from nano import nano_blog +app = nano_blog() if __name__ == "__main__": - main() + app.run(debug=True) From 35c0adcdcb426ac5a7b7f4c2b8c80e368b7c04f1 Mon Sep 17 00:00:00 2001 From: winter_x64 <75623356+winter-x64@users.noreply.github.com> Date: Tue, 25 Feb 2025 12:25:48 +0530 Subject: [PATCH 2/3] Add files via upload --- nano/__init__.py | 11 ++ nano/__pycache__/__init__.cpython-313.pyc | Bin 0 -> 476 bytes nano/blog/dashboard.py | 3 + nano/home/__pycache__/home.cpython-313.pyc | Bin 0 -> 1103 bytes nano/home/home.py | 31 +++ nano/static/css/home/home.css | 212 +++++++++++++++++++++ nano/templates/landing_page.html | 89 +++++++++ 7 files changed, 346 insertions(+) create mode 100644 nano/__init__.py create mode 100644 nano/__pycache__/__init__.cpython-313.pyc create mode 100644 nano/blog/dashboard.py create mode 100644 nano/home/__pycache__/home.cpython-313.pyc create mode 100644 nano/home/home.py create mode 100644 nano/static/css/home/home.css create mode 100644 nano/templates/landing_page.html diff --git a/nano/__init__.py b/nano/__init__.py new file mode 100644 index 0000000..27d5a39 --- /dev/null +++ b/nano/__init__.py @@ -0,0 +1,11 @@ +from flask import Flask + + +def nano_blog(): + app = Flask(__name__) + + from .home.home import home_bp + + app.register_blueprint(blueprint=home_bp) + + return app diff --git a/nano/__pycache__/__init__.cpython-313.pyc b/nano/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25e49e16f8b31a171d253357c72442798d738825 GIT binary patch literal 476 zcmYLFze~eF6u!%)KT>Ur4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q&5$O^A9 zVR>qN8>!a;dlTO3H85xB@8zxOtv7!O&pr1_YlhsQrR>4uUdIF@o>WK5ZrF4;o%rRD zv9g;t!+rK$)oV%XWntRB-(Rj^V{{mjWK$`#n literal 0 HcmV?d00001 diff --git a/nano/home/home.py b/nano/home/home.py new file mode 100644 index 0000000..af531e4 --- /dev/null +++ b/nano/home/home.py @@ -0,0 +1,31 @@ +from flask import Blueprint, render_template + +home_bp = Blueprint(name="home_bp", import_name=__name__, url_prefix="/") + +featured_posts = [ + { + "title": "Understanding Quantum Computing in Simple Terms", + "description": "A brief introduction to quantum computing and its potential impact.", + "image": "https://via.placeholder.com/350x250", + "link": "#", + }, + { + "title": "The Future of Artificial Intelligence", + "description": "Exploring the next big breakthroughs in AI technology.", + "image": "https://via.placeholder.com/350x250", + "link": "#", + }, + { + "title": "How Minimalism Can Improve Your Life", + "description": "Discover the power of living with less and its benefits for your mental health.", + "image": "https://via.placeholder.com/350x250", + "link": "#", + }, +] + + +@home_bp.route(rule="/") +def home(): + return render_template( + template_name_or_list="landing_page.html", featured_posts=featured_posts + ) diff --git a/nano/static/css/home/home.css b/nano/static/css/home/home.css new file mode 100644 index 0000000..5197146 --- /dev/null +++ b/nano/static/css/home/home.css @@ -0,0 +1,212 @@ +/* Reset */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + color: #333; + padding: 20px; + text-align: center; +} + +header { + margin-bottom: 40px; +} + +header h1 { + font-size: 40px; + color: #2c3e50; +} + +header p { + font-size: 18px; + color: #7f8c8d; +} + +.posts { + margin: 0 auto; + max-width: 600px; +} + +.posts h2 { + font-size: 30px; + margin-bottom: 20px; +} + +.post-list { + display: flex; + flex-direction: column; + gap: 20px; +} + +article { + background-color: white; + padding: 20px; + border-radius: 8px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +article h3 { + font-size: 22px; + margin-bottom: 10px; +} + +article p { + font-size: 16px; + margin-bottom: 15px; +} + +article a { + font-size: 16px; + color: #e74c3c; + text-decoration: none; +} + +article a:hover { + text-decoration: underline; +} + +footer { + margin-top: 40px; + font-size: 14px; + color: #7f8c8d; +} + +/* General Reset */ +/* * { + margin: 0; + padding: 0; + box-sizing: border-box; +} */ + +/* Body */ +/* body { + font-family: Arial, sans-serif; + line-height: 1.6; +} */ + +/* Header */ +/* header { + background: #2c3e50; + color: white; + padding: 20px 0; + text-align: center; +} + +.navbar { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 20px; +} + +.logo { + font-size: 30px; + font-weight: bold; +} + +nav ul { + list-style: none; +} + +nav ul li { + display: inline; + margin: 0 15px; +} + +nav ul li a { + color: white; + text-decoration: none; +} + +.hero-section { + margin-top: 40px; +} + +.hero-section h2 { + font-size: 50px; + margin-bottom: 10px; +} + +.hero-section p { + font-size: 20px; + margin-bottom: 20px; +} + +.cta-button { + background-color: #e74c3c; + padding: 12px 25px; + color: white; + font-size: 18px; + text-decoration: none; + border-radius: 5px; +} + +.cta-button:hover { + background-color: #c0392b; +} */ + +/* Featured Posts Section */ +/* .featured-posts { + background-color: #ecf0f1; + padding: 40px 0; + text-align: center; +} + +.featured-posts h3 { + font-size: 36px; + margin-bottom: 20px; +} + +.posts-container { + display: flex; + justify-content: space-around; + flex-wrap: wrap; +} + +.post { + background-color: white; + width: 300px; + margin: 15px; + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + text-align: center; +} + +.post img { + width: 100%; + border-radius: 10px; +} + +.post h4 { + margin-top: 15px; + font-size: 22px; +} + +.post p { + margin: 10px 0; + font-size: 16px; +} + +.post a { + color: #e74c3c; + text-decoration: none; +} + +.post a:hover { + text-decoration: underline; +} */ + +/* Footer */ +/* footer { + background-color: #34495e; + color: white; + text-align: center; + padding: 20px 0; + margin-top: 50px; +} */ diff --git a/nano/templates/landing_page.html b/nano/templates/landing_page.html new file mode 100644 index 0000000..7dba7ed --- /dev/null +++ b/nano/templates/landing_page.html @@ -0,0 +1,89 @@ + + + + + + Nano Blog + + + +
+

Nano Blog

+

Your source for bite-sized knowledge.

+
+ +
+

Featured Posts

+
+ {% for post in featured_posts %} +
+

{{ post.title }}

+

{{ post.description }}

+ Read More +
+ {% endfor %} +
+
+ +
+

© 2025 Nano Blog

+
+ + + + From 05562ad3202be607c543bb39804880a446cefd1f Mon Sep 17 00:00:00 2001 From: winter_x64 <75623356+winter-x64@users.noreply.github.com> Date: Tue, 25 Feb 2025 12:39:59 +0530 Subject: [PATCH 3/3] updated --- nano/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nano/__init__.py b/nano/__init__.py index 27d5a39..3239d85 100644 --- a/nano/__init__.py +++ b/nano/__init__.py @@ -6,6 +6,7 @@ def nano_blog(): from .home.home import home_bp + # blueprints app.register_blueprint(blueprint=home_bp) return app