You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,8 @@ Text domain: always `'atmosphere'`.
72
72
73
73
**MUST** use `use` imports for cross-namespace references — no inline `\Namespace\Class`.
74
74
75
+
**MUST** build any front-end-displayed Bluesky/appview web link (`profile`, `post`, `hashtag`, `mention`) through `Atmosphere\appview_url( $path, $context )` in `includes/functions.php` — never hardcode `https://bsky.app/...`. The helper centralizes the host and makes it filterable (`atmosphere_appview_host` / `atmosphere_appview_url`). Keep escaping at the call site (`\esc_url()` for HTML, `\esc_url_raw()` for storage); the helper returns an unescaped URL on purpose. This applies to display links only, not to AT Protocol records being published.
76
+
75
77
## Autoloading
76
78
77
79
Uses the custom `Atmosphere\Autoloader` in `includes/class-autoloader.php`, which respects WordPress filename conventions (`class-foo.php`, lowercase, hyphenated). `composer.json` declares an empty `autoload` block — Composer is only used for dev tooling (PHPUnit, PHPCS, Changelogger). Helper functions in `includes/functions.php` are loaded via a direct `require_once` from `atmosphere.php`.
Copy file name to clipboardExpand all lines: docs/developer-docs.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,12 +40,68 @@ ATmosphere exposes a small set of filters and actions for plugins to extend beha
40
40
|`atmosphere_should_sync_reply`| filter | Customise which inbound Bluesky replies become WordPress comments. |
41
41
|`atmosphere_transform_bsky_post`| filter | Mutate the Bluesky post record before write. |
42
42
|`atmosphere_transform_document`| filter | Mutate the document record before write. |
43
+
|`atmosphere_appview_host`| filter | Point Bluesky web links at an alternative AT Protocol appview (host or subpath). |
44
+
|`atmosphere_appview_url`| filter | Rewrite the whole assembled appview link, including its route. |
43
45
|`atmosphere_publish_post_result`| action | React to a post-publish outcome (success or `WP_Error`). |
44
46
|`atmosphere_publish_comment_result`| action | React to a comment-publish outcome. |
45
47
|`atmosphere_reaction_synced`| action | React when a Bluesky reaction is stored as a WordPress comment. |
46
48
47
49
When adding a new public hook, mark its `@since` tag as `unreleased` — the release script rewrites it (see [Release Process → Marking Unreleased Code](release-process.md#marking-unreleased-code)).
48
50
51
+
### Pointing Bluesky links at another appview
52
+
53
+
Rendered links to Bluesky (profiles, hashtags, mentions, posts) default to the `bsky.app` web appview. Two filters let you redirect them, depending on how much you need to change.
54
+
55
+
Both filters pass up to three arguments. As with any WordPress filter, register with `$accepted_args = 3` if your callback needs `$path` and `$context`:
56
+
57
+
-`$path` — the path being built, e.g. `profile/<did>` or `hashtag/<tag>`.
58
+
-`$context` — array with the available parts: `type` (one of `profile`, `post`, `mention`, `hashtag`), `did`, `handle`, `rkey`, `tag`.
59
+
60
+
#### `atmosphere_appview_host` — swap the host (or subpath)
61
+
62
+
Use this when the alternative appview mirrors bsky.app's routes (`/profile/...`, `/hashtag/...`) and you only need to change where they live. The first argument is the default host, `'bsky.app'`.
63
+
64
+
The returned value can be a bare host, a host on a subdomain, or a host with a path prefix, with or without a scheme or trailing slash — it's normalized before use, so an appview hosted on a subpath works cleanly:
#### `atmosphere_appview_url` — rewrite the whole link
85
+
86
+
Use this when the appview's routes differ from bsky.app's — for example `/account/<did>` instead of `/profile/<did>`, or a custom hashtag route. The first argument is the fully assembled URL (after the host filter has run); rebuild it from `$context` and return a complete URL:
87
+
88
+
```php
89
+
// Custom profile route: /account/<did> instead of /profile/<did>.
Of note: links rendered on the fly (facet mentions, hashtags, and the "View on Bluesky" link) pick up the filters on every render, so changing them updates immediately. The author and source links stored on synced reaction comments are resolved once at sync time, so they keep whichever host was in effect when the comment was synced.
104
+
49
105
## Extending Content Formats
50
106
51
107
The `site.standard.document` record's `content` field is a singular open union of typed content objects (see [`docs/content-formats.md`](content-formats.md)). ATmosphere ships built-in parsers for HTML, Markpub, Leaflet, and pckt formats, and integrations can register additional parsers.
0 commit comments