pull/1/head
Yax 5 years ago
parent 05d4d2891e
commit f8ddfb09e2

@ -1,5 +1,5 @@
<div class="article">
<h1><a href="{{ base_path }}/{{ year }}/{{ slug }}.html">{{ title }}</a></h1>
<h1><a href="/{{ year }}/{{ slug }}.html">{{ title }}</a></h1>
<p class="meta">{{ category_label}}<span>{{ friendly_date }}</span></p>
<p class="summary">{{ summary }}</p>
</div>
</div>

@ -1,12 +1,11 @@
<item>
<title>{{ title }}</title>
<link>{{ site_url }}/{{ blog }}/{{ slug }}/</link>
<link>{{ site_url }}/{{ year }}/{{ slug }}.html</link>
<description>
<![CDATA[
<p>
{{ summary }}&nbsp;<a href="{{ site_url }}/{{ blog }}/{{ slug }}/">...</a>
{{ content }}
</p>
<p><a href="{{ site_url }}/{{ blog }}/{{ slug }}/">Read More</a></p>
]]>
</description>
<pubDate>{{ rfc_2822_date }}</pubDate>

@ -1,4 +1 @@
{{ content }}
<section>
<a class="rss" href="{{ base_path }}/rss.xml">RSS</a>
</section>

@ -2,18 +2,18 @@
<html>
<head>
<title>{{ title }} - {{ subtitle }}</title>
<title>{{ title }}</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{{ base_path }}/css/pure/pure-min.css">
<link rel="stylesheet" type="text/css" href="{{ base_path }}/css/style.css">
<link rel="stylesheet" type="text/css" href="/css/pure/pure-min.css">
<link rel="stylesheet" type="text/css" href="/css/style.css">
<!--[if lte IE 8]>
<link rel="stylesheet" href="{{ base_path }}/css/pure/grids-responsive-old-ie-min.css">
<link rel="stylesheet" href="/css/pure/grids-responsive-old-ie-min.css">
<![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="{{ base_path }}/css/pure/grids-responsive-min.css">
<link rel="stylesheet" href="/css/pure/grids-responsive-min.css">
<!--<![endif]-->
<!-- favicon -->
@ -28,9 +28,11 @@
<link rel="icon" type="image/png" href="/logos/logo@144px.png" sizes="144x144">
<link rel="apple-touch-icon" sizes="144x144" href="/logos/logo@144px.png">
<link rel="shortcut icon" href="/logos/logo@32px.png">
</head>
<body id="{{ slug }}">
<!-- RSS -->
<link type="application/atom+xml" rel="alternate" href="{{ site_url }}/rss.xml" title="{{ title }}" />
</head>
<body>
<div class="pure-g">
<div class="pure-u-1-12"></div>
@ -41,7 +43,6 @@
<div id="menu-blog">
<a href="/">Blog</a>
<a href="#">Archives</a>
<a href="#">Recherche</a>
</div>
</div>
<div class="pure-u-1-12"></div>
@ -68,5 +69,4 @@
</footer>
</body>
</html>

@ -4,7 +4,7 @@
<channel>
<title>{{ title }}</title>
<link>{{ site_url }}/</link>
<description>Grow with Technology</description>
<description>{{ subtitle }}</description>
{{ content }}

@ -246,8 +246,11 @@ def make_list(posts, dst, list_layout, item_layout, banner_layout, **params):
item = render(item_layout, **item_params)
items.append(item)
banner = render(banner_layout, **params)
params['banner'] = banner
if banner_layout is None:
params['banner'] = ''
else:
banner = render(banner_layout, **params)
params['banner'] = banner
params['content'] = ''.join(items)
dst_path = render(dst, **params)
@ -265,7 +268,6 @@ def main():
# Default parameters.
params = {
'base_path': '',
'title': 'Blog',
'subtitle': 'Lorem Ipsum',
'author': 'Admin',
@ -284,7 +286,7 @@ def main():
item_layout = fread('layout/item.html')
banner_layout = fread('layout/banner.html')
category_layout = fread('layout/category.html')
feed_xml = fread('layout/feed.xml')
rss_xml = fread('layout/rss.xml')
item_xml = fread('layout/item.xml')
# Combine layouts to form final layouts.
@ -316,13 +318,14 @@ def main():
catpost[cat] = [post]
for cat in catpost.keys():
make_list(catpost[cat], '_site/' + slugify(cat) + '.html',
list_layout, item_layout, banner_layout, **params)
list_layout, item_layout, None, **params)
print(catpost.keys())
#print(blog_posts)
# Create RSS feeds.
#make_list(blog_posts, '_site/blog/rss.xml',
# feed_xml, item_xml, banner_layout, **params)
nb_items = min(10, len(blog_posts))
make_list(blog_posts[:nb_items], '_site/rss.xml',
rss_xml, item_xml, None, **params)
# Test parameter to be set temporarily by unit tests.

@ -1,5 +1,6 @@
{
"site_url": "https://blogduyax.madyanne.fr",
"title": "Le blog du Yax",
"subtitle": "GNU, Linux, BSD et autres libertés",
"author": "Yax"
}
}

Loading…
Cancel
Save