refactor: 统一使用路由参数对象格式化 URL 生成逻辑
生产环境部署 - BlogFlare 至 Cloudflare Pages / 构建与自动化上线 (push) Failing after 5m9s
生产环境部署 - BlogFlare 至 Cloudflare Pages / 构建与自动化上线 (push) Failing after 5m9s
This commit is contained in:
1 parent
ce71cedfd1
commit
a261803204
4 files changed
+8
-7
No files matched your search
@@ -15,7 +15,7 @@
|
|||||||
<section id="index-list">
|
<section id="index-list">
|
||||||
<div class="post-list">
|
<div class="post-list">
|
||||||
{#each data.posts as post (post.id || post)}
|
{#each data.posts as post (post.id || post)}
|
||||||
<a href={resolve('/posts/{post.slug}')} class="card-link">
|
<a href={resolve('/posts/[slug]', { slug: post.slug })} class="card-link">
|
||||||
<article class="card article-content" class:has-cover={!!post.cover}>
|
<article class="card article-content" class:has-cover={!!post.cover}>
|
||||||
{#if post.cover}
|
{#if post.cover}
|
||||||
<div class="post-cover">
|
<div class="post-cover">
|
||||||
|
|||||||
@@ -86,11 +86,12 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{pageItem.id}</td>
|
<td>{pageItem.id}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href={resolve('/admin/pages/{pageItem.id}')} class="title-link"
|
<a
|
||||||
><strong>{pageItem.title}</strong></a
|
href={resolve('/admin/pages/[id]', { id: pageItem.id.toString() })}
|
||||||
|
class="title-link"><strong>{pageItem.title}</strong></a
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href={resolve('/{pageItem.slug}')}
|
href={resolve('/[slug]', { slug: pageItem.slug })}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="preview-link"
|
class="preview-link"
|
||||||
title="前台预览"
|
title="前台预览"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<h2>编辑{$page.data.aliases?.page || '页面'}</h2>
|
<h2>编辑{$page.data.aliases?.page || '页面'}</h2>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<a
|
<a
|
||||||
href={resolve('/{data.page.slug}')}
|
href={resolve('/[slug]', { slug: data.page.slug })}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="btn btn-secondary"
|
class="btn btn-secondary"
|
||||||
style="margin-right: 12px;">前台预览</a
|
style="margin-right: 12px;">前台预览</a
|
||||||
|
|||||||
@@ -88,11 +88,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{post.id}</td>
|
<td>{post.id}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href={resolve('/admin/posts/{post.id}')} class="title-link"
|
<a href={resolve('/admin/posts/[id]', { id: post.id.toString() })} class="title-link"
|
||||||
><strong>{post.title}</strong></a
|
><strong>{post.title}</strong></a
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href={resolve('/posts/{post.slug}')}
|
href={resolve('/posts/[slug]', { slug: post.slug })}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="preview-link"
|
class="preview-link"
|
||||||
title="前台预览"
|
title="前台预览"
|
||||||
|
|||||||
Reference in new issue
Block a user