w3c/website-templates-bundle
Composer 安装命令:
composer require w3c/website-templates-bundle
包简介
W3C Website Templates
README 文档
README
The Symfony website templates for w3.org. This also generates the static HTML design system website.
Reporting issues
Please report any issues to the w3c-website repo.
Design System
This repo contains the design system documentation, frontend assets and example Twig templates.
For documentation on how to use the W3C design system, see the Design System website.
For documentation on how to make updates to the design system codebase, see the design-system.md README.
Template bundle
This repo also contains a Symfony bundle which loads the frontend assets and has a set of Twig templates available to build Symfony apps using the W3C website design system.
How to use the design system templates in Symfony
The design system contains example Twig templates that cover all design patterns used on the W3C website. These are simplified templates to help illustrate usage.
To actually use the design system Twig templates, you need to copy these to the Symfony bundle templates and customise them for use in your application. At present we're building the W3C frontend application which will power w3.org. As we build pages we are copying the design system templates across to the bundle templates and modifying them for real-world usage.
Long-term the plan is to be able to use the Symfony bundle templates in a range of different Symfony applications - though some refactoring may need to be done to ensure the templates work easily across different applications.
Installation
You can install this in your Symfony app via:
composer require w3c/website-templates-bundle:dev-main
This requires PHP 7.4+
On installation, front-end assets (CSS, JavaScript, fonts, etc.) will be copied into the public directory of the application.
You will find them in the folder public/bundles/w3cwebsitetemplates/dist/assets.
You will need to update the assets base URL to point to that folder. This can be done in your application config/packages/assets.yaml file for example.
Example syntax (provided you have defined an %app.app_url% parameter):
framework: assets: packages: main: base_urls: '%app.app_url%/bundles/w3cwebsitetemplates/dist/assets/'
You can now use the W3C Twig templates and front-end assets in your application.
Usage
The templates available can be found in this bundle's 'templates' folder. You can reference them in your application using the
handle @W3CWebsiteTemplates. E.g.
{% extends '@W3CWebsiteTemplates/base.html.twig' %}
Note on development deployments
If you're testing work to the development server, please ensure that you have merged your work into the development branch first. This is because the frontend codebase on the development server will reference the development branch when it includes this repo in composer.
Overriding the templates
Templates can be overridden in the templates/bundles/w3cwebsitetemplates/ directory in your
Symfony project, using the same name and path as the original templates.
Reporting issues
Please report any issues to the w3c-website repo.
w3c/website-templates-bundle 适用场景与选型建议
w3c/website-templates-bundle 是一款 基于 Twig 开发的 Composer 扩展包,目前已累计 6.07k 次下载、GitHub Stars 达 81, 最近一次更新时间为 2021 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 w3c/website-templates-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 w3c/website-templates-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 6.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 81
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: W3C-20150513
- 更新时间: 2021-08-06