rss feed
This commit is contained in:
parent
05d4d2891e
commit
f8ddfb09e2
7 changed files with 27 additions and 27 deletions
|
@ -1,5 +1,5 @@
|
||||||
<div class="article">
|
<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="meta">{{ category_label}}<span>{{ friendly_date }}</span></p>
|
||||||
<p class="summary">{{ summary }}</p>
|
<p class="summary">{{ summary }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<item>
|
<item>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link>{{ site_url }}/{{ blog }}/{{ slug }}/</link>
|
<link>{{ site_url }}/{{ year }}/{{ slug }}.html</link>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<p>
|
<p>
|
||||||
{{ summary }} <a href="{{ site_url }}/{{ blog }}/{{ slug }}/">...</a>
|
{{ content }}
|
||||||
</p>
|
</p>
|
||||||
<p><a href="{{ site_url }}/{{ blog }}/{{ slug }}/">Read More</a></p>
|
|
||||||
]]>
|
]]>
|
||||||
</description>
|
</description>
|
||||||
<pubDate>{{ rfc_2822_date }}</pubDate>
|
<pubDate>{{ rfc_2822_date }}</pubDate>
|
||||||
|
|
|
@ -1,4 +1 @@
|
||||||
{{ content }}
|
{{ content }}
|
||||||
<section>
|
|
||||||
<a class="rss" href="{{ base_path }}/rss.xml">RSS</a>
|
|
||||||
</section>
|
|
||||||
|
|
|
@ -2,18 +2,18 @@
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>{{ title }} - {{ subtitle }}</title>
|
<title>{{ title }}</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<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="/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/style.css">
|
||||||
|
|
||||||
<!--[if lte IE 8]>
|
<!--[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]-->
|
<![endif]-->
|
||||||
<!--[if gt IE 8]><!-->
|
<!--[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]-->
|
<!--<![endif]-->
|
||||||
|
|
||||||
<!-- favicon -->
|
<!-- favicon -->
|
||||||
|
@ -28,9 +28,11 @@
|
||||||
<link rel="icon" type="image/png" href="/logos/logo@144px.png" sizes="144x144">
|
<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="apple-touch-icon" sizes="144x144" href="/logos/logo@144px.png">
|
||||||
<link rel="shortcut icon" href="/logos/logo@32px.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-g">
|
||||||
<div class="pure-u-1-12"></div>
|
<div class="pure-u-1-12"></div>
|
||||||
|
@ -41,7 +43,6 @@
|
||||||
<div id="menu-blog">
|
<div id="menu-blog">
|
||||||
<a href="/">Blog</a>
|
<a href="/">Blog</a>
|
||||||
<a href="#">Archives</a>
|
<a href="#">Archives</a>
|
||||||
<a href="#">Recherche</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pure-u-1-12"></div>
|
<div class="pure-u-1-12"></div>
|
||||||
|
@ -68,5 +69,4 @@
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<channel>
|
<channel>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link>{{ site_url }}/</link>
|
<link>{{ site_url }}/</link>
|
||||||
<description>Grow with Technology</description>
|
<description>{{ subtitle }}</description>
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
|
19
makesite.py
19
makesite.py
|
@ -246,8 +246,11 @@ def make_list(posts, dst, list_layout, item_layout, banner_layout, **params):
|
||||||
item = render(item_layout, **item_params)
|
item = render(item_layout, **item_params)
|
||||||
items.append(item)
|
items.append(item)
|
||||||
|
|
||||||
banner = render(banner_layout, **params)
|
if banner_layout is None:
|
||||||
params['banner'] = banner
|
params['banner'] = ''
|
||||||
|
else:
|
||||||
|
banner = render(banner_layout, **params)
|
||||||
|
params['banner'] = banner
|
||||||
|
|
||||||
params['content'] = ''.join(items)
|
params['content'] = ''.join(items)
|
||||||
dst_path = render(dst, **params)
|
dst_path = render(dst, **params)
|
||||||
|
@ -265,7 +268,6 @@ def main():
|
||||||
|
|
||||||
# Default parameters.
|
# Default parameters.
|
||||||
params = {
|
params = {
|
||||||
'base_path': '',
|
|
||||||
'title': 'Blog',
|
'title': 'Blog',
|
||||||
'subtitle': 'Lorem Ipsum',
|
'subtitle': 'Lorem Ipsum',
|
||||||
'author': 'Admin',
|
'author': 'Admin',
|
||||||
|
@ -284,7 +286,7 @@ def main():
|
||||||
item_layout = fread('layout/item.html')
|
item_layout = fread('layout/item.html')
|
||||||
banner_layout = fread('layout/banner.html')
|
banner_layout = fread('layout/banner.html')
|
||||||
category_layout = fread('layout/category.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')
|
item_xml = fread('layout/item.xml')
|
||||||
|
|
||||||
# Combine layouts to form final layouts.
|
# Combine layouts to form final layouts.
|
||||||
|
@ -316,13 +318,14 @@ def main():
|
||||||
catpost[cat] = [post]
|
catpost[cat] = [post]
|
||||||
for cat in catpost.keys():
|
for cat in catpost.keys():
|
||||||
make_list(catpost[cat], '_site/' + slugify(cat) + '.html',
|
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)
|
#print(blog_posts)
|
||||||
|
|
||||||
# Create RSS feeds.
|
# Create RSS feeds.
|
||||||
#make_list(blog_posts, '_site/blog/rss.xml',
|
nb_items = min(10, len(blog_posts))
|
||||||
# feed_xml, item_xml, banner_layout, **params)
|
make_list(blog_posts[:nb_items], '_site/rss.xml',
|
||||||
|
rss_xml, item_xml, None, **params)
|
||||||
|
|
||||||
|
|
||||||
# Test parameter to be set temporarily by unit tests.
|
# Test parameter to be set temporarily by unit tests.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
|
"site_url": "https://blogduyax.madyanne.fr",
|
||||||
"title": "Le blog du Yax",
|
"title": "Le blog du Yax",
|
||||||
"subtitle": "GNU, Linux, BSD et autres libertés",
|
"subtitle": "GNU, Linux, BSD et autres libertés",
|
||||||
"author": "Yax"
|
"author": "Yax"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue