parent
872992b426
commit
53d2624133
@ -5,6 +5,7 @@
|
|||||||
{% import "macros/content.html" as macros_content %}
|
{% import "macros/content.html" as macros_content %}
|
||||||
{% import "macros/cards_posts.html" as macros_cards_posts %}
|
{% import "macros/cards_posts.html" as macros_cards_posts %}
|
||||||
{% import "macros/list_title.html" as macros_list_title %}
|
{% import "macros/list_title.html" as macros_list_title %}
|
||||||
|
{% import "macros/set_title.html" as macros_set_title %}
|
||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
29
templates/macros/set_title.html
Normal file
29
templates/macros/set_title.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{% macro set_title(title) %}
|
||||||
|
|
||||||
|
{# Setup. #}
|
||||||
|
{% set prefix = config.title | safe %}
|
||||||
|
{% set separator = " • " %}
|
||||||
|
|
||||||
|
{% if current_path and current_path == "/" %}
|
||||||
|
{% set suffix = "" %}
|
||||||
|
{% set separator = "" %}
|
||||||
|
{% elif title %}
|
||||||
|
{% set suffix = title %}
|
||||||
|
{% elif section.title %}
|
||||||
|
{% set suffix = section.title %}
|
||||||
|
{% elif page.title %}
|
||||||
|
{% set suffix = page.title %}
|
||||||
|
{% elif term.name %}
|
||||||
|
{# Individual tags. #}
|
||||||
|
{% set suffix = term.name ~ " tag" %}
|
||||||
|
{% elif taxonomy.name %}
|
||||||
|
{# List of tags. #}
|
||||||
|
{% set suffix = taxonomy.name | capitalize %}
|
||||||
|
{% else %}
|
||||||
|
{% set suffix = "Lost?" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{# Return the final concatenated string. #}
|
||||||
|
{{ prefix ~ separator ~ suffix}}
|
||||||
|
|
||||||
|
{% endmacro page_header %}
|
@ -4,30 +4,18 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
{# Site title #}
|
{# Site title #}
|
||||||
{% set current_path = current_path | default(value="/") %}
|
<title>{{ macros_set_title::set_title(title="") }}</title>
|
||||||
{% if current_path == "/" %}
|
|
||||||
<title>
|
|
||||||
{{ config.title | default(value="Home") }}
|
|
||||||
</title>
|
|
||||||
{% else %}
|
|
||||||
<title>
|
|
||||||
{{ page.title | default(value=config.title) | default(value="Post") }}
|
|
||||||
</title>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{# Favicon #}
|
{# Favicon #}
|
||||||
{% if config.extra.favicon %}
|
{% if config.extra.favicon %}
|
||||||
<link rel="icon" type="image/png" href={{ config.extra.favicon }} />
|
<link rel="icon" type="image/png" href={{ config.extra.favicon }} />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{# RSS #}
|
{# RSS #}
|
||||||
<link rel="alternate" type="application/atom+xml" title="{{ config.title }}" href="{{ get_url(path="atom.xml",
|
<link rel="alternate" type="application/atom+xml" title="{{ config.title }}" href="{{ get_url(path="atom.xml",
|
||||||
trailing_slash=false) }}">
|
trailing_slash=false) }}">
|
||||||
<link rel="stylesheet" type="text/css" media="screen" href={{ get_url(path="main.css" ) }} />
|
<link rel="stylesheet" type="text/css" media="screen" href={{ get_url(path="main.css" ) }} />
|
||||||
|
|
||||||
|
|
||||||
{% if config.extra.stylesheets %}
|
{% if config.extra.stylesheets %}
|
||||||
{% for stylesheet in config.extra.stylesheets %}
|
{% for stylesheet in config.extra.stylesheets %}
|
||||||
<link rel="stylesheet" href="{{ get_url(path=stylesheet) }}">
|
<link rel="stylesheet" href="{{ get_url(path=stylesheet) }}">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user