<?php
  $name = '';
  $canonical = '';

  if (isset($res['page'])) {
    if ($res['page'] == 'watch') {
      $name = $res['detail']->name;
      $canonical .= '/w/'.$res['detail']->uuid;
    }
    else if ($res['page'] == 'account') {
      $name = $res['owner']->displayName.'さんのチャンネル一覧';
      $canonical .= '/a/'.$res['owner']->name;
    }
    else if ($res['page'] == 'channel') {
      $name = $res['channel']->displayName.'さんのチャンネル';
      $canonical .= '/c/'.$res['channel']->name;
    }
    else if ($res['page'] == 'home') {
      $name = 'トップページ';
      $canonical = '/home';
    }
    else if ($res['page'] == 'overview') {
      $name = 'ディスカバー';
      $canonical = '/videos/overview';
    }
    else if ($res['page'] == 'trending') {
      $name = 'トレンド';
      $canonical = '/videos/trending';
    }
    else if ($res['page'] == 'recently-added') {
      $name = '最近投稿された動画';
      $canonical = '/videos/recently-added';
    }
    else if ($res['page'] == 'local') {
      $name = 'ローカル動画';
      $canonical = '/local';
    }
    else if ($res['page'] == 'about') {
      $name = 'このアプリについて';
      $canonical = '/about';
    }
    else if ($res['page'] == 'notification') {
      $name = '通知';
      $canonical = '/my-account/notifications'
    }
  }
?>

<link rel="alternate" type="application/json+oembed" href="{{ env('PEER_URI') }}/services/oembed?url={{ urlencode(env('PEER_URI').$canonical) }}" title="{{ $name }}" />
<link rel="canonical" href="{{ $canonical }}" />

<link rel="stylesheet" href="/css/styles.css" />
<link rel="stylesheet" href="/css/global.css" />
<link rel="stylesheet" href="/css/style.css" />
<link rel="stylesheet" href="/css/custom.css" />
