Browse Source

add meta tags config

main
ghost 9 months ago
parent
commit
699e01c396
  1. 5
      .env
  2. 4
      config/packages/twig.yaml
  3. 3
      config/services.yaml
  4. 4
      templates/default/layout.html.twig

5
.env

@ -48,6 +48,11 @@ APP_VERSION="1.0.0" @@ -48,6 +48,11 @@ APP_VERSION="1.0.0"
# Application name
APP_NAME="HLState"
# SEO
APP_META_TITLE="HLState"
APP_META_DESCRIPTION="HLState - Open Source Web Stats for Half-Life Server"
APP_META_KEYWORDS="Half-Life, HLState, YGGverse, Servers, Stats, Online, Analytics, Explorer"
# Application template
APP_THEME="default"

4
config/packages/twig.yaml

@ -5,6 +5,10 @@ twig: @@ -5,6 +5,10 @@ twig:
version: '%app.version%'
name: '%app.name%'
theme: '%app.theme%'
meta:
title: '%env(APP_META_TITLE)%'
description: '%env(APP_META_DESCRIPTION)%'
keywords: '%env(APP_META_KEYWORDS)%'
when@test:
twig:
strict_variables: true

3
config/services.yaml

@ -8,6 +8,9 @@ parameters: @@ -8,6 +8,9 @@ parameters:
app.name: '%env(APP_NAME)%'
app.theme: '%env(APP_THEME)%'
app.hlservers: '%env(APP_HLSERVERS)%'
app.meta.title: '%env(APP_META_TITLE)%'
app.meta.description: '%env(APP_META_DESCRIPTION)%'
app.meta.keywords: '%env(APP_META_KEYWORDS)%'
services:
# default configuration for services in *this* file

4
templates/default/layout.html.twig

@ -2,7 +2,9 @@ @@ -2,7 +2,9 @@
<html>
<head>
<meta charset="UTF-8">
<title>{% block head_title_content %}{{ app.name }}{% endblock %}</title>
<meta name="description" content="{% block head_meta_description %}{{ app.meta.description }}{% endblock %}" />
<meta name="keywords" content="{% block head_meta_keywords %}{{ app.meta.keywords }}{% endblock %}" />
<title>{% block head_title_content %}{{ app.meta.title }}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{{ url('main_index') }}css/default.css?{{ app.version }}"/>
</head>
<body>

Loading…
Cancel
Save