Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion blog/src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { APP_URL, SITE_TITLE } from '../consts';
<div class="footer-inner">
<span>{SITE_TITLE} &copy; {new Date().getFullYear()}</span>
<div class="footer-links">
<a href={APP_URL}>返回应用</a>
<a href={APP_URL} class="app-return-link">返回应用</a>
<a href="/blog/">日志</a>
<a href="/blog/about/">关于</a>
<a href="/blog/rss.xml">RSS</a>
Expand Down Expand Up @@ -41,3 +41,18 @@ import { APP_URL, SITE_TITLE } from '../consts';
}
.footer-links a:hover { color: #39C5BB; }
</style>


<script>
document.addEventListener('click', function(e) {
var target = e.target.closest('a.app-return-link');
if (target) {
e.preventDefault();
if (window.opener && !window.opener.closed) {
window.close();
} else {
window.location.href = target.href;
}
}
});
</script>
2 changes: 1 addition & 1 deletion blog/src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const base = lang === 'zh-cn' ? '/blog/' : `/blog/${lang}/`;
<header class="site-header">
<nav class="header-nav">
<div class="header-left">
<a href={APP_URL} class="back-link" title="返回应用">
<a href={APP_URL} class="back-link app-return-link" title="返回应用">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M19 12H5M12 5l-7 7 7 7"/>
</svg>
Expand Down
2 changes: 1 addition & 1 deletion blog/src/pages/[lang]/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const t = labels[lang] || labels['en'];
</ul>

<div style="margin-top:3rem;padding-top:1.5rem;border-top:1px solid rgba(255,255,255,0.08)">
<a href={APP_URL} style="color:#39C5BB;font-weight:600;display:inline-flex;align-items:center;gap:0.4rem">
<a href={APP_URL} class="app-return-link" style="color:#39C5BB;font-weight:600;display:inline-flex;align-items:center;gap:0.4rem">
← {t.back}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion blog/src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { APP_URL, SITE_TITLE } from '../consts';
<p>请查看 <a href="/blog/blog/" style="color:var(--accent)">开发日志</a> 了解最新更新动态。</p>

<div style="margin-top:3rem;padding-top:1.5rem;border-top:1px solid var(--border)">
<a href={APP_URL} style="color:var(--accent);font-weight:600;display:inline-flex;align-items:center;gap:0.4rem">
<a href={APP_URL} class="app-return-link" style="color:var(--accent);font-weight:600;display:inline-flex;align-items:center;gap:0.4rem">
← 返回应用
</a>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/VersionBadge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ const VersionBadge = ({ version: currentVersion }) => {
{/* Badge Trigger */}
<a
href="/blog/"
target="_blank"
rel="opener"
className="cursor-pointer group/badge bg-[#39C5BB] hover:bg-teal-500 transition-colors text-white rounded px-1.5 py-0.5 text-[10px] font-bold ml-2 shadow-sm flex items-center gap-1 relative"
>
<span className="group-hover/badge:hidden">v{currentVersion}</span>
Expand Down Expand Up @@ -176,7 +178,7 @@ const VersionBadge = ({ version: currentVersion }) => {
</div>
<div className="flex items-center justify-between mt-1">
<span className="text-[10px] text-gray-300">{log.date}</span>
<a href={`/blog/dev/v${log.version}/`} className="invisible group-hover:visible text-[10px] font-bold text-[#39C5BB] hover:text-teal-600 flex items-center gap-1 transition-colors">
<a href={`/blog/dev/v${log.version}/`} target="_blank" rel="opener" className="invisible group-hover:visible text-[10px] font-bold text-[#39C5BB] hover:text-teal-600 flex items-center gap-1 transition-colors">
Detail <ExternalLink size={10}/>
</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/common/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export class ErrorBoundary extends React.Component<Props, State> {
</button>
<a
href="/blog/"
target="_blank"
rel="opener"
className="flex items-center gap-2 px-5 py-2 bg-white text-slate-600 text-xs font-bold rounded-xl border border-slate-200 transition-all hover:bg-slate-50 active:scale-95 shadow-sm"
>
<Home size={14} /> 返回索引
Expand Down