diff --git a/mkdocsPublisher/githubInteraction/filesManagement.ts b/mkdocsPublisher/githubInteraction/filesManagement.ts index 455e734c..8d4aa8ca 100644 --- a/mkdocsPublisher/githubInteraction/filesManagement.ts +++ b/mkdocsPublisher/githubInteraction/filesManagement.ts @@ -150,10 +150,19 @@ export class FilesManagement extends MkdocsPublish { ); if (imageLink.name.match(/(png|jpe?g|svg|bmp|gif)$/i)) { imageList.push(imageLink); + } else if (imageLink.extension==='md') { + const sharedKey = this.settings.shareKey; + const frontmatter = this.metadataCache.getFileCache(imageLink).frontmatter; + if ( + frontmatter && frontmatter[sharedKey] && + !this.checkExcludedFolder(imageLink) + ) { + imageList.push(imageLink); + } } } catch (e) { console.log(e) - console.log("Error with this image : " + embedCach.displayText); + console.log("Error with this file : " + embed.displayText); } } return imageList;