{siteName}
+{description}
+diff --git a/asky.config.ts b/asky.config.ts
index 66c35c6..0890ecd 100644
--- a/asky.config.ts
+++ b/asky.config.ts
@@ -38,9 +38,31 @@ const config: AskyConfig = {
menu: [
{ label: '首页', url: '/' },
{ label: '归档', url: '/archive' },
+ { label: '链接', url: '/links' },
{ label: '关于', url: '/about' }
- ]
+ ],
// 主导航菜单(对应原 wp_nav_menu 'primary' 位置)
+
+ links: [
+ {
+ title: '友情链接',
+ items: [
+ {
+ name: 'Asky',
+ url: 'https://github.com/saresam/Asky',
+ description: 'Asky WordPress 主题原版',
+ image: '/images/none.png'
+ },
+ {
+ name: 'Astro',
+ url: 'https://astro.build/',
+ description: '当前站点使用的静态站点框架',
+ image: '/images/none.png'
+ }
+ ]
+ }
+ ]
+ // 友情链接页面数据(对应原 WordPress 书签/链接分类)
},
/* ===== 基本设置 ===== */
@@ -289,22 +311,6 @@ const config: AskyConfig = {
// 是否显示评论者的 UA 图标(OS / 浏览器)
},
- /* ===== 前台登录 ===== */
- login_bg: '',
- // 后台登录界面背景图(为空则使用默认)
-
- exlogin_url: '',
- // 指定登录地址(强制不使用后台 wp-login.php)
-
- exregister_url: '',
- // 指定注册地址(作为登录页面的注册入口)
-
- ex_register_open: false,
- // 允许用户在前台注册
-
- login_urlskip: false,
- // 登录后自动跳转(管理员→后台,用户→主页)
-
/* ===== 杂七杂八 ===== */
canvas_nest: false,
// 开启蜂窝背景动效(屏幕宽度 >800px 时生效)
@@ -354,6 +360,16 @@ export interface AskyConfig {
language: string;
charset: string;
menu: Array<{ label: string; url: string; children?: Array<{ label: string; url: string }> }>;
+ links?: Array<{
+ title: string;
+ description?: string;
+ items: Array<{
+ name: string;
+ url: string;
+ description?: string;
+ image?: string;
+ }>;
+ }>;
};
/* ===== 基本设置 ===== */
@@ -451,13 +467,6 @@ export interface AskyConfig {
showUa?: boolean;
};
- /* ===== 前台登录 ===== */
- login_bg: string;
- exlogin_url: string;
- exregister_url: string;
- ex_register_open: boolean;
- login_urlskip: boolean;
-
/* ===== 杂七杂八 ===== */
canvas_nest: boolean;
flying_fish: boolean;
diff --git a/astro.config.mjs b/astro.config.mjs
index b698b64..9eacdd4 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -3,6 +3,9 @@ import { defineConfig } from 'astro/config';
export default defineConfig({
site: 'https://example.com',
trailingSlash: 'ignore',
+ markdown: {
+ syntaxHighlight: false
+ },
build: {
format: 'directory',
assets: 'assets'
diff --git a/public/style.css b/public/style.css
index d1aa2d4..e4c9f1d 100644
--- a/public/style.css
+++ b/public/style.css
@@ -6935,3 +6935,74 @@ i.iconfont.icon-people{
}
}
+
+/* Mac-style code blocks */
+.entry-content pre {
+ position: relative;
+ margin: 1.8em 0;
+ padding: 54px 22px 22px;
+ border: 1px solid rgba(255, 255, 255, .08);
+ border-radius: 8px;
+ background: #1f2329;
+ color: #d7dde8;
+ box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
+ overflow: auto;
+}
+
+.entry-content pre:before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 38px;
+ border-bottom: 1px solid rgba(255, 255, 255, .08);
+ border-radius: 8px 8px 0 0;
+ background: linear-gradient(#3a3f4b, #2b3039);
+}
+
+.entry-content pre:after {
+ content: "";
+ position: absolute;
+ top: 14px;
+ left: 16px;
+ width: 11px;
+ height: 11px;
+ border-radius: 50%;
+ background: #ff5f57;
+ box-shadow: 19px 0 #ffbd2e, 38px 0 #28c840;
+}
+
+.entry-content pre code {
+ display: block;
+ margin: 0;
+ padding: 0;
+ border-radius: 0;
+ background: transparent;
+ color: inherit;
+ font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
+ font-size: 14px;
+ line-height: 1.75;
+ white-space: pre;
+}
+
+@media (max-width: 860px) {
+ .entry-content pre {
+ padding: 50px 16px 18px;
+ border-radius: 6px;
+ }
+
+ .entry-content pre:before {
+ height: 36px;
+ border-radius: 6px 6px 0 0;
+ }
+
+ .entry-content pre:after {
+ top: 13px;
+ left: 14px;
+ }
+
+ .entry-content pre code {
+ font-size: 13px;
+ }
+}
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro
index 6c3a86c..26d73f9 100644
--- a/src/layouts/BaseLayout.astro
+++ b/src/layouts/BaseLayout.astro
@@ -8,6 +8,16 @@ export interface Props {
isHome?: boolean;
/** 当前页的特色图(pattern 装饰图) */
patternImg?: string;
+ /** 装饰图中显示的标题 */
+ patternTitle?: string;
+ /** 装饰图中显示的描述 */
+ patternDescription?: string;
+ /** 是否使用文章详情页的装饰图布局 */
+ patternSingle?: boolean;
+ patternAuthor?: string;
+ patternAuthorUrl?: string;
+ patternAvatar?: string;
+ patternMeta?: string;
/** 自定义 body class */
bodyClass?: string;
}
@@ -17,11 +27,19 @@ const {
description,
isHome = false,
patternImg,
+ patternTitle,
+ patternDescription,
+ patternSingle = false,
+ patternAuthor,
+ patternAuthorUrl = '/',
+ patternAvatar,
+ patternMeta,
bodyClass = ''
} = Astro.props;
const siteName = bloginfo('name');
const siteDesc = bloginfo('description');
+const siteUrl = bloginfo('url').replace(/\/$/, '');
const charset = bloginfo('charset');
const lang = bloginfo('language');
@@ -49,6 +67,9 @@ const stats = askyOption('site_statistics');
const statsLink = askyOption('site_statistics_link');
const sitemapLink = askyOption('site_map_link');
const themeSkin = askyOption('theme_skin');
+
+const patternClass = `pattern-center${patternSingle ? ' single-center' : ''}`;
+const patternHeaderClass = `pattern-header${patternSingle ? ' single-header' : ''}`;
---
@@ -67,6 +88,7 @@ const themeSkin = askyOption('theme_skin');
)}
+
@@ -100,8 +122,32 @@ const themeSkin = askyOption('theme_skin');
+ {patternAuthor && patternAvatar && (
+
+ )}
+ {patternAuthor && {patternAuthor}}
+ {patternMeta && (
+ <>
+ {patternAuthor && ·}
+ {patternMeta}
+ >
+ )}
+
{description}
+