Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"esbenp.prettier-vscode"
]
}
36 changes: 36 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.inlayHints.variableTypes": true,
"python.analysis.inlayHints.callArgumentNames": "partial",
"python.analysis.autoImportCompletions": true,
"python.analysis.fixAll": [
"source.unusedImports"
],
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "always",
"source.unusedImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.terminal.activateEnvInCurrentTerminal": true,
"python.terminal.focusAfterLaunch": true,
"python.createEnvironment.contentButton": "show",
"diffEditor.wordWrap": "on",
"editor.wordWrap": "on",
"explorer.autoRevealExclude": {
"/env": true,
"/venv": true,
"/.venv": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"ruff.organizeImports": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.fontLigatures": true,
"editor.formatOnType": true,
"editor.guides.bracketPairs": "active"
}
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)
11 changes: 11 additions & 0 deletions nano/__init__.py
Original file line number Diff line number Diff line change
@@ -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
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")
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;
} */
Loading