[{"content":"Git 目前世界上最先进的分布式版本控制系统\n版本控制系统： 手动控制 自动控制系统 Git与Github的区别\nGit安装：\nGit的使用： 1.本地仓库 1.1 工作流程： git本地操作的三个区域\nGit Repository（Git仓库） 最终确定额文件保存到仓库，成为一个新的版本，并且对他人可见 暂存区 暂存已经修改的文件最后统一提交到git仓库中 工作区（Working Directory）（写代码工作目录） 添加、编辑、修改文件等动作 暂存区的作用：等待所有修改完成，统一提交commit\ngit add test.php 添加到暂存区\ngit status\n1.2 本地仓库操作 repository 每个文件的修改，删除等操作都能跟踪到\n1.进行全局配置操作\n$ git config --global user.name \u0026#34;用户名\u0026#34; $ git config --global user.email \u0026#34;邮箱地址\u0026#34; 2.创建仓库 创建一个空目录： windows中创建 命令行中创建\n$ mkdir pro_name 在命令行中进入这个目录\nGit仓库初始化（让git知道，自己需要管理这个目录）\n进入到工程目录初始化 $ git init 在任意位置，初始化指定的工程目录 $ git init newrepo 表现，执行之后，会在项目目录下创建\u0026quot;.git\u0026quot;的隐藏目录，这个目录是Git所创建的，不能删除，也不能随意更改其中的内容。\nGit常用指令操作 查看当前状态：git status\n添加到缓存区： git add 文件名 说明：git add 指令，可以添加一个文件，也可以同时添加多个文件。 语法1：git add 文件名 添加一个文件 语法2：git add 文件名1 文件名2 文件名3 语法3：git add . 添加当前目录到暂存区中\n提交至版本库： git commit -m \u0026ldquo;注释内容\u0026rdquo;\n注释可以写中文\nGit的版本回退操作 版本回退分为两步骤操作： 步骤： 1.查看版本，确定需要回到的时刻点 指令： $git log $git log --pretty=oneline 显示一行，常用 2.回退操作 指令： $git reset --hard 提交编号\n3.注意：回到过去之后，想要再回到之前最先的版本的时候，需要使用指令去查看历史操作，以得到最新的commit id 指令： $git reflog\n小结： 1.要想回到过去，必须先得到commit id ，然后通过git reset \u0026ndash;hard 进行回退 2.想要回到未来，需要使用 git reflog进行历史操作查看，得到最新的commit id 3.在写回退指令的时候，commit id可以不用写全，git会自动识别\n2.远程仓库 2.1远程仓库创建\n2.2两种常见的使用方式 HTTPS协议使用 1.创建一个空目录\n2.使用clone指令克隆线上仓库到本地 语法： $git clone 线上仓库地址\n3.在仓库上做对应的操作（提交暂存区，提交本地仓库，提交线上仓库，拉取线上仓库）\n提交到线上仓库的指令：$git push\n首次往线上仓库提交内容时出现403致命错误，原因是： 不是任何人都可以往线上仓库提交内容，必须进行鉴权\n需要修改，\u0026quot;.git/config\u0026quot;文件\n拉取线上仓库的指令: $git pull\n提醒： 在每天工作的第一件事就是先git pull 拉取线上最新的版本 每天下班前要做的是 git push 将本地代码提交到线上仓库\n基于ssh协议\n该方式与前面的https方式相比，只是影响github对于用户的身份鉴权方式，对于git的具体操作（如，提交本地，添加注释，提交远程等操作没有任何影响）\n生成私钥对指令（需要先自行安装openssh）：$ssh-keygen -t rsa -C \u0026quot;注册邮箱\u0026quot;\n步骤，创建公私钥对文件\n上传公钥文件内容（.ssh/*.pub)\n一般使用的设备固定，推荐使用ssh方式\nGit的分支操作 在版本回退的章节里，每次提交后都会有记录，Git把他们串成时间线，形成类似于时间轴的东西，这个时间轴就是一个分支，我们称之为master分支\n在开发的时候往往是团队协作，多人进行开发，因此光有一个分支是无法满足多人同时开发的需求，并且在分支上工作，并不影响其他分支的正常使用\n分支相关指令 查看分支： $git branch 创建分支： $git branch 分支名 切换分支: $git checkout 分支名 $git checkout -b 分支名 -b选项表示创建并切换，相当于是两个操作指令 合并分支： $git merge 被合并的分支名 删除分支： $git branch -d 分支名 注意：在删除分支的时候，一定要先退出要删除的分支，然后才能删除\n","date":"2026-05-13T14:16:17+08:00","permalink":"https://turnaoo.top/p/usegit/","title":"Usegit"},{"content":"Stack 主题还提供了一些自定义短代码来增强你的内容。\n引用 (Quote) quote 短代码允许你显示带有作者、来源和 URL 的引用。\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n― 一位名人, 他们写的书 用法 {{\u0026lt; quote author=\u0026#34;作者名字\u0026#34; source=\u0026#34;文章标题\u0026#34; url=\u0026#34;https://example.com\u0026#34; \u0026gt;}} 这里是引用内容。 {{\u0026lt; /quote \u0026gt;}} 视频 (Video) video 短代码允许你嵌入自托管或远程视频文件。\nYour browser doesn't support HTML5 video. Here is a link to the video instead. 用法 {{\u0026lt; video src=\u0026#34;https://example.com/video.mp4\u0026#34; \u0026gt;}} Bilibili 嵌入来自 Bilibili 的视频。支持 av 和 bv 号。\n用法 {{\u0026lt; bilibili \u0026#34;BV1634y1t7xR\u0026#34; \u0026gt;}} YouTube Hugo 内置的 YouTube 短代码。\n用法 {{\u0026lt; youtube ZJthWmvUzzc \u0026gt;}} 腾讯视频 (Tencent Video) 嵌入来自腾讯视频的视频。\n用法 {{\u0026lt; tencent \u0026#34;u00306ng962\u0026#34; \u0026gt;}} GitLab Snippet 嵌入来自 GitLab 的代码片段。\n用法 {{\u0026lt; gitlab 2349278 \u0026gt;}} 图表 (Diagrams) Stack 出箱即用地支持 Mermaid 图表。\ngraph TD; A--\u0026gt;B; A--\u0026gt;C; B--\u0026gt;D; C--\u0026gt;D; 用法 将你的 Mermaid 代码包裹在语言设置为 mermaid 的代码块中。\n","date":"2026-01-26T00:00:00Z","permalink":"https://turnaoo.top/p/%E7%9F%AD%E4%BB%A3%E7%A0%81/","title":"短代码"},{"content":"Stack 主题内置了对相册的支持。你只需要简单地将多张图片并排放置，就可以创建一个精美的相册。\n示例相册 它是如何工作的 相册由 Photoswipe 和一个自定义的内部脚本驱动。它会根据图片的宽高比自动计算出最佳布局。\n要创建一个相册，你只需要将多张图片放在同一行（或同一个段落）中。\n语法 ![图片 1](image1.jpg) ![图片 2](image2.jpg) ![图片 3](image3.jpg) ![图片 4](image4.jpg) 注意: 图片之间应该有两个空格，以确保它们在 Markdown 中保持在同一行。\n相册语法启发自 Typlog\n","date":"2026-01-26T00:00:00Z","image":"https://turnaoo.top/p/image-gallery/helena-hertz-wWZzXlDpMog-unsplash_hu_7d5f5b09f91c89db.jpg","permalink":"https://turnaoo.top/p/image-gallery/","title":"相册"},{"content":"这篇文章提供了可以在 Hugo 内容文件中使用的基本 Markdown 语法示例，同时也展示了 Hugo 主题中基本 HTML 元素是否应用了 CSS 装饰。\n标题 (Headings) 以下 HTML \u0026lt;h1\u0026gt;—\u0026lt;h6\u0026gt; 元素代表了六个级别的章节标题。\u0026lt;h1\u0026gt; 是最高级别，而 \u0026lt;h6\u0026gt; 是最低级别。\nH3 H4 H5 H6 段落 (Paragraph) Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.\nItatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.\n引用 (Blockquotes) 引用元素代表从另一个来源引用的内容，可以选择带有引用说明（必须在 footer 或 cite 元素内），也可以选择带有行内更改（如注释和缩写）。\n不带出处的引用 Tiam, ad mint andaepu dandae nostion secatur sequo quae. 注意：你可以在引用中使用 Markdown 语法。\n带有出处的引用 不要通过共享内存来通信，而要通过通信来共享内存。 — Rob Pike1\n带提示的引用 [!NOTE] 突出显示用户在快速浏览时也应注意的信息。\n[!TIP] 可选信息，帮助用户更顺利地完成任务。\n[!IMPORTANT] 用户成功所必需的关键信息。\n[!WARNING] 由于潜在风险而需要用户立即关注的关键内容。\n[!CAUTION] 某个操作可能带来的负面后果。\n[!NOTE] 自定义标题 如果你想使用自定义标题，可以在方括号后面添加标题文本，如上所示。\n表格 (Tables) 表格虽然不是 Markdown 核心规范的一部分，但 Hugo 出箱即用地支持它们。\n姓名 年龄 Bob 27 Alice 23 表格内的行内 Markdown 斜体 加粗 代码 italics bold code A B C D E F Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ultricies, sapien non euismod aliquam, dui ligula tincidunt odio, at accumsan nulla sapien eget ex. Proin eleifend dictum ipsum, non euismod ipsum pulvinar et. Vivamus sollicitudin, quam in pulvinar aliquam, metus elit pretium purus Proin sit amet velit nec enim imperdiet vehicula. Ut bibendum vestibulum quam, eu egestas turpis gravida nec Sed scelerisque nec turpis vel viverra. Vivamus vitae pretium sapien 代码块 (Code Blocks) 使用反引号的代码块 \u0026lt;!doctype html\u0026gt; \u0026lt;html lang=\u0026#34;en\u0026#34;\u0026gt; \u0026lt;head\u0026gt; \u0026lt;meta charset=\u0026#34;utf-8\u0026#34;\u0026gt; \u0026lt;title\u0026gt;Example HTML5 Document\u0026lt;/title\u0026gt; \u0026lt;/head\u0026gt; \u0026lt;body\u0026gt; \u0026lt;p\u0026gt;Test\u0026lt;/p\u0026gt; \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; 使用四个空格缩进的代码块 \u0026lt;!doctype html\u0026gt; \u0026lt;html lang=\u0026quot;en\u0026quot;\u0026gt; \u0026lt;head\u0026gt; \u0026lt;meta charset=\u0026quot;utf-8\u0026quot;\u0026gt; \u0026lt;title\u0026gt;Example HTML5 Document\u0026lt;/title\u0026gt; \u0026lt;/head\u0026gt; \u0026lt;body\u0026gt; \u0026lt;p\u0026gt;Test\u0026lt;/p\u0026gt; \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; Diff 代码块 [dependencies.bevy] git = \u0026#34;https://github.com/bevyengine/bevy\u0026#34; rev = \u0026#34;11f52b8c72fc3a568e8bb4a4cd1f3eb025ac2e13\u0026#34; - features = [\u0026#34;dynamic\u0026#34;] + features = [\u0026#34;jpeg\u0026#34;, \u0026#34;dynamic\u0026#34;] 单行代码块 \u0026lt;p\u0026gt;A paragraph\u0026lt;/p\u0026gt; 列表类型 (List Types) 有序列表 第一项 第二项 第三项 无序列表 列表项 另一项 还有一项 嵌套列表 水果 苹果 橘子 香蕉 乳制品 牛奶 奶酪 其他元素 — abbr, sub, sup, kbd, mark GIF 是一种位图图像格式。\nH2O\nXn + Yn = Zn\n按 CTRL + ALT + Delete 结束会话。\n大多数蝾螈是夜行性的，捕食昆虫、蠕虫和其他小型生物。\n以上引用摘自 Rob Pike 在 2015 年 11 月 18 日 Gopherfest 期间的演讲。\u0026#160;\u0026#x21a9;\u0026#xfe0e;\n","date":"2026-01-25T00:00:00Z","image":"https://turnaoo.top/p/markdown-%E8%AF%AD%E6%B3%95%E6%8C%87%E5%8D%97/pawel-czerwinski-8uZPynIu-rQ-unsplash_hu_9e6bcf9cfe9a9448.jpg","permalink":"https://turnaoo.top/p/markdown-%E8%AF%AD%E6%B3%95%E6%8C%87%E5%8D%97/","title":"Markdown 语法指南"},{"content":"Stack 主题支持使用 KaTeX 渲染数学公式。\n启用 KaTeX 按页面启用 要在特定文章中启用 KaTeX，请在文章的前置参数（frontmatter）中包含 math: true：\n--- title: \u0026#34;我的数学文章\u0026#34; math: true --- 全局启用 要为所有文章启用 KaTeX，请在网站配置（params.yaml 或 params.toml）中将 article.math 设置为 true：\narticle: math: true 示例 行内公式 你可以通过将表达式包裹在单个美元符号 $ 中来包含行内公式。\n例如：$ \\varphi = \\dfrac{1+\\sqrt5}{2}= 1.6180339887… $ 将渲染为 $ \\varphi = \\dfrac{1+\\sqrt5}{2}= 1.6180339887… $\n块级公式 对于较大的方程式，请使用双美元符号 $$ 创建数学块。\n$$ \\varphi = 1+\\frac{1} {1+\\frac{1} {1+\\frac{1} {1+\\cdots} } } $$\n更复杂的公式 $$ f(a) = \\frac{1}{2\\pi i} \\oint_\\gamma \\frac{f(z)}{z-a} dz $$\n注意： 有关受支持的 TeX 函数的完整列表，请参阅 KaTeX 文档。\n","date":"2026-01-24T00:00:00Z","permalink":"https://turnaoo.top/p/math-typesetting/","title":"数学公式"},{"content":"This theme supports Mermaid diagrams directly in your Markdown content. Mermaid lets you create diagrams and visualizations using text and code.\nAbout Mermaid.js This theme integrates Mermaid.js (v11) to render diagrams from text definitions within Markdown code blocks. Mermaid is a JavaScript-based diagramming and charting tool that uses text-based syntax inspired by Markdown.\nFor complete syntax documentation, see the Mermaid.js documentation.\nGetting Started To create a Mermaid diagram, simply use a fenced code block with mermaid as the language identifier:\n```mermaid graph TD A[Start] --\u0026gt; B[Process] B --\u0026gt; C[End] ``` The diagram will be automatically rendered when the page loads.\nFeatures Auto-detection: Mermaid script only loads on pages that contain diagrams Theme Support: Diagrams automatically adapt to light/dark mode HTML Labels: Support for HTML content in labels (like \u0026lt;br/\u0026gt; for line breaks) Configurable: Customize version, security level, and more in your site config Configuration You can configure Mermaid in your site config:\nhugo.yaml:\nparams: article: mermaid: version: \u0026#34;11\u0026#34; # Mermaid version from CDN look: classic # classic or handDrawn (sketch style) lightTheme: default # Theme for light mode darkTheme: neutral # Theme for dark mode securityLevel: strict # strict (default), loose, antiscript, sandbox htmlLabels: true # Enable HTML in labels hugo.toml:\n[params.article.mermaid] version = \u0026#34;11\u0026#34; # Mermaid version from CDN look = \u0026#34;classic\u0026#34; # classic or handDrawn (sketch style) lightTheme = \u0026#34;default\u0026#34; # Theme for light mode darkTheme = \u0026#34;neutral\u0026#34; # Theme for dark mode securityLevel = \u0026#34;strict\u0026#34; # strict (default), loose, antiscript, sandbox htmlLabels = true # Enable HTML in labels Additional Global Options These optional settings use Mermaid\u0026rsquo;s defaults when not specified:\nhugo.yaml:\nparams: article: mermaid: maxTextSize: 50000 # Maximum text size (default: 50000) maxEdges: 500 # Maximum edges allowed (default: 500) fontSize: 16 # Global font size in pixels (default: 16) fontFamily: \u0026#34;arial\u0026#34; # Global font family curve: \u0026#34;basis\u0026#34; # Line curve: basis, cardinal, linear (default: basis) logLevel: 5 # Debug level 0-5, 0=debug, 5=fatal (default: 5) hugo.toml:\n[params.article.mermaid] maxTextSize = 50000 # Maximum text size (default: 50000) maxEdges = 500 # Maximum edges allowed (default: 500) fontSize = 16 # Global font size in pixels (default: 16) fontFamily = \u0026#34;arial\u0026#34; # Global font family curve = \u0026#34;basis\u0026#34; # Line curve: basis, cardinal, linear (default: basis) logLevel = 5 # Debug level 0-5, 0=debug, 5=fatal (default: 5) For diagram-specific options (like flowchart.useMaxWidth), use Mermaid\u0026rsquo;s init directive directly in your diagram:\n```mermaid %%{init: {\u0026#39;flowchart\u0026#39;: {\u0026#39;useMaxWidth\u0026#39;: false}}}%% flowchart LR A --\u0026gt; B ``` Security Note: The default securityLevel: strict is recommended. Set to loose only if you need HTML labels like \u0026lt;br/\u0026gt; in your diagrams.\nAvailable Themes Theme Description default Standard colorful theme neutral Grayscale, great for printing and dark mode dark Designed for dark backgrounds forest Green color palette base Minimal theme, customizable with themeVariables null Disable theming entirely Custom Theme Variables For full control, use the base theme with custom variables:\nhugo.yaml:\nparams: article: mermaid: lightTheme: base darkTheme: base lightThemeVariables: primaryColor: \u0026#34;#4a90d9\u0026#34; primaryTextColor: \u0026#34;#ffffff\u0026#34; lineColor: \u0026#34;#333333\u0026#34; darkThemeVariables: primaryColor: \u0026#34;#6ab0f3\u0026#34; primaryTextColor: \u0026#34;#ffffff\u0026#34; lineColor: \u0026#34;#cccccc\u0026#34; background: \u0026#34;#1a1a2e\u0026#34; hugo.toml:\n[params.article.mermaid] lightTheme = \u0026#34;base\u0026#34; darkTheme = \u0026#34;base\u0026#34; [params.article.mermaid.lightThemeVariables] primaryColor = \u0026#34;#4a90d9\u0026#34; primaryTextColor = \u0026#34;#ffffff\u0026#34; lineColor = \u0026#34;#333333\u0026#34; [params.article.mermaid.darkThemeVariables] primaryColor = \u0026#34;#6ab0f3\u0026#34; primaryTextColor = \u0026#34;#ffffff\u0026#34; lineColor = \u0026#34;#cccccc\u0026#34; background = \u0026#34;#1a1a2e\u0026#34; Common variables: primaryColor, secondaryColor, tertiaryColor, primaryTextColor, lineColor, background, fontFamily\nNote: Theme variables only work with the base theme and must use hex color values (e.g., #ff0000).\nDiagram Types Flowchart Flowcharts are the most common diagram type. Use graph or flowchart with direction indicators:\nTD or TB: Top to bottom BT: Bottom to top LR: Left to right RL: Right to left flowchart LR A[Hard edge] --\u0026gt;|Link text| B(Round edge) B --\u0026gt; C{Decision} C --\u0026gt;|One| D[Result one] C --\u0026gt;|Two| E[Result two] Sequence Diagram Perfect for showing interactions between components:\nsequenceDiagram participant Alice participant Bob Alice-\u0026gt;\u0026gt;John: Hello John, how are you? loop Healthcheck John-\u0026gt;\u0026gt;John: Fight against hypochondria end Note right of John: Rational thoughts \u0026lt;br/\u0026gt;prevail! John--\u0026gt;\u0026gt;Alice: Great! John-\u0026gt;\u0026gt;Bob: How about you? Bob--\u0026gt;\u0026gt;John: Jolly good! Class Diagram Visualize class structures and relationships:\nclassDiagram Animal \u0026lt;|-- Duck Animal \u0026lt;|-- Fish Animal \u0026lt;|-- Zebra Animal : +int age Animal : +String gender Animal: +isMammal() Animal: +mate() class Duck{ +String beakColor +swim() +quack() } class Fish{ -int sizeInFeet -canEat() } class Zebra{ +bool is_wild +run() } State Diagram Model state machines and transitions:\nstateDiagram-v2 [*] --\u0026gt; Still Still --\u0026gt; [*] Still --\u0026gt; Moving Moving --\u0026gt; Still Moving --\u0026gt; Crash Crash --\u0026gt; [*] Entity Relationship Diagram Document database schemas:\nerDiagram CUSTOMER ||--o{ ORDER : places ORDER ||--|{ LINE-ITEM : contains CUSTOMER }|..|{ DELIVERY-ADDRESS : uses CUSTOMER { string name string custNumber string sector } ORDER { int orderNumber string deliveryAddress } Gantt Chart Plan and track project schedules:\ngantt title A Gantt Diagram dateFormat YYYY-MM-DD section Section A task :a1, 2024-01-01, 30d Another task :after a1, 20d section Another Task in Another :2024-01-12, 12d another task :24d Pie Chart Display proportional data:\npie showData title Key elements in Product X \u0026#34;Calcium\u0026#34; : 42.96 \u0026#34;Potassium\u0026#34; : 50.05 \u0026#34;Magnesium\u0026#34; : 10.01 \u0026#34;Iron\u0026#34; : 5 Git Graph Visualize Git branching strategies:\ngitGraph commit commit branch develop checkout develop commit commit checkout main merge develop commit commit Mindmap Create hierarchical mindmaps:\nmindmap root((mindmap)) Origins Long history Popularisation British popular psychology author Tony Buzan Research On effectiveness\u0026lt;br/\u0026gt;and features On Automatic creation Uses Creative techniques Strategic planning Argument mapping Tools Pen and paper Mermaid Timeline Display chronological events:\ntimeline title History of Social Media Platform 2002 : LinkedIn 2004 : Facebook : Google 2005 : YouTube 2006 : Twitter Advanced Features HTML in Labels To use HTML in labels, you must set securityLevel: loose in your site config:\nhugo.yaml:\nparams: article: mermaid: securityLevel: loose htmlLabels: true hugo.toml:\n[params.article.mermaid] securityLevel = \u0026#34;loose\u0026#34; htmlLabels = true Then you can use HTML tags like \u0026lt;br/\u0026gt; for line breaks:\n```mermaid graph TD A[Line 1\u0026lt;br/\u0026gt;Line 2] --\u0026gt; B[\u0026lt;b\u0026gt;Bold\u0026lt;/b\u0026gt; text] ``` Per-Diagram Theming Override the theme for a specific diagram using Mermaid\u0026rsquo;s frontmatter:\n```mermaid %%{init: {\u0026#39;theme\u0026#39;: \u0026#39;forest\u0026#39;}}%% graph TD A[Start] --\u0026gt; B[End] ``` %%{init: {\u0026#39;theme\u0026#39;: \u0026#39;forest\u0026#39;}}%% graph TD A[Christmas] --\u0026gt;|Get money| B(Go shopping) B --\u0026gt; C{Let me think} C --\u0026gt;|One| D[Laptop] C --\u0026gt;|Two| E[iPhone] C --\u0026gt;|Three| F[Car] Inline Styling with style You can style individual nodes directly within your diagram using the style directive:\n```mermaid flowchart LR A[Start] --\u0026gt; B[Process] --\u0026gt; C[End] style A fill:#4ade80,stroke:#166534,color:#000 style B fill:#60a5fa,stroke:#1e40af,color:#000 style C fill:#f87171,stroke:#991b1b,color:#fff ``` Result:\nflowchart LR A[Start] --\u0026gt; B[Process] --\u0026gt; C[End] style A fill:#4ade80,stroke:#166534,color:#000 style B fill:#60a5fa,stroke:#1e40af,color:#000 style C fill:#f87171,stroke:#991b1b,color:#fff Style properties include:\nfill - Background color stroke - Border color stroke-width - Border thickness color - Text color stroke-dasharray - Dashed border (e.g., 5 5) Styling with CSS Classes You can define reusable styles with classDef and apply them using :::className:\n```mermaid flowchart LR A:::success --\u0026gt; B:::info --\u0026gt; C:::warning classDef success fill:#4ade80,stroke:#166534,color:#000 classDef info fill:#60a5fa,stroke:#1e40af,color:#000 classDef warning fill:#fbbf24,stroke:#92400e,color:#000 ``` Result:\nflowchart LR A:::success --\u0026gt; B:::info --\u0026gt; C:::warning classDef success fill:#4ade80,stroke:#166534,color:#000 classDef info fill:#60a5fa,stroke:#1e40af,color:#000 classDef warning fill:#fbbf24,stroke:#92400e,color:#000 Subgraphs Group related nodes together:\nflowchart TB subgraph one a1--\u0026gt;a2 end subgraph two b1--\u0026gt;b2 end subgraph three c1--\u0026gt;c2 end one --\u0026gt; two three --\u0026gt; two two --\u0026gt; c2 Theme Switching This theme automatically detects your site\u0026rsquo;s light/dark mode preference and adjusts the Mermaid diagram theme accordingly:\nLight mode: Uses the default Mermaid theme Dark mode: Uses the dark Mermaid theme (configurable) Try toggling the theme switcher to see diagrams update in real-time!\nComplex Example Here\u0026rsquo;s an example with subgraphs, HTML labels, emojis, and custom styling:\nflowchart TD subgraph client[\u0026#34;👤 Client\u0026#34;] A[\u0026#34;User Device\u0026lt;br/\u0026gt;192.168.1.10\u0026#34;] end subgraph cloud[\u0026#34;☁️ Cloud Gateway\u0026#34;] B[\u0026#34;Load Balancer\u0026lt;br/\u0026gt;(SSL Termination)\u0026#34;] end subgraph server[\u0026#34;🖥️ Application Server\u0026#34;] C[\u0026#34;API Gateway\u0026lt;br/\u0026gt;10.0.0.1\u0026#34;] D[\u0026#34;Auth Service\u0026lt;br/\u0026gt;10.0.0.2\u0026#34;] E[\u0026#34;Web Server\u0026lt;br/\u0026gt;10.0.0.3\u0026#34;] F[\u0026#34;Database\u0026lt;br/\u0026gt;10.0.0.4\u0026#34;] end A -- \u0026#34;HTTPS Request\u0026#34; --\u0026gt; B B -- \u0026#34;Forward\u0026lt;br/\u0026gt;(internal)\u0026#34; --\u0026gt; C C -- \u0026#34;Authenticate\u0026#34; --\u0026gt; D D -- \u0026#34;Token\u0026#34; --\u0026gt; C C -- \u0026#34;Route\u0026#34; --\u0026gt; E E --\u0026gt; F style client fill:#1a365d,stroke:#2c5282,color:#fff style cloud fill:#f6ad55,stroke:#dd6b20,color:#000 style server fill:#276749,stroke:#22543d,color:#fff Note: This example requires securityLevel: loose for HTML labels and styling to work.\nKnown Limitations Dark Mode Theming Mermaid.js\u0026rsquo;s built-in themes have some limitations:\ndark theme (default): Best text contrast, but some diagram backgrounds may appear brownish (e.g., Gantt charts) neutral theme: Better background colors, but some text (labels, legends) may have reduced contrast For full control, use the base theme with custom variables:\nhugo.yaml:\nparams: article: mermaid: darkTheme: base darkThemeVariables: primaryColor: \u0026#34;#1f2937\u0026#34; primaryTextColor: \u0026#34;#ffffff\u0026#34; lineColor: \u0026#34;#9ca3af\u0026#34; textColor: \u0026#34;#e5e7eb\u0026#34; hugo.toml:\n[params.article.mermaid] darkTheme = \u0026#34;base\u0026#34; [params.article.mermaid.darkThemeVariables] primaryColor = \u0026#34;#1f2937\u0026#34; primaryTextColor = \u0026#34;#ffffff\u0026#34; lineColor = \u0026#34;#9ca3af\u0026#34; textColor = \u0026#34;#e5e7eb\u0026#34; We plan to improve dark mode theming in future updates as Mermaid.js evolves.\nTroubleshooting Diagram not rendering? Make sure you\u0026rsquo;re using a fenced code block with mermaid as the language Check your browser\u0026rsquo;s console for syntax errors Verify your Mermaid syntax at Mermaid Live Editor HTML not working in labels? HTML in labels requires securityLevel: loose. Update your configuration:\nhugo.yaml:\nparams: article: mermaid: securityLevel: loose htmlLabels: true hugo.toml:\n[params.article.mermaid] securityLevel = \u0026#34;loose\u0026#34; htmlLabels = true Warning: Using loose security level allows HTML in diagrams. Only use this if you trust your diagram content.\nSyntax errors? Mermaid is strict about syntax. Common issues:\nMissing spaces around arrows Unclosed brackets or quotes Invalid node IDs (avoid special characters) Resources Mermaid Documentation Mermaid Live Editor - Test diagrams interactively Mermaid Syntax Reference ","date":"2025-12-23T00:00:00Z","permalink":"https://turnaoo.top/p/mermaid-diagrams/","title":"Mermaid Diagrams"},{"content":"This is pagination test post 12.\n","date":"2000-01-12T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-12/","title":"Pagination Test 12"},{"content":"This is pagination test post 11.\n","date":"2000-01-11T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-11/","title":"Pagination Test 11"},{"content":"This is pagination test post 10.\n","date":"2000-01-10T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-10/","title":"Pagination Test 10"},{"content":"This is pagination test post 09.\n","date":"2000-01-09T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-09/","title":"Pagination Test 09"},{"content":"This is pagination test post 08.\n","date":"2000-01-08T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-08/","title":"Pagination Test 08"},{"content":"This is pagination test post 07.\n","date":"2000-01-07T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-07/","title":"Pagination Test 07"},{"content":"This is pagination test post 06.\n","date":"2000-01-06T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-06/","title":"Pagination Test 06"},{"content":"This is pagination test post 05.\n","date":"2000-01-05T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-05/","title":"Pagination Test 05"},{"content":"This is pagination test post 04.\n","date":"2000-01-04T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-04/","title":"Pagination Test 04"},{"content":"This is pagination test post 03.\n","date":"2000-01-03T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-03/","title":"Pagination Test 03"},{"content":"This is pagination test post 02.\n","date":"2000-01-02T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-02/","title":"Pagination Test 02"},{"content":"This is pagination test post 01.\n","date":"2000-01-01T00:00:00Z","permalink":"https://turnaoo.top/p/pagination-test-01/","title":"Pagination Test 01"}]