master
ブランチ master
LittleBeast / view / common / header.maron
4.3 KB、84行 生 Blame 履歴
1<!DOCTYPE html>
2<html lang="ja">
3<head>
4 <meta content="text/html; charset=utf-8" http-equiv="content-type" />
5 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6 <link rel="icon" href="/favicon.ico" id="favicon">
7 <title>{{ SITEINFO['title'] }}: {{ $pagetit }}</title>
8 <link rel="stylesheet" type="text/css" href="{{ ass_url('style.css') }}" />
9{@ if (isset($custCss) && !empty($custCss) && !is_bool($custCss)) @}
10{@ foreach ($custCss as $css) @}
11 {{{ $css }}}
12{@ endforeach @}
13{@ endif @}
14{@ if (isset($meta)) @}
15{@ if (isset($meta->author)) @}
16 <meta name="author" content="{{ $meta->author }}" />
17{@ endif @}
18{@ if (isset($meta->thumbnail) && !empty($meta->thumbnail)) @}
19 <meta name="thumbnail" content="{{ ass_url('article/'.$meta->thumbnail) }}" />
20{@ endif @}
21{@ endif @}
22 <meta name="description" content="{{ $description }}" />
23 <meta name="keywords" content="{{ SITEINFO['tags'].(isset($meta->category) ? ','.implode(',', $meta->category) : '') }}" />
24
25 <meta property="og:title" content="{{ SITEINFO['title'] }}: {{ $pagetit }}" />
26 <meta property="og:description" content="{{ $description }}" />
27 <meta property="og:locale" content="{{ str_contains($_SERVER['REQUEST_URI'], '/enblog') ? 'en_US' : 'ja_JP' }}" />
28 <meta property="og:site_name" content="{{ SITEINFO['title'] }}" />
29 <meta property="og:type" content="{{ isset($meta) && isset($meta->thumbnail) ? 'article' : 'website' }}" />
30 <meta property="og:url" content="{{ isset($_SERVER['REQUEST_URI']) ? 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] : 'https://'.$_SERVER['HTTP_HOST'] }}" />
31{@ if (isset($meta) && isset($meta->thumbnail) && !empty($meta->thumbnail)) @}
32 <meta property="og:image" content="{{ ass_url('article/'.$meta->thumbnail, 'https://'.$_SERVER['HTTP_HOST']) }}" />
33 <meta property="og:image:secure_url" content="{{ ass_url('article/'.$meta->thumbnail, 'https://'.$_SERVER['HTTP_HOST']) }}" />
34 {$ $imgspec = getImageInfo(ass_path('article/'.$meta->thumbnail))->fullInfo; $}
35 <meta property="og:image:type" content="{{ $imgspec->type }}" />
36 <meta property="og:image:width" content="{{ $imgspec->width }}" />
37 <meta property="og:image:height" content="{{ $imgspec->height }}" />
38 <meta property="og:image:alt" content="{{ $meta->title }}" />
39{@ endif @}
40
41{@ if (TWITTER_HANDLE != '') @}
42 <meta name="twitter:card" content="summary_large_image" />
43 <meta name="twitter:site" content="{{ TWITTER_HANDLE }}" />
44 <meta name="twitter:creator" content="{{ TWITTER_HANDLE }}" />
45 <meta name="twitter:title" content="{{ SITEINFO['title'] }}: {{ $pagetit }}" />
46 <meta name="twitter:url" content="{{ isset($_SERVER['REQUEST_URI']) ? 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] : 'https://'.$_SERVER['HTTP_HOST'] }}" />
47 <meta name="twitter:description" content="{{ $description }}" />
48{@ if (isset($meta) && isset($meta->thumbnail) && !empty($meta->thumbnail)) @}
49 <meta name="twitter:image:src" content="{{ ass_url('article/'.$meta->thumbnail, 'https://'.$_SERVER['HTTP_HOST']) }}" />
50{@ endif @}
51{@ endif @}
52{@ if (ATOM_ENABLED) @}
53{$ $feed = isset($section) && array_key_exists($section, blogs()) ? $section : array_key_first(blogs()) $}
54 <link rel="alternate" type="application/atom+xml" title="{{ blogs()[$feed]['title'] }} feed" href="/{{ $feed }}.atom" />
55{@ endif @}
56</head>
57<body>
58 <div class="container">
59 <header>
60 <div class="logo">
61 {{ SITEINFO['title'] }}{{ "\n" }}
62 </div>
63 <nav>
64{@ foreach ($menu as $m) @}
65{@ if ($m['show']) @}
66 <a class="{{ $m['class'] }}{{ $curPage == $m['page'] ? ' active' : '' }}" href="{{ $m['href'] }}">{{ $m['text'] }}</a>
67{@ endif @}
68{@ endforeach @}
69{@ if (AUTH_ENABLED) @}
70 <div>
71{@ if (isset($user) && isset($user->id) && $user->id > 0) @}
72{$ $unreadComments = \Std\Lib\Notifications::unreadCount($user->username) $}
73 お帰りなしゃ~い、<a style="text-decoration: none;" href="/profile/{{ $user->username }}">{{{ namecolor($user) }}}</a>! (<a href="/notifications">通知{{ $unreadComments > 0 ? '('.$unreadComments.')' : '' }}</a> | <a href="/logout">ログアウト</a>)
74{@ else @}
75 <a href="/login">ログイン</a>
76{@ if (AUTH_REGISTER_ENABLED) @}
77 | <a href="/register">登録</a>
78{@ endif @}
79{@ endif @}
80 </div>
81{@ endif @}
82 </nav>
83 </header>
84 <main>