Twilightガイド:高度なカスタマイズ
Guide for Template - Advanced Customization
このガイドでは、Twilightテンプレートで利用可能な高度なカスタマイズオプションと機能について、グローバル設定から特殊なMarkdown拡張までを網羅します。
グローバル設定
twilight.config.yaml ファイルは、ブログ設定の中核です。以下に調整可能な高度な設定をいくつか示します。
サイトとローカライゼーション
-
言語と翻訳:
site.translate.enableを使用してクライアントサイド翻訳を有効にします。異なるサービスを選択し、自動検出を設定できます。 -
カスタムフォント:
site.fontの下にCSSリンクまたはファイルパスを指定して、独自のフォントを追加します。
視覚効果
-
テーマカラー:
site.themeColor.hue(0-360) を調整して、ブログのメインカラーを変更します。 -
壁紙モード:
banner、fullscreen、noneから選択します。kenBurnsエフェクトを使用して、複数の壁紙を表示するcarouselを有効にすることもできます。 -
波エフェクト:
site.wallpaper.banner.waves.enableを使用して、バナー上のアニメーションする水の波紋エフェクトを切り替えます。 -
パーティクルエフェクト:
particle.enableを使用して、背景に浮遊するパーティクルを有効にします。
UI
-
ナビバーの透明度:
site.wallpaper.banner.navbar.transparentModeをsemi、full、semifullの間で調整します。 -
サイドバーウィジェット:
sidebar.componentsで、profile、announcement、categories、tags、toc、statisticsなどのサイドバーコンポーネントの順序を変更したり、表示/非表示を切り替えたりできます。
Markdown拡張
GitHubリポジトリカード
GitHubリポジトリにリンクする動的なカードを追加できます。ページ読み込み時に、リポジトリ情報がGitHub APIから取得されます。
GitHubリポジトリカードは、コード ::github{repo="Spr-Aachen/Twilight"} で作成します。
1::github{repo="Spr-Aachen/Twilight"}音楽カード
- オンライン
1::music{meting="https://meting.spr-aachen.com/api?server=netease&type=song&id=1390882521"}- ローカル
1::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アクションによる否定的な潜在的な結果です。
-
基本構文
1:::note2ユーザーがざっと読む場合でも考慮すべき情報を強調表示します。3:::45:::tip6ユーザーがより成功するための任意の情報です。7::: -
カスタムタイトル
アドモニションのタイトルはカスタマイズできます。
マイカスタムタイトルこれはカスタムタイトルが付いたノートです。
1:::note[マイカスタムタイトル]2これはカスタムタイトルが付いたノートです。3::: -
GitHub構文
TipGitHub構文もサポートされています。
1> [!TIP]2> GitHub構文もサポートされています。 -
スポイラー
テキストにスポイラーを追加できます。テキストはMarkdown構文もサポートしています。
このコンテンツは
隠されています えいっ !1このコンテンツは :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, ornone. You can also enable acarouselfor multiple wallpapers with thekenBurnseffect. -
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.transparentModebetweensemi,full, orsemifull. -
Sidebar Widgets: Reorder or toggle sidebar components like
profile,announcement,categories,tags,toc, andstatisticsinsidebar.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.
Create a GitHub repository card with the code ::github{repo="Spr-Aachen/Twilight"}.
1::github{repo="Spr-Aachen/Twilight"}Music Cards
- Online
1::music{meting="https://meting.spr-aachen.com/api?server=netease&type=song&id=1390882521"}- Local
1::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
NoteHighlights information that users should take into account, even when skimming.
TipOptional information to help a user be more successful.
ImportantCrucial information necessary for users to succeed.
WarningCritical content demanding immediate user attention due to potential risks.
CautionNegative potential consequences of an action.
-
Basic Syntax
1:::note2Highlights information that users should take into account, even when skimming.3:::45:::tip6Optional information to help a user be more successful.7::: -
Custom Titles
The title of the admonition can be customized.
MY CUSTOM TITLEThis is a note with a custom title.
1:::note[MY CUSTOM TITLE]2This is a note with a custom title.3::: -
GitHub Syntax
TipThe GitHub syntax is also supported.
1> [!TIP]2> 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 !1The content :spoiler[is hidden **ayyy**]!
For more details, check the Documentation.
This page may not be the latest version.