gautambjain / autolink
Turn configured keywords and phrases in posts into links.
Package info
github.com/gautambjain/autolink
Language:JavaScript
Type:flarum-extension
pkg:composer/gautambjain/autolink
Requires
- flarum/core: ^2.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-12-03 15:53:30 UTC
README
Admins map keywords or phrases to URLs. Wherever they appear as plain text in a post, they are shown as links that open in a new window.
Install
-
Unzip into
packages/inside your Flarum folder, givingpackages/autolink. -
From the Flarum folder:
composer config repositories.autolink path packages/autolink composer require gautambjain/autolink:@dev php flarum migrate php flarum cache:clear -
Enable Autolink in the admin panel, open its page and add keywords.
-
Reload the forum.
The built JavaScript is included in js/dist; Node is only needed to change it.
Matching rules
- Case-insensitive; the author's capitalisation is kept.
- Whole words only:
flarumdoes not match insideflarums. - Every occurrence is linked. The longest matching phrase wins.
- Spaces in a phrase match any run of whitespace.
- Existing links (including mentions), inline code, code blocks and buttons are skipped.
- A phrase split by formatting (
**machine** learning) or a line break tag is not matched. - Only
http://andhttps://URLs are accepted.
Scope
- Posts are linked in the browser. Stored post text is never changed.
- Discussion titles, the composer preview, emails and the server-rendered HTML that search engines or no-JavaScript visitors see are not linked.
- The keyword list is sent to every visitor with the forum page.
Data
Table autolink (with your configured prefix): id, keyword, link,
created_at. Admin-only REST endpoints are at /api/autolinks.
Develop
cd js
npm install
npm run build
npm test
The vendor is gautambjain and the package is gautambjain/autolink. The PHP
namespace is Gautambjain\Autolink and the extension id (used for translations
and JS initializers) is gautambjain-autolink.