Skip to content
Permalink
Browse files

Include PHP in sitemaps

  • Loading branch information
da2x committed Jul 27, 2015
1 parent 980312b commit 0de18d49e3bb782780583cddd74451835024942f
Showing with 3 additions and 2 deletions.
  1. +1 −0 CHANGES.txt
  2. +2 −2 nikola/plugins/task/sitemap/__init__.py
@@ -12,6 +12,7 @@ Features
Bugfixes
--------

* Include .php files in sitemaps
* Retry all client errors (4xx) to HEAD as GET reques when checking remote links
* Graceful fallback in ``nikola serve --detach`` on Windows (Issue #1913)
* Don't auto-rebuild on changes to ".foo" or "foo~" or changes in folders
@@ -117,7 +117,7 @@ def gen_tasks(self):
"strip_indexes": self.site.config["STRIP_INDEXES"],
"index_file": self.site.config["INDEX_FILE"],
"sitemap_include_fileless_dirs": self.site.config["SITEMAP_INCLUDE_FILELESS_DIRS"],
"mapped_extensions": self.site.config.get('MAPPED_EXTENSIONS', ['.atom', '.html', '.htm', '.xml', '.rss']),
"mapped_extensions": self.site.config.get('MAPPED_EXTENSIONS', ['.atom', '.html', '.htm', '.php', '.xml', '.rss']),
"robots_exclusions": self.site.config["ROBOTS_EXCLUSIONS"],
"filters": self.site.config["FILTERS"],
"translations": self.site.config["TRANSLATIONS"],
@@ -174,7 +174,7 @@ def scan_locs():
filehead = fh.read(1024)
fh.close()

if path.endswith('.html') or path.endswith('.htm'):
if path.endswith('.html') or path.endswith('.htm') or path.endswith('.php'):
""" ignores "html" files without doctype """
if b'<!doctype html' not in filehead.lower():
continue

0 comments on commit 0de18d4

Please sign in to comment.
You can’t perform that action at this time.