Skip to content

Commit

Permalink
Merge pull request #12 from KyleSmith0905/fix-apple-icons-classifying…
Browse files Browse the repository at this point in the history
…-as-icon
  • Loading branch information
harlan-zw authored Nov 1, 2023
2 parents ee2e2e8 + 11efc18 commit cf3fe90
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/features/generateTagsFromPublicFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ export default async function generateTagsFromPublicFiles(nuxt: Nuxt = useNuxt()
sizes: 'any',
})
}

const isIcon = (file: string) => file.includes('icon') && !file.endsWith('.ico');
const isAppleIcon = (file: string) => (
!isIcon(file) && (file.startsWith('apple-icon.') || file.startsWith('apple-touch-icon.'))
);

headConfig.link.push(
...await Promise.all([
...rootPublicFiles
.filter(file => file.includes('icon') && !file.endsWith('.ico'))
.filter(file => isIcon(file))
.sort()
.map(async (iconFile) => {
const iconFileExt = iconFile.split('.').pop()
Expand All @@ -43,7 +49,8 @@ export default async function generateTagsFromPublicFiles(nuxt: Nuxt = useNuxt()
sizes,
}
}),
...rootPublicFiles.filter(file => file.startsWith('apple-icon.') || file.startsWith('apple-touch-icon.'))
...rootPublicFiles
.filter(file => isAppleIcon(file))
.sort()
.map(async (appleIconFile) => {
const appleIconFileExt = appleIconFile.split('.').pop()
Expand Down

0 comments on commit cf3fe90

Please sign in to comment.