Compare commits

..

No commits in common. "69347dde9a4d3c3233d5e39a0e01c041f4556d95" and "cc1cc4639cd4d1fd45afe7deb4245f62422f044b" have entirely different histories.

6 changed files with 7 additions and 48 deletions

View file

@ -1,7 +1,3 @@
<p align="center">
<img src="images/logo.png" alt="picopaper" width="150">
</p>
# picopaper
A minimal static site generator for blogs built with Python 3 and Jinja2

View file

@ -1,6 +1,6 @@
"""Configuration file for picopaper blog"""
BLOG_TITLE = "PicoPaper.com"
BLOG_TITLE = "picopaper"
BLOG_DESCRIPTION = "we like simple."
THEME = "default"
@ -14,8 +14,3 @@ NAVBAR_ITEMS = [
{'text': 'About', 'url': '/about/'}
]
# Logo settings
HIDE_LOGO = False
HIDE_TITLE = True
LOGO_PATH = "/images/logo.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -6,7 +6,7 @@ from datetime import datetime
from pathlib import Path
from jinja2 import Environment, FileSystemLoader
import markdown
from config import BLOG_TITLE, BLOG_DESCRIPTION, THEME, EXCLUDE_FEEDS_FROM_MAIN, NAVBAR_ITEMS, HIDE_LOGO, HIDE_TITLE, LOGO_PATH
from config import BLOG_TITLE, BLOG_DESCRIPTION, THEME, EXCLUDE_FEEDS_FROM_MAIN, NAVBAR_ITEMS
class SSGGGenerator:
def __init__(self, items_dir='items', output_dir='output', theme=None, blog_title=None, blog_description=None):
@ -20,9 +20,6 @@ class SSGGGenerator:
self.blog_description = blog_description or BLOG_DESCRIPTION
self.exclude_feeds = EXCLUDE_FEEDS_FROM_MAIN
self.navbar_items = NAVBAR_ITEMS
self.hide_logo = HIDE_LOGO
self.hide_title = HIDE_TITLE
self.logo_path = LOGO_PATH
# Setup Jinja2
self.env = Environment(loader=FileSystemLoader(self.templates_dir))
@ -146,10 +143,7 @@ class SSGGGenerator:
blog_description=self.blog_description,
navbar_items=self.navbar_items,
posts=posts,
all_posts=all_posts or posts,
hide_logo=self.hide_logo,
hide_title=self.hide_title,
logo_path=self.logo_path
all_posts=all_posts or posts
)
output_path.parent.mkdir(parents=True, exist_ok=True)
@ -180,10 +174,7 @@ class SSGGGenerator:
blog_description=self.blog_description,
navbar_items=self.navbar_items,
feeds=feed_list,
all_posts=all_posts or [],
hide_logo=self.hide_logo,
hide_title=self.hide_title,
logo_path=self.logo_path
all_posts=all_posts or []
)
output_path.parent.mkdir(parents=True, exist_ok=True)
@ -202,10 +193,7 @@ class SSGGGenerator:
blog_description=self.blog_description,
navbar_items=self.navbar_items,
post=post,
all_posts=all_posts or [],
hide_logo=self.hide_logo,
hide_title=self.hide_title,
logo_path=self.logo_path
all_posts=all_posts or []
)
# Create directory for the post slug

View file

@ -12,7 +12,6 @@ header {
padding: 20px;
margin-bottom: 40px;
border-radius: 10px;
text-align: center;
}
img {
@ -23,13 +22,7 @@ hr {
border: 1px solid #efefef;
}
h1 {
margin: 0;
}
.header-logo {
vertical-align: middle;
}
h1 { margin: 0; }
.blog-description {
margin: 10px 0 0 0;
@ -40,10 +33,6 @@ h1 {
.main-nav {
margin-top: 15px;
font-weight: bold;
display: flex;
justify-content: center;
gap: 10px;
flex-wrap: wrap;
}
.nav-item {

View file

@ -1,14 +1,5 @@
<header>
<h1>
<a href="/" style="color: #333; text-decoration: none;">
{% if not hide_logo %}
<img src="{{ logo_path }}" alt="{{ blog_title }}" class="header-logo">
{% endif %}
{% if not hide_title %}
{{ blog_title }}
{% endif %}
</a>
</h1>
<h1><a href="/" style="color: #333; text-decoration: none;">{{ blog_title }}</a></h1>
<p class="blog-description">{{ blog_description }}</p>
<nav class="main-nav">
{% for item in navbar_items %}