chrisvasey/statamic-backlinks
Composer 安装命令:
composer require chrisvasey/statamic-backlinks
包简介
Obsidian-style backlinks for Statamic's Bard and Markdown fields
README 文档
README
Obsidian-style backlinks for Statamic's Bard and Markdown fields. Create wiki-links between entries, track which pages link to each other, and create new pages from missing links.
Learn more about Obsidian backlinks.
Features
- Wiki-link syntax: Use
[[Page Title]]or[[Page Title|Display Text]]in your content - Backlink tracking: Automatically tracks which entries link to each other
- Missing link detection: Visually distinguish links to non-existent pages
- Page creation: Create new entries directly from missing wiki-links
- Dashboard widget: See backlink activity at a glance
- Entry sidebar: View backlinks when editing an entry
- Antlers tag: Display backlinks in your templates
Installation
composer require chrisvasey/statamic-backlinks
Usage
Wiki-Link Syntax
Use double-bracket syntax in your content fields:
Check out [[Getting Started]] for the basics.
You might also like [[Advanced Topics|our advanced guide]].
Rendering Wiki-Links
Use the wiki_links modifier to render wiki-links as HTML:
{{ content | wiki_links }}
This transforms:
[[Existing Page]]→<a href="/existing-page" class="wiki-link">Existing Page</a>[[Missing Page]]→<span class="wiki-link-missing" data-title="Missing Page">Missing Page</span>
Displaying Backlinks
Use the backlinks tag to show pages that link to the current entry:
{{ backlinks }}
<a href="{{ url }}">{{ title }}</a>
{{ /backlinks }}
{{# Or just get the count #}}
{{ backlinks:count }}
{{# For a specific entry #}}
{{ backlinks from="entry-id-here" }}
{{ title }}
{{ /backlinks }}
Dashboard Widget
Add the backlinks widget to your dashboard in config/statamic/cp.php:
'widgets' => [ [ 'type' => 'backlinks', 'title' => 'Recent Backlinks', 'limit' => 10, ], ],
Rebuilding the Index
If you need to rebuild the backlink index (e.g., after importing content):
php please backlinks:rebuild
Configuration
Publish the config file:
php artisan vendor:publish --tag=statamic-backlinks-config
Options
return [ // Collections to scan for wiki-links 'scan_collections' => ['*'], // or ['pages', 'blog'] // Collections that can be linked to 'linkable_collections' => ['*'], // Fields to scan for wiki-links 'scan_fields' => ['content', 'body', 'text', '*'], // Page creation settings 'creation' => [ 'collection_strategy' => 'same', // 'same' or 'default' 'default_collection' => 'pages', 'default_blueprint' => null, 'default_published' => false, ], // Index storage 'storage' => 'file', // 'file' or 'cache' 'storage_path' => storage_path('statamic/backlinks.json'), // CSS classes for rendered links 'css' => [ 'link' => 'wiki-link', 'missing' => 'wiki-link-missing', ], ];
Styling
The addon includes basic CSS for wiki-links. You can customize the appearance:
.wiki-link { color: blue; text-decoration: underline dotted; } .wiki-link-missing { color: red; text-decoration: underline dashed; cursor: pointer; }
Development
Building Assets
cd addons/chrisvasey/statamic-backlinks
npm install
npm run build
For development with hot reloading:
npm run dev
Running Tests
cd addons/chrisvasey/statamic-backlinks
./vendor/bin/phpunit
License
MIT License
chrisvasey/statamic-backlinks 适用场景与选型建议
chrisvasey/statamic-backlinks 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 01 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「markdown」 「Backlinks」 「statamic」 「bard」 「obsidian」 「wiki-links」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 chrisvasey/statamic-backlinks 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 chrisvasey/statamic-backlinks 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 chrisvasey/statamic-backlinks 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Adds more BBCode
Statamic Fine Seo addon
Creates a markdown changelog for your GitHub repository.
A lightweight floating toolbar for Statamic that gives logged-in users quick access to the CP and entry editor
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-20