Skip static content for toc extraction
This commit is contained in:
@@ -8,10 +8,12 @@ and place it in its own article.toc variable.
|
|||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from pelican import signals, readers
|
from pelican import signals, readers, contents
|
||||||
|
|
||||||
|
|
||||||
def extract_toc(content):
|
def extract_toc(content):
|
||||||
|
if isinstance(content, contents.Static):
|
||||||
|
return
|
||||||
soup = BeautifulSoup(content._content)
|
soup = BeautifulSoup(content._content)
|
||||||
filename = content.source_path
|
filename = content.source_path
|
||||||
extension = path.splitext(filename)[1][1:]
|
extension = path.splitext(filename)[1][1:]
|
||||||
|
|||||||
Reference in New Issue
Block a user