stillat/statamic-bard-heading-permalinks
Composer 安装命令:
composer require stillat/statamic-bard-heading-permalinks
包简介
README 文档
README
Bard Heading Permalinks is an addon for Statamic that can add permalinks automatically to headings, similar to how permalinks can be added to markdown content.
How to Install
To install Bard Heading Permalinks run the following command from the root of your project:
composer require stillat/statamic-bard-heading-permalinks
How to Use
Once installed you will need to register the Bard extensions provided by this addon. This is typically done within your site's AppServiceProvider.
Bard Heading Permalinks provides two different extensions:
Permalink: Responsible for rendering the embedded link within headingsHeadingPermalinkExtension: Adds the permalink, and any other details to rendered headings
For convenience, both extensions may be registered at once:
<?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Stillat\StatamicBardHeadingPermalinks\HeadingPermalinkExtension; class AppServiceProvider { public function boot() { // Register all heading permalink extensions. HeadingPermalinkExtension::registerAll(); } }
Note: The
HeadingPermalinkExtensionwill replace any existing heading extension.
Configuration
By default, Bard Heading Permalinks will utilize the heading_permalink settings for the default markdown parser. For more information on configuring Statamic's markdown parsers, consider reading the official documentation here: https://statamic.dev/extending/markdown#configuration.
However, you may publish Bard Heading Permalink's configuration file to override any settings by running the following command from the root of your project:
php artisan vendor:publish --tag=bard-permalinks-config
A new file will be created at config/bard_permalinks.php, with the following contents:
<?php use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkRenderer; return [ 'config' => [ 'html_class' => config('statamic.markdown.configs.default.heading_permalink.html_class', 'heading-permalink'), 'id_prefix' => config('statamic.markdown.configs.default.heading_permalink.id_prefix', 'content'), 'apply_id_to_heading' => config('statamic.markdown.configs.default.heading_permalink.apply_id_to_heading', false), 'heading_class' => config('statamic.markdown.configs.default.heading_permalink.heading_class', ''), 'fragment_prefix' => config('statamic.markdown.configs.default.heading_permalink.fragment_prefix', 'content'), 'insert' => config('statamic.markdown.configs.default.heading_permalink.insert', 'before'), 'min_heading_level' => config('statamic.markdown.configs.default.heading_permalink.min_heading_level', 1), 'max_heading_level' => config('statamic.markdown.configs.default.heading_permalink.max_heading_level', 6), 'title' => config('statamic.markdown.configs.default.heading_permalink.title', 'Permalink'), 'symbol' => config('statamic.markdown.configs.default.heading_permalink.symbol', HeadingPermalinkRenderer::DEFAULT_SYMBOL), 'aria_hidden' => config('statamic.markdown.configs.default.heading_permalink.aria_hidden', true), ], ];
Bard Heading Permalinks supports all documented configuration options provided by CommonMark's Heading Permalink Extension. For more information on each configuration option, please consult their documentation page here: https://commonmark.thephpleague.com/2.4/extensions/heading-permalinks/.
License
Bard Heading Permalinks is free software, released under the MIT license.
stillat/statamic-bard-heading-permalinks 适用场景与选型建议
stillat/statamic-bard-heading-permalinks 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 526 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 11 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 stillat/statamic-bard-heading-permalinks 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stillat/statamic-bard-heading-permalinks 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 526
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-11