add folder image in config post
This commit is contained in:
parent
e3b97160a2
commit
656e1e43fd
@ -55,6 +55,7 @@ ${filteredExcerpt}
|
||||
.then((res) => {
|
||||
// suite du poste avec upload d'image
|
||||
console.log('on envoie le media et l image')
|
||||
configPost.folder_image = folderBlogPostsPreview;
|
||||
configPost.image = 'media_post_' + postObject.post_name + '.jpg';
|
||||
sendPostMastodon(configPost)
|
||||
|
||||
|
@ -25,6 +25,7 @@ export let defaultConfigMasto = {
|
||||
sensitive: false,
|
||||
reallySendPost: false,
|
||||
image: '',
|
||||
folder_image: 'assets/',
|
||||
message: "Hey coucou! on est le" + nowDate,
|
||||
scheduled_at: "",
|
||||
content_type: "text/markdown"
|
||||
@ -103,7 +104,7 @@ export default function sendPostMastodon(config) {
|
||||
var id;
|
||||
console.log("envoi du média", config.image)
|
||||
// upload new media
|
||||
return masto.post('media', {file: fs.createReadStream('assets/' + config.image)})
|
||||
return masto.post('media', {file: fs.createReadStream(config.folder_image + config.image)})
|
||||
.then(resp => {
|
||||
id = resp.data.id;
|
||||
params.media_ids = [id]
|
||||
|
Loading…
x
Reference in New Issue
Block a user