update
This commit is contained in:
@ -6,6 +6,7 @@ import '../../assets/css1/style5.css'
|
|||||||
import { newsDetail } from "../../../utils/rpc";
|
import { newsDetail } from "../../../utils/rpc";
|
||||||
const { slug } = Astro.params;
|
const { slug } = Astro.params;
|
||||||
const config = getConfig(Astro)
|
const config = getConfig(Astro)
|
||||||
|
const requestUrl = Astro.request.url;
|
||||||
if (!slug) {
|
if (!slug) {
|
||||||
return Astro.redirect('/404');
|
return Astro.redirect('/404');
|
||||||
}
|
}
|
||||||
@ -39,9 +40,10 @@ if (!data || code !== 0) {
|
|||||||
<Fragment set:html={data.content} />
|
<Fragment set:html={data.content} />
|
||||||
</article>
|
</article>
|
||||||
<div>
|
<div>
|
||||||
<p>原文地址: xxx</p>
|
原文地址:<a href={`/news/${data.id}`}>{requestUrl}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="top-icon"></div>
|
||||||
<div class="news-navigation">
|
<div class="news-navigation">
|
||||||
{
|
{
|
||||||
data.prevNews && (
|
data.prevNews && (
|
||||||
@ -112,7 +114,8 @@ if (!data || code !== 0) {
|
|||||||
|
|
||||||
|
|
||||||
.top-icon {
|
.top-icon {
|
||||||
padding-bottom: 30px;
|
margin-bottom: 1rem;
|
||||||
|
margin-top: 1rem;
|
||||||
border-bottom: 1px solid #e0e0e0
|
border-bottom: 1px solid #e0e0e0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,11 +246,11 @@ if (!data || code !== 0) {
|
|||||||
|
|
||||||
.news-navigation {
|
.news-navigation {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
padding-top: 2rem;
|
|
||||||
border-top: 1px solid var(--divider-color);
|
border-top: 1px solid var(--divider-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-sidebar {
|
.news-sidebar {
|
||||||
|
padding: 0 1.5rem 3rem;
|
||||||
/* position: sticky; */
|
/* position: sticky; */
|
||||||
top: 2rem;
|
top: 2rem;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
@ -277,7 +280,7 @@ if (!data || code !== 0) {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
padding: 0.3rem;
|
padding: 0.2rem;
|
||||||
border-radius: var(--radius-md);
|
border-radius: var(--radius-md);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ export async function newsIndex(websiteId:number = 0):Promise<result<InewsIndex[
|
|||||||
|
|
||||||
// 新闻详情
|
// 新闻详情
|
||||||
export interface InewsDetail {
|
export interface InewsDetail {
|
||||||
|
id: number
|
||||||
title: string
|
title: string
|
||||||
keywords: string
|
keywords: string
|
||||||
description: string
|
description: string
|
||||||
|
Reference in New Issue
Block a user