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