base: Set HTML title from content

pull/1/head
Dustin 2022-05-01 12:33:00 -05:00
parent fc2bbea4cf
commit c0d974e5ec
2 changed files with 18 additions and 1 deletions

3
content/_index.md Normal file
View File

@ -0,0 +1,3 @@
+++
title = "Dustin C. Hatch"
+++

View File

@ -15,7 +15,21 @@
rel="stylesheet" rel="stylesheet"
href="{{ get_url(path='style.css', trailing_slash=false) }}" href="{{ get_url(path='style.css', trailing_slash=false) }}"
/> />
<title>Dustin C. Hatch</title> <title>
{%- if page is defined -%}
{{ page.title }}
{% for sec_name in page.ancestors | reverse -%}
{% set s = get_section(path=sec_name) -%}
• {{ s.title }}
{% endfor -%}
{% elif section is defined -%}
{{ section.title }}
{% for sec_name in section.ancestors | reverse -%}
{% set s = get_section(path=sec_name) -%}
• {{ s.title }}
{% endfor -%}
{% endif -%}
</title>
{% block links %}{% endblock %} {% block links %}{% endblock %}
</head> </head>