Remove embed: It was unneeded
This commit is contained in:
parent
8989f52f66
commit
3906478431
24
makesite.py
24
makesite.py
@ -147,18 +147,6 @@ def make_pages(src, dst, layout, **params):
|
|||||||
dst_path = render(dst, **page_params)
|
dst_path = render(dst, **page_params)
|
||||||
output = render(layout, **page_params)
|
output = render(layout, **page_params)
|
||||||
|
|
||||||
# For embedding, for example, a post into the page layout
|
|
||||||
if 'embed' in params:
|
|
||||||
embed = fread(f'layout/{params["embed"]}.html')
|
|
||||||
'''
|
|
||||||
embed_params = {}
|
|
||||||
embed_params.update(**page_params)
|
|
||||||
embed_params['content'] = output
|
|
||||||
'''
|
|
||||||
embed_params = dict(**page_params)
|
|
||||||
embed_params.update(content=output)
|
|
||||||
output = render(embed, **embed_params)
|
|
||||||
|
|
||||||
log('Rendering {} => {} ...', src_path, dst_path)
|
log('Rendering {} => {} ...', src_path, dst_path)
|
||||||
fwrite(dst_path, output)
|
fwrite(dst_path, output)
|
||||||
|
|
||||||
@ -250,10 +238,6 @@ def main():
|
|||||||
# Load layouts.
|
# Load layouts.
|
||||||
page_layout = fread('layout/page.html')
|
page_layout = fread('layout/page.html')
|
||||||
|
|
||||||
# Combine layouts to form final layouts.
|
|
||||||
#post_layout = render(page_layout, content=post_layout)
|
|
||||||
#list_layout = render(page_layout, content=list_layout)
|
|
||||||
|
|
||||||
# Create site pages.
|
# Create site pages.
|
||||||
for element in os.listdir('content/'):
|
for element in os.listdir('content/'):
|
||||||
if not os.path.isfile('content/' + element):
|
if not os.path.isfile('content/' + element):
|
||||||
@ -267,14 +251,18 @@ def main():
|
|||||||
list_layout = fread('layout/list.html')
|
list_layout = fread('layout/list.html')
|
||||||
item_layout = fread('layout/item.html')
|
item_layout = fread('layout/item.html')
|
||||||
|
|
||||||
|
# Combine layouts to form final layouts.
|
||||||
|
post_layout = render(page_layout, content=post_layout)
|
||||||
|
list_layout = render(page_layout, content=list_layout)
|
||||||
|
|
||||||
# Create blogs.
|
# Create blogs.
|
||||||
blog_posts = make_pages('content/blog/*.md',
|
blog_posts = make_pages('content/blog/*.md',
|
||||||
'_site/{{ slug }}.html',
|
'_site/{{ slug }}.html',
|
||||||
post_layout, blog='blog', embed='page', **params)
|
post_layout, blog='blog', **params)
|
||||||
|
|
||||||
# Create blog list pages.
|
# Create blog list pages.
|
||||||
make_list(blog_posts, '_site/index.html',
|
make_list(blog_posts, '_site/index.html',
|
||||||
page_layout, item_layout, blog='blog', embed='page', **params)
|
list_layout, item_layout, blog='blog', **params)
|
||||||
|
|
||||||
if options.rss:
|
if options.rss:
|
||||||
feed_xml = fread('layout/feed.xml')
|
feed_xml = fread('layout/feed.xml')
|
||||||
|
Loading…
Reference in New Issue
Block a user