11import  {  Style ,  css  }  from  "hono/css" ; 
22import  {  html  }  from  "hono/html" ; 
33import  type  {  FC ,  PropsWithChildren  }  from  "hono/jsx" ; 
4- import  {  basePath  }  from  "../../metadata" ; 
4+ import  {  basePath ,   originUrl ,   typstOfficialUrl  }  from  "../../metadata" ; 
55import  type  {  Page  }  from  "../../types/model" ; 
66import  {  getTranslationStatus  }  from  "../../utils/translationStatus" ; 
77import  { 
@@ -44,6 +44,9 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
4444	const  route  =  page . route ; 
4545	const  outline  =  page . outline ; 
4646	const  translationStatus  =  getTranslationStatus ( route ) ; 
47+ 	const  absoluteRouteUrl  =  new  URL ( route ,  originUrl ) . toString ( ) ; 
48+ 	const  faviconUrl  =  new  URL ( `${ basePath }  /favicon.png` ,  originUrl ) . toString ( ) ; 
49+ 	const  typstOfficialRouteUrl  =  new  URL ( route ,  typstOfficialUrl ) . toString ( ) ; 
4750	return  ( 
4851		< html  lang = "ja"  class = "scroll-pt-24" > 
4952			< head > 
@@ -52,26 +55,20 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
5255				< meta  name = "description"  content = { description }  /> 
5356				< meta  name = "viewport"  content = "width=device-width,initial-scale=1"  /> 
5457				< meta  name = "theme-color"  content = "#239dad"  /> 
55- 				< meta 
56- 					property = "og:url" 
57- 					content = { `https://typst-jp.github.io${ route }  ` } 
58- 				/> 
58+ 				< meta  property = "og:url"  content = { absoluteRouteUrl }  /> 
5959				< meta 
6060					property = "og:title" 
6161					content = { `${ title }   – Typstドキュメント日本語版` } 
6262				/> 
6363				< meta  property = "og:site_name"  content = "Typst"  /> 
6464				< meta  property = "og:description"  content = { description }  /> 
6565				< meta  property = "og:type"  content = ""  /> 
66- 				< meta 
67- 					property = "og:image" 
68- 					content = "https://typst-jp.github.io/assets/favicon.png" 
69- 				/> 
66+ 				< meta  property = "og:image"  content = { faviconUrl }  /> 
7067				< meta  property = "og:image:width"  content = "1200"  /> 
7168				< meta  property = "og:image:height"  content = "630"  /> 
7269				< meta  name = "twitter:site"  content = "@typstapp"  /> 
7370				< meta  name = "twitter:card"  content = "summary_large_image"  /> 
74- 				< link  rel = "canonical"  href = { `https://typst-jp.github.io ${ route } ` }  /> 
71+ 				< link  rel = "canonical"  href = { absoluteRouteUrl }  /> 
7572				< meta  name = "robots"  content = "index, follow"  /> 
7673				< meta 
7774					name = "twitter:image:alt" 
@@ -247,7 +244,7 @@ samp {
247244							{ translationStatus  !==  "community"  &&  ( 
248245								< div  class = "flex" > 
249246									< a 
250- 										href = { `https://typst.app ${ route } ` } 
247+ 										href = { typstOfficialRouteUrl } 
251248										target = "_blank" 
252249										rel = "noopener noreferrer" 
253250										class = "inline-flex items-center text-sm  underline text-gray-400 hover:text-gray-600 transition-colors" 
@@ -266,7 +263,7 @@ samp {
266263
267264							{ translationStatus  !==  "community"  &&  ( 
268265								< a 
269- 									href = { `https://typst.app ${ route } ` } 
266+ 									href = { typstOfficialRouteUrl } 
270267									target = "_blank" 
271268									rel = "noopener noreferrer" 
272269									class = "group inline-flex items-center px-3 py-2 rounded-md border border-gray-200 bg-white hover:border-gray-500 hover:bg-gray-50 transition-all duration-200 w-fit" 
0 commit comments