LOADING
598 字
3 分钟

暮光指南:高级自定义

Guide for Template - Advanced Customization

翻译提示 (未审阅)

此页面由 AI 翻译生成,可能存在不准确之处。

翻译自: 🇬🇧 English (Deepseek)

查看原文 回到译文

本指南涵盖了暮光模板中可用的高级自定义选项和功能,从全局配置到专门的Markdown扩展。

全局配置

twilight.config.yaml 文件是您博客配置的核心。以下是一些您可以调整的高级设置:

站点与本地化

  • 语言与翻译:使用 site.translate.enable 启用客户端翻译。您可以选择不同的服务并配置自动检测。

  • 自定义字体:通过在 site.font 下提供CSS链接或文件路径来添加您自己的字体。

视觉效果

  • 主题颜色:通过调整 site.themeColor.hue(0-360)更改博客的主色调。

  • 壁纸模式:选择 bannerfullscreennone。您还可以启用 carousel 来展示多张壁纸,并带有 kenBurns 效果。

  • 波浪效果:使用 site.wallpaper.banner.waves.enable 切换横幅上的动画水波纹效果。

  • 粒子效果:使用 particle.enable 启用背景中的浮动粒子。

用户界面

  • 导航栏透明度:将 site.wallpaper.banner.navbar.transparentMode 调整为 semifullsemifull

  • 侧边栏小部件:在 sidebar.components 中重新排序或切换侧边栏组件,如 profileannouncementcategoriestagstocstatistics

Markdown扩展

GitHub仓库卡片

您可以添加链接到GitHub仓库的动态卡片,页面加载时,仓库信息会从GitHub API中拉取。

Spr-Aachen
/
Twilight
Waiting for api.github.com...
00K
0K
0K
Waiting...

使用代码 ::github{repo="Spr-Aachen/Twilight"} 创建GitHub仓库卡片。

::github{repo="Spr-Aachen/Twilight"}

音乐卡片

  • 在线
Loading...
Loading...
Loading lyrics...
0:00 / 0:00
::music{meting="https://meting.spr-aachen.com/api?server=netease&type=song&id=1390882521"}
  • 本地
深海之息
Youzee Music
Loading lyrics...
0:00 / 0:00
::music{title="深海之息" artist="Youzee Music" cover="https://p1.music.126.net/PhKOqFtljgHDDpKYM2ADUA==/109951169858309716.jpg" audio="assets/music/深海之息.m4a" lrc="assets/music/深海之息.lrc"}

提示块

支持以下类型的提示块:note tip important warning caution

Note

突出显示用户即使在浏览时也应注意的信息。

Tip

帮助用户更成功的可选信息。

Important

用户成功所必需的关键信息。

Warning

因潜在风险需要用户立即关注的严重内容。

Caution

某项操作的负面潜在后果。

  • 基本语法

    :::note
    突出显示用户即使在浏览时也应注意的信息。
    :::
    :::tip
    帮助用户更成功的可选信息。
    :::
  • 自定义标题

    提示块的标题可以自定义。

    我的自定义标题

    这是一个带有自定义标题的注释。

    :::note[我的自定义标题]
    这是一个带有自定义标题的注释。
    :::
  • GitHub语法

    Tip

    GitHub语法也受支持。

    > [!TIP]
    > GitHub语法也受支持。
  • 剧透

    您可以在文本中添加剧透。文本也支持 Markdown 语法。

    内容 被隐藏了 嘿嘿

    内容 :spoiler[被隐藏了 **嘿嘿**]!

更多详情,请查看文档

This guide covers advanced customization options and features available in the Twilight template, from global configurations to specialized Markdown extensions.

Global Configuration

The twilight.config.yaml file is the heart of your blog’s configuration. Here are some advanced settings you can tweak:

Site & Localization

  • Language & Translation: Enable client-side translation using site.translate.enable. You can choose different services and configure auto-detection.

  • Custom Fonts: Add your own fonts by providing a CSS link or file path under site.font.

Visual Effects

  • Theme Color: Change the primary color of your blog by adjusting the site.themeColor.hue (0-360).

  • Wallpaper Modes: Choose between banner, fullscreen, or none. You can also enable a carousel for multiple wallpapers with the kenBurns effect.

  • Waves Effect: Toggle the animated water ripple effect on the banner using site.wallpaper.banner.waves.enable.

  • Particle Effects: Enable floating particles in the background with particle.enable.

UI

  • Navbar Transparency: Adjust site.wallpaper.banner.navbar.transparentMode between semi, full, or semifull.

  • Sidebar Widgets: Reorder or toggle sidebar components like profile, announcement, categories, tags, toc, and statistics in sidebar.components.

Markdown Extensions

GitHub Repository Cards

You can add dynamic cards that link to GitHub repositories, on page load, the repository information is pulled from the GitHub API.

Spr-Aachen
/
Twilight
Waiting for api.github.com...
00K
0K
0K
Waiting...

Create a GitHub repository card with the code ::github{repo="Spr-Aachen/Twilight"}.

::github{repo="Spr-Aachen/Twilight"}

Music Cards

  • Online
Loading...
Loading...
Loading lyrics...
0:00 / 0:00
::music{meting="https://meting.spr-aachen.com/api?server=netease&type=song&id=1390882521"}
  • Local
深海之息
Youzee Music
Loading lyrics...
0:00 / 0:00
::music{title="深海之息" artist="Youzee Music" cover="https://p1.music.126.net/PhKOqFtljgHDDpKYM2ADUA==/109951169858309716.jpg" audio="assets/music/深海之息.m4a" lrc="assets/music/深海之息.lrc"}

Admonitions

Following types of admonitions are supported: note tip important warning caution

Note

Highlights information that users should take into account, even when skimming.

Tip

Optional information to help a user be more successful.

Important

Crucial information necessary for users to succeed.

Warning

Critical content demanding immediate user attention due to potential risks.

Caution

Negative potential consequences of an action.

  • Basic Syntax

    :::note
    Highlights information that users should take into account, even when skimming.
    :::
    :::tip
    Optional information to help a user be more successful.
    :::
  • Custom Titles

    The title of the admonition can be customized.

    MY CUSTOM TITLE

    This is a note with a custom title.

    :::note[MY CUSTOM TITLE]
    This is a note with a custom title.
    :::
  • GitHub Syntax

    Tip

    The GitHub syntax is also supported.

    > [!TIP]
    > The GitHub syntax is also supported.
  • Spoiler

    You can add spoilers to your text. The text also supports Markdown syntax.

    The content is hidden ayyy!

    The content :spoiler[is hidden **ayyy**]!

For more details, check the Documentation.

暮光指南:高级自定义
/zh-CN/posts/twilight-guide-advanced-customization/
作者
MuxBuffer
发布于
2024-02-10
许可协议
CC BY-NC-SA 4.0
AI参与指数 IIIA-0
分类 未经AI制作
等级 0
简介 完全未使用AI

此页面可能不是最新版本。