* docs: resolve raw HTML link and image paths through useBaseUrl
Docusaurus prepends `baseUrl` to markdown-syntax links (`[text](/path)`) but
never to site-absolute paths written in raw HTML/JSX attributes. Those values
ship verbatim, which is correct only while `baseUrl` is `/`.
Convert the 221 raw `<a href="/...">` anchors across 22 files under docs/main
and the 3 raw `<img src="/img/...">` tags in docs/develop to
`useBaseUrl('/...')`, matching how images in the same table rows already
resolve their paths. Link targets, link text and table structure are unchanged.
Add scripts/check-base-url-attrs.mjs and run it as the first step of
`prebuild` so the build fails fast on any new occurrence.
* docs(site): match CommonMark fence closing in baseUrl attr check
Toggle on any fence-like line could exit a block early; track the
opening marker and only close with the same character of sufficient length.
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs(site): also flag JSX string-literal href/src in baseUrl check
Quoted attributes alone miss href={"/path"} / src={'/path'}, which
bypass baseUrl the same way. Scan both forms through one validation path.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
3.2 KiB
title, sidebar_position
| title | sidebar_position |
|---|---|
| Example plugins | 90 |
import useBaseUrl from '@docusaurus/useBaseUrl';
Server "Hello, world!"
To get started extending server-side functionality with plugins, take a look at our server "Hello, world!" tutorial.
Web app "Hello, world!"
To get started extending browser-side functionality with plugins, take a look at our web app "Hello, world!" tutorial.
Demo plugin
To see a demonstration of all server-side hooks and webapp components, take a look at our demo plugin.
Sample plugin
To see a stripped down version of the demo plugin with just the build scripts and templates to get started, take a look at our plugin starter template.
Zoom
The Zoom plugin for Mattermost adds UI elements that allow users to easily create and join Zoom meetings:
<img src={useBaseUrl('/img/extend/zoom-plugin-screenshot.png')} width="445" height="295" />
Topics demonstrated:
- Uses a custom HTTP handler to integrate with external systems.
- Defines a settings schema, allowing system administrators to configure the plugin via system console UI.
- Implements tests using the plugin/plugintest package.
- Creates rich posts using custom post types.
- Extends existing webapp components to add elements to the UI.
JIRA
The JIRA plugin for Mattermost creates a webhook that your JIRA server can use to post messages to Mattermost when issues are created:
<img src={useBaseUrl('/img/extend/jira-plugin-screenshot.png')} width="445" height="263" />
Topics demonstrated:
- Uses a custom HTTP handler to integrate with external systems.
- Defines a settings schema, allowing system administrators to configure the plugin via system console UI.
- Implements tests using the plugin/plugintest package.
- Compiles and publishes releases for multiple platforms using Travis-CI.
Profanity filter
The profanity filter plugin for Mattermost automatically detects restricted words in posts and censors them prior to writing to the database. For more use cases, see this forum post.
Topics demonstrated:
- Interception and modification of posts prior to writing them into the database.
- Rejection of posts prior to writing them into the database.
Memes
The Memes plugin for Mattermost creates a slash command that can be used to create dank memes:
<img src={useBaseUrl('/img/extend/memes-plugin-screenshot.png')} width="445" height="325" />
Topics demonstrated:
- Registers a custom slash command.
- Uses a custom HTTP handler to generate and serve content.
- Compiles and publishes releases for multiple platforms using Travis-CI.