jekyll-standard-site 0.1.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 +7 -0
- data/LICENSE.txt +18 -0
- data/README.md +64 -0
- data/lib/jekyll-standard-site/version.rb +5 -0
- data/lib/jekyll-standard-site.rb +72 -0
- metadata +111 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 432d493831fe450e29f8cea035a23d7ec753b87f55b92c53e521afbc361abbee
|
|
4
|
+
data.tar.gz: '09ffc806be505b95521bdb62698615790d2967fa331d262d93b66bdb22d71494'
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 3567bd39945886a4230422d6496e74e4172f022a2dffa32a9520633c07b5eba829efbf2308658f454aecfb3aecfc49dd9013cce1b902becc46b8c22b15cf81b0
|
|
7
|
+
data.tar.gz: 3a1c605dd484f9342964dc8f7ae974abc08a81245369bc285d636df6bf0874d9ae1856f3b745c92de70cc97bcb3196c6a4e0bf0335aade744f930f7d8e3ea0eb
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Andrew Nesbitt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
6
|
+
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
12
|
+
portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
15
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
16
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
18
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# jekyll-standard-site
|
|
2
|
+
|
|
3
|
+
A Jekyll plugin that emits the verification artifacts required by [standard.site](https://standard.site), the AT Protocol lexicons for long-form publishing.
|
|
4
|
+
|
|
5
|
+
The plugin does not create AT Protocol records. Those live on your PDS and are created separately (via the standard.site dashboard, `goat`, `@atproto/api`, etc.). Once the records exist, this plugin handles the static-site side: a `.well-known` endpoint for your publication and `<link>` tags on each post that point at the corresponding document record.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add to your Gemfile:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
group :jekyll_plugins do
|
|
13
|
+
gem "jekyll-standard-site"
|
|
14
|
+
end
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
And to `_config.yml`:
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
plugins:
|
|
21
|
+
- jekyll-standard-site
|
|
22
|
+
|
|
23
|
+
standard_site:
|
|
24
|
+
publication: "at://did:plc:abc123/site.standard.publication/3lwafzkjqm25s"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Publication verification
|
|
30
|
+
|
|
31
|
+
The plugin writes the publication AT-URI to `/.well-known/site.standard.publication`. No further setup needed.
|
|
32
|
+
|
|
33
|
+
If the publication is not at the domain root, set `publication_path`:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
standard_site:
|
|
37
|
+
publication: "at://did:plc:abc123/site.standard.publication/3lwafzkjqm25s"
|
|
38
|
+
publication_path: "/blog"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This writes to `/.well-known/site.standard.publication/blog` per the [verification spec](https://standard.site/docs/verification).
|
|
42
|
+
|
|
43
|
+
### Document verification
|
|
44
|
+
|
|
45
|
+
Add the document's AT-URI to each post's front matter:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
---
|
|
49
|
+
title: My First Post
|
|
50
|
+
at_uri: "at://did:plc:abc123/site.standard.document/3mek5jhkri72r"
|
|
51
|
+
---
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then drop the Liquid tag into your `<head>` layout:
|
|
55
|
+
|
|
56
|
+
```liquid
|
|
57
|
+
{% standard_site_links %}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This emits a `site.standard.publication` discovery hint on every page and a `site.standard.document` link tag on any page whose front matter includes `at_uri`.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
require "jekyll"
|
|
2
|
+
require_relative "jekyll-standard-site/version"
|
|
3
|
+
|
|
4
|
+
module Jekyll
|
|
5
|
+
module StandardSite
|
|
6
|
+
AT_URI_PATTERN = %r{\Aat://did:[a-z]+:[a-zA-Z0-9._:%-]+/[a-zA-Z0-9.]+/[a-zA-Z0-9]+\z}.freeze
|
|
7
|
+
|
|
8
|
+
def self.config(site)
|
|
9
|
+
site.config["standard_site"] || {}
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.publication_uri(site)
|
|
13
|
+
config(site)["publication"]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class WellKnownGenerator < Jekyll::Generator
|
|
17
|
+
safe true
|
|
18
|
+
priority :low
|
|
19
|
+
|
|
20
|
+
def generate(site)
|
|
21
|
+
uri = StandardSite.publication_uri(site)
|
|
22
|
+
return unless uri
|
|
23
|
+
|
|
24
|
+
unless uri =~ StandardSite::AT_URI_PATTERN
|
|
25
|
+
Jekyll.logger.warn "Standard.site:", "publication is not a valid AT-URI: #{uri}"
|
|
26
|
+
return
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
path = StandardSite.config(site)["publication_path"]
|
|
30
|
+
dir = ".well-known"
|
|
31
|
+
name = "site.standard.publication"
|
|
32
|
+
if path && !path.empty?
|
|
33
|
+
dir = File.join(".well-known", "site.standard.publication", path.sub(%r{\A/}, ""))
|
|
34
|
+
name = File.basename(dir)
|
|
35
|
+
dir = File.dirname(dir)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
file = Jekyll::PageWithoutAFile.new(site, site.source, dir, name)
|
|
39
|
+
file.content = uri
|
|
40
|
+
file.data["layout"] = nil
|
|
41
|
+
file.data["sitemap"] = false
|
|
42
|
+
site.pages << file
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class LinksTag < Liquid::Tag
|
|
47
|
+
def render(context)
|
|
48
|
+
site = context.registers[:site]
|
|
49
|
+
page = context.registers[:page] || {}
|
|
50
|
+
|
|
51
|
+
tags = []
|
|
52
|
+
|
|
53
|
+
if (pub = StandardSite.publication_uri(site))
|
|
54
|
+
tags << %(<link rel="site.standard.publication" href="#{pub}">)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
doc = page["at_uri"]
|
|
58
|
+
if doc
|
|
59
|
+
if doc =~ StandardSite::AT_URI_PATTERN
|
|
60
|
+
tags << %(<link rel="site.standard.document" href="#{doc}">)
|
|
61
|
+
else
|
|
62
|
+
Jekyll.logger.warn "Standard.site:", "at_uri on #{page["path"]} is not a valid AT-URI: #{doc}"
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
tags.join("\n")
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
Liquid::Template.register_tag("standard_site_links", Jekyll::StandardSite::LinksTag)
|
metadata
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: jekyll-standard-site
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Andrew Nesbitt
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: jekyll
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '3.7'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '5.0'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: '3.7'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '5.0'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: bundler
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
type: :development
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: rake
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0'
|
|
53
|
+
type: :development
|
|
54
|
+
prerelease: false
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
name: minitest
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - "~>"
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '5.0'
|
|
67
|
+
type: :development
|
|
68
|
+
prerelease: false
|
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - "~>"
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '5.0'
|
|
74
|
+
description: Generates the .well-known/site.standard.publication endpoint and provides
|
|
75
|
+
a Liquid tag that emits site.standard.publication and site.standard.document link
|
|
76
|
+
tags for AT Protocol verification.
|
|
77
|
+
email:
|
|
78
|
+
- andrewnez@gmail.com
|
|
79
|
+
executables: []
|
|
80
|
+
extensions: []
|
|
81
|
+
extra_rdoc_files:
|
|
82
|
+
- LICENSE.txt
|
|
83
|
+
- README.md
|
|
84
|
+
files:
|
|
85
|
+
- LICENSE.txt
|
|
86
|
+
- README.md
|
|
87
|
+
- lib/jekyll-standard-site.rb
|
|
88
|
+
- lib/jekyll-standard-site/version.rb
|
|
89
|
+
homepage: https://github.com/andrew/jekyll-standard-site
|
|
90
|
+
licenses:
|
|
91
|
+
- MIT
|
|
92
|
+
metadata:
|
|
93
|
+
source_code_uri: https://github.com/andrew/jekyll-standard-site
|
|
94
|
+
rdoc_options: []
|
|
95
|
+
require_paths:
|
|
96
|
+
- lib
|
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
|
+
requirements:
|
|
99
|
+
- - ">="
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: 2.7.0
|
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
|
+
requirements:
|
|
104
|
+
- - ">="
|
|
105
|
+
- !ruby/object:Gem::Version
|
|
106
|
+
version: '0'
|
|
107
|
+
requirements: []
|
|
108
|
+
rubygems_version: 4.0.6
|
|
109
|
+
specification_version: 4
|
|
110
|
+
summary: Emit standard.site verification artifacts from a Jekyll site
|
|
111
|
+
test_files: []
|