Просмотр исходного кода

fix(web): rename favicons to v2 for cache busting (#9492)

Ryan Vogel 2 месяцев назад
Родитель
Сommit
889c60d63b

+ 4 - 4
packages/app/index.html

@@ -4,10 +4,10 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1" />
     <title>OpenCode</title>
-    <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
-    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
-    <link rel="shortcut icon" href="/favicon.ico" />
-    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
+    <link rel="icon" type="image/png" href="/favicon-96x96-v2.png" sizes="96x96" />
+    <link rel="icon" type="image/svg+xml" href="/favicon-v2.svg" />
+    <link rel="shortcut icon" href="/favicon-v2.ico" />
+    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-v2.png" />
     <link rel="manifest" href="/site.webmanifest" />
     <meta name="theme-color" content="#F8F7F7" />
     <meta name="theme-color" content="#131010" media="(prefers-color-scheme: dark)" />

+ 1 - 0
packages/app/public/apple-touch-icon-v2.png

@@ -0,0 +1 @@
+../../ui/src/assets/favicon/apple-touch-icon-v2.png

+ 1 - 0
packages/app/public/favicon-96x96-v2.png

@@ -0,0 +1 @@
+../../ui/src/assets/favicon/favicon-96x96-v2.png

+ 1 - 0
packages/app/public/favicon-v2.ico

@@ -0,0 +1 @@
+../../ui/src/assets/favicon/favicon-v2.ico

+ 1 - 0
packages/app/public/favicon-v2.svg

@@ -0,0 +1 @@
+../../ui/src/assets/favicon/favicon-v2.svg

+ 1 - 1
packages/app/src/entry.tsx

@@ -37,7 +37,7 @@ const platform: Platform = {
       .then(() => {
         const notification = new Notification(title, {
           body: description ?? "",
-          icon: "https://opencode.ai/favicon-96x96.png",
+          icon: "https://opencode.ai/favicon-96x96-v2.png",
         })
         notification.onclick = () => {
           window.focus()

+ 1 - 1
packages/app/src/pages/layout.tsx

@@ -1284,7 +1284,7 @@ export default function Layout(props: ParentProps) {
         <div class="size-full rounded overflow-clip">
           <Avatar
             fallback={name()}
-            src={props.project.id === opencode ? "https://opencode.ai/favicon.svg" : props.project.icon?.url}
+            src={props.project.id === opencode ? "https://opencode.ai/favicon-v2.svg" : props.project.icon?.url}
             {...getAvatarColors(props.project.icon?.color)}
             class="size-full rounded"
             style={

+ 1 - 1
packages/console/function/src/auth.ts

@@ -35,7 +35,7 @@ export const subjects = createSubjects({
 
 const MY_THEME: Theme = {
   ...THEME_OPENAUTH,
-  logo: "https://opencode.ai/favicon.svg",
+  logo: "https://opencode.ai/favicon-v2.svg",
 }
 
 export default {

+ 4 - 4
packages/desktop/index.html

@@ -4,10 +4,10 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1" />
     <title>OpenCode</title>
-    <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
-    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
-    <link rel="shortcut icon" href="/favicon.ico" />
-    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
+    <link rel="icon" type="image/png" href="/favicon-96x96-v2.png" sizes="96x96" />
+    <link rel="icon" type="image/svg+xml" href="/favicon-v2.svg" />
+    <link rel="shortcut icon" href="/favicon-v2.ico" />
+    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-v2.png" />
     <link rel="manifest" href="/site.webmanifest" />
     <meta name="theme-color" content="#F8F7F7" />
     <meta name="theme-color" content="#131010" media="(prefers-color-scheme: dark)" />

+ 1 - 1
packages/desktop/src/index.tsx

@@ -253,7 +253,7 @@ const createPlatform = (password: Accessor<string | null>): Platform => ({
       .then(() => {
         const notification = new Notification(title, {
           body: description ?? "",
-          icon: "https://opencode.ai/favicon-96x96.png",
+          icon: "https://opencode.ai/favicon-96x96-v2.png",
         })
         notification.onclick = () => {
           const win = getCurrentWindow()

+ 1 - 1
packages/docs/docs.json

@@ -7,7 +7,7 @@
     "light": "#07C983",
     "dark": "#15803D"
   },
-  "favicon": "/favicon.svg",
+  "favicon": "/favicon-v2.svg",
   "navigation": {
     "tabs": [
       {

+ 19 - 0
packages/docs/favicon-v2.svg

@@ -0,0 +1,19 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M9.06145 23.1079C5.26816 22.3769 -3.39077 20.6274 1.4173 5.06384C9.6344 6.09939 16.9728 14.0644 9.06145 23.1079Z" fill="url(#paint0_linear_17557_2021)"/>
+<path d="M8.91928 23.0939C5.27642 21.2223 0.78371 4.20891 17.0071 0C20.7569 7.19341 19.6212 16.5452 8.91928 23.0939Z" fill="url(#paint1_linear_17557_2021)"/>
+<path d="M8.91388 23.0788C8.73534 19.8817 10.1585 9.08525 23.5699 13.1107C23.1812 20.1229 18.984 26.4182 8.91388 23.0788Z" fill="url(#paint2_linear_17557_2021)"/>
+<defs>
+<linearGradient id="paint0_linear_17557_2021" x1="3.77557" y1="5.91571" x2="5.23185" y2="21.5589" gradientUnits="userSpaceOnUse">
+<stop stop-color="#18E299"/>
+<stop offset="1" stop-color="#15803D"/>
+</linearGradient>
+<linearGradient id="paint1_linear_17557_2021" x1="12.1711" y1="-0.718425" x2="10.1897" y2="22.9832" gradientUnits="userSpaceOnUse">
+<stop stop-color="#16A34A"/>
+<stop offset="1" stop-color="#4ADE80"/>
+</linearGradient>
+<linearGradient id="paint2_linear_17557_2021" x1="23.1327" y1="15.353" x2="9.33841" y2="18.5196" gradientUnits="userSpaceOnUse">
+<stop stop-color="#4ADE80"/>
+<stop offset="1" stop-color="#0D9373"/>
+</linearGradient>
+</defs>
+</svg>

BIN
packages/ui/src/assets/favicon/apple-touch-icon-v2.png


BIN
packages/ui/src/assets/favicon/favicon-96x96-v2.png


BIN
packages/ui/src/assets/favicon/favicon-v2.ico


+ 7 - 0
packages/ui/src/assets/favicon/favicon-v2.svg

@@ -0,0 +1,7 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="512" height="512" fill="#131010"></rect>
+<path d="M320 224V352H192V224H320Z" fill="#5A5858"></path>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M384 416H128V96H384V416ZM320 160H192V352H320V160Z" fill="white"></path>
+</svg><style>@media (prefers-color-scheme: light) { :root { filter: none; } }
+@media (prefers-color-scheme: dark) { :root { filter: none; } }
+</style></svg>

+ 3 - 3
packages/ui/src/components/favicon.tsx

@@ -3,9 +3,9 @@ import { Link, Meta } from "@solidjs/meta"
 export const Favicon = () => {
   return (
     <>
-      <Link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
-      <Link rel="shortcut icon" href="/favicon.ico" />
-      <Link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
+      <Link rel="icon" type="image/png" href="/favicon-96x96-v2.png" sizes="96x96" />
+      <Link rel="shortcut icon" href="/favicon-v2.ico" />
+      <Link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-v2.png" />
       <Link rel="manifest" href="/site.webmanifest" />
       <Meta name="apple-mobile-web-app-title" content="OpenCode" />
     </>

+ 28 - 0
packages/web/astro.config.mjs

@@ -32,6 +32,34 @@ export default defineConfig({
     solidJs(),
     starlight({
       title: "OpenCode",
+      favicon: "/favicon-v2.svg",
+      head: [
+        {
+          tag: "link",
+          attrs: {
+            rel: "icon",
+            href: "/favicon-v2.ico",
+            sizes: "32x32",
+          },
+        },
+        {
+          tag: "link",
+          attrs: {
+            rel: "icon",
+            type: "image/png",
+            href: "/favicon-96x96-v2.png",
+            sizes: "96x96",
+          },
+        },
+        {
+          tag: "link",
+          attrs: {
+            rel: "apple-touch-icon",
+            href: "/apple-touch-icon-v2.png",
+            sizes: "180x180",
+          },
+        },
+      ],
       lastUpdated: true,
       expressiveCode: { themes: ["github-light", "github-dark"] },
       social: [

+ 1 - 0
packages/web/public/apple-touch-icon-v2.png

@@ -0,0 +1 @@
+../../ui/src/assets/favicon/apple-touch-icon-v2.png

+ 1 - 0
packages/web/public/favicon-96x96-v2.png

@@ -0,0 +1 @@
+../../ui/src/assets/favicon/favicon-96x96-v2.png

+ 1 - 0
packages/web/public/favicon-v2.ico

@@ -0,0 +1 @@
+../../ui/src/assets/favicon/favicon-v2.ico

+ 1 - 0
packages/web/public/favicon-v2.svg

@@ -0,0 +1 @@
+../../ui/src/assets/favicon/favicon-v2.svg