Browse Source

add meta keywords support

main
ghost 1 year ago
parent
commit
2524a30476
  1. 1
      src/Controller/TorrentController.php
  2. 3
      templates/default/layout.html.twig
  3. 5
      templates/default/torrent/info.html.twig

1
src/Controller/TorrentController.php

@ -125,6 +125,7 @@ class TorrentController extends AbstractController @@ -125,6 +125,7 @@ class TorrentController extends AbstractController
'peers' => (int) $torrent->getPeers(),
'leechers' => (int) $torrent->getLeechers(),
],
'keywords' => $torrent->getKeywords(),
'locales' => $torrent->getLocales(),
'sensitive' => $torrent->isSensitive(),
'approved' => $torrent->isApproved(),

3
templates/default/layout.html.twig

@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
<head>
<meta charset="UTF-8" />
<title>{% block title %}{{ name }}{% endblock %}</title>
{% block keywords %}
<meta name="keywords" content="yggverse,yggtracker,yggdrasil,bittorrent,magnet,tracker" />
{% endblock %}
{% block stylesheets %}
<link href="{{ asset('asset/' ~ theme ~ '/css/framework.css') }}?{{ version }}" rel="stylesheet" />
<link href="{{ asset('asset/' ~ theme ~ '/css/common.css') }}?{{ version }}" rel="stylesheet" />

5
templates/default/torrent/info.html.twig

@ -21,6 +21,11 @@ @@ -21,6 +21,11 @@
{% from _self import recursive_file_tree %}
{% extends 'default/layout.html.twig' %}
{% block title %}{{ file.name }} - {{ 'Torrent' | trans }} #{{ torrent.id }}{% if pagination.page > 1 %} - {{ 'Page' | trans }} {{ pagination.page }}{% endif %} - {{ name }}{% endblock %}
{% block keywords %}
{% if torrent.keywords %}
<meta name="keywords" content="{{ torrent.keywords | join(',') }}" />
{% endif %}
{% endblock %}
{% block main_content %}
<div class="padding-24-px margin-y-8-px border-radius-3-px background-color-night">
<h1 class="display-block text-center margin-b-16-px">

Loading…
Cancel
Save