-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublisher.config.mjs
More file actions
38 lines (33 loc) · 1.06 KB
/
Copy pathpublisher.config.mjs
File metadata and controls
38 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// publisher.config.mjs
// Generated by Publisher. Do not change publisherVersion manually.
// --- PublisherContent type (reference copy) ---
/**
* @typedef {Object} PublisherContent
* @property {string} [title]
* @property {string} [body]
* @property {string} caption - Required. The text posted to social media.
* @property {string[]} [tags]
*/
export const publisherVersion = 1
export default {
// Template slugs this project uses, pinned to a specific version.
templates: {
"quote-short": 1,
"quote-wide": 1
},
// Social channels to publish to.
channels: ['instagram', 'facebook', 'linkedin'],
// Content adapter: receives a file path, returns PublisherContent.
// Default: reads a JSON file with { title?, caption, body?, tags? }
adapter: async (filePath) => {
const { readFile } = await import('fs/promises')
const raw = await readFile(filePath, 'utf-8')
const data = JSON.parse(raw)
return {
title: data.title,
body: data.body,
caption: data.caption ?? '',
tags: data.tags ?? [],
}
},
}