retrobon/metatags-bundle

Symfony MetaTags bundles

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

0.1.0 2020-12-13 09:42 UTC

This package is auto-updated.

Last update: 2024-05-14 15:45:43 UTC


README

Install the bundle with the command: composer require retrobon/metatags-bundle

Configuration

Default values

There are two sections in the configuration:

  • tags: array meta tags
  • special values:
    • title - displayed with a closing tag;
    • canonical - with link attribute, if not specified, a link with Request will be displayed;
    • shortlink - with link attribute;
  • rewrite_default - if specified, values will be added to the default values

In your meta_tags.yaml:

meta_tags:
    tags:
        title: 'default title'
        description: 'default description'
        keywords: 'default, keywords'
        robots: 'index, follow, all'
        author: 'default author'
    rewrite_default: true

In your view:

<head>
    {{ metaTags() }}
</head>

or add array value in twig:

<head>
    {{ metaTags({'title': 'test'}) }}
</head>