11---
2- import NavBar from " ../../components/NavBar.astro" ;
3- import Footer from " ../../components/Footer.astro" ;
2+ import ContentLayout from " ../../layouts/ContentLayout.astro" ;
43import " ../../styles/global.css" ;
54import { t } from " ../../i18n/utils.ts" ;
65import { getCollection } from " astro:content" ;
@@ -20,34 +19,9 @@ const dateParts = post.data.date.split("-");
2019const formattedDate = ` ${dateParts [0 ]} 年 ${parseInt (dateParts [1 ])} 月 ${parseInt (dateParts [2 ])} 日 ` ;
2120---
2221
23- <html lang =" zh" >
24- <head >
25- <meta charset =" UTF-8" />
26- <meta name =" viewport" content =" width=device-width, initial-scale=1.0" />
27- <link rel =" icon" href =" data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>⚡</text></svg>" />
28- <title >{ post .data .title } | Awesome AI</title >
29- <meta name =" description" content ={ post .data .summary || post .data .title } />
30- <script type =" module" >
31- import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
32- mermaid.initialize({ theme: 'dark', securityLevel: 'loose' });
33-
34- document.addEventListener('DOMContentLoaded', async () => {
35- const pres = document.querySelectorAll('pre[data-language="mermaid"]');
36- for (const pre of pres) {
37- const rawText = pre.textContent;
38- const div = document.createElement('div');
39- div.className = 'mermaid';
40- div.textContent = rawText;
41- pre.replaceWith(div);
42- }
43- await mermaid.run({ nodes: document.querySelectorAll('.mermaid') });
44- });
45- </script >
46- </head >
47- <body class =" bg-bg text-text font-sans antialiased flex flex-col min-h-screen" >
48- <NavBar locale =" zh" currentPath =" /daily" />
4922
50- <main class =" max-w-[780px] mx-auto px-4 sm:px-6 pt-[72px] sm:pt-[80px] pb-[40px] sm:pb-[60px] flex-1 w-full animate-fade-in" >
23+ <ContentLayout title ={ post .data .title } description ={ post .data .summary || post .data .title } locale =" zh" currentPath =" /daily" >
24+ <main class =" max-w-[780px] mx-auto px-4 sm:px-6 pt-[72px] sm:pt-[80px] pb-[40px] sm:pb-[60px] flex-1 w-full animate-fade-in" >
5125 <a href =" /daily" class =" inline-flex items-center gap-1.5 text-text-dim text-xs sm:text-sm mb-4 sm:mb-6 px-3 sm:px-4 py-2 rounded-lg border border-border bg-bg-card hover:text-text hover:bg-accent-glow hover:border-accent transition-all no-underline" >
5226 { t (" article.back" )}
5327 </a >
@@ -69,23 +43,19 @@ const formattedDate = `${dateParts[0]} 年 ${parseInt(dateParts[1])} 月 ${parse
6943 <Content />
7044 </article >
7145 </main >
72-
73- <Footer />
74-
75- <script is:inline >
76- window.copyArticle = function() {
77- var el = document.getElementById('md-source');
78- if (!el) return;
79- navigator.clipboard.writeText(el.value).then(function() {
80- var btn = document.querySelector('.copy-btn');
81- if (btn) {
82- btn.innerHTML = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>';
83- setTimeout(function() {
84- btn.innerHTML = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25zM5 1.75C0 .784.784 0 1.75 0h7.5C10.216 0 11 .784 11 1.75v7.5A1.75 1.75 0 019.25 11h-7.5A1.75 1.75 0 010 9.25zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25z"></path></svg>';
85- }, 1500);
86- }
87- });
88- };
89- </script >
90- </body >
91- </html >
46+ <script is:inline >
47+ window.copyArticle = function() {
48+ var el = document.getElementById('md-source');
49+ if (!el) return;
50+ navigator.clipboard.writeText(el.value).then(function() {
51+ var btn = document.querySelector('.copy-btn');
52+ if (btn) {
53+ btn.innerHTML = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>';
54+ setTimeout(function() {
55+ btn.innerHTML = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25zM5 1.75C0 .784.784 0 1.75 0h7.5C10.216 0 11 .784 11 1.75v7.5A1.75 1.75 0 019.25 11h-7.5A1.75 1.75 0 010 9.25zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25z"></path></svg>';
56+ }, 1500);
57+ }
58+ });
59+ };
60+ </script >
61+ </ContentLayout >
0 commit comments