<!DOCTYPE html>

<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta http-equiv="x-ua-compatible" content="ie=edge">

		<!-- Title -->
		{{ $title := .Site.Title}}
		{{ if and (not .IsHome) .Title }}
		{{ $title = printf "%s | %s" .Title .Site.Title}}
		{{ end }}
		<title>{{ $title }}</title>
		<meta property="og:title" content="{{ $title }}" />
		<meta name="twitter:title" content="{{ $title }}" />
		<meta itemprop="name" content="{{ $title }}" />
		<meta name="application-name" content="{{ $title }}" />

		<!-- Description -->
		<meta name="description" content="{{ .Params.description }}" />
		<meta itemprop="description" content="{{ .Params.description }}" />
		<meta property="og:description" content="{{ .Params.description }}" />
		<meta name="twitter:description" content="{{ .Params.description }}" />

		<!-- Links -->
		<base href="{{ .Permalink }}">
		<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
		<meta name="url" content="{{ .Permalink }}" />
		<meta name="twitter:url" content="{{ .Permalink }}" />
		<meta property="og:url" content="{{ .Permalink }}" />

		<!-- Images -->
		{{ with .Params.image }}
		<meta itemprop="image" content="{{ . | absURL }}" />
		<meta property="og:image" content="{{ . | absURL }}" />
		<meta name="twitter:image" content="{{ . | absURL }}" />
		<meta name="twitter:image:src" content="{{ . | absURL }}" />
		{{ else }}
		<meta itemprop="image" content="{{ .Site.Params.ogimage | absURL }}images/vikunja.png" />
		<meta property="og:image" content="{{ .Site.Params.ogimage | absURL }}images/vikunja.png" />
		<meta name="twitter:image" content="{{ .Site.Params.ogimage | absURL }}images/vikunja.png" />
		<meta name="twitter:image:src" content="{{ .Site.Params.ogimage | absURL }}images/vikunja.png" />
		{{ end }}

		<!-- Misc -->
		<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}"/>
		{{ hugo.Generator }}

		{{ range .AlternativeOutputFormats -}}
		{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
		{{ end -}}

		<link rel="canonical" href="{{ .Permalink }}">

		{{ $siteBaseURL := .Site.BaseURL }}
		{{ $styleFolder := "./themes/vikunja/static/styles" }}
		{{ range readDir $styleFolder }}
			<link rel="stylesheet" href="{{ $siteBaseURL }}styles/{{ .Name }}">
		{{ end }}

		<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.BaseURL }}favicon.ico">
		<link rel="icon" type="image/x-icon" href="{{ .Site.BaseURL }}favicon.ico">
	</head>
	<body>
