diff --git a/layout/item.xml b/layout/rss_item.xml similarity index 100% rename from layout/item.xml rename to layout/rss_item.xml diff --git a/layout/sitemap.xml b/layout/sitemap.xml new file mode 100644 index 0000000..27c1de4 --- /dev/null +++ b/layout/sitemap.xml @@ -0,0 +1,2 @@ + + diff --git a/layout/sitemap_item.xml b/layout/sitemap_item.xml new file mode 100644 index 0000000..a718306 --- /dev/null +++ b/layout/sitemap_item.xml @@ -0,0 +1,4 @@ + +{{ site_url }}/{{ date }}/{{ slug }}.html +{{ rfc_2822_date }} + diff --git a/makesite.py b/makesite.py index 8c0f3ed..a551602 100755 --- a/makesite.py +++ b/makesite.py @@ -287,7 +287,9 @@ def main(): banner_layout = fread('layout/banner.html') category_layout = fread('layout/category.html') rss_xml = fread('layout/rss.xml') - item_xml = fread('layout/item.xml') + rss_item_xml = fread('layout/rss_item.xml') + sitemap_xml = fread('layout/sitemap.xml') + sitemap_item_xml = fread('layout/sitemap_item.xml') # Combine layouts to form final layouts. post_layout = render(page_layout, content=post_layout) @@ -325,8 +327,11 @@ def main(): # Create RSS feeds. nb_items = min(10, len(blog_posts)) make_list(blog_posts[:nb_items], '_site/rss.xml', - rss_xml, item_xml, None, **params) + rss_xml, rss_item_xml, None, **params) + # Create sitemap + make_list(blog_posts, '_site/sitemap.xml', + sitemap_xml, sitemap_item_xml, None, **params) # Test parameter to be set temporarily by unit tests. _test = None