Removed unnecessary safe guards in templates

This commit is contained in:
squidfunk 2022-06-04 07:51:12 +02:00
parent fdb409dea6
commit 95f80479a2
10 changed files with 20 additions and 20 deletions

View File

@ -8,12 +8,12 @@
{% block site_meta %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
{% if page and page.meta and page.meta.description %}
{% if page.meta and page.meta.description %}
<meta name="description" content="{{ page.meta.description }}">
{% elif config.site_description %}
<meta name="description" content="{{ config.site_description }}">
{% endif %}
{% if page and page.meta and page.meta.author %}
{% if page.meta and page.meta.author %}
<meta name="author" content="{{ page.meta.author }}">
{% elif config.site_author %}
<meta name="author" content="{{ config.site_author }}">
@ -25,9 +25,9 @@
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-8.3.0">
{% endblock %}
{% block htmltitle %}
{% if page and page.meta and page.meta.title %}
{% if page.meta and page.meta.title %}
<title>{{ page.meta.title }} - {{ config.site_name }}</title>
{% elif page and page.title and not page.is_homepage %}
{% elif page.title and not page.is_homepage %}
<title>{{ page.title | striptags }} - {{ config.site_name }}</title>
{% else %}
<title>{{ config.site_name }}</title>
@ -135,7 +135,7 @@
<div class="md-main__inner md-grid">
{% block site_nav %}
{% if nav %}
{% if page and page.meta and page.meta.hide %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "navigation" in page.meta.hide %}
{% endif %}
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" {{ hidden }}>
@ -147,7 +147,7 @@
</div>
{% endif %}
{% if not "toc.integrate" in features %}
{% if page and page.meta and page.meta.hide %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "toc" in page.meta.hide %}
{% endif %}
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" {{ hidden }}>

View File

@ -18,7 +18,7 @@
<h1>{{ page.title | d(config.site_name, true)}}</h1>
{% endif %}
{{ page.content }}
{% if page and page.meta and (
{% if page.meta and (
page.meta.git_revision_date_localized or
page.meta.revision_date
) %}

View File

@ -13,7 +13,7 @@
<h1>{{ page.title | d(config.site_name, true)}}</h1>
{% endif %}
{{ page.content }}
{% if page and page.meta and (
{% if page.meta and (
page.meta.git_revision_date_localized or
page.meta.revision_date
) %}

View File

@ -22,7 +22,7 @@
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
{% if page and page.meta and page.meta.title %}
{% if page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}

View File

@ -1,7 +1,7 @@
{#-
This file was automatically generated - do not edit
-#}
{% if page and page.meta and page.meta.hide %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "tags" in page.meta.hide %}
{% endif %}
{% if tags %}

View File

@ -32,14 +32,14 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<!-- Page description -->
{% if page and page.meta and page.meta.description %}
{% if page.meta and page.meta.description %}
<meta name="description" content="{{ page.meta.description }}" />
{% elif config.site_description %}
<meta name="description" content="{{ config.site_description }}" />
{% endif %}
<!-- Page author -->
{% if page and page.meta and page.meta.author %}
{% if page.meta and page.meta.author %}
<meta name="author" content="{{ page.meta.author }}" />
{% elif config.site_author %}
<meta name="author" content="{{ config.site_author }}" />
@ -62,9 +62,9 @@
<!-- Site title -->
{% block htmltitle %}
{% if page and page.meta and page.meta.title %}
{% if page.meta and page.meta.title %}
<title>{{ page.meta.title }} - {{ config.site_name }}</title>
{% elif page and page.title and not page.is_homepage %}
{% elif page.title and not page.is_homepage %}
<title>{{ page.title | striptags }} - {{ config.site_name }}</title>
{% else %}
<title>{{ config.site_name }}</title>
@ -253,7 +253,7 @@
<!-- Navigation -->
{% if nav %}
{% if page and page.meta and page.meta.hide %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "navigation" in page.meta.hide %}
{% endif %}
<div
@ -272,7 +272,7 @@
<!-- Table of contents -->
{% if not "toc.integrate" in features %}
{% if page and page.meta and page.meta.hide %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "toc" in page.meta.hide %}
{% endif %}
<div

View File

@ -58,7 +58,7 @@
{{ page.content }}
<!-- Source file information -->
{% if page and page.meta and (
{% if page.meta and (
page.meta.git_revision_date_localized or
page.meta.revision_date
) %}

View File

@ -49,7 +49,7 @@
{{ page.content }}
<!-- Source file information -->
{% if page and page.meta and (
{% if page.meta and (
page.meta.git_revision_date_localized or
page.meta.revision_date
) %}

View File

@ -59,7 +59,7 @@
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
{% if page and page.meta and page.meta.title %}
{% if page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}

View File

@ -21,7 +21,7 @@
-->
<!-- Determine whether to show tags -->
{% if page and page.meta and page.meta.hide %}
{% if page.meta and page.meta.hide %}
{% set hidden = "hidden" if "tags" in page.meta.hide %}
{% endif %}