al_ext_posts 0.1.0 → 1.0.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +12 -24
- data/lib/al_ext_posts.rb +19 -2
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7854d59bf4f472e37e31cb9c397c45154a66c1803c785cbae6be5e0a6fe52936
|
|
4
|
+
data.tar.gz: 2552fdbeb58639b0eedd78589fca65518bde5bbf283fd483565543efbb77f8ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49733ec7e66503e0ef3326333495cad2b246a657e3780e06d3d8211d4e962293bd80ead5a524e0c0e92ea47b0d13f231c9fdf392c1268ae486bdc06d2f67552b
|
|
7
|
+
data.tar.gz: 3dbc5c1e74595e275acf15c892cc432963e953d1656899ff47a284f4b6258eaa8920fc39d50ed560f68452a1922cfb33ebdab8f00e4425181f59569e107ae123
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.1 - 2026-05-24
|
|
4
|
+
|
|
5
|
+
- Preserved source-level categories/tags while allowing RSS entries and explicit external posts to override them.
|
|
6
|
+
- Hardened tests against local timezone differences and current Minitest releases.
|
|
7
|
+
|
|
3
8
|
## 0.1.0 - 2026-02-07
|
|
9
|
+
|
|
4
10
|
- Initial gem release.
|
|
5
11
|
- Added external post import from RSS feeds and explicit URL lists.
|
|
6
12
|
- Added RSS parse error handling and per-source default categories/tags.
|
data/README.md
CHANGED
|
@@ -1,31 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# al-ext-posts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`al_ext_posts` imports and renders external posts for `al-folio` v1.x and compatible Jekyll sites.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
Add this line to your Jekyll site's Gemfile:
|
|
8
|
-
|
|
9
7
|
```ruby
|
|
10
8
|
gem 'al_ext_posts'
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
And then execute:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
$ bundle install
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
1. Add the plugin to your site's `_config.yml`:
|
|
22
|
-
|
|
23
11
|
```yaml
|
|
24
12
|
plugins:
|
|
25
13
|
- al_ext_posts
|
|
26
14
|
```
|
|
27
15
|
|
|
28
|
-
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Configure external sources in `_config.yml`:
|
|
29
19
|
|
|
30
20
|
```yaml
|
|
31
21
|
external_sources:
|
|
@@ -43,18 +33,16 @@ external_sources:
|
|
|
43
33
|
published_date: "2024-03-21"
|
|
44
34
|
```
|
|
45
35
|
|
|
46
|
-
|
|
47
|
-
- RSS feeds: Provide the `rss_url` parameter
|
|
48
|
-
- Direct URLs: Provide a list of `posts` with `url` and `published_date`
|
|
36
|
+
Supported source types:
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
- `tags`: array of tags automatically applied to imported posts
|
|
38
|
+
- RSS feeds (`rss_url`)
|
|
39
|
+
- Manual URL entries (`posts` with `url` + `published_date`)
|
|
53
40
|
|
|
54
|
-
##
|
|
41
|
+
## Ecosystem context
|
|
55
42
|
|
|
56
|
-
|
|
43
|
+
- Starter demo content/wiring lives in `al-folio`.
|
|
44
|
+
- External post ingestion logic is owned here.
|
|
57
45
|
|
|
58
46
|
## Contributing
|
|
59
47
|
|
|
60
|
-
|
|
48
|
+
Parser/source behavior changes should be contributed in this repository.
|
data/lib/al_ext_posts.rb
CHANGED
|
@@ -42,7 +42,7 @@ module AlExtPosts
|
|
|
42
42
|
content: e.content,
|
|
43
43
|
summary: e.summary,
|
|
44
44
|
published: e.published
|
|
45
|
-
}, src)
|
|
45
|
+
}, metadata_for_post(src, e))
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
|
@@ -85,7 +85,24 @@ module AlExtPosts
|
|
|
85
85
|
puts "...fetching #{post['url']}"
|
|
86
86
|
content = fetch_content_from_url(post['url'])
|
|
87
87
|
content[:published] = parse_published_date(post['published_date'])
|
|
88
|
-
create_document(site, src['name'], post['url'], content, src)
|
|
88
|
+
create_document(site, src['name'], post['url'], content, metadata_for_post(src, post))
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def metadata_for_post(src, post)
|
|
93
|
+
metadata = src.dup
|
|
94
|
+
%w[categories tags].each do |key|
|
|
95
|
+
value = metadata_value(post, key)
|
|
96
|
+
metadata[key] = value if value && !(value.respond_to?(:empty?) && value.empty?)
|
|
97
|
+
end
|
|
98
|
+
metadata
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def metadata_value(post, key)
|
|
102
|
+
if post.respond_to?(:key?)
|
|
103
|
+
post[key] || post[key.to_sym]
|
|
104
|
+
elsif post.respond_to?(key)
|
|
105
|
+
post.public_send(key)
|
|
89
106
|
end
|
|
90
107
|
end
|
|
91
108
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: al_ext_posts
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- al-org
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: jekyll
|
|
@@ -143,7 +142,6 @@ metadata:
|
|
|
143
142
|
allowed_push_host: https://rubygems.org
|
|
144
143
|
homepage_uri: https://github.com/al-org-dev/al-ext-posts
|
|
145
144
|
source_code_uri: https://github.com/al-org-dev/al-ext-posts
|
|
146
|
-
post_install_message:
|
|
147
145
|
rdoc_options: []
|
|
148
146
|
require_paths:
|
|
149
147
|
- lib
|
|
@@ -158,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
158
156
|
- !ruby/object:Gem::Version
|
|
159
157
|
version: '0'
|
|
160
158
|
requirements: []
|
|
161
|
-
rubygems_version:
|
|
162
|
-
signing_key:
|
|
159
|
+
rubygems_version: 4.0.6
|
|
163
160
|
specification_version: 4
|
|
164
161
|
summary: Import external posts from RSS feeds and URLs
|
|
165
162
|
test_files: []
|