You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Playing a little bit with the settings Nikola I have found an error in the creation of the sourcelink when establishing the options:
conf.py:
STRIP_INDEXES = True
...
PRETTY_URLS = True
These options create within the output/posts folder a set of folders that taking by name the title of each post and whose content are index.html and index.* files. This means that if you have a post titled foo on your website (http://www.example.com), the link provided by Nikola for sourcelink would be:
http://www.example.com/posts/foo/foo.txt
obtaining a 404 error because within output/posts/foo folder only exist index.html and index.txt files.
This is the code inside the post template
post.tmpl:
<%block name="sourcelink">
% if not post.meta('password'):
<li>
<a href="${post.meta('slug')+post.source_ext()}" id="sourcelink">${messages("Source")}</a>
</li>
% endif
</%block>
The above code works perfectly when the PRETTY_URLS option is not enabled, but once it set to True logically the error appears. For now I've solved it substituting:
Playing a little bit with the settings Nikola I have found an error in the creation of the sourcelink when establishing the options:
conf.py:
These options create within the output/posts folder a set of folders that taking by name the title of each post and whose content are index.html and index.* files. This means that if you have a post titled foo on your website (http://www.example.com), the link provided by Nikola for sourcelink would be:
obtaining a 404 error because within output/posts/foo folder only exist index.html and index.txt files.
This is the code inside the post template
post.tmpl:
The above code works perfectly when the PRETTY_URLS option is not enabled, but once it set to True logically the error appears. For now I've solved it substituting:
with:
Obviously is not the perfect and final solution but for now it works for me XD.
The text was updated successfully, but these errors were encountered: