feat: 更新样式和功能,优化徽章、登录页面和文章页面的布局,增强可访问性和用户体验

This commit is contained in:
2026-04-03 04:10:35 +08:00
parent 36d505ece6
commit 83f3c8d249
8 changed files with 353 additions and 153 deletions

View File

@@ -1,4 +1,6 @@
---
import { resolvePublicApiBaseUrl } from '../../lib/api/client';
interface Props {
pageType: string;
entityId?: string;
@@ -9,11 +11,12 @@ const props = Astro.props;
const pageType = props.pageType;
const entityId = props.entityId ?? '';
const postSlug = props.postSlug ?? '';
const analyticsEndpoint = `${resolvePublicApiBaseUrl(Astro.url)}/analytics/content`;
---
<script is:inline define:vars={{ pageType, entityId, postSlug }}>
<script is:inline define:vars={{ analyticsEndpoint, pageType, entityId, postSlug }}>
(() => {
const endpoint = '/api/analytics/content';
const endpoint = analyticsEndpoint;
const storageKey = `termi:pageview:${pageType}:${entityId || postSlug || 'root'}`;
function ensureSessionId() {