diff --git a/README.md b/README.md index 42bebdb..0ffa4d8 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ From Logseq store - `Plugins -> Marketplace`. ### ✨ Page icons Enable feature to show Logseq page (or aliased page) icon for internal links in content. -In addition you can config icon inheriting from related page (or its alias) proprty, to avoid manual setting `icon::` for common pages. +In addition you can config icon inheriting from related page proprty, to avoid manual setting `icon::` for common pages. For ex.: * create "Projects" page, set `icon::` for it * create "Some project" page, set `page-type:: [[Projects]]` diff --git a/src/js/awesomeLinks.ts b/src/js/awesomeLinks.ts index 941f587..5366b77 100644 --- a/src/js/awesomeLinks.ts +++ b/src/js/awesomeLinks.ts @@ -196,6 +196,20 @@ const setPageIcons = async (linkList: NodeListOf) => { } if (!pageIcon && pluginConfig.featureInheritPageIcons) { + if (!pageIcon) { + // inherited from page props, when props linked to page + const inheritedPropsTitle = await getInheritedPropsTitle(pageTitle, pluginConfig.featureInheritPageIcons); + if (inheritedPropsTitle) { + pageIcon = await getPageIcon(inheritedPropsTitle); + // if (!pageIcon) { + // // inherited from page props, when props linked to aliased + // const aliasedPageTitle = await getAliasedPageTitle(inheritedPropsTitle); + // if (aliasedPageTitle) { + // pageIcon = await getPageIcon(aliasedPageTitle); + // } + // } + } + } if (!pageIcon) { // inherited from aliased page props, when props linked to page const aliasedPageTitle = await getAliasedPageTitle(pageTitle); @@ -206,20 +220,6 @@ const setPageIcons = async (linkList: NodeListOf) => { } } } - if (!pageIcon) { - // inherited from page props, when props linked to page - const inheritedPropsTitle = await getInheritedPropsTitle(pageTitle, pluginConfig.featureInheritPageIcons); - if (inheritedPropsTitle) { - pageIcon = await getPageIcon(inheritedPropsTitle); - if (!pageIcon) { - // inherited from page props, when props linked to aliased - const aliasedPageTitle = await getAliasedPageTitle(inheritedPropsTitle); - if (aliasedPageTitle) { - pageIcon = await getPageIcon(aliasedPageTitle); - } - } - } - } } if (pageIcon) { linkItem.insertAdjacentHTML('afterbegin', `${pageIcon}`);