Browse Source

Skip static content for toc extraction

bas smit 11 years ago
parent
commit
e07dac8799
1 changed files with 3 additions and 1 deletions
  1. 3 1
      extract_toc/extract_toc.py

+ 3 - 1
extract_toc/extract_toc.py

@@ -8,10 +8,12 @@ and place it in its own article.toc variable.
 
 from os import path
 from bs4 import BeautifulSoup
-from pelican import signals, readers
+from pelican import signals, readers, contents
 
 
 def extract_toc(content):
+    if isinstance(content, contents.Static):
+        return
     soup = BeautifulSoup(content._content)
     filename = content.source_path
     extension = path.splitext(filename)[1][1:]