Skip to content

Commit

Permalink
Prefetch newest post when visiting the front page
Browse files Browse the repository at this point in the history
  • Loading branch information
da2x committed Mar 22, 2015
1 parent 2284efa commit 4cd4584
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -4,6 +4,7 @@ New in master
Features Features
-------- --------


* Instruct browsers to prefetch newest post when visiting the front page
* Add a ``sort`` parameter to the post-list directive to sort posts in * Add a ``sort`` parameter to the post-list directive to sort posts in
the list using natsort. (Issue #1635) the list using natsort. (Issue #1635)


Expand Down
7 changes: 7 additions & 0 deletions nikola/data/themes/base/templates/index.tmpl
Expand Up @@ -3,6 +3,13 @@
<%namespace name="comments" file="comments_helper.tmpl"/> <%namespace name="comments" file="comments_helper.tmpl"/>
<%inherit file="base.tmpl"/> <%inherit file="base.tmpl"/>


<%block name="extra_head">
${parent.extra_head()}
% if permalink == '/' or permalink == '/' + index_file:
<link rel="prefetch" href="${posts[0].permalink()}" type="text/html">
% endif
</%block>

<%block name="content"> <%block name="content">
<div class="postindex"> <div class="postindex">
% for post in posts: % for post in posts:
Expand Down

1 comment on commit 4cd4584

@Kwpolska
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IndexError: list index out of range

Please sign in to comment.