@rmdes/indiekit-endpoint-rss 1.1.0 → 1.1.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.
- package/assets/styles.css +8 -0
- package/locales/en.json +5 -1
- package/package.json +1 -1
- package/views/rss.njk +73 -32
package/assets/styles.css
CHANGED
|
@@ -86,10 +86,18 @@
|
|
|
86
86
|
align-items: center;
|
|
87
87
|
border-block-end: 1px solid var(--color-border);
|
|
88
88
|
display: flex;
|
|
89
|
+
flex-wrap: wrap;
|
|
89
90
|
gap: var(--space-s);
|
|
90
91
|
padding: var(--space-s) 0;
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
/* The publish disclosure gets a row of its own. As a plain flex sibling of the
|
|
95
|
+
icon, info and actions it was squeezed into the same line and overlapped the
|
|
96
|
+
feed metadata. */
|
|
97
|
+
.rss-publish {
|
|
98
|
+
flex-basis: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
93
101
|
.rss-feed-item:last-child {
|
|
94
102
|
border-block-end: none;
|
|
95
103
|
}
|
package/locales/en.json
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"feedAdded": "Feed added successfully",
|
|
41
41
|
"feedRemoved": "Feed removed",
|
|
42
42
|
"feedUpdated": "Feed updated",
|
|
43
|
-
|
|
43
|
+
"feedEnabled": "Feed enabled",
|
|
44
44
|
"feedDisabled": "Feed disabled",
|
|
45
45
|
"backfillQueued": "Backfill queued; items will be published as drafts over the next sync cycles",
|
|
46
46
|
"syncComplete": "Sync complete",
|
|
@@ -56,8 +56,12 @@
|
|
|
56
56
|
"enabled": "Create posts from this feed",
|
|
57
57
|
"postType": "Post type",
|
|
58
58
|
"content": "Content template",
|
|
59
|
+
"contentHint": "Placeholders: {{title}} {{link}} {{description}} {{content}} {{author}} {{sourceTitle}}",
|
|
59
60
|
"linkProperty": "Link property",
|
|
61
|
+
"linkPropertyHint": "Discovery property carrying the item URL, e.g. bookmark-of. Leave empty for a plain note or article.",
|
|
60
62
|
"status": "Post status",
|
|
63
|
+
"draft": "Draft",
|
|
64
|
+
"published": "Published",
|
|
61
65
|
"save": "Save publish settings"
|
|
62
66
|
}
|
|
63
67
|
}
|
package/package.json
CHANGED
package/views/rss.njk
CHANGED
|
@@ -101,39 +101,78 @@
|
|
|
101
101
|
<div class="rss-feed-error">{{ feed.lastError }}</div>
|
|
102
102
|
{% endif %}
|
|
103
103
|
</div>
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
{% set typeItems = [] %}
|
|
105
|
+
{% for type in postTypes %}
|
|
106
|
+
{% set typeItems = (typeItems.push({
|
|
107
|
+
text: type,
|
|
108
|
+
value: type,
|
|
109
|
+
selected: feed.publish.postType == type
|
|
110
|
+
}), typeItems) %}
|
|
111
|
+
{% endfor %}
|
|
112
|
+
{% set publishSummary %}{{ __("rss.publish.title") }}{% if feed.publish.enabled %} • {{ feed.publish.postType }}{% endif %}{% endset %}
|
|
113
|
+
{% call details({
|
|
114
|
+
classes: "rss-publish",
|
|
115
|
+
summary: publishSummary
|
|
116
|
+
}) %}
|
|
106
117
|
<form data-publish-feed="{{ feed.id }}">
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
118
|
+
{{ checkboxes({
|
|
119
|
+
idPrefix: "publish-enabled-" + feed.id,
|
|
120
|
+
name: "enabled",
|
|
121
|
+
items: [{
|
|
122
|
+
value: "true",
|
|
123
|
+
text: __("rss.publish.enabled"),
|
|
124
|
+
checked: feed.publish.enabled
|
|
125
|
+
}]
|
|
126
|
+
}) }}
|
|
127
|
+
|
|
128
|
+
{{ select({
|
|
129
|
+
id: "publish-post-type-" + feed.id,
|
|
130
|
+
name: "postType",
|
|
131
|
+
label: __("rss.publish.postType"),
|
|
132
|
+
items: typeItems
|
|
133
|
+
}) }}
|
|
134
|
+
|
|
135
|
+
{{ input({
|
|
136
|
+
id: "publish-content-" + feed.id,
|
|
137
|
+
name: "content",
|
|
138
|
+
label: __("rss.publish.content"),
|
|
139
|
+
hint: __("rss.publish.contentHint"),
|
|
140
|
+
value: feed.publish.content or "{{description}}"
|
|
141
|
+
}) }}
|
|
142
|
+
|
|
143
|
+
{{ input({
|
|
144
|
+
id: "publish-link-property-" + feed.id,
|
|
145
|
+
name: "linkProperty",
|
|
146
|
+
label: __("rss.publish.linkProperty"),
|
|
147
|
+
hint: __("rss.publish.linkPropertyHint"),
|
|
148
|
+
optional: true,
|
|
149
|
+
value: feed.publish.linkProperty
|
|
150
|
+
}) }}
|
|
151
|
+
|
|
152
|
+
{{ select({
|
|
153
|
+
id: "publish-status-" + feed.id,
|
|
154
|
+
name: "status",
|
|
155
|
+
label: __("rss.publish.status"),
|
|
156
|
+
items: [
|
|
157
|
+
{
|
|
158
|
+
text: __("rss.publish.draft"),
|
|
159
|
+
value: "draft",
|
|
160
|
+
selected: feed.publish.status != "published"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
text: __("rss.publish.published"),
|
|
164
|
+
value: "published",
|
|
165
|
+
selected: feed.publish.status == "published"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}) }}
|
|
169
|
+
|
|
170
|
+
{{ button({
|
|
171
|
+
type: "submit",
|
|
172
|
+
text: __("rss.publish.save")
|
|
173
|
+
}) }}
|
|
135
174
|
</form>
|
|
136
|
-
|
|
175
|
+
{% endcall %}
|
|
137
176
|
<div class="rss-feed-actions">
|
|
138
177
|
<label class="rss-toggle">
|
|
139
178
|
<input
|
|
@@ -322,7 +361,9 @@
|
|
|
322
361
|
const data = new FormData(e.target);
|
|
323
362
|
|
|
324
363
|
const publish = {
|
|
325
|
-
|
|
364
|
+
// The checkboxes component sets value="true"; an unchecked box is
|
|
365
|
+
// omitted from FormData entirely, so presence is the signal.
|
|
366
|
+
enabled: data.get('enabled') !== null,
|
|
326
367
|
postType: data.get('postType'),
|
|
327
368
|
content: data.get('content'),
|
|
328
369
|
linkProperty: data.get('linkProperty') || null,
|