Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 12 additions & 0 deletions nano/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from flask import Flask


def nano_blog():
app = Flask(__name__)

from .home.home import home_bp

# blueprints
app.register_blueprint(blueprint=home_bp)

return app
Binary file added nano/__pycache__/__init__.cpython-313.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions nano/blog/dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from flask import Blueprint

dashboard_bp = Blueprint(name="home_bp", import_name=__name__, url_prefix="/blog")
Binary file added nano/home/__pycache__/home.cpython-313.pyc
Binary file not shown.
31 changes: 31 additions & 0 deletions nano/home/home.py
Original file line number Diff line number Diff line change
@@ -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
)
212 changes: 212 additions & 0 deletions nano/static/css/home/home.css
Original file line number Diff line number Diff line change
@@ -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;
} */
89 changes: 89 additions & 0 deletions nano/templates/landing_page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nano Blog</title>
<link
rel="stylesheet"
href="{{ url_for('static', filename='css/home/home.css') }}"
/>
</head>
<body>
<header>
<h1>Nano Blog</h1>
<p>Your source for bite-sized knowledge.</p>
</header>

<section class="posts">
<h2>Featured Posts</h2>
<div class="post-list">
{% for post in featured_posts %}
<article>
<h3>{{ post.title }}</h3>
<p>{{ post.description }}</p>
<a href="{{ post.link }}">Read More</a>
</article>
{% endfor %}
</div>
</section>

<footer>
<p>&copy; 2025 Nano Blog</p>
</footer>
</body>
</html>

<!-- <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nano Blog - Your Source for Bite-Sized Knowledge</title>
<link
rel="stylesheet"
href="{{ url_for('static', filename='css/home/home.css') }}"
/>
</head>
<body>
<header>
<div class="navbar">
<h1 class="logo">Nano Blog</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Categories</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>
<div class="hero-section">
<h2>Welcome to Nano Blog</h2>
<p>
Your source for bite-sized knowledge on all things tech, lifestyle,
and more.
</p>
<a href="#" class="cta-button">Read the Latest Posts</a>
</div>
</header>

<section class="featured-posts">
<h3>Featured Posts</h3>
<div class="posts-container">
{% for post in featured_posts %}
<article class="post">
<img src="{{ post.image }}" alt="{{ post.title }}" />
<h4>{{ post.title }}</h4>
<p>{{ post.description }}</p>
<a href="{{ post.link }}">Read More</a>
</article>
{% endfor %}
</div>
</section>

<footer>
<p>&copy; 2025 Nano Blog. All rights reserved.</p>
</footer>
</body>
</html> -->