Skip to content

Commit

Permalink
feat: Update webmanifest
Browse files Browse the repository at this point in the history
  • Loading branch information
riceball-tw committed Feb 14, 2024
1 parent 8b044fc commit 191aeb4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions public/images/brand/favicon/maskable-icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/globalConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
slogan: '把網頁開發知識一桿進洞',
description:
'是什麼原因導致網頁建構上遭遇瓶頸?以及如何突破?網頁東東用最親切簡單的方式描述如何設計與架構網頁,著重於圖像化以及實例操作,累積教學上的經驗降低每次學習新事物的成本',
themeColor: '#534af7',
thumbnail: {
width: 1200,
height: 630,
Expand Down
4 changes: 4 additions & 0 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ const GOOGLE_ANALYTIC_ID = import.meta.env.PUBLIC_GOOGLEANALYTIC_ID
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{
name: 'theme-color',
content: brand.themeColor,
},
],
}}
/>
Expand Down
10 changes: 8 additions & 2 deletions src/pages/manifest.webmanifest.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import type { APIRoute } from 'astro';
import globalConfig from '@/globalConfig';

// https://web.dev/articles/add-manifest
export const GET: APIRoute = () =>
new Response(
JSON.stringify({
name: `${globalConfig.brand.nameTC}`,
icons: [
{ src: '/icon-192.png', type: 'image/png', sizes: '192x192' },
{ src: '/icon-512.png', type: 'image/png', sizes: '512x512' },
{ src: 'images/brand/favicon/icon-192.png', type: 'image/png', sizes: '192x192' },
{ src: 'images/brand/favicon/icon-512.png', type: 'image/png', sizes: '512x512' },
{ src: 'images/brand/favicon/maskable-icon-512.png', type: 'image/png', sizes: '512x512', purpose: 'maskable' },
],
start_url: '/posts',
display: 'fullscreen',
theme_color: globalConfig.brand.themeColor,
background_color: globalConfig.brand.themeColor,
}),
);

0 comments on commit 191aeb4

Please sign in to comment.