Skip to content

Commit

Permalink
feat: favicon -d
Browse files Browse the repository at this point in the history
  • Loading branch information
arpowers committed Mar 22, 2024
1 parent e621f37 commit ac45554
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- dev
paths:
- 'docs/**'

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion @fiction/plugin-sites/el/ToolPageGlobal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const options = [
label: 'Site Meta Information',
input: 'group',
options: [
new InputOption({ key: 'userConfig.faviconUrl', label: 'Favicon', input: 'InputMediaUpload' }),
new InputOption({ key: 'userConfig.favicon', label: 'Favicon', input: 'InputMediaUpload' }),
new InputOption({ key: 'userConfig.shareImage', label: 'Share Image', description: 'Image appears when your site is shared', input: 'InputMediaUpload' }),
new InputOption({ key: 'userConfig.timeZone', label: 'Site Time Zone', input: 'InputTimezone' }),
new InputOption({ key: 'userConfig.languageCode', label: 'Site Language Code', input: 'InputText', placeholder: 'en' }),
Expand Down
9 changes: 8 additions & 1 deletion @fiction/plugin-sites/engine/FSite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
}
}
const faviconUrl = () => site.value?.userConfig.value.favicon?.url || '/favicon.svg'
unhead.useHead({
htmlAttrs: { lang: 'en', dir: 'ltr' },
title: () => getTitleTag(),
Expand All @@ -110,7 +112,12 @@ unhead.useHead({
{ property: 'og:url', content: () => site.value?.frame.displayUrl.value },
],
link: [
{ rel: 'shortcut icon', href: () => site.value?.userConfig.value.faviconUrl?.url || '/favicon.png' },
{
rel: 'shortcut icon',
href: () => faviconUrl(),
type: () => faviconUrl().includes('svg') ? 'image/svg+xml' : '',
sizes: () => faviconUrl().includes('svg') ? 'any' : '',
},
{ rel: 'canonical', href: () => site.value?.frame.displayUrl.value },
{ key: 'font-pre', rel: 'preconnect ', href: 'https://fonts.googleapis.com' },
{ key: 'font-static', rel: 'preconnect ', href: 'https://fonts.gstatic.com', crossorigin: 'anonymous' },
Expand Down
2 changes: 1 addition & 1 deletion @fiction/plugin-sites/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type PageRegion = typeof pageRegionIds[number] | string
export type TableSiteConfig = CreateObjectType<typeof siteCols> & st & { pages: CardConfigPortable[] }

export type SiteUserConfig = Partial<{
faviconUrl: MediaDisplayObject
favicon: MediaDisplayObject
shareImage: MediaDisplayObject
robotsTxt: string
locale: string
Expand Down
11 changes: 11 additions & 0 deletions @fiction/plugin-sites/themes/fiction/img/favicon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
2 changes: 2 additions & 0 deletions @fiction/plugin-sites/themes/fiction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export function setup(args: ServiceList) {
pages,

userConfig: {
shareImage: { url: new URL('./img/share-image.jpg', import.meta.url).href },
favicon: { url: new URL('./img/favicon.svg', import.meta.url).href },
colors: { isDarkMode: true },
spacing: {
contentWidthClass: 'max-w-screen-2xl px-4 sm:px-6 lg:px-20 mx-auto',
Expand Down
Binary file removed @fiction/www/src/public/CalSans-SemiBold.woff
Binary file not shown.
Binary file removed @fiction/www/src/public/CalSans-SemiBold.woff2
Binary file not shown.
Binary file removed @fiction/www/src/public/favicon-slate.png
Binary file not shown.
Binary file modified @fiction/www/src/public/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions @fiction/www/src/public/favicon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed @fiction/www/src/public/icon-blue.png
Binary file not shown.
Binary file removed @fiction/www/src/public/icon-pink.png
Binary file not shown.
Binary file removed @fiction/www/src/public/icon-white.png
Binary file not shown.

0 comments on commit ac45554

Please sign in to comment.