Properly set page title and summary

This commit is contained in:
Tim Van Baak 2021-02-12 17:51:35 -08:00
parent f626c86f8a
commit 8bd8bdf269
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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>