Search by

gautambjain / autolink

gautambjain

Turn configured keywords and phrases in posts into links.

Package info

github.com/gautambjain/autolink

Language:JavaScript

Type:flarum-extension

pkg:composer/gautambjain/autolink

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0 2026-12-02 16:01 UTC

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

  1. Unzip into packages/ inside your Flarum folder, giving packages/autolink.

  2. From the Flarum folder:

    composer config repositories.autolink path packages/autolink
    composer require gautambjain/autolink:@dev
    php flarum migrate
    php flarum cache:clear
    
  3. Enable Autolink in the admin panel, open its page and add keywords.

  4. 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: flarum does not match inside flarums.
  • 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:// and https:// 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.