jekyll-activitypub-static 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 474e7a72176ed92f873aa65bcee1b79b1069ec2e124a23fee429741a81bc00e2
4
- data.tar.gz: 136fee10239aa4da8c286c03643dd1b17ef315997690f7a6c10d05b1750f94ca
3
+ metadata.gz: ecce07ba2b46d11a685b972da716ab71581b3cf3ed8223a997fb41b91dbcb446
4
+ data.tar.gz: c55f977f3f7c80cef6f3a2ff3de2b3fd87dd5ea81b9ad19d5b3e0f00c33fcf2f
5
5
  SHA512:
6
- metadata.gz: 2367a4b0f89526bc5af938b3abe372398c3bae8d6a5766ee4ffca8eccb029884fd35bb34a0a0a6683a1fe8d9ca8cd13ead5f7c5c27d57b4f60b101cfcf768734
7
- data.tar.gz: acc055a65f78b0fda9f9d35d800baebe4a4c0d2f1094fe93cb29ac829ba7f51d62633f076096ca052f66fc2b352546b4c3f994e37240ae72c3152e5aaf5610a7
6
+ metadata.gz: 9a1f8a02496607d0da688d196bff71a7f34e562b1aed6371490d332a8649c18e67b9b25891cc29b98d0fc52b5b1bc0ecef448574a771dc18ab241218545be1ef
7
+ data.tar.gz: 47c31eb9a5f1b3f79255b679ec259d4b67540b0630b68de76099595905f4b167dbb0cc51ca031cb9e5d030a930716c00c78befa910ae284e07e631e187fd1842
data/README.md CHANGED
@@ -2,7 +2,20 @@
2
2
 
3
3
  A Jekyll plugin that generates a static ActivityPoll feed, the read-only polling subset of ActivityPub defined by FEP-b06c.
4
4
 
5
- ## Installation
5
+ ## Table of Contents
6
+
7
+ - [Install](#install)
8
+ - [Usage](#usage)
9
+ - [Configuration](#configuration)
10
+ - [Articles and Notes](#articles-and-notes)
11
+ - [Layouts](#layouts)
12
+ - [Generated Files](#generated-files)
13
+ - [GitHub Pages](#github-pages)
14
+ - [Example Site](#example-site)
15
+ - [Contributing](#contributing)
16
+ - [License](#license)
17
+
18
+ ## Install
6
19
 
7
20
  Add this to the `Gemfile` of your Jekyll site:
8
21
 
@@ -17,15 +30,27 @@ gem build jekyll-activitypub-static.gemspec
17
30
  gem install ./jekyll-activitypub-static-*.gem
18
31
  ```
19
32
 
20
- ## Usage
21
-
22
- Add this to the `_config.yml` for your site:
33
+ Add the plugin to the `_config.yml` for your site:
23
34
 
24
35
  ```yaml
25
36
  plugins:
26
37
  - jekyll-activitypub-static
27
38
  ```
28
39
 
40
+ ## Usage
41
+
42
+ Build your site to generate the ActivityPub files:
43
+
44
+ ```sh
45
+ bundle exec jekyll build
46
+ ```
47
+
48
+ To build the site and serve it locally:
49
+
50
+ ```sh
51
+ bundle exec jekyll serve
52
+ ```
53
+
29
54
  ## Configuration
30
55
 
31
56
  The plugin uses your site's standard `url`, `author`, and `description`
@@ -42,6 +67,7 @@ activitypub:
42
67
  summary_property: "description"
43
68
  note_max_characters: 500
44
69
  update_interval: "P1D"
70
+ webfinger_output_file: ".well-known/webfinger"
45
71
  ```
46
72
 
47
73
  Available `activitypub` options:
@@ -58,6 +84,9 @@ Available `activitypub` options:
58
84
  Note objects. Defaults to `500`.
59
85
  - `update_interval`: ActivityPoll polling interval for the generated Actor
60
86
  object, as an ISO 8601 duration. Defaults to `P1D`.
87
+ - `webfinger_output_file`: path for the generated WebFinger document. Defaults
88
+ to `.well-known/webfinger`. GitHub Pages sites can set this to
89
+ `.well-known/webfinger/index.json` as a workaround for its content type.
61
90
 
62
91
  ## Articles and Notes
63
92
 
@@ -114,16 +143,53 @@ The `activitypub` path changes when `activitypub.output_path` is configured.
114
143
 
115
144
  ### WebFinger
116
145
 
117
- The WebFinger document is generated at `.well-known/webfinger` and uses an
118
- account ID in the form `preferred_username` at the site domain. For example,
119
- with `url: "https://example.com"` and `preferred_username: "evan"`, the
120
- account ID is `evan@example.com`.
146
+ The WebFinger document is generated at `.well-known/webfinger` by default and
147
+ uses an account ID in the form `preferred_username` at the site domain. For
148
+ example, with `url: "https://example.com"` and `preferred_username: "evan"`,
149
+ the account ID is `evan@example.com`.
150
+
151
+ The output path can be configured with `activitypub.webfinger_output_file`.
152
+ For example, GitHub Pages sites can use the following workaround to serve the
153
+ document through an `index.json` file:
154
+
155
+ ```yaml
156
+ activitypub:
157
+ webfinger_output_file: ".well-known/webfinger/index.json"
158
+ ```
159
+
160
+ GitHub Pages redirects requests for `.well-known/webfinger` to
161
+ `.well-known/webfinger/`, where it serves `index.json`.
121
162
 
122
163
  WebFinger discovery only works when the generated site is served from the root
123
164
  of its domain, because clients request `https://example.com/.well-known/webfinger`.
124
165
  Sites served from a subdirectory cannot provide a domain-level WebFinger
125
166
  endpoint with this plugin alone.
126
167
 
168
+ ## GitHub Pages
169
+
170
+ GitHub Pages' built-in Jekyll build does not support this plugin because it is
171
+ not on GitHub's allowlist. Configure a GitHub Actions workflow to build the
172
+ site instead.
173
+
174
+ The `.well-known` directory can be dropped when uploading the resulting site to GitHub Pages. To work around this, set `include-hidden-files: true` on the `actions/upload-pages-artifact` step in the GitHub Actions workflow:
175
+
176
+ ```yaml
177
+ - uses: actions/upload-pages-artifact@v5
178
+ with:
179
+ path: _site
180
+ include-hidden-files: true
181
+ ```
182
+
183
+ Configure WebFinger to use an `index.json` file:
184
+
185
+ ```yaml
186
+ activitypub:
187
+ webfinger_output_file: ".well-known/webfinger/index.json"
188
+ ```
189
+
190
+ The `index.json` path works around GitHub Pages serving the extensionless
191
+ `.well-known/webfinger` file with an `application/octet-stream` content type.
192
+
127
193
  ## Example Site
128
194
 
129
195
  The `example-site` directory has a minimal example site (thus the name). You can build and run it with these commands:
@@ -137,6 +203,16 @@ bundle exec jekyll serve
137
203
 
138
204
  This will build a site that runs on `http://localhost:4000/`
139
205
 
206
+ ## Viewing from the Fediverse
207
+
208
+ Support for interacting with static accounts on the Fediverse is still experimental; most software will not allow full interactions.
209
+
210
+ With Mastodon 4.x (the current version) you can search for the account by Webfinger ID (username@domain), and then load the account. It should show the profile information.
211
+
212
+ With [Webfinger Browser](https://acct.swf.pub/), you can search for the account by Webfinger ID, and view the account. It should show the profile information and all the generated content.
213
+
214
+ It's still definitely worthwhile to keep this plugin enabled; it gives an incentive for Fediverse software developers to add support for static accounts.
215
+
140
216
  ## Contributing
141
217
 
142
218
  PRs accepted.
@@ -33,7 +33,7 @@ module Jekyll
33
33
  end
34
34
 
35
35
  def generate_webfinger(site)
36
- Jekyll.logger.info LOG_TAG, "Generating .well-known/webfinger"
36
+ Jekyll.logger.info LOG_TAG, "Generating webfinger endpoint"
37
37
 
38
38
  url = site.config["url"]
39
39
  actor_url = "#{url}/actor.jsonld"
@@ -49,7 +49,10 @@ module Jekyll
49
49
  ]
50
50
  }
51
51
 
52
- sf = JsonStaticFile.new(site, ".well-known", "webfinger", webfinger)
52
+ webfinger_output_file = site.config.dig("activitypub", "webfinger_output_file") || ".well-known/webfinger"
53
+
54
+ sf = JsonStaticFile.new(site, File.dirname(webfinger_output_file), File.basename(webfinger_output_file),
55
+ webfinger)
53
56
  site.static_files << sf
54
57
 
55
58
  Jekyll.logger.info LOG_TAG, "Added webfinger as #{sf.path}"
@@ -1,6 +1,6 @@
1
1
  # lib/jekyll/activitypub_static/version.rb
2
2
  module Jekyll
3
3
  module ActivityPubStatic
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-activitypub-static
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Prodromou