mirror of
https://github.com/TeamNewPipe/website
synced 2025-10-06 00:22:38 +02:00
127 lines
5.0 KiB
HTML
127 lines
5.0 KiB
HTML
{{
|
|
# This script builds the head of a site, including opening <html> tag, a complete <head> and an open <body> tag.
|
|
# Following parameters are allowed:
|
|
# title The text to print in between <title></title>.
|
|
# extraCSS Additional CSS files from /css/ can be added to the <head>. style.css and print.css are always included.
|
|
# extraJS Additional JS files from /js/ can be added to <head>.
|
|
# bodyID HTML id attribute for the <body> tag.
|
|
# page Optional <div id="page"> tag to allow easy use of CSS flex boxes or other styles.
|
|
Must be closed via the footer include. Default: False
|
|
#
|
|
# Unfortunately, there were problems with identifying whether a variable has been set no the page or not.
|
|
# We therefore need these hacks to print the correct values.
|
|
}}
|
|
|
|
{%- assign notPage = True -%}
|
|
{%- assign metatit = "NewPipe - a free YouTube client" -%}
|
|
{%- if page.metatitle -%}
|
|
{%- unless page.metatitle == "" -%}
|
|
{%- unless page.metatitle == nil -%}
|
|
{%- assign metatit = page.metatitle -%}
|
|
{%- assign notPage = False -%}
|
|
{%- endunless -%}
|
|
{%- endunless -%}
|
|
{%- else if page.title -%}
|
|
{%- unless page.title == "" -%}
|
|
{%- unless page.title == nil -%}
|
|
{%- assign metatit = page.title -%}
|
|
{%- assign notPage = False -%}
|
|
{%- endunless -%}
|
|
{%- endunless -%}
|
|
{%- else if layout.metatitle AND notPage == True -%}
|
|
{%- unless layout.metatitle == "" -%}
|
|
{%- unless layout.metatitle == nil -%}
|
|
{%- assign metatit = layout.metatitle -%}
|
|
{%- endunless -%}
|
|
{%- endunless -%}
|
|
{%- endif -%}
|
|
|
|
{%- if include.title -%}
|
|
{%- assign renderedTitle = include.title -%}
|
|
{%- else -%}
|
|
{%- assign renderedTitle = page.title | default: metatit -%}
|
|
{%- endif -%}
|
|
|
|
{%- assign des = site.description -%}
|
|
{%- assign notPage = True -%}
|
|
{%- if page.metades -%}
|
|
{%- unless page.metades == "" -%}
|
|
{%- unless page.metades == nil -%}
|
|
{%- assign des = page.metades | normalize_whitespace -%}
|
|
{%- assign notPage = False -%}
|
|
{%- endunless -%}
|
|
{%- endunless -%}
|
|
{%- else if page.post AND page.excerpt %}
|
|
{%- assign des = page.excerpt | strip_html | normalize_whitespace -%}
|
|
{%- else if layout.metades AND notPage == True -%}
|
|
{%- unless layout.metades == "" -%}
|
|
{%- unless page.metades == nil -%}
|
|
{%- assign des = layout.metades -%}
|
|
{%- endunless -%}
|
|
{%- endunless -%}
|
|
{%- endif -%}
|
|
|
|
{%- if page.author -%}
|
|
{%- assign metaAuthor = page.author -%}
|
|
{%- else -%}
|
|
{%- assign metaAuthor = "Team NewPipe" -%}
|
|
{%- endif -%}
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>{{ renderedTitle }}</title>
|
|
|
|
<meta name="author" content="{{ metaAuthor | strip_html }}">
|
|
<meta name="description" content="{{ des | strip_html }}">
|
|
<meta name="keywords" content="NewPipe, YouTube, Android, player, background, privacy, PeerTube, Bandcamp, Soundcloud">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta charset="UTF-8">
|
|
|
|
<meta property="og:site_name" content="NewPipe">
|
|
<meta property="og:title" content="{{ metatit | strip_html }}">
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:url" content="{{ site.url }}">
|
|
<meta property="og:image" content="{{ site.url }}{{ site.baseurl }}/img/logo_400.png">
|
|
<meta property="og:image:width" content="400">
|
|
<meta property="og:image:height" content="400">
|
|
<meta property="og:image:type" content="image/png">
|
|
|
|
<link rel="icon" href="{{ site.baseurl }}/favicon.ico" type="icon" sizes="64x64">
|
|
|
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="/blog/feeds/news.rss">
|
|
<link rel="alternate" type="application/atom+xml" title="ATOM" href="/blog/feeds/news.atom">
|
|
|
|
<!-- JQuery -->
|
|
<script src="{{ site.baseurl }}/js/jquery.min.js"></script>
|
|
|
|
<!-- Bootstrap -->
|
|
<link href="{{ site.baseurl }}/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
|
<!--[if lt IE 9]>
|
|
<script src="/js/html5shiv.min.js"></script>
|
|
<script src="/js/respond.min.js"></script>
|
|
<![endif]-->
|
|
|
|
<!-- custom scripts -->
|
|
{% for script in include.extraJS -%}
|
|
<script src="{{ site.baseurl }}/js/{{ script }}"></script>
|
|
{% endfor %}
|
|
|
|
<!-- FontAwesome -->
|
|
<link rel="stylesheet" href="{{ site.baseurl }}/font-awesome/css/font-awesome.min.css">
|
|
|
|
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/css/style.css">
|
|
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/css/print.css">
|
|
|
|
<!-- custom stylesheets -->
|
|
{% for stylesheet in include.extraCSS -%}
|
|
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/css/{{ stylesheet }}">
|
|
{% endfor %}
|
|
|
|
</head>
|
|
<body{% if include.bodyID %} id="{{ include.bodyID }}"{% endif %}>
|
|
{% if include.page == "False" %}{% else %}<div id="page">{% endif %}
|