Add output language support
This commit is contained in:
@@ -319,6 +319,9 @@ class Index(DynastieGenerator):
|
||||
except:
|
||||
pass
|
||||
|
||||
if post.language != None:
|
||||
post_elem.setAttribute('lang', post.language.abbrev)
|
||||
|
||||
self.parent_posts = []
|
||||
post_content = self._loadPostContent(post)
|
||||
if not post_content: return None
|
||||
|
||||
@@ -134,7 +134,13 @@ class Post(Index):
|
||||
new_elem = self.createMeta(dom, name, post.author.first_name + ' ' + post.author.last_name)
|
||||
except:
|
||||
return None
|
||||
|
||||
elif name == 'lang':
|
||||
meta_elem.removeChild(root)
|
||||
# Add attribute lang in <html> tag
|
||||
if post.language != None:
|
||||
meta_elem.parentNode.setAttribute('lang', post.language.abbrev)
|
||||
return None
|
||||
|
||||
if not new_elem is None:
|
||||
root.parentNode.replaceChild(new_elem, root)
|
||||
return new_elem
|
||||
|
||||
Reference in New Issue
Block a user