head.html (2430B)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
{%- macro font(config) %} <link rel="preload" href="{{ get_url(path='fonts/JetBrainsMono-Nerd-Regular.woff2') }}" as="font" type="font/woff2" crossorigin /> <link rel="stylesheet" href="{{ get_url(path='fonts.css', trailing_slash=false) }}" /> {% endmacro font -%} {% macro styling(config) %} <link rel="stylesheet" href="{{ get_url(path='style.css', trailing_slash=false) }}" /> {% if config.extra.theme_color -%} {% set color = "color/" ~config.extra.theme_color ~ ".css" -%} <link id="site-theme" data-theme="{{ config.extra.theme_color }}" rel="stylesheet" href="{{ get_url(path=color, trailing_slash=false) }}" /> {%- else -%} <link id="site-theme" data-theme="red" rel="stylesheet" href="{{ get_url(path='color/red.css', trailing_slash=false) }}" /> {% endif %} {% endmacro styling %} {% macro feed_discovery(path) %} <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path=path, trailing_slash=false) }}" /> {% endmacro feed_discovery %} {% macro favicon(config) %} {% if config.extra.favicon %} <link rel="shortcut icon" href="{{ get_url(path=config.extra.favicon, trailing_slash=false) }}" type="image/x-icon" /> {% endif %} {% endmacro favicon %} {% macro general_meta() %} {% set description = config.description %} {% set title = config.title %} {% if page %} {% set title = page.title %} {% if page.description %}{% set description = page.description %} {% else %}{% set description = page.content | striptags | truncate(length=160) %}{% endif %} {% elif section %} {% set title = section.title %} {% if section.description %}{% set description = section.description %}{% endif %} {% elif term %}{% set title = term.name %} {% elif taxonomy %}{% set title = taxonomy.name %}{% endif %} <meta name="description" content="{{ description }}" /> <meta property="og:title" content="{{ title }}" /> <meta property="og:description" content="{{ description }}" /> <meta property="og:site_name" content="{{ config.title }}" /> <meta property="og:type" content="{% if page and page.date %}article{% else %}website{% endif %}" /> <meta name="twitter:card" content="summary" /> {% if current_url %} <link rel="canonical" href="{{ current_url }}" /> <meta property="og:url" content="{{ current_url }}" /> {% else %}<meta name="robots" content="noindex" />{% endif %} {{ head::feed_discovery(path=config.extra.feed_path) }} {% endmacro general_meta %}