Skip to content
Permalink
Browse files

Handle absolute paths in POSTS / PAGES as relative to output/

  • Loading branch information
ralsina committed Mar 15, 2018
1 parent 26b7695 commit 5f76ad21ffe0b509f02ebabdccbfc1093369ff1a
Showing with 4 additions and 3 deletions.
  1. +1 −0 CHANGES.txt
  2. +3 −3 nikola/post.py
@@ -32,6 +32,7 @@ Features
Bugfixes
--------

* Handle '/' and other absolute paths better in POSTS / PAGES
* Support KaTeX for reST display math (Issue #2888)
* Use npm for asset management instead of bower, which was deprecated
(Issue #2790)
@@ -182,14 +182,14 @@ def __init__(
# Fill default_metadata with stuff from the other languages
for lang in sorted(self.translated_to):
default_metadata.update(self.meta[lang])

# Compose paths
if self.folder_base is not None:
# Use translatable destination folders
self.folders = {}
for lang in self.config['TRANSLATIONS'].keys():
self.folders[lang] = os.path.normpath(os.path.join(
self.folder_base(lang), self.folder_relative))
if os.path.isabs(self.folder_base(lang)): # Issue 2982
self.folder_base[lang] = os.path.relpath(self.folder_base(lang), '/')
self.folders[lang] = os.path.normpath(os.path.join(self.folder_base(lang), self.folder_relative))
else:
# Old behavior (non-translatable destination path, normalized by scanner)
self.folders = {lang: self.folder_relative for lang in self.config['TRANSLATIONS'].keys()}

0 comments on commit 5f76ad2

Please sign in to comment.