Skip to content

Commit

Permalink
feat(embed): share embed files too!
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Jul 10, 2022
1 parent fa4c55e commit 558cc74
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mkdocsPublisher/githubInteraction/filesManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 558cc74

Please sign in to comment.