Properly set page title and summary
This commit is contained in:
parent
f626c86f8a
commit
8bd8bdf269
@ -174,6 +174,11 @@ class DocumentTab:
|
||||
return tag
|
||||
return None
|
||||
|
||||
def get_tag_value(self, name: str, default: str):
|
||||
if tag := self.get_tag(name):
|
||||
return tag.value
|
||||
return default
|
||||
|
||||
|
||||
class Document:
|
||||
"""
|
||||
@ -201,6 +206,11 @@ class Document:
|
||||
return tag
|
||||
return None
|
||||
|
||||
def get_tag_value(self, name: str, default: str):
|
||||
if tag := self.get_tag(name):
|
||||
return tag.value
|
||||
return default
|
||||
|
||||
|
||||
#
|
||||
# Parsing functions
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% extends 'base.jinja' %}
|
||||
|
||||
{% set page_title = 'tmp' -%}
|
||||
{% set page_summary = 'tmpp' %}
|
||||
{% set page_title = document.get_tag_value('title', document.get_tag('id').value) -%}
|
||||
{% set page_summary = document.get_tag_value('summary', '') %}
|
||||
|
||||
{% block page_scripts %}
|
||||
<script>
|
||||
|
Loading…
Reference in New Issue
Block a user