longitude-one/meta-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

longitude-one/meta-bundle

Composer 安装命令:

composer require longitude-one/meta-bundle

包简介

A Symfony bundle to manage meta tags

README 文档

README

This bundle provides a Twig extension and an easy configurable file to customize contents of all your meta tags.

Installation

composer require longitude-one/meta-bundle

Configuration

Edit your twig base view to call functions meta_description(), meta_title(), meta('foo:bar') implemented by our twig extension.

Example:

<!-- templates/base.html.twig -->
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta name="description" content="{{ meta_description() }}" />
    <meta property="og:image" content="{{ meta('og:image') }}" />
    <title>{{ meta_title() }}</title>
</head>
<body></body>
</html>

Create or edit the bundle configuration file and

# config/packages/meta.yaml
meta:
  defaults:
    description: 'My default description' # the default description
    'og-image': 'My default image' # the default image
    title: 'My default title' # the default title
  paths:
    '/foo/bar/': # For this url, our extension will return customs 
      description: 'My custom description for /foo/bar url'
      'og-image': 'My custom image for /foo/bar url'
      title: 'My custom title for /foo/bar url'
    '/bar': #For this url, our extension will return a custom title and the default image and title.
      title: 'My custom description for /bar url'

Contributing

  • Fork the github project.
  • Clone it

A very simple docker is embedded to:

  • provide you a PHP8.1 environment
  • provide you composer, symfony and phpcsfixer as external tools
  • launch local symfony server to help you to dev

Then simply build your container:

docker-compose up --build

With your browser, you can access the embedded application by accessing the symfony local server http://127.0.0.1/

Update the code, fix bugs or implement new feature, then check the test.

docker exec bundle-php ./vendor/bin/phpunit

Check quality code with PHP-CS-FIXER:

docker exec bundle-php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.php

All is OK ? commit your code, push it and pull request it ;)

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固