Deploying to gh-pages from @ geekifan/chirpy-starter@244d60af9a 🚀

This commit is contained in:
geekifan
2025-06-05 08:17:43 +00:00
commit 1855c0645f
235 changed files with 8087 additions and 0 deletions

44
zh-cn/404.html Normal file
View File

@ -0,0 +1,44 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/404.html"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="404 Page not found"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="404 Page not found"><meta itemprop=name content="404 Page not found"><title>404 Page not found |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script defer src=/chirpy-starter/js/commons.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>404 Page not found</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title>404 Page not found</div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><h1 class=dynamic-title>404: Page not found</h1><div class=content><blockquote class=prompt-danger><p>抱歉,我们放错了该 URL或者它指向了不存在的内容。</p></blockquote></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

45
zh-cn/about/index.html Normal file
View File

@ -0,0 +1,45 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/about/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="关于"><meta property="og:description" content="Chirpy 是一个基于 Jekyll 的博客主题。由于 Jekyll 的设计限制它本身不支持国际化i18n需要依赖第三方插件来实现 i18n 功能。为了让 Chirpy 在不依赖第三方插件的情况下支持 i18nhugo-theme-chirpy 项目将 Chirpy 主题迁移至 Hugo并进行了最小化的适配。Chirpy 的所有功能在 hugo-theme-chirpy 中均可使用(不过在 Hugo 框架下,部分功能的操作方式可能有所不同)。"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="article"><meta property="article:published_time" content="2023-04-20T00:00:00+00:00"><meta property="article:modified_time" content="2023-04-20T00:00:00+00:00"><meta name=twitter:card content="summary"><meta name=twitter:title content="关于"><meta name=twitter:description content="Chirpy 是一个基于 Jekyll 的博客主题。由于 Jekyll 的设计限制它本身不支持国际化i18n需要依赖第三方插件来实现 i18n 功能。为了让 Chirpy 在不依赖第三方插件的情况下支持 i18nhugo-theme-chirpy 项目将 Chirpy 主题迁移至 Hugo并进行了最小化的适配。Chirpy 的所有功能在 hugo-theme-chirpy 中均可使用(不过在 Hugo 框架下,部分功能的操作方式可能有所不同)。"><meta itemprop=name content="关于"><meta itemprop=description content="Chirpy 是一个基于 Jekyll 的博客主题。由于 Jekyll 的设计限制它本身不支持国际化i18n需要依赖第三方插件来实现 i18n 功能。为了让 Chirpy 在不依赖第三方插件的情况下支持 i18nhugo-theme-chirpy 项目将 Chirpy 主题迁移至 Hugo并进行了最小化的适配。Chirpy 的所有功能在 hugo-theme-chirpy 中均可使用(不过在 Hugo 框架下,部分功能的操作方式可能有所不同)。"><meta itemprop=datePublished content="2023-04-20T00:00:00+00:00"><meta itemprop=dateModified content="2023-04-20T00:00:00+00:00"><meta itemprop=wordCount content="373"><title>关于 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/js/glightbox.min.js></script><script src=https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js></script><script src=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.js></script><script defer src=/chirpy-starter/js/page.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class="nav-item active"><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>关于</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title>关于</div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><article class=px-1><h1 class=dynamic-title>关于</h1><div class=content><p><a href=https://github.com/cotes2020/jekyll-theme-chirpy>Chirpy</a> 是一个基于 <a href=https://jekyllrb.com/>Jekyll</a> 的博客主题。由于 Jekyll 的设计限制它本身不支持国际化i18n需要依赖第三方插件来实现 i18n 功能。为了让 Chirpy 在不依赖第三方插件的情况下支持 i18n<a href=https://github.com/geekifan/hugo-theme-chirpy>hugo-theme-chirpy</a> 项目将 Chirpy 主题迁移至 <a href=https://gohugo.io/>Hugo</a>并进行了最小化的适配。Chirpy 的所有功能在 hugo-theme-chirpy 中均可使用(不过在 Hugo 框架下,部分功能的操作方式可能有所不同)。</p><p>跟随示例站点的文章,快速搭建一个免费的个人博客吧!</p><h2 id=功能特点 id=功能特点><span class=me-2>功能特点</span>
<a href=#%e5%8a%9f%e8%83%bd%e7%89%b9%e7%82%b9 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><ul><li><strong>深色模式</strong>:在低光环境下提升阅读体验。</li><li><strong>多语言界面</strong>:轻松切换不同语言。</li><li><strong>高效的文章管理</strong>:支持层级分类、热门标签、推荐阅读和搜索功能。</li><li><strong>优化的布局</strong>:包含目录、语法高亮、提示框等。</li><li><strong>丰富的写作扩展</strong>:支持数学公式、图表、流程图和嵌入式媒体。</li><li><strong>多种评论系统</strong>:提供多种评论方案可选。</li><li><strong>网站分析工具</strong>:集成多种分析工具。</li><li><strong>现代 Web 技术</strong>:优化 SEO 和网页性能。</li><li><strong>RSS 订阅支持</strong>:通过 RSS 让读者获取最新内容。</li></ul></div></article></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

52
zh-cn/archives/index.html Normal file
View File

@ -0,0 +1,52 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/archives/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="归档"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="article"><meta name=twitter:card content="summary"><meta name=twitter:title content="归档"><meta itemprop=name content="归档"><title>归档 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/misc.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class="nav-item active"><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>归档</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title>归档</div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><article class=px-1><h1 class=dynamic-title>归档</h1><div class=content><div id=archives class=pl-xl-3><time class="year lead d-block">2019</time><ul class=list-unstyled><li><span class="date day" data-ts=1565454840 data-df=DD>11</span>
<span class="date month small text-muted ms-1" data-ts=1565454840 data-df=MMM>%b
</span><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li><span class="date day" data-ts=1565355300 data-df=DD>09</span>
<span class="date month small text-muted ms-1" data-ts=1565355300 data-df=MMM>%b
</span><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li><span class="date day" data-ts=1565244600 data-df=DD>08</span>
<span class="date month small text-muted ms-1" data-ts=1565244600 data-df=MMM>%b
</span><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li><span class="date day" data-ts=1565235180 data-df=DD>08</span>
<span class="date month small text-muted ms-1" data-ts=1565235180 data-df=MMM>%b
</span><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></div></div></article></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,56 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/categories/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="分类"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="分类"><meta itemprop=name content="分类"><meta itemprop=datePublished content="2019-08-11T00:34:00+08:00"><meta itemprop=dateModified content="2019-08-11T00:34:00+08:00"><title>分类 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/categories.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class="nav-item active"><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>分类</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><article class=px-1><h1 class=dynamic-title>分类</h1><div class=content><div class="card categories mb-3"><div id=h_0 class="card-header d-flex justify-content-between hide-border-bottom"><span class=ms-2><i class="far fa-folder-open fa-fw"></i>
<a href=https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E5%8D%9A%E5%AE%A2 class=mx-2>博客</a>
<span class="text-muted small font-weight-light">2
个分类,
4
篇文章
</span></span><a href=#l_0 data-bs-toggle=collapse aria-expanded=false aria-label=博客-trigger class="category-trigger hide-border-bottom"><i class="fas fa-fw fa-angle-down"></i></a></div><div id=l_0 class="collapse show"><ul class=list-group><li class=list-group-item><i class="far fa-folder fa-fw"></i>
<a href=https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%95%99%E7%A8%8B class=mx-2>教程</a>
<span class="text-muted small font-weight-light">3
篇文章</span></li><li class=list-group-item><i class="far fa-folder fa-fw"></i>
<a href=https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%BC%94%E7%A4%BA class=mx-2>演示</a>
<span class="text-muted small font-weight-light">1
篇文章</span></li></ul></div></div></div></article></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>分类 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/categories/</link><description>Recent content in 分类 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 11 Aug 2019 00:34:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/categories/index.xml" rel="self" type="application/rss+xml"/><item><title>博客</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E5%8D%9A%E5%AE%A2/</link><pubDate>Sun, 11 Aug 2019 00:34:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E5%8D%9A%E5%AE%A2/</guid><description/></item><item><title>教程</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%95%99%E7%A8%8B/</link><pubDate>Sun, 11 Aug 2019 00:34:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%95%99%E7%A8%8B/</guid><description/></item><item><title>演示</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%BC%94%E7%A4%BA/</link><pubDate>Thu, 08 Aug 2019 11:33:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%BC%94%E7%A4%BA/</guid><description/></item></channel></rss>

View File

@ -0,0 +1,55 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E5%8D%9A%E5%AE%A2/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="博客"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="博客"><meta itemprop=name content="博客"><meta itemprop=datePublished content="2019-08-11T00:34:00+08:00"><meta itemprop=dateModified content="2019-08-11T00:34:00+08:00"><title>博客 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/misc.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span><a href=https://geekifan.github.io/chirpy-starter/zh-cn/categories/>分类</a></span>
<span>博客</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><div id=page-category><h1 class=ps-lg-2><i class="far fa-folder-open fa-fw text-muted"></i>
博客
<span class="lead text-muted ps-2">4</span></h1><ul class="content ps-0"><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a>
<span class="dash flex-grow-1"></span>
<span class="text-muted small text-nowrap">Aug 11, 2019</span></li><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a>
<span class="dash flex-grow-1"></span>
<span class="text-muted small text-nowrap">Aug 9, 2019</span></li><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a>
<span class="dash flex-grow-1"></span>
<span class="text-muted small text-nowrap">Aug 8, 2019</span></li><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a>
<span class="dash flex-grow-1"></span>
<span class="text-muted small text-nowrap">Aug 8, 2019</span></li></ul></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>博客 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E5%8D%9A%E5%AE%A2/</link><description>Recent content in 博客 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 11 Aug 2019 00:34:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E5%8D%9A%E5%AE%A2/index.xml" rel="self" type="application/rss+xml"/><item><title>自定义网站图标</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</link><pubDate>Sun, 11 Aug 2019 00:34:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</guid><description>&lt;p>&lt;a href="https://github.com/cotes2020/jekyll-theme-chirpy/">&lt;strong>Chirpy&lt;/strong>&lt;/a> 的&lt;a href="https://www.favicon-generator.org/about/">网站图标&lt;/a>放置在 &lt;code class="filepath">assets/img/favicons/&lt;/code> 目录中。您可能想用自己的图标替换它们。以下部分将指导您创建和替换默认网站图标。&lt;/p>
&lt;h2 id="生成网站图标" id=生成网站图标>
&lt;span class="me-2">生成网站图标&lt;/span>
&lt;a href="#%e7%94%9f%e6%88%90%e7%bd%91%e7%ab%99%e5%9b%be%e6%a0%87" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>准备一张尺寸为 512x512 或更大的正方形图像PNG、JPG 或 SVG然后前往在线工具 &lt;a href="https://realfavicongenerator.net/">&lt;strong>Real Favicon Generator&lt;/strong>&lt;/a>,点击 &lt;kbd>Select your Favicon image&lt;/kbd> 按钮上传您的图像文件。&lt;/p></description></item><item><title>开始使用</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</link><pubDate>Fri, 09 Aug 2019 20:55:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</guid><description>&lt;blockquote class="prompt-warning">&lt;p>&lt;strong>NOTE:&lt;/strong> 该教程还没有完成从 Jekyll 版本的迁移,请谨慎参考。&lt;/p>&lt;/blockquote>
&lt;h2 id="创建站点仓库" id=创建站点仓库>
&lt;span class="me-2">创建站点仓库&lt;/span>
&lt;a href="#%e5%88%9b%e5%bb%ba%e7%ab%99%e7%82%b9%e4%bb%93%e5%ba%93" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建站点仓库时,根据您的需求有两种选择:&lt;/p>
&lt;h3 id="选项1-使用起始模板推荐" id=选项1-使用起始模板推荐>
&lt;span class="me-2">选项1. 使用起始模板(推荐)&lt;/span>
&lt;a href="#%e9%80%89%e9%a1%b91-%e4%bd%bf%e7%94%a8%e8%b5%b7%e5%a7%8b%e6%a8%a1%e6%9d%bf%e6%8e%a8%e8%8d%90" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h3>&lt;p>这种方法简化了升级过程,隔离了不必要的文件,非常适合那些想专注于写作而不需要太多配置的用户。&lt;/p></description></item><item><title>撰写新文章</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</link><pubDate>Thu, 08 Aug 2019 14:10:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</guid><description>&lt;p>本教程将指导您如何在 &lt;em>Chirpy&lt;/em> 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。&lt;/p>
&lt;h2 id="命名和路径" id=命名和路径>
&lt;span class="me-2">命名和路径&lt;/span>
&lt;a href="#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建一个新文件,使用 &lt;code>hugo new content/post/YYYY-MM-DD-TITLE.md&lt;/code>。您可以根据自己的喜好更改路径,但请注意,所有文章都应该放在根目录的 &lt;code class="filepath">content/post&lt;/code> 中。&lt;/p></description></item><item><title>文本和排版</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</link><pubDate>Thu, 08 Aug 2019 11:33:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</guid><description>&lt;h2 id="标题" id=标题>
&lt;span class="me-2">标题&lt;/span>
&lt;a href="#%e6%a0%87%e9%a2%98" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;!-- markdownlint-capture -->
&lt;!-- markdownlint-disable -->
&lt;h1 id="h1--标题" class=mt-4 mb-0 data-toc-skip=true id=h1--标题>
H1 — 标题
&lt;/h1>&lt;h2 id="h2--标题" class=mt-4 mb-0 data-toc-skip=true id=h2--标题>
H2 — 标题
&lt;/h2>&lt;h3 id="h3--标题" class=mt-4 mb-0 data-toc-skip=true id=h3--标题>
H3 — 标题
&lt;/h3>&lt;h4 id="h4--标题" class=mt-4 data-toc-skip=true id=h4--标题>
H4 — 标题
&lt;/h4>&lt;!-- markdownlint-restore -->
&lt;h2 id="段落" id=段落>
&lt;span class="me-2">段落&lt;/span>
&lt;a href="#%e6%ae%b5%e8%90%bd" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>这是一个段落示例。在这里,我们可以看到段落是如何在 Markdown 中呈现的。段落是由一个或多个连续的文本行组成,它们之间用一个或多个空行分隔。正常的段落不应该用空格或制表符缩进。这样可以保持文档的整洁和一致性。文本排版是网页设计和内容创作中的重要元素,良好的排版可以提高可读性和美观度。&lt;/p></description></item></channel></rss>

View File

@ -0,0 +1,53 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%95%99%E7%A8%8B/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="教程"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="教程"><meta itemprop=name content="教程"><meta itemprop=datePublished content="2019-08-11T00:34:00+08:00"><meta itemprop=dateModified content="2019-08-11T00:34:00+08:00"><title>教程 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/misc.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span><a href=https://geekifan.github.io/chirpy-starter/zh-cn/categories/>分类</a></span>
<span>教程</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><div id=page-category><h1 class=ps-lg-2><i class="far fa-folder-open fa-fw text-muted"></i>
教程
<span class="lead text-muted ps-2">3</span></h1><ul class="content ps-0"><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a>
<span class="dash flex-grow-1"></span>
<span class="text-muted small text-nowrap">Aug 11, 2019</span></li><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a>
<span class="dash flex-grow-1"></span>
<span class="text-muted small text-nowrap">Aug 9, 2019</span></li><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a>
<span class="dash flex-grow-1"></span>
<span class="text-muted small text-nowrap">Aug 8, 2019</span></li></ul></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>教程 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%95%99%E7%A8%8B/</link><description>Recent content in 教程 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 11 Aug 2019 00:34:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%95%99%E7%A8%8B/index.xml" rel="self" type="application/rss+xml"/><item><title>自定义网站图标</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</link><pubDate>Sun, 11 Aug 2019 00:34:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</guid><description>&lt;p>&lt;a href="https://github.com/cotes2020/jekyll-theme-chirpy/">&lt;strong>Chirpy&lt;/strong>&lt;/a> 的&lt;a href="https://www.favicon-generator.org/about/">网站图标&lt;/a>放置在 &lt;code class="filepath">assets/img/favicons/&lt;/code> 目录中。您可能想用自己的图标替换它们。以下部分将指导您创建和替换默认网站图标。&lt;/p>
&lt;h2 id="生成网站图标" id=生成网站图标>
&lt;span class="me-2">生成网站图标&lt;/span>
&lt;a href="#%e7%94%9f%e6%88%90%e7%bd%91%e7%ab%99%e5%9b%be%e6%a0%87" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>准备一张尺寸为 512x512 或更大的正方形图像PNG、JPG 或 SVG然后前往在线工具 &lt;a href="https://realfavicongenerator.net/">&lt;strong>Real Favicon Generator&lt;/strong>&lt;/a>,点击 &lt;kbd>Select your Favicon image&lt;/kbd> 按钮上传您的图像文件。&lt;/p></description></item><item><title>开始使用</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</link><pubDate>Fri, 09 Aug 2019 20:55:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</guid><description>&lt;blockquote class="prompt-warning">&lt;p>&lt;strong>NOTE:&lt;/strong> 该教程还没有完成从 Jekyll 版本的迁移,请谨慎参考。&lt;/p>&lt;/blockquote>
&lt;h2 id="创建站点仓库" id=创建站点仓库>
&lt;span class="me-2">创建站点仓库&lt;/span>
&lt;a href="#%e5%88%9b%e5%bb%ba%e7%ab%99%e7%82%b9%e4%bb%93%e5%ba%93" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建站点仓库时,根据您的需求有两种选择:&lt;/p>
&lt;h3 id="选项1-使用起始模板推荐" id=选项1-使用起始模板推荐>
&lt;span class="me-2">选项1. 使用起始模板(推荐)&lt;/span>
&lt;a href="#%e9%80%89%e9%a1%b91-%e4%bd%bf%e7%94%a8%e8%b5%b7%e5%a7%8b%e6%a8%a1%e6%9d%bf%e6%8e%a8%e8%8d%90" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h3>&lt;p>这种方法简化了升级过程,隔离了不必要的文件,非常适合那些想专注于写作而不需要太多配置的用户。&lt;/p></description></item><item><title>撰写新文章</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</link><pubDate>Thu, 08 Aug 2019 14:10:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</guid><description>&lt;p>本教程将指导您如何在 &lt;em>Chirpy&lt;/em> 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。&lt;/p>
&lt;h2 id="命名和路径" id=命名和路径>
&lt;span class="me-2">命名和路径&lt;/span>
&lt;a href="#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建一个新文件,使用 &lt;code>hugo new content/post/YYYY-MM-DD-TITLE.md&lt;/code>。您可以根据自己的喜好更改路径,但请注意,所有文章都应该放在根目录的 &lt;code class="filepath">content/post&lt;/code> 中。&lt;/p></description></item></channel></rss>

View File

@ -0,0 +1,49 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%BC%94%E7%A4%BA/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="演示"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="演示"><meta itemprop=name content="演示"><meta itemprop=datePublished content="2019-08-08T11:33:00+08:00"><meta itemprop=dateModified content="2019-08-08T11:33:00+08:00"><title>演示 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/misc.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span><a href=https://geekifan.github.io/chirpy-starter/zh-cn/categories/>分类</a></span>
<span>演示</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><div id=page-category><h1 class=ps-lg-2><i class="far fa-folder-open fa-fw text-muted"></i>
演示
<span class="lead text-muted ps-2">1</span></h1><ul class="content ps-0"><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a>
<span class="dash flex-grow-1"></span>
<span class="text-muted small text-nowrap">Aug 8, 2019</span></li></ul></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>演示 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%BC%94%E7%A4%BA/</link><description>Recent content in 演示 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Thu, 08 Aug 2019 11:33:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%BC%94%E7%A4%BA/index.xml" rel="self" type="application/rss+xml"/><item><title>文本和排版</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</link><pubDate>Thu, 08 Aug 2019 11:33:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</guid><description>&lt;h2 id="标题" id=标题>
&lt;span class="me-2">标题&lt;/span>
&lt;a href="#%e6%a0%87%e9%a2%98" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;!-- markdownlint-capture -->
&lt;!-- markdownlint-disable -->
&lt;h1 id="h1--标题" class=mt-4 mb-0 data-toc-skip=true id=h1--标题>
H1 — 标题
&lt;/h1>&lt;h2 id="h2--标题" class=mt-4 mb-0 data-toc-skip=true id=h2--标题>
H2 — 标题
&lt;/h2>&lt;h3 id="h3--标题" class=mt-4 mb-0 data-toc-skip=true id=h3--标题>
H3 — 标题
&lt;/h3>&lt;h4 id="h4--标题" class=mt-4 data-toc-skip=true id=h4--标题>
H4 — 标题
&lt;/h4>&lt;!-- markdownlint-restore -->
&lt;h2 id="段落" id=段落>
&lt;span class="me-2">段落&lt;/span>
&lt;a href="#%e6%ae%b5%e8%90%bd" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>这是一个段落示例。在这里,我们可以看到段落是如何在 Markdown 中呈现的。段落是由一个或多个连续的文本行组成,它们之间用一个或多个空行分隔。正常的段落不应该用空格或制表符缩进。这样可以保持文档的整洁和一致性。文本排版是网页设计和内容创作中的重要元素,良好的排版可以提高可读性和美观度。&lt;/p></description></item></channel></rss>

57
zh-cn/index.html Normal file
View File

@ -0,0 +1,57 @@
<!doctype html><head><meta name=generator content="Hugo 0.147.7"><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="Chirpy"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="Chirpy"><meta itemprop=name content="Chirpy"><meta itemprop=datePublished content="2023-04-20T00:00:00+00:00"><meta itemprop=dateModified content="2023-04-20T00:00:00+00:00"><title>Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/home.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class="nav-item active"><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span>首页</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><div id=post-list class="flex-grow-1 px-xl-1"><article class="card-wrapper card"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/ class="post-preview row g-0 flex-md-row-reverse"><div class=col-md-12><div class="card-body d-flex flex-column"><h1 class="card-title my-2 mt-md-0">开始使用</h1><div class="card-text content mt-0 mb-3"><p>通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。</p></div><div class="post-meta flex-grow-1 d-flex align-items-end"><div class=me-auto><i class="far fa-calendar fa-fw me-1"></i>
<time data-ts=1565355300 data-df=YYYY/MM/DD>%Y/%m/%d
</time><i class="far fa-folder-open fa-fw me-1"></i>
<span class=categories>博客, 教程</span></div><div class="pin ms-1"><i class="fas fa-thumbtack fa-fw"></i>
<span></span></div></div></div></div></a></article><article class="card-wrapper card"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/ class="post-preview row g-0 flex-md-row-reverse"><div class=col-md-5><img src=/chirpy-starter/post/2019-08-08-text-and-typography/devices-mockup.png alt="Chirpy 主题在多个设备上的响应式渲染。" lqip=data:image/webp;base64,UklGRpoAAABXRUJQVlA4WAoAAAAQAAAADwAABwAAQUxQSDIAAAARL0AmbZurmr57yyIiqE8oiG0bejIYEQTgqiDA9vqnsUSI6H+oAERp2HZ65qP/VIAWAFZQOCBCAAAA8AEAnQEqEAAIAAVAfCWkAALp8sF8rgRgAP7o9FDvMCkMde9PK7euH5M1m6VWoDXf2FkP3BqV0ZYbO6NA/VFIAAAA></div><div class=col-md-7><div class="card-body d-flex flex-column"><h1 class="card-title my-2 mt-md-0">文本和排版</h1><div class="card-text content mt-0 mb-3"><p>文本、排版、数学公式、图表、流程图、图片、视频等示例。</p></div><div class="post-meta flex-grow-1 d-flex align-items-end"><div class=me-auto><i class="far fa-calendar fa-fw me-1"></i>
<time data-ts=1565235180 data-df=YYYY/MM/DD>%Y/%m/%d
</time><i class="far fa-folder-open fa-fw me-1"></i>
<span class=categories>博客, 演示</span></div><div class="pin ms-1"><i class="fas fa-thumbtack fa-fw"></i>
<span></span></div></div></div></div></a></article><article class="card-wrapper card"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/ class="post-preview row g-0 flex-md-row-reverse"><div class=col-md-12><div class="card-body d-flex flex-column"><h1 class="card-title my-2 mt-md-0">自定义网站图标</h1><div class="card-text content mt-0 mb-3"><p>通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。</p></div><div class="post-meta flex-grow-1 d-flex align-items-end"><div class=me-auto><i class="far fa-calendar fa-fw me-1"></i>
<time data-ts=1565454840 data-df=YYYY/MM/DD>%Y/%m/%d
</time><i class="far fa-folder-open fa-fw me-1"></i>
<span class=categories>博客, 教程</span></div></div></div></div></a></article><article class="card-wrapper card"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/ class="post-preview row g-0 flex-md-row-reverse"><div class=col-md-12><div class="card-body d-flex flex-column"><h1 class="card-title my-2 mt-md-0">撰写新文章</h1><div class="card-text content mt-0 mb-3"><p>本教程将指导您如何在 Chirpy 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。
命名和路径 创建一个新文件,使用 hugo new content/post/YYYY-MM-DD-TITLE.md。您可以根据自己的喜好更改路径但请注意所有文章都应该放在根目录的 content/post 中。</p></div><div class="post-meta flex-grow-1 d-flex align-items-end"><div class=me-auto><i class="far fa-calendar fa-fw me-1"></i>
<time data-ts=1565244600 data-df=YYYY/MM/DD>%Y/%m/%d
</time><i class="far fa-folder-open fa-fw me-1"></i>
<span class=categories>博客, 教程</span></div></div></div></div></a></article></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

1
zh-cn/index.json Normal file

File diff suppressed because one or more lines are too long

46
zh-cn/index.xml Normal file
View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/</link><description>Recent content on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Thu, 20 Apr 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/index.xml" rel="self" type="application/rss+xml"/><item><title>关于</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/about/</link><pubDate>Thu, 20 Apr 2023 00:00:00 +0000</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/about/</guid><description>&lt;p>&lt;a href="https://github.com/cotes2020/jekyll-theme-chirpy">Chirpy&lt;/a> 是一个基于 &lt;a href="https://jekyllrb.com/">Jekyll&lt;/a> 的博客主题。由于 Jekyll 的设计限制它本身不支持国际化i18n需要依赖第三方插件来实现 i18n 功能。为了让 Chirpy 在不依赖第三方插件的情况下支持 i18n&lt;a href="https://github.com/geekifan/hugo-theme-chirpy">hugo-theme-chirpy&lt;/a> 项目将 Chirpy 主题迁移至 &lt;a href="https://gohugo.io/">Hugo&lt;/a>并进行了最小化的适配。Chirpy 的所有功能在 hugo-theme-chirpy 中均可使用(不过在 Hugo 框架下,部分功能的操作方式可能有所不同)。&lt;/p></description></item><item><title>自定义网站图标</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</link><pubDate>Sun, 11 Aug 2019 00:34:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</guid><description>&lt;p>&lt;a href="https://github.com/cotes2020/jekyll-theme-chirpy/">&lt;strong>Chirpy&lt;/strong>&lt;/a> 的&lt;a href="https://www.favicon-generator.org/about/">网站图标&lt;/a>放置在 &lt;code class="filepath">assets/img/favicons/&lt;/code> 目录中。您可能想用自己的图标替换它们。以下部分将指导您创建和替换默认网站图标。&lt;/p>
&lt;h2 id="生成网站图标" id=生成网站图标>
&lt;span class="me-2">生成网站图标&lt;/span>
&lt;a href="#%e7%94%9f%e6%88%90%e7%bd%91%e7%ab%99%e5%9b%be%e6%a0%87" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>准备一张尺寸为 512x512 或更大的正方形图像PNG、JPG 或 SVG然后前往在线工具 &lt;a href="https://realfavicongenerator.net/">&lt;strong>Real Favicon Generator&lt;/strong>&lt;/a>,点击 &lt;kbd>Select your Favicon image&lt;/kbd> 按钮上传您的图像文件。&lt;/p></description></item><item><title>开始使用</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</link><pubDate>Fri, 09 Aug 2019 20:55:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</guid><description>&lt;blockquote class="prompt-warning">&lt;p>&lt;strong>NOTE:&lt;/strong> 该教程还没有完成从 Jekyll 版本的迁移,请谨慎参考。&lt;/p>&lt;/blockquote>
&lt;h2 id="创建站点仓库" id=创建站点仓库>
&lt;span class="me-2">创建站点仓库&lt;/span>
&lt;a href="#%e5%88%9b%e5%bb%ba%e7%ab%99%e7%82%b9%e4%bb%93%e5%ba%93" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建站点仓库时,根据您的需求有两种选择:&lt;/p>
&lt;h3 id="选项1-使用起始模板推荐" id=选项1-使用起始模板推荐>
&lt;span class="me-2">选项1. 使用起始模板(推荐)&lt;/span>
&lt;a href="#%e9%80%89%e9%a1%b91-%e4%bd%bf%e7%94%a8%e8%b5%b7%e5%a7%8b%e6%a8%a1%e6%9d%bf%e6%8e%a8%e8%8d%90" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h3>&lt;p>这种方法简化了升级过程,隔离了不必要的文件,非常适合那些想专注于写作而不需要太多配置的用户。&lt;/p></description></item><item><title>撰写新文章</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</link><pubDate>Thu, 08 Aug 2019 14:10:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</guid><description>&lt;p>本教程将指导您如何在 &lt;em>Chirpy&lt;/em> 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。&lt;/p>
&lt;h2 id="命名和路径" id=命名和路径>
&lt;span class="me-2">命名和路径&lt;/span>
&lt;a href="#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建一个新文件,使用 &lt;code>hugo new content/post/YYYY-MM-DD-TITLE.md&lt;/code>。您可以根据自己的喜好更改路径,但请注意,所有文章都应该放在根目录的 &lt;code class="filepath">content/post&lt;/code> 中。&lt;/p></description></item><item><title>文本和排版</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</link><pubDate>Thu, 08 Aug 2019 11:33:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</guid><description>&lt;h2 id="标题" id=标题>
&lt;span class="me-2">标题&lt;/span>
&lt;a href="#%e6%a0%87%e9%a2%98" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;!-- markdownlint-capture -->
&lt;!-- markdownlint-disable -->
&lt;h1 id="h1--标题" class=mt-4 mb-0 data-toc-skip=true id=h1--标题>
H1 — 标题
&lt;/h1>&lt;h2 id="h2--标题" class=mt-4 mb-0 data-toc-skip=true id=h2--标题>
H2 — 标题
&lt;/h2>&lt;h3 id="h3--标题" class=mt-4 mb-0 data-toc-skip=true id=h3--标题>
H3 — 标题
&lt;/h3>&lt;h4 id="h4--标题" class=mt-4 data-toc-skip=true id=h4--标题>
H4 — 标题
&lt;/h4>&lt;!-- markdownlint-restore -->
&lt;h2 id="段落" id=段落>
&lt;span class="me-2">段落&lt;/span>
&lt;a href="#%e6%ae%b5%e8%90%bd" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>这是一个段落示例。在这里,我们可以看到段落是如何在 Markdown 中呈现的。段落是由一个或多个连续的文本行组成,它们之间用一个或多个空行分隔。正常的段落不应该用空格或制表符缩进。这样可以保持文档的整洁和一致性。文本排版是网页设计和内容创作中的重要元素,良好的排版可以提高可读性和美观度。&lt;/p></description></item><item><title>归档</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/archives/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/archives/</guid><description/></item></channel></rss>

1
zh-cn/page/1/index.html Normal file
View File

@ -0,0 +1 @@
<!doctype html><html lang=zh-CN><head><title>https://geekifan.github.io/chirpy-starter/zh-cn/</title><link rel=canonical href=https://geekifan.github.io/chirpy-starter/zh-cn/><meta name=robots content="noindex"><meta charset=utf-8><meta http-equiv=refresh content="0; url=https://geekifan.github.io/chirpy-starter/zh-cn/"></head></html>

View File

@ -0,0 +1,104 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="文本和排版"><meta property="og:description" content="文本、排版、数学公式、图表、流程图、图片、视频等示例。"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="article"><meta property="article:section" content="post"><meta property="article:published_time" content="2019-08-08T11:33:00+08:00"><meta property="article:modified_time" content="2019-08-08T11:33:00+08:00"><meta property="article:tag" content="排版"><meta name=twitter:card content="summary"><meta name=twitter:title content="文本和排版"><meta name=twitter:description content="文本、排版、数学公式、图表、流程图、图片、视频等示例。"><meta itemprop=name content="文本和排版"><meta itemprop=description content="文本、排版、数学公式、图表、流程图、图片、视频等示例。"><meta itemprop=datePublished content="2019-08-08T11:33:00+08:00"><meta itemprop=dateModified content="2019-08-08T11:33:00+08:00"><meta itemprop=wordCount content="940"><meta itemprop=keywords content="排版"><title>文本和排版 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/js/glightbox.min.js></script><script src=https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script src=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.js></script><script defer src=/chirpy-starter/js/post.js></script><script src=/chirpy-starter/js/mathjax.min.d5a771863485b941b4157c0de2d0426f86b284e264501da1d8d9b2d5973488e0.js defer></script><script async src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script><script id=MathJax-script src=https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml.js defer></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>文本和排版</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title>文本和排版</div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><article class=px-1 data-toc=true><header><h1 data-toc-skip>文本和排版</h1><p class="post-desc fw-light mb-4">文本、排版、数学公式、图表、流程图、图片、视频等示例。</p><div class="post-meta text-muted"><span>发表于
<time data-ts=1565235180 data-df=YYYY/MM/DD data-bs-toggle=tooltip data-bs-placement=bottom>%Y/%m/%d</time></span><div class="mt-3 mb-3"><img src=/chirpy-starter/post/2019-08-08-text-and-typography/devices-mockup.png class=preview-img alt="Chirpy 主题在多个设备上的响应式渲染。" w=1200 h=630 lqip=data:image/webp;base64,UklGRpoAAABXRUJQVlA4WAoAAAAQAAAADwAABwAAQUxQSDIAAAARL0AmbZurmr57yyIiqE8oiG0bejIYEQTgqiDA9vqnsUSI6H+oAERp2HZ65qP/VIAWAFZQOCBCAAAA8AEAnQEqEAAIAAVAfCWkAALp8sF8rgRgAP7o9FDvMCkMde9PK7euH5M1m6VWoDXf2FkP3BqV0ZYbO6NA/VFIAAAA><figcaption class="text-center pt-2 pb-2">Chirpy 主题在多个设备上的响应式渲染。</figcaption></div><div class="d-flex justify-content-between"><span>作者
<em><a href=https://github.com/geekifan>一凡</a></em></span><div><span class=readtime data-bs-toggle=tooltip data-bs-placement=bottom title="1173 字"><em>6 分钟</em> 阅读</span></div></div></div></header><div id=toc-bar class="d-flex align-items-center justify-content-between invisible"><span class="label text-truncate">文本和排版</span>
<button type=button class="toc-trigger btn me-1">
<i class="fa-solid fa-list-ul fa-fw"></i></button></div><button id=toc-solo-trigger type=button class="toc-trigger btn btn-outline-secondary btn-sm">
<span class="label ps-2 pe-1">文章内容</span>
<i class="fa-solid fa-angle-right fa-fw"></i>
</button>
<dialog id=toc-popup class=p-0><div class="header d-flex flex-row align-items-center justify-content-between"><div class="label text-truncate py-2 ms-4">文本和排版</div><button id=toc-popup-close type=button class="btn mx-1 my-1 opacity-75">
<i class="fas fa-close"></i></button></div><div id=toc-popup-content class="px-4 py-3 pb-4"><nav id=TableOfContents><ul><li><a href=#标题>标题</a></li></ul><ul><li><a href=#h2--标题>H2 — 标题</a><ul><li><a href=#h3--标题>H3 — 标题</a></li></ul></li><li><a href=#段落>段落</a></li><li><a href=#列表>列表</a><ul><li><a href=#有序列表>有序列表</a></li><li><a href=#无序列表>无序列表</a></li><li><a href=#待办列表>待办列表</a></li><li><a href=#描述列表>描述列表</a></li></ul></li><li><a href=#引用块>引用块</a></li><li><a href=#提示框>提示框</a></li><li><a href=#表格>表格</a></li><li><a href=#链接>链接</a></li><li><a href=#脚注>脚注</a></li><li><a href=#内联代码>内联代码</a></li><li><a href=#文件路径>文件路径</a></li><li><a href=#代码块>代码块</a><ul><li><a href=#通用>通用</a></li><li><a href=#特定语言>特定语言</a></li><li><a href=#特定文件名>特定文件名</a></li></ul></li><li><a href=#数学公式>数学公式</a></li><li><a href=#图片>图片</a><ul><li><a href=#默认带标题>默认(带标题)</a></li><li><a href=#左对齐>左对齐</a></li><li><a href=#向左浮动>向左浮动</a></li><li><a href=#向右浮动>向右浮动</a></li><li><a href=#暗亮模式--阴影>暗/亮模式 & 阴影</a></li></ul></li><li><a href=#视频>视频</a></li><li><a href=#反向脚注>反向脚注</a></li></ul></nav></div></dialog><div class=content><h2 id=标题 id=标题><span class=me-2>标题</span>
<a href=#%e6%a0%87%e9%a2%98 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><h1 id=h1--标题 class=mt-4 mb-0 data-toc-skip=true id=h1--标题>H1 — 标题</h1><h2 id=h2--标题 class=mt-4 mb-0 data-toc-skip=true id=h2--标题>H2 — 标题</h2><h3 id=h3--标题 class=mt-4 mb-0 data-toc-skip=true id=h3--标题>H3 — 标题</h3><h4 id=h4--标题 class=mt-4 data-toc-skip=true id=h4--标题>H4 — 标题</h4><h2 id=段落 id=段落><span class=me-2>段落</span>
<a href=#%e6%ae%b5%e8%90%bd class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>这是一个段落示例。在这里,我们可以看到段落是如何在 Markdown 中呈现的。段落是由一个或多个连续的文本行组成,它们之间用一个或多个空行分隔。正常的段落不应该用空格或制表符缩进。这样可以保持文档的整洁和一致性。文本排版是网页设计和内容创作中的重要元素,良好的排版可以提高可读性和美观度。</p><h2 id=列表 id=列表><span class=me-2>列表</span>
<a href=#%e5%88%97%e8%a1%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><h3 id=有序列表 id=有序列表><span class=me-2>有序列表</span>
<a href=#%e6%9c%89%e5%ba%8f%e5%88%97%e8%a1%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><ol><li>第一点</li><li>第二点</li><li>第三点</li></ol><h3 id=无序列表 id=无序列表><span class=me-2>无序列表</span>
<a href=#%e6%97%a0%e5%ba%8f%e5%88%97%e8%a1%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><ul><li>章节<ul><li><ul><li>段落</li></ul></li></ul></li></ul><h3 id=待办列表 id=待办列表><span class=me-2>待办列表</span>
<a href=#%e5%be%85%e5%8a%9e%e5%88%97%e8%a1%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><ul class=task-list><li class=task-list-item><i class="far fa-circle fa-fw"></i> 任务<ul class=task-list><li class=task-list-item><i class="fas fa-check-circle fa-fw checked"></i> 步骤 1</li><li class=task-list-item><i class="fas fa-check-circle fa-fw checked"></i> 步骤 2</li><li class=task-list-item><i class="far fa-circle fa-fw"></i> 步骤 3</li></ul></li></ul><h3 id=描述列表 id=描述列表><span class=me-2>描述列表</span>
<a href=#%e6%8f%8f%e8%bf%b0%e5%88%97%e8%a1%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><dl><dt>太阳</dt><dd>地球绕其运行的恒星</dd><dt>月亮</dt><dd>地球的天然卫星,通过反射太阳光可见</dd></dl><h2 id=引用块 id=引用块><span class=me-2>引用块</span>
<a href=#%e5%bc%95%e7%94%a8%e5%9d%97 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><blockquote><p>这行显示 <em>引用块</em></p></blockquote><h2 id=提示框 id=提示框><span class=me-2>提示框</span>
<a href=#%e6%8f%90%e7%a4%ba%e6%a1%86 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><blockquote class=prompt-tip><p>这是一个显示 <code>tip</code> 类型提示的例子。</p></blockquote><blockquote class=prompt-info><p>这是一个显示 <code>info</code> 类型提示的例子。</p></blockquote><blockquote class=prompt-warning><p>这是一个显示 <code>warning</code> 类型提示的例子。</p></blockquote><blockquote class=prompt-danger><p>这是一个显示 <code>danger</code> 类型提示的例子。</p></blockquote><h2 id=表格 id=表格><span class=me-2>表格</span>
<a href=#%e8%a1%a8%e6%a0%bc class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><div class=table-wrapper><table><thead><tr><th style=text-align:left>公司</th><th style=text-align:left>联系人</th><th style=text-align:right>国家</th></tr></thead><tbody><tr><td style=text-align:left>Alfreds Futterkiste</td><td style=text-align:left>Maria Anders</td><td style=text-align:right>德国</td></tr><tr><td style=text-align:left>Island Trading</td><td style=text-align:left>Helen Bennett</td><td style=text-align:right>英国</td></tr><tr><td style=text-align:left>Magazzini Alimentari Riuniti</td><td style=text-align:left>Giovanni Rovelli</td><td style=text-align:right>意大利</td></tr></tbody></table></div><h2 id=链接 id=链接><span class=me-2>链接</span>
<a href=#%e9%93%be%e6%8e%a5 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p><a href=http://127.0.0.1:4000>http://127.0.0.1:4000</a></p><h2 id=脚注 id=脚注><span class=me-2>脚注</span>
<a href=#%e8%84%9a%e6%b3%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>点击钩子将定位到脚注 <sup id=fnref:1><a href=#fn:1 class=footnote-ref role=doc-noteref>1</a></sup>,这里是另一个脚注 <sup id=fnref:2><a href=#fn:2 class=footnote-ref role=doc-noteref>2</a></sup></p><h2 id=内联代码 id=内联代码><span class=me-2>内联代码</span>
<a href=#%e5%86%85%e8%81%94%e4%bb%a3%e7%a0%81 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>这是 <code>内联代码</code> 的一个例子。</p><h2 id=文件路径 id=文件路径><span class=me-2>文件路径</span>
<a href=#%e6%96%87%e4%bb%b6%e8%b7%af%e5%be%84 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>这里是 <code class=filepath>/path/to/the/file.extend</code></p><h2 id=代码块 id=代码块><span class=me-2>代码块</span>
<a href=#%e4%bb%a3%e7%a0%81%e5%9d%97 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><h3 id=通用 id=通用><span class=me-2>通用</span>
<a href=#%e9%80%9a%e7%94%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><div class=code-block><div class=code-header><span data-label-text=Text><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-text data-lang=text><span class=line><span class=cl>这是一个通用代码片段,没有语法高亮和行号。</span></span></code></pre></td></tr></table></div></div></div><h3 id=特定语言 id=特定语言><span class=me-2>特定语言</span>
<a href=#%e7%89%b9%e5%ae%9a%e8%af%ad%e8%a8%80 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><div class=code-block><div class=code-header><span data-label-text=Shell><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span><span class=lnt>4
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-bash data-lang=bash><span class=line><span class=cl><span class=k>if</span> <span class=o>[</span> <span class=nv>$?</span> -ne <span class=m>0</span> <span class=o>]</span><span class=p>;</span> <span class=k>then</span>
</span></span><span class=line><span class=cl> <span class=nb>echo</span> <span class=s2>&#34;命令执行不成功。&#34;</span><span class=p>;</span>
</span></span><span class=line><span class=cl> <span class=c1>#执行必要操作 / 退出</span>
</span></span><span class=line><span class=cl><span class=k>fi</span><span class=p>;</span></span></span></code></pre></td></tr></table></div></div></div><h3 id=特定文件名 id=特定文件名><span class=me-2>特定文件名</span>
<a href=#%e7%89%b9%e5%ae%9a%e6%96%87%e4%bb%b6%e5%90%8d class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><div class=code-block><div class=code-header><span data-label-text=_sass/jekyll-theme-chirpy.scss><i class="far fa-file-code fa-fw"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight file=_sass/jekyll-theme-chirpy.scss><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-sass data-lang=sass><span class=line><span class=cl><span class=k>@import</span>
</span></span><span class=line><span class=cl> <span class=s2>&#34;colors/light-typography&#34;</span><span class=o>,</span>
</span></span><span class=line><span class=cl> <span class=s2>&#34;colors/dark-typography&#34;</span><span class=o>;</span></span></span></code></pre></td></tr></table></div></div></div><h2 id=数学公式 id=数学公式><span class=me-2>数学公式</span>
<a href=#%e6%95%b0%e5%ad%a6%e5%85%ac%e5%bc%8f class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>数学公式由 <a href=https://www.mathjax.org/><strong>MathJax</strong></a> 提供支持:</p><p>$$
\begin{equation}
\sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6}
\label{eq:series}
\end{equation}
$$</p><p>我们可以引用公式如 \eqref{eq:series}。</p><p>当 $a \ne 0$ 时,$ax^2 + bx + c = 0$ 有两个解,它们是</p><p>$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$</p><h2 id=图片 id=图片><span class=me-2>图片</span>
<a href=#%e5%9b%be%e7%89%87 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><h3 id=默认带标题 id=默认带标题><span class=me-2>默认(带标题)</span>
<a href=#%e9%bb%98%e8%ae%a4%e5%b8%a6%e6%a0%87%e9%a2%98 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><a href=/chirpy-starter/post/2019-08-08-text-and-typography/mockup.png class="popup img-link"><img src=/chirpy-starter/post/2019-08-08-text-and-typography/mockup.png alt=桌面视图 caption=全屏宽度和居中对齐 height=589 width=972>
</a><em>全屏宽度和居中对齐</em><h3 id=左对齐 id=左对齐><span class=me-2>左对齐</span>
<a href=#%e5%b7%a6%e5%af%b9%e9%bd%90 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><a href=/chirpy-starter/post/2019-08-08-text-and-typography/mockup.png class="popup img-link w-75 normal"><img src=/chirpy-starter/post/2019-08-08-text-and-typography/mockup.png alt=桌面视图 height=589 width=972></a><h3 id=向左浮动 id=向左浮动><span class=me-2>向左浮动</span>
<a href=#%e5%90%91%e5%b7%a6%e6%b5%ae%e5%8a%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><a href=/chirpy-starter/post/2019-08-08-text-and-typography/mockup.png class="popup img-link w-50 left"><img src=/chirpy-starter/post/2019-08-08-text-and-typography/mockup.png alt=桌面视图 height=589 width=972></a><p>这是一段文本示例,用于演示图片向左浮动时的效果。在这种情况下,文本会环绕在图片的右侧。这对于创建更具视觉吸引力的布局很有用,特别是当您想要文本和图片并排显示时。浮动元素是网页设计中常用的技术,可以有效利用空间并增强内容的可读性。</p><h3 id=向右浮动 id=向右浮动><span class=me-2>向右浮动</span>
<a href=#%e5%90%91%e5%8f%b3%e6%b5%ae%e5%8a%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><a href=/chirpy-starter/post/2019-08-08-text-and-typography/mockup.png class="popup img-link w-50 right"><img src=/chirpy-starter/post/2019-08-08-text-and-typography/mockup.png alt=桌面视图 height=589 width=972></a><p>这是一段文本示例,用于演示图片向右浮动时的效果。在这种情况下,文本会环绕在图片的左侧。这种布局技术可以创建更加动态和有趣的页面设计。合理使用浮动可以使您的内容更加吸引人,并引导读者的视线在页面上流畅移动。记住,浮动元素需要适当的空间才能发挥最佳效果。</p><h3 id=暗亮模式--阴影 id=暗亮模式--阴影><span class=me-2>暗/亮模式 & 阴影</span>
<a href=#%e6%9a%97%e4%ba%ae%e6%a8%a1%e5%bc%8f--%e9%98%b4%e5%bd%b1 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>下面的图片将根据主题偏好切换暗/亮模式,注意它有阴影效果。</p><a href=/chirpy-starter/post/2019-08-08-text-and-typography/devtools-light.png class="popup img-link light w-75 shadow rounded-10"><img src=/chirpy-starter/post/2019-08-08-text-and-typography/devtools-light.png alt=仅亮模式 h=668 w=1212>
</a><a href=/chirpy-starter/post/2019-08-08-text-and-typography/devtools-dark.png class="popup img-link dark w-75 shadow rounded-10"><img src=/chirpy-starter/post/2019-08-08-text-and-typography/devtools-dark.png alt=仅暗模式 h=668 w=1212></a><h2 id=视频 id=视频><span class=me-2>视频</span>
<a href=#%e8%a7%86%e9%a2%91 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><iframe class=embed-video loading=lazy src=https://www.youtube.com/embed/Balreaj8Yqs title="YouTube video player" frameborder=0 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><h2 id=反向脚注 id=反向脚注><span class=me-2>反向脚注</span>
<a href=#%e5%8f%8d%e5%90%91%e8%84%9a%e6%b3%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><div class=footnotes role=doc-endnotes><hr><ol><li id=fn:1><p>脚注源&#160;<a href=#fnref:1 class=footnote-backref role=doc-backlink>&#8617;&#xfe0e;</a></p></li><li id=fn:2><p>第二个脚注源&#160;<a href=#fnref:2 class=footnote-backref role=doc-backlink>&#8617;&#xfe0e;</a></p></li></ol></div></div><div class="post-tail-wrapper text-muted"><div class="post-meta mb-3"><i class="far fa-folder-open fa-fw me-1"></i>
<a href=/zh-cn/categories/%E5%8D%9A%E5%AE%A2/>博客</a>
,
<a href=/zh-cn/categories/%E5%8D%9A%E5%AE%A2/%E6%BC%94%E7%A4%BA/>演示</a></div><div class=post-tags><i class="fa fa-tags fa-fw me-1"></i>
<a href=/zh-cn/tags/%E6%8E%92%E7%89%88/ class="post-tag no-text-decoration">排版</a></div><div class="post-tail-bottom d-flex justify-content-between align-items-center mt-5 pb-2"><div class=license-wrapper>本文由作者按照 <a href=https://creativecommons.org/licenses/by/4.0/>CC BY 4.0</a> 进行授权</div></div></div></article></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div class="toc-border-cover z-3"></div><section id=toc-wrapper class="invisible position-sticky ps-0 pe-4 pb-4"><h2 class="panel-heading ps-3 pb-2 mb-0">文章内容</h2><nav id=toc></nav></section></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><aside id=related-posts aria-labelledby=related-label><h3 class=mb-4 id=related-label>相关文章</h3><nav class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4 mb-4"><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/ class="post-preview card h-100"><div class=card-body><time data-ts=1565244600 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">撰写新文章</h4><div class=text-muted><p>本教程将指导您如何在 Chirpy 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。 &amp;lt;span class=&amp;quot;me-2&amp;quot;&amp;gt;命名和路径&amp;lt;/span&amp;gt; &amp;lt;a href=&amp;quot;#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84&amp;quot; …</p></div></div></a></article><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/ class="post-preview card h-100"><div class=card-body><time data-ts=1565355300 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">开始使用</h4><div class=text-muted><p>通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。</p></div></div></a></article><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/ class="post-preview card h-100"><div class=card-body><time data-ts=1565454840 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">自定义网站图标</h4><div class=text-muted><p>通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。</p></div></div></a></article></nav></aside><nav class="post-navigation d-flex justify-content-between" aria-label="Post Navigation"><div class="btn btn-outline-primary disabled" aria-label=上一篇><p>-</p></div><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/ class="btn btn-outline-primary" aria-label=下一篇><p>撰写新文章</p></a></nav><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,313 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="撰写新文章"><meta property="og:description" content="本教程将指导您如何在 Chirpy 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。
命名和路径 创建一个新文件,使用 hugo new content/post/YYYY-MM-DD-TITLE.md。您可以根据自己的喜好更改路径但请注意所有文章都应该放在根目录的 content/post 中。"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="article"><meta property="article:section" content="post"><meta property="article:published_time" content="2019-08-08T14:10:00+08:00"><meta property="article:modified_time" content="2019-08-08T14:10:00+08:00"><meta property="article:tag" content="写作"><meta name=twitter:card content="summary"><meta name=twitter:title content="撰写新文章"><meta name=twitter:description content="本教程将指导您如何在 Chirpy 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。
命名和路径 创建一个新文件,使用 hugo new content/post/YYYY-MM-DD-TITLE.md。您可以根据自己的喜好更改路径但请注意所有文章都应该放在根目录的 content/post 中。"><meta itemprop=name content="撰写新文章"><meta itemprop=description content="本教程将指导您如何在 Chirpy 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。
命名和路径 创建一个新文件,使用 hugo new content/post/YYYY-MM-DD-TITLE.md。您可以根据自己的喜好更改路径但请注意所有文章都应该放在根目录的 content/post 中。"><meta itemprop=datePublished content="2019-08-08T14:10:00+08:00"><meta itemprop=dateModified content="2019-08-08T14:10:00+08:00"><meta itemprop=wordCount content="3713"><meta itemprop=keywords content="写作"><title>撰写新文章 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/js/glightbox.min.js></script><script src=https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script src=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.js></script><script defer src=/chirpy-starter/js/post.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>撰写新文章</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title>撰写新文章</div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><article class=px-1 data-toc=true><header><h1 data-toc-skip>撰写新文章</h1><div class="post-meta text-muted"><span>发表于
<time data-ts=1565244600 data-df=YYYY/MM/DD data-bs-toggle=tooltip data-bs-placement=bottom>%Y/%m/%d</time></span><div class="d-flex justify-content-between"><span>作者
<em><a href=https://github.com/geekifan>一凡</a></em></span><div><span class=readtime data-bs-toggle=tooltip data-bs-placement=bottom title="3007 字"><em>16 分钟</em> 阅读</span></div></div></div></header><div id=toc-bar class="d-flex align-items-center justify-content-between invisible"><span class="label text-truncate">撰写新文章</span>
<button type=button class="toc-trigger btn me-1">
<i class="fa-solid fa-list-ul fa-fw"></i></button></div><button id=toc-solo-trigger type=button class="toc-trigger btn btn-outline-secondary btn-sm">
<span class="label ps-2 pe-1">文章内容</span>
<i class="fa-solid fa-angle-right fa-fw"></i>
</button>
<dialog id=toc-popup class=p-0><div class="header d-flex flex-row align-items-center justify-content-between"><div class="label text-truncate py-2 ms-4">撰写新文章</div><button id=toc-popup-close type=button class="btn mx-1 my-1 opacity-75">
<i class="fas fa-close"></i></button></div><div id=toc-popup-content class="px-4 py-3 pb-4"><nav id=TableOfContents><ul><li><a href=#命名和路径>命名和路径</a></li><li><a href=#前言>前言</a><ul><li><a href=#分类和标签>分类和标签</a></li><li><a href=#作者信息>作者信息</a></li><li><a href=#文章描述>文章描述</a></li></ul></li><li><a href=#目录>目录</a></li><li><a href=#评论>评论</a></li><li><a href=#媒体>媒体</a><ul><li><a href=#url前缀>URL前缀</a></li><li><a href=#图片>图片</a></li><li><a href=#视频>视频</a></li><li><a href=#音频>音频</a></li></ul></li><li><a href=#置顶文章>置顶文章</a></li><li><a href=#提示框>提示框</a></li><li><a href=#语法>语法</a><ul><li><a href=#内联代码>内联代码</a></li><li><a href=#文件路径高亮>文件路径高亮</a></li><li><a href=#代码块>代码块</a></li></ul></li><li><a href=#数学公式>数学公式</a></li><li><a href=#mermaid>Mermaid</a></li><li><a href=#了解更多>了解更多</a></li></ul></nav></div></dialog><div class=content><p>本教程将指导您如何在 <em>Chirpy</em> 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。</p><h2 id=命名和路径 id=命名和路径><span class=me-2>命名和路径</span>
<a href=#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>创建一个新文件,使用 <code>hugo new content/post/YYYY-MM-DD-TITLE.md</code>。您可以根据自己的喜好更改路径,但请注意,所有文章都应该放在根目录的 <code class=filepath>content/post</code> 中。</p><h2 id=前言 id=前言><span class=me-2>前言</span>
<a href=#%e5%89%8d%e8%a8%80 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>基本上,您需要在文章顶部填写<a href=https://gohugo.io/content-management/front-matter/>前言</a>,如下所示:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span><span class=lnt>4
</span><span class=lnt>5
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>title</span><span class=p>:</span><span class=w> </span><span class=l>标题</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>date</span><span class=p>:</span><span class=w> </span><span class=l>YYYY-MM-DD HH:MM:SS +/-TTTT</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>draft</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><p>您可以根据需要添加以下字段:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span><span class=lnt>4
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nt>categories</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=l>主分类, 子分类]</span><span class=w> </span><span class=c># 只支持两个分类</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>tags</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=l>标签] </span><span class=w> </span><span class=c># 标签名称应始终为小写</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>pin</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=w> </span><span class=c># 表示这篇文章将显示在首页顶部</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>description</span><span class=p>:</span><span class=w> </span><span class=l>文章描述</span><span class=w> </span><span class=c># 该文章的描述</span></span></span></code></pre></td></tr></table></div></div></div><blockquote class=prompt-tip><p>文章的_布局_默认已设置为<code>post</code>因此无需在前言块中添加变量_layout_。</p></blockquote><h3 id=分类和标签 id=分类和标签><span class=me-2>分类和标签</span>
<a href=#%e5%88%86%e7%b1%bb%e5%92%8c%e6%a0%87%e7%ad%be class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>每篇文章的 <code>categories</code> 设计为最多包含两个元素,而 <code>tags</code> 中的元素数量可以从零到无穷大。例如:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span><span class=lnt>4
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>categories</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=l>动物, 昆虫]</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>tags</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=l>蜜蜂]</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><h3 id=作者信息 id=作者信息><span class=me-2>作者信息</span>
<a href=#%e4%bd%9c%e8%80%85%e4%bf%a1%e6%81%af class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>文章的作者信息通常不需要在 <em>前言</em> 中填写,默认情况下,它们将从配置文件的 <code>social.name</code><code>social.links</code> 的第一个条目中获取。但您也可以按如下方式覆盖它:</p><p><code>data/authors.yaml</code> 中添加作者信息(如果您的网站没有此文件,请创建一个)。</p><div class=code-block><div class=code-header><span data-label-text=data/authors.yml><i class="far fa-file-code fa-fw"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight file=data/authors.yml><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nt>&lt;作者ID&gt;</span><span class=p>:</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>&lt;全名&gt;</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nt>url</span><span class=p>:</span><span class=w> </span><span class=l>&lt;作者的主页&gt;</span></span></span></code></pre></td></tr></table></div></div></div><p>然后使用 <code>author</code> 指定单个条目或 <code>authors</code> 指定多个条目:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span><span class=lnt>4
</span><span class=lnt>5
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>author</span><span class=p>:</span><span class=w> </span><span class=l>&lt;作者ID&gt; </span><span class=w> </span><span class=c># 单个条目</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=c># 或</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>authors</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=l>&lt;作者1ID&gt;, &lt;作者2ID&gt;] </span><span class=w> </span><span class=c># 多个条目</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><p>如果您不想在每篇文章的前言中指定作者,可以在 <code class=filepath>config/_default/params.toml</code> 中设置全局作者。</p><div class=code-block><div class=code-header><span data-label-text=config/_default/params.toml><i class="far fa-file-code fa-fw"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight file=config/_default/params.toml><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nt>author</span><span class=p>:</span><span class=w> </span><span class=l>&lt;作者ID&gt;</span></span></span></code></pre></td></tr></table></div></div></div><blockquote class=prompt-info><p>在每篇文章前言中指定的作者将覆盖全局作者设置。因此,如果任何文章的作者与全局作者不同,可以直接在其前言中添加作者。</p></blockquote><p>要在启用 i18n 的站点上支持多语言作者信息,您可以在 <code class=filepath>data/authors/</code> 下组织特定语言的 YAML 文件中的作者数据。例如:</p><ul><li>英语:<code class=filepath>data/authors/en.yaml</code></li><li>简体中文:<code class=filepath>data/authors/zh-CN.yaml</code></li></ul><p>只需用相应的作者详细信息填充每个文件:</p><div class=code-block><div class=code-header><span data-label-text=data/authors/en.yaml><i class="far fa-file-code fa-fw"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight file=data/authors/en.yaml><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nt>&lt;作者ID&gt;</span><span class=p>:</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>&lt;作者英文名&gt;</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nt>url</span><span class=p>:</span><span class=w> </span><span class=l>&lt;作者的主页&gt;</span></span></span></code></pre></td></tr></table></div></div></div><div class=code-block><div class=code-header><span data-label-text=data/authors/zh-CN.yaml><i class="far fa-file-code fa-fw"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight file=data/authors/zh-CN.yaml><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nt>&lt;作者ID&gt;</span><span class=p>:</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>&lt;作者中文名&gt;</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nt>url</span><span class=p>:</span><span class=w> </span><span class=l>&lt;作者的主页&gt;</span></span></span></code></pre></td></tr></table></div></div></div><h3 id=文章描述 id=文章描述><span class=me-2>文章描述</span>
<a href=#%e6%96%87%e7%ab%a0%e6%8f%8f%e8%bf%b0 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>默认情况下,文章的第一句话用于在首页的文章列表、<em>进一步阅读</em> 部分以及RSS源的XML中显示。如果您不想为文章显示自动生成的描述可以使用 <em>前言</em> 中的 <code>description</code> 字段自定义它,如下所示:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>description</span><span class=p>:</span><span class=w> </span><span class=l>文章的简短摘要。</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><p>此外,<code>description</code> 文本也将显示在文章页面的文章标题下方。</p><h2 id=目录 id=目录><span class=me-2>目录</span>
<a href=#%e7%9b%ae%e5%bd%95 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>默认情况下目录TOC显示在文章的右侧面板上。如果您想全局关闭它请转到 <code class=filepath>config/_default/params.toml</code> 并将变量 <code>toc</code> 的值设置为 <code>false</code>。如果您想为特定文章关闭TOC请将以下内容添加到文章的<a href=https://gohugo.io/content-management/front-matter/>前言</a>中:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>toc</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><h2 id=评论 id=评论><span class=me-2>评论</span>
<a href=#%e8%af%84%e8%ae%ba class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>评论的全局设置由 <code class=filepath>config/_default/params.toml</code> 文件中的 <code>comments.provider</code> 选项定义。一旦为此变量选择了评论系统,所有文章将启用评论。</p><p>如果您想关闭特定文章的评论,请将以下内容添加到文章的<strong>前言</strong>中:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>comments</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><h2 id=媒体 id=媒体><span class=me-2>媒体</span>
<a href=#%e5%aa%92%e4%bd%93 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p><em>Chirpy</em> 中,我们将图片、音频和视频称为媒体资源。</p><h3 id=url前缀 id=url前缀><span class=me-2>URL前缀</span>
<a href=#url%e5%89%8d%e7%bc%80 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><blockquote class=prompt-warning><p>URL 前缀功能正在开发中。</p></blockquote><p>有时我们必须为一篇文章中的多个资源定义重复的URL前缀这是一项可以通过设置两个参数来避免的繁琐任务。</p><ul><li><p>如果您使用CDN托管媒体文件可以在 <code class=filepath>config/_default/params.toml</code> 中指定 <code>cdn</code>。然后站点头像和文章的媒体资源的URL将以CDN域名为前缀。</p><div class=code-block><div class=code-header><span data-label-text=config/_default/params.toml><i class="far fa-file-code fa-fw"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight file=config/_default/params.toml><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nt>cdn</span><span class=p>:</span><span class=w> </span><span class=l>https://cdn.com</span></span></span></code></pre></td></tr></table></div></div></div></li><li><p>要为当前文章/页面范围指定资源路径前缀,请在文章的 <em>前言</em> 中设置 <code>media_subpath</code></p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>media_subpath</span><span class=p>:</span><span class=w> </span><span class=l>/path/to/media/</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div></li></ul><p>选项 <code>site.cdn</code><code>page.media_subpath</code> 可以单独使用或组合使用以灵活组合最终的资源URL<code>[site.cdn/][page.media_subpath/]file.ext</code></p><h3 id=图片 id=图片><span class=me-2>图片</span>
<a href=#%e5%9b%be%e7%89%87 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><h4 id=标题 id=标题><span class=me-2>标题</span>
<a href=#%e6%a0%87%e9%a2%98 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>在图片的下一行添加 HTML 属性 <code>caption</code>,然后它将作为标题显示在图片底部:</p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl>![<span class=nt>图片描述</span>](<span class=na>/path/to/image</span>)
</span></span><span class=line><span class=cl>{ caption=&#34;图片的标题&#34; }</span></span></code></pre></td></tr></table></div></div></div><h4 id=尺寸 id=尺寸><span class=me-2>尺寸</span>
<a href=#%e5%b0%ba%e5%af%b8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>为防止图片加载时页面内容布局发生偏移,我们应该为每张图片设置宽度和高度。</p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl>![<span class=nt>桌面视图</span>](<span class=na>/assets/img/sample/mockup.png</span>)
</span></span><span class=line><span class=cl>{ width=&#34;700&#34; height=&#34;400&#34; }</span></span></code></pre></td></tr></table></div></div></div><blockquote class=prompt-info><p>对于SVG您至少必须指定其 <em>宽度</em>,否则它不会被渲染。</p></blockquote><h4 id=位置 id=位置><span class=me-2>位置</span>
<a href=#%e4%bd%8d%e7%bd%ae class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>默认情况下,图片居中,但您可以使用 <code>normal</code><code>left</code><code>right</code> 类之一指定位置。</p><blockquote class=prompt-warning><p>一旦指定了位置,就不应添加图片标题。</p></blockquote><ul><li><p><strong>普通位置</strong></p><p>在下面的示例中,图片将左对齐:</p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl>![<span class=nt>桌面视图</span>](<span class=na>/assets/img/sample/mockup.png</span>)
</span></span><span class=line><span class=cl>{ .normal }</span></span></code></pre></td></tr></table></div></div></div></li><li><p><strong>向左浮动</strong></p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl>![<span class=nt>桌面视图</span>](<span class=na>/assets/img/sample/mockup.png</span>)
</span></span><span class=line><span class=cl>{ .left }</span></span></code></pre></td></tr></table></div></div></div></li><li><p><strong>向右浮动</strong></p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl>![<span class=nt>桌面视图</span>](<span class=na>/assets/img/sample/mockup.png</span>)
</span></span><span class=line><span class=cl>{ .right }</span></span></code></pre></td></tr></table></div></div></div></li></ul><h4 id=暗亮模式 id=暗亮模式><span class=me-2>暗/亮模式</span>
<a href=#%e6%9a%97%e4%ba%ae%e6%a8%a1%e5%bc%8f class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>您可以使图片跟随暗/亮模式的主题偏好。这需要您准备两张图片,一张用于暗模式,一张用于亮模式,然后为它们分配特定的类(<code>dark</code><code>light</code></p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span><span class=lnt>4
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl>![<span class=nt>仅亮模式</span>](<span class=na>/path/to/light-mode.png</span>)
</span></span><span class=line><span class=cl>{ .light }
</span></span><span class=line><span class=cl>![<span class=nt>仅暗模式</span>](<span class=na>/path/to/dark-mode.png</span>)
</span></span><span class=line><span class=cl>{ .dark }</span></span></code></pre></td></tr></table></div></div></div><h4 id=阴影 id=阴影><span class=me-2>阴影</span>
<a href=#%e9%98%b4%e5%bd%b1 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>程序窗口的截图可以考虑显示阴影效果:</p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl>![<span class=nt>桌面视图</span>](<span class=na>/assets/img/sample/mockup.png</span>)
</span></span><span class=line><span class=cl>{ .shadow }</span></span></code></pre></td></tr></table></div></div></div><h4 id=预览图片 id=预览图片><span class=me-2>预览图片</span>
<a href=#%e9%a2%84%e8%a7%88%e5%9b%be%e7%89%87 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>如果您想在文章顶部添加图片,请提供分辨率为 <code>1200 x 630</code> 的图片。请注意,如果图片的宽高比不符合 <code>1.91 : 1</code>,图片将被缩放和裁剪。</p><p>了解这些先决条件后,您可以开始设置图片的属性:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span><span class=lnt>4
</span><span class=lnt>5
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>image</span><span class=p>:</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nt>path</span><span class=p>:</span><span class=w> </span><span class=l>/path/to/image</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=nt>alt</span><span class=p>:</span><span class=w> </span><span class=l>图片替代文本</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><p>请注意,<a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/#url%e5%89%8d%e7%bc%80><code>media_subpath</code></a> 也可以传递给预览图片,也就是说,当它已经设置好时,属性 <code>path</code> 只需要图片文件名。</p><h3 id=视频 id=视频><span class=me-2>视频</span>
<a href=#%e8%a7%86%e9%a2%91 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><h4 id=社交媒体平台 id=社交媒体平台><span class=me-2>社交媒体平台</span>
<a href=#%e7%a4%be%e4%ba%a4%e5%aa%92%e4%bd%93%e5%b9%b3%e5%8f%b0 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>您可以使用以下语法嵌入来自社交媒体平台的视频:</p><div class=code-block><div class=code-header><span data-label-text=Hugo><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-fallback data-lang=fallback><span class=line><span class=cl>{{&lt; embed/{Platform}.html id=&#34;{ID}&#34; &gt;}}</span></span></code></pre></td></tr></table></div></div></div><p>其中 <code>Platform</code> 是平台名称的小写形式,<code>ID</code> 是视频 ID。</p><p>下表显示了如何从给定的视频 URL 中获取我们需要的两个参数,您还可以了解当前支持的视频平台。</p><div class=table-wrapper><table><thead><tr><th>视频 URL</th><th>平台</th><th style=text-align:left>ID</th></tr></thead><tbody><tr><td><a href="https://www.youtube.com/watch?v=H-B46URT4mg">https://www.<strong>youtube</strong>.com/watch?v=<strong>H-B46URT4mg</strong></a></td><td><code>youtube</code></td><td style=text-align:left><code>H-B46URT4mg</code></td></tr><tr><td><a href=https://www.twitch.tv/videos/1634779211>https://www.<strong>twitch</strong>.tv/videos/<strong>1634779211</strong></a></td><td><code>twitch</code></td><td style=text-align:left><code>1634779211</code></td></tr><tr><td><a href=https://www.bilibili.com/video/BV1Q44y1B7Wf>https://www.<strong>bilibili</strong>.com/video/<strong>BV1Q44y1B7Wf</strong></a></td><td><code>bilibili</code></td><td style=text-align:left><code>BV1Q44y1B7Wf</code></td></tr></tbody></table></div><h4 id=视频文件 id=视频文件><span class=me-2>视频文件</span>
<a href=#%e8%a7%86%e9%a2%91%e6%96%87%e4%bb%b6 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>如果您想直接嵌入视频文件,请使用以下语法:</p><div class=code-block><div class=code-header><span data-label-text=Hugo><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-fallback data-lang=fallback><span class=line><span class=cl>{{&lt; embed/video.html src=&#34;{URL}&#34; &gt;}}</span></span></code></pre></td></tr></table></div></div></div><p>其中 <code>URL</code> 是指向视频文件的 URL例如 <code>/path/to/sample/video.mp4</code></p><p>您还可以为嵌入的视频文件指定其他属性。以下是允许的属性的完整列表。</p><ul><li><code>poster='/path/to/poster.png'</code> — 视频的海报图片,在视频下载时显示</li><li><code>title='文本'</code> — 显示在视频下方的标题,外观与图片标题相同</li><li><code>autoplay=true</code> — 视频在准备好后自动开始播放</li><li><code>loop=true</code> — 在视频播放结束时自动回到起点</li><li><code>muted=true</code> — 音频最初将被静音</li><li><code>types</code> — 指定其他视频格式的扩展名,用 <code>|</code> 分隔。确保这些文件与您的主视频文件存在于同一目录中。</li></ul><p>考虑使用上述所有内容的示例:</p><div class=code-block><div class=code-header><span data-label-text=Liquid><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt> 1
</span><span class=lnt> 2
</span><span class=lnt> 3
</span><span class=lnt> 4
</span><span class=lnt> 5
</span><span class=lnt> 6
</span><span class=lnt> 7
</span><span class=lnt> 8
</span><span class=lnt> 9
</span><span class=lnt>10
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-fallback data-lang=fallback><span class=line><span class=cl>{{&lt;
</span></span><span class=line><span class=cl> embed/video.html
</span></span><span class=line><span class=cl> src=&#34;/path/to/video.mp4&#34;
</span></span><span class=line><span class=cl> types=&#34;ogg|mov&#34;
</span></span><span class=line><span class=cl> poster=&#34;poster.png&#34;
</span></span><span class=line><span class=cl> title=&#34;演示视频&#34;
</span></span><span class=line><span class=cl> autoplay=true
</span></span><span class=line><span class=cl> loop=true
</span></span><span class=line><span class=cl> muted=true
</span></span><span class=line><span class=cl>&gt;}}</span></span></code></pre></td></tr></table></div></div></div><h3 id=音频 id=音频><span class=me-2>音频</span>
<a href=#%e9%9f%b3%e9%a2%91 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>如果您想直接嵌入音频文件,请使用以下语法:</p><div class=code-block><div class=code-header><span data-label-text=Liquid><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-fallback data-lang=fallback><span class=line><span class=cl>{{&lt; embed/audio.html src=&#34;{URL}&#34; &gt;}}</span></span></code></pre></td></tr></table></div></div></div><p>其中 <code>URL</code> 是指向音频文件的 URL例如 <code>/path/to/audio.mp3</code></p><p>您还可以为嵌入的音频文件指定其他属性。以下是允许的属性的完整列表。</p><ul><li><code>title='文本'</code> — 显示在音频下方的标题,外观与图片标题相同</li><li><code>types</code> — 指定其他音频格式的扩展名,用 <code>|</code> 分隔。确保这些文件与您的主音频文件存在于同一目录中。</li></ul><p>考虑使用上述所有内容的示例:</p><div class=code-block><div class=code-header><span data-label-text=Hugo><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span><span class=lnt>4
</span><span class=lnt>5
</span><span class=lnt>6
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-fallback data-lang=fallback><span class=line><span class=cl>{{&lt;
</span></span><span class=line><span class=cl> include embed/audio.html
</span></span><span class=line><span class=cl> src=&#39;/path/to/audio.mp3&#39;
</span></span><span class=line><span class=cl> types=&#39;ogg|wav|aac&#39;
</span></span><span class=line><span class=cl> title=&#39;演示音频&#39;
</span></span><span class=line><span class=cl>&gt;}}</span></span></code></pre></td></tr></table></div></div></div><h2 id=置顶文章 id=置顶文章><span class=me-2>置顶文章</span>
<a href=#%e7%bd%ae%e9%a1%b6%e6%96%87%e7%ab%a0 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>您可以将一篇或多篇文章置顶到首页顶部,置顶的文章按照它们的发布日期以倒序排序。通过以下方式启用:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>pin</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><h2 id=提示框 id=提示框><span class=me-2>提示框</span>
<a href=#%e6%8f%90%e7%a4%ba%e6%a1%86 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>有几种类型的提示框:<code>tip</code><code>info</code><code>warning</code><code>danger</code>。它们可以通过向引用块添加类 <code>prompt-{type}</code> 来生成。例如,按如下方式定义 <code>info</code> 类型的提示框:</p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-md data-lang=md><span class=line><span class=cl><span class=k>&gt; </span><span class=ge>提示框示例文本。
</span></span></span><span class=line><span class=cl><span class=ge></span>{ .prompt-info }</span></span></code></pre></td></tr></table></div></div></div><h2 id=语法 id=语法><span class=me-2>语法</span>
<a href=#%e8%af%ad%e6%b3%95 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><h3 id=内联代码 id=内联代码><span class=me-2>内联代码</span>
<a href=#%e5%86%85%e8%81%94%e4%bb%a3%e7%a0%81 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-md data-lang=md><span class=line><span class=cl><span class=sb>`内联代码部分`</span></span></span></code></pre></td></tr></table></div></div></div><h3 id=文件路径高亮 id=文件路径高亮><span class=me-2>文件路径高亮</span>
<a href=#%e6%96%87%e4%bb%b6%e8%b7%af%e5%be%84%e9%ab%98%e4%ba%ae class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><div class=code-block><div class=code-header><span data-label-text=Hugo><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-fallback data-lang=fallback><span class=line><span class=cl>{{&lt; filepath src=&#34;/path/to/a/file.extend&#34; &gt;}}</span></span></code></pre></td></tr></table></div></div></div><h3 id=代码块 id=代码块><span class=me-2>代码块</span>
<a href=#%e4%bb%a3%e7%a0%81%e5%9d%97 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>Markdown 符号 <code>```</code> 可以轻松创建代码块,如下所示:</p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-md data-lang=md><span class=line><span class=cl><span class=s>```
</span></span></span><span class=line><span class=cl><span class=s></span>这是一个纯文本代码片段。
</span></span><span class=line><span class=cl><span class=s>```</span></span></span></code></pre></td></tr></table></div></div></div><h4 id=指定语言 id=指定语言><span class=me-2>指定语言</span>
<a href=#%e6%8c%87%e5%ae%9a%e8%af%ad%e8%a8%80 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>使用 <code>```{language}</code> 您将获得带有语法高亮的代码块:</p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl><span class=s>```yaml
</span></span></span><span class=line><span class=cl><span class=s></span><span class=nt>key</span><span class=p>:</span><span class=w> </span><span class=l>value</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=s>```</span></span></span></code></pre></td></tr></table></div></div></div><h4 id=指定文件名 id=指定文件名><span class=me-2>指定文件名</span>
<a href=#%e6%8c%87%e5%ae%9a%e6%96%87%e4%bb%b6%e5%90%8d class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h4><p>您可能已经注意到代码语言将显示在代码块的顶部。如果您想用文件名替换它,可以添加 <code>file</code> 属性来实现:</p><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl>``<span class=sb>`shell { file=&#34;path/to/file&#34; }
</span></span></span><span class=line><span class=cl><span class=sb># content
</span></span></span><span class=line><span class=cl><span class=sb>`</span>``</span></span></code></pre></td></tr></table></div></div></div><h2 id=数学公式 id=数学公式><span class=me-2>数学公式</span>
<a href=#%e6%95%b0%e5%ad%a6%e5%85%ac%e5%bc%8f class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>我们使用 <a href=https://www.mathjax.org/><strong>MathJax</strong></a> 来生成数学公式。出于网站性能的原因,默认情况下不会加载数学功能。但可以通过以下方式启用:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>math</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><p>启用数学功能后,您可以使用以下语法添加数学公式:</p><ul><li><strong>块级数学公式</strong> 应该使用 <code>$$ math $$</code> 添加,<strong>必须</strong><code>$$</code> 之前和之后留有空行<ul><li><strong>插入方程编号</strong> 应该使用 <code>$$\begin{equation} math \end{equation}$$</code> 添加</li><li><strong>引用方程编号</strong> 应该在方程块中使用 <code>\label{eq:label_name}</code> 和在文本中使用 <code>\eqref{eq:label_name}</code> 内联引用(见下面的示例)</li></ul></li><li><strong>内联数学公式</strong>(在行中)应该使用 <code>$$ math $$</code> 添加,在 <code>$$</code> 之前或之后不要有任何空行</li><li><strong>内联数学公式</strong>(在列表中)应该使用 <code>\$$ math $$</code> 添加</li></ul><div class=code-block><div class=code-header><span data-label-text=Markdown><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt> 1
</span><span class=lnt> 2
</span><span class=lnt> 3
</span><span class=lnt> 4
</span><span class=lnt> 5
</span><span class=lnt> 6
</span><span class=lnt> 7
</span><span class=lnt> 8
</span><span class=lnt> 9
</span><span class=lnt>10
</span><span class=lnt>11
</span><span class=lnt>12
</span><span class=lnt>13
</span><span class=lnt>14
</span><span class=lnt>15
</span><span class=lnt>16
</span><span class=lnt>17
</span><span class=lnt>18
</span><span class=lnt>19
</span><span class=lnt>20
</span><span class=lnt>21
</span><span class=lnt>22
</span><span class=lnt>23
</span><span class=lnt>24
</span><span class=lnt>25
</span><span class=lnt>26
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-markdown data-lang=markdown><span class=line><span class=cl><span class=c>&lt;!-- 块级数学公式,保留所有空行 --&gt;</span>
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl>$$
</span></span><span class=line><span class=cl>LaTeX_数学表达式
</span></span><span class=line><span class=cl>$$
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl><span class=c>&lt;!-- 方程编号,保留所有空行 --&gt;</span>
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl>$$
</span></span><span class=line><span class=cl>\begin{equation}
</span></span><span class=line><span class=cl> LaTeX_数学表达式
</span></span><span class=line><span class=cl> \label{eq:label_name}
</span></span><span class=line><span class=cl>\end{equation}
</span></span><span class=line><span class=cl>$$
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl>可以引用为 \eqref{eq:label_name}。
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl><span class=c>&lt;!-- 行内数学公式,不要有空行 --&gt;</span>
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl>&#34;Lorem ipsum dolor sit amet, $$ LaTeX_数学表达式 $$ consectetur adipiscing elit.&#34;
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl><span class=c>&lt;!-- 列表中的内联数学公式,第一个 </span><span class=sb>`$`</span><span class=c> 需要转义 --&gt;</span>
</span></span><span class=line><span class=cl>
</span></span><span class=line><span class=cl><span class=k>1.</span> \$$ LaTeX_数学表达式 $$
</span></span><span class=line><span class=cl><span class=k>2.</span> \$$ LaTeX_数学表达式 $$
</span></span><span class=line><span class=cl>3. \$$ LaTeX_数学表达式 $$</span></span></code></pre></td></tr></table></div></div></div><h2 id=mermaid id=mermaid><span class=me-2>Mermaid</span>
<a href=#mermaid class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><blockquote class=prompt-warning><p>Mermaid 支持正在开发中</p></blockquote><p><a href=https://github.com/mermaid-js/mermaid><strong>Mermaid</strong></a> 是一个很棒的图表生成工具。要在您的文章中启用它,请将以下内容添加到 YAML 块中:</p><div class=code-block><div class=code-header><span data-label-text=YAML><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span><span class=lnt>2
</span><span class=lnt>3
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=nn>---</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nt>mermaid</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=w>
</span></span></span><span class=line><span class=cl><span class=w></span><span class=nn>---</span></span></span></code></pre></td></tr></table></div></div></div><p>然后您可以像其他 markdown 语言一样使用它:将图表代码用 <code>```mermaid</code><code>```</code> 包围起来。</p><h2 id=了解更多 id=了解更多><span class=me-2>了解更多</span>
<a href=#%e4%ba%86%e8%a7%a3%e6%9b%b4%e5%a4%9a class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>要了解更多关于撰写 Hugo 文章的知识,请访问 <a href=https://gohugo.io/documentation/>Hugo 文档</a></p></div><div class="post-tail-wrapper text-muted"><div class="post-meta mb-3"><i class="far fa-folder-open fa-fw me-1"></i>
<a href=/zh-cn/categories/%E5%8D%9A%E5%AE%A2/>博客</a>
,
<a href=/zh-cn/categories/%E5%8D%9A%E5%AE%A2/%E6%95%99%E7%A8%8B/>教程</a></div><div class=post-tags><i class="fa fa-tags fa-fw me-1"></i>
<a href=/zh-cn/tags/%E5%86%99%E4%BD%9C/ class="post-tag no-text-decoration">写作</a></div><div class="post-tail-bottom d-flex justify-content-between align-items-center mt-5 pb-2"><div class=license-wrapper>本文由作者按照 <a href=https://creativecommons.org/licenses/by/4.0/>CC BY 4.0</a> 进行授权</div></div></div></article></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div class="toc-border-cover z-3"></div><section id=toc-wrapper class="invisible position-sticky ps-0 pe-4 pb-4"><h2 class="panel-heading ps-3 pb-2 mb-0">文章内容</h2><nav id=toc></nav></section></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><aside id=related-posts aria-labelledby=related-label><h3 class=mb-4 id=related-label>相关文章</h3><nav class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4 mb-4"><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/ class="post-preview card h-100"><div class=card-body><time data-ts=1565355300 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">开始使用</h4><div class=text-muted><p>通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。</p></div></div></a></article><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/ class="post-preview card h-100"><div class=card-body><time data-ts=1565454840 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">自定义网站图标</h4><div class=text-muted><p>通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。</p></div></div></a></article><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/ class="post-preview card h-100"><div class=card-body><time data-ts=1565235180 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">文本和排版</h4><div class=text-muted><p>文本、排版、数学公式、图表、流程图、图片、视频等示例。</p></div></div></a></article></nav></aside><nav class="post-navigation d-flex justify-content-between" aria-label="Post Navigation"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/ class="btn btn-outline-primary" aria-label=上一篇><p>文本和排版</p></a><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/ class="btn btn-outline-primary" aria-label=下一篇><p>开始使用</p></a></nav><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,79 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="开始使用"><meta property="og:description" content="通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="article"><meta property="article:section" content="post"><meta property="article:published_time" content="2019-08-09T20:55:00+08:00"><meta property="article:modified_time" content="2019-08-09T20:55:00+08:00"><meta property="article:tag" content="入门指南"><meta name=twitter:card content="summary"><meta name=twitter:title content="开始使用"><meta name=twitter:description content="通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。"><meta itemprop=name content="开始使用"><meta itemprop=description content="通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。"><meta itemprop=datePublished content="2019-08-09T20:55:00+08:00"><meta itemprop=dateModified content="2019-08-09T20:55:00+08:00"><meta itemprop=wordCount content="1990"><meta itemprop=keywords content="入门指南"><title>开始使用 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/js/glightbox.min.js></script><script src=https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script src=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.js></script><script defer src=/chirpy-starter/js/post.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>开始使用</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title>开始使用</div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><article class=px-1 data-toc=true><header><h1 data-toc-skip>开始使用</h1><p class="post-desc fw-light mb-4">通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。</p><div class="post-meta text-muted"><span>发表于
<time data-ts=1565355300 data-df=YYYY/MM/DD data-bs-toggle=tooltip data-bs-placement=bottom>%Y/%m/%d</time></span><div class="d-flex justify-content-between"><span>作者
<em><a href=https://github.com/geekifan>一凡</a></em></span><div><span class=readtime data-bs-toggle=tooltip data-bs-placement=bottom title="494 字"><em>2 分钟</em> 阅读</span></div></div></div></header><div id=toc-bar class="d-flex align-items-center justify-content-between invisible"><span class="label text-truncate">开始使用</span>
<button type=button class="toc-trigger btn me-1">
<i class="fa-solid fa-list-ul fa-fw"></i></button></div><button id=toc-solo-trigger type=button class="toc-trigger btn btn-outline-secondary btn-sm">
<span class="label ps-2 pe-1">文章内容</span>
<i class="fa-solid fa-angle-right fa-fw"></i>
</button>
<dialog id=toc-popup class=p-0><div class="header d-flex flex-row align-items-center justify-content-between"><div class="label text-truncate py-2 ms-4">开始使用</div><button id=toc-popup-close type=button class="btn mx-1 my-1 opacity-75">
<i class="fas fa-close"></i></button></div><div id=toc-popup-content class="px-4 py-3 pb-4"><nav id=TableOfContents><ul><li><a href=#创建站点仓库>创建站点仓库</a><ul><li><a href=#选项1-使用起始模板推荐>选项1. 使用起始模板(推荐)</a></li><li><a href=#选项2-复刻主题>选项2. 复刻主题</a></li></ul></li><li><a href=#设置环境>设置环境</a><ul><li><a href=#使用开发容器windows系统推荐>使用开发容器Windows系统推荐</a></li><li><a href=#本地设置类unix操作系统推荐>本地设置类Unix操作系统推荐</a></li></ul></li><li><a href=#使用方法>使用方法</a><ul><li><a href=#启动jekyll服务器>启动Jekyll服务器</a></li><li><a href=#配置>配置</a></li><li><a href=#社交联系选项>社交联系选项</a></li><li><a href=#自定义样式表>自定义样式表</a></li><li><a href=#自定义静态资源>自定义静态资源</a></li></ul></li><li><a href=#部署>部署</a><ul><li><a href=#使用github-actions部署>使用Github Actions部署</a></li><li><a href=#手动构建和部署>手动构建和部署</a></li></ul></li></ul></nav></div></dialog><div class=content><blockquote class=prompt-warning><p><strong>NOTE:</strong> 该教程还没有完成从 Jekyll 版本的迁移,请谨慎参考。</p></blockquote><h2 id=创建站点仓库 id=创建站点仓库><span class=me-2>创建站点仓库</span>
<a href=#%e5%88%9b%e5%bb%ba%e7%ab%99%e7%82%b9%e4%bb%93%e5%ba%93 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>创建站点仓库时,根据您的需求有两种选择:</p><h3 id=选项1-使用起始模板推荐 id=选项1-使用起始模板推荐><span class=me-2>选项1. 使用起始模板(推荐)</span>
<a href=#%e9%80%89%e9%a1%b91-%e4%bd%bf%e7%94%a8%e8%b5%b7%e5%a7%8b%e6%a8%a1%e6%9d%bf%e6%8e%a8%e8%8d%90 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>这种方法简化了升级过程,隔离了不必要的文件,非常适合那些想专注于写作而不需要太多配置的用户。</p><ol><li>登录GitHub并导航到<a href=https://github.com/cotes2020/chirpy-starter><strong>起始模板</strong></a></li><li>点击<kbd>Use this template</kbd>按钮,然后选择<kbd>Create a new repository</kbd></li><li>将新仓库命名为<code>&lt;username>.github.io</code>,其中<code>username</code>替换为您的小写GitHub用户名。</li></ol><h3 id=选项2-复刻主题 id=选项2-复刻主题><span class=me-2>选项2. 复刻主题</span>
<a href=#%e9%80%89%e9%a1%b92-%e5%a4%8d%e5%88%bb%e4%b8%bb%e9%a2%98 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>这种方法便于修改功能或UI设计但在升级时会遇到挑战。除非您熟悉Jekyll并计划对此主题进行大量修改否则不要尝试这种方法。</p><ol><li>登录GitHub。</li><li><a href=https://github.com/cotes2020/jekyll-theme-chirpy/fork>复刻主题仓库</a></li><li>将新仓库命名为<code>&lt;username>.github.io</code>,其中<code>username</code>替换为您的小写GitHub用户名。</li></ol><h2 id=设置环境 id=设置环境><span class=me-2>设置环境</span>
<a href=#%e8%ae%be%e7%bd%ae%e7%8e%af%e5%a2%83 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>创建仓库后,是时候设置您的开发环境了。主要有两种方法:</p><h3 id=使用开发容器windows系统推荐 id=使用开发容器windows系统推荐><span class=me-2>使用开发容器Windows系统推荐</span>
<a href=#%e4%bd%bf%e7%94%a8%e5%bc%80%e5%8f%91%e5%ae%b9%e5%99%a8windows%e7%b3%bb%e7%bb%9f%e6%8e%a8%e8%8d%90 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>开发容器使用Docker提供隔离环境这可以防止与您的系统冲突并确保所有依赖项都在容器内管理。</p><p><strong>步骤</strong>:</p><ol><li>安装Docker<ul><li>在Windows/macOS上安装<a href=https://www.docker.com/products/docker-desktop/>Docker Desktop</a></li><li>在Linux上安装<a href=https://docs.docker.com/engine/install/>Docker Engine</a></li></ul></li><li>安装<a href=https://code.visualstudio.com/>VS Code</a><a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers">Dev Containers扩展</a></li><li>克隆您的仓库:<ul><li>对于Docker Desktop启动VS Code并<a href=https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume>在容器卷中克隆您的仓库</a></li><li>对于Docker Engine在本地克隆您的仓库然后通过VS Code<a href=https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-an-existing-folder-in-a-container>在容器中打开它</a></li></ul></li><li>等待开发容器设置完成。</li></ol><h3 id=本地设置类unix操作系统推荐 id=本地设置类unix操作系统推荐><span class=me-2>本地设置类Unix操作系统推荐</span>
<a href=#%e6%9c%ac%e5%9c%b0%e8%ae%be%e7%bd%ae%e7%b1%bbunix%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e6%8e%a8%e8%8d%90 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>对于类Unix系统您可以本地设置环境以获得最佳性能不过您也可以使用开发容器作为替代方案。</p><p><strong>步骤</strong>:</p><ol><li>按照<a href=https://jekyllrb.com/docs/installation/>Jekyll安装指南</a>安装Jekyll并确保已安装<a href=https://git-scm.com/>Git</a></li><li>将您的仓库克隆到本地机器。</li><li>如果您复刻了主题,安装<a href=https://nodejs.org/>Node.js</a>并在根目录中运行<code>bash tools/init.sh</code>来初始化仓库。</li><li>在仓库根目录中运行命令<code>bundle</code>来安装依赖项。</li></ol><h2 id=使用方法 id=使用方法><span class=me-2>使用方法</span>
<a href=#%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><h3 id=启动jekyll服务器 id=启动jekyll服务器><span class=me-2>启动Jekyll服务器</span>
<a href=#%e5%90%af%e5%8a%a8jekyll%e6%9c%8d%e5%8a%a1%e5%99%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>要在本地运行站点,请使用以下命令:</p><div class=code-block><div class=code-header><span data-label-text=Terminal><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-fallback data-lang=fallback><span class=line><span class=cl>$ bundle exec jekyll serve</span></span></code></pre></td></tr></table></div></div></div><blockquote><p>如果您使用的是开发容器,必须在<strong>VS Code</strong>终端中运行该命令。
{: .prompt-info }</p></blockquote><p>几秒钟后,本地服务器将在<a href=http://127.0.0.1:4000>http://127.0.0.1:4000</a>上可用。</p><h3 id=配置 id=配置><span class=me-2>配置</span>
<a href=#%e9%85%8d%e7%bd%ae class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>根据需要更新<code>_config.yml</code>{: .filepath}中的变量。一些典型选项包括:</p><ul><li><code>url</code></li><li><code>avatar</code></li><li><code>timezone</code></li><li><code>lang</code></li></ul><h3 id=社交联系选项 id=社交联系选项><span class=me-2>社交联系选项</span>
<a href=#%e7%a4%be%e4%ba%a4%e8%81%94%e7%b3%bb%e9%80%89%e9%a1%b9 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>社交联系选项显示在侧边栏底部。您可以在<code>_data/contact.yml</code>{: .filepath}文件中启用或禁用特定联系方式。</p><h3 id=自定义样式表 id=自定义样式表><span class=me-2>自定义样式表</span>
<a href=#%e8%87%aa%e5%ae%9a%e4%b9%89%e6%a0%b7%e5%bc%8f%e8%a1%a8 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>要自定义样式表,请将主题的<code>assets/css/jekyll-theme-chirpy.scss</code>{: .filepath}文件复制到Jekyll站点的相同路径中并在文件末尾添加您的自定义样式。</p><h3 id=自定义静态资源 id=自定义静态资源><span class=me-2>自定义静态资源</span>
<a href=#%e8%87%aa%e5%ae%9a%e4%b9%89%e9%9d%99%e6%80%81%e8%b5%84%e6%ba%90 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>静态资源配置在版本<code>5.1.0</code>中引入。静态资源的CDN在<code>_data/origin/cors.yml</code>{: .filepath}中定义。您可以根据您的网站发布地区的网络状况替换其中一些。</p><p>如果您更喜欢自托管静态资源,请参考<a href=https://github.com/cotes2020/chirpy-static-assets#readme><em>chirpy-static-assets</em></a>仓库。</p><h2 id=部署 id=部署><span class=me-2>部署</span>
<a href=#%e9%83%a8%e7%bd%b2 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>部署前,检查<code>_config.yml</code>{: .filepath}文件并确保正确配置了<code>url</code>。如果您更喜欢<a href=https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites><strong>项目站点</strong></a>且不使用自定义域名或者您想通过GitHub Pages以外的Web服务器上的基本URL访问您的网站请记得将<code>baseurl</code>设置为项目名称,以斜杠开头,例如<code>/project-name</code></p><p>现在您可以选择以下方法之一来部署您的Jekyll站点。</p><h3 id=使用github-actions部署 id=使用github-actions部署><span class=me-2>使用Github Actions部署</span>
<a href=#%e4%bd%bf%e7%94%a8github-actions%e9%83%a8%e7%bd%b2 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>准备以下内容:</p><ul><li><p>如果您使用的是GitHub免费计划请保持站点仓库公开。</p></li><li><p>如果您已将<code>Gemfile.lock</code>{: .filepath}提交到仓库并且您的本地机器不是运行Linux请更新锁定文件的平台列表</p><div class=code-block><div class=code-header><span data-label-text=Console><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-console data-lang=console><span class=line><span class=cl><span class=gp>$</span> bundle lock --add-platform x86_64-linux
</span></span></code></pre></td></tr></table></div></div></div></li></ul><p>接下来配置_Pages_服务</p><ol><li>在GitHub上进入您的仓库。选择_Settings_标签然后点击左侧导航栏中的_Pages_。在<strong>Source</strong>部分_Build and deployment_下从下拉菜单中选择<a href=https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow><strong>GitHub Actions</strong></a></li></ol><a href=/chirpy-starter/post/2019-08-09-getting-started/pages-source-light.png class="popup img-link light border normal"><img src=/chirpy-starter/post/2019-08-09-getting-started/pages-source-light.png alt=构建源 height=140 width=375>
</a><a href=/chirpy-starter/post/2019-08-09-getting-started/pages-source-dark.png class="popup img-link dark normal"><img src=/chirpy-starter/post/2019-08-09-getting-started/pages-source-dark.png alt=构建源 height=140 width=375></a><ol start=2><li>将任何提交推送到GitHub以触发_Actions_工作流。在仓库的_Actions_标签中您应该看到正在运行的_Build and Deploy_工作流。一旦构建完成并成功站点将自动部署。</li></ol><p>现在您可以访问GitHub提供的URL来访问您的站点。</p><h3 id=手动构建和部署 id=手动构建和部署><span class=me-2>手动构建和部署</span>
<a href=#%e6%89%8b%e5%8a%a8%e6%9e%84%e5%bb%ba%e5%92%8c%e9%83%a8%e7%bd%b2 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h3><p>对于自托管服务器,您需要在本地机器上构建站点,然后将站点文件上传到服务器。</p><p>导航到源项目的根目录,并使用以下命令构建您的站点:</p><div class=code-block><div class=code-header><span data-label-text=Console><i class="fas fa-code fa-fw small"></i></span> <button aria-label=copy data-title-succeed=Copied!><i class="far fa-clipboard"></i></button></div><div class=highlight><div class=chroma><table class=lntable><tr><td class=lntd><pre tabindex=0 class=chroma><code><span class=lnt>1
</span></code></pre></td><td class=lntd><pre tabindex=0 class=chroma><code class=language-console data-lang=console><span class=line><span class=cl><span class=gp>$</span> <span class=nv>JEKYLL_ENV</span><span class=o>=</span>production bundle <span class=nb>exec</span> jekyll b
</span></span></code></pre></td></tr></table></div></div></div><p>除非您指定了输出路径,否则生成的站点文件将放置在项目根目录的<code>_site</code>{: .filepath}文件夹中。将这些文件上传到您的目标服务器。</p></div><div class="post-tail-wrapper text-muted"><div class="post-meta mb-3"><i class="far fa-folder-open fa-fw me-1"></i>
<a href=/zh-cn/categories/%E5%8D%9A%E5%AE%A2/>博客</a>
,
<a href=/zh-cn/categories/%E5%8D%9A%E5%AE%A2/%E6%95%99%E7%A8%8B/>教程</a></div><div class=post-tags><i class="fa fa-tags fa-fw me-1"></i>
<a href=/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/ class="post-tag no-text-decoration">入门指南</a></div><div class="post-tail-bottom d-flex justify-content-between align-items-center mt-5 pb-2"><div class=license-wrapper>本文由作者按照 <a href=https://creativecommons.org/licenses/by/4.0/>CC BY 4.0</a> 进行授权</div></div></div></article></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div class="toc-border-cover z-3"></div><section id=toc-wrapper class="invisible position-sticky ps-0 pe-4 pb-4"><h2 class="panel-heading ps-3 pb-2 mb-0">文章内容</h2><nav id=toc></nav></section></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><aside id=related-posts aria-labelledby=related-label><h3 class=mb-4 id=related-label>相关文章</h3><nav class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4 mb-4"><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/ class="post-preview card h-100"><div class=card-body><time data-ts=1565244600 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">撰写新文章</h4><div class=text-muted><p>本教程将指导您如何在 Chirpy 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。 &amp;lt;span class=&amp;quot;me-2&amp;quot;&amp;gt;命名和路径&amp;lt;/span&amp;gt; &amp;lt;a href=&amp;quot;#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84&amp;quot; …</p></div></div></a></article><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/ class="post-preview card h-100"><div class=card-body><time data-ts=1565454840 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">自定义网站图标</h4><div class=text-muted><p>通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。</p></div></div></a></article><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/ class="post-preview card h-100"><div class=card-body><time data-ts=1565235180 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">文本和排版</h4><div class=text-muted><p>文本、排版、数学公式、图表、流程图、图片、视频等示例。</p></div></div></a></article></nav></aside><nav class="post-navigation d-flex justify-content-between" aria-label="Post Navigation"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/ class="btn btn-outline-primary" aria-label=上一篇><p>撰写新文章</p></a><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/ class="btn btn-outline-primary" aria-label=下一篇><p>自定义网站图标</p></a></nav><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,59 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="自定义网站图标"><meta property="og:description" content="通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="article"><meta property="article:section" content="post"><meta property="article:published_time" content="2019-08-11T00:34:00+08:00"><meta property="article:modified_time" content="2019-08-11T00:34:00+08:00"><meta property="article:tag" content="网站图标"><meta name=twitter:card content="summary"><meta name=twitter:title content="自定义网站图标"><meta name=twitter:description content="通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。"><meta itemprop=name content="自定义网站图标"><meta itemprop=description content="通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。"><meta itemprop=datePublished content="2019-08-11T00:34:00+08:00"><meta itemprop=dateModified content="2019-08-11T00:34:00+08:00"><meta itemprop=wordCount content="342"><meta itemprop=keywords content="网站图标"><title>自定义网站图标 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/js/glightbox.min.js></script><script src=https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script src=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.js></script><script defer src=/chirpy-starter/js/post.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>自定义网站图标</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title>自定义网站图标</div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><article class=px-1 data-toc=true><header><h1 data-toc-skip>自定义网站图标</h1><p class="post-desc fw-light mb-4">通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。</p><div class="post-meta text-muted"><span>发表于
<time data-ts=1565454840 data-df=YYYY/MM/DD data-bs-toggle=tooltip data-bs-placement=bottom>%Y/%m/%d</time></span><div class="d-flex justify-content-between"><span>作者
<em><a href=https://github.com/geekifan>一凡</a></em></span><div><span class=readtime data-bs-toggle=tooltip data-bs-placement=bottom title="275 字"><em>1 分钟</em> 阅读</span></div></div></div></header><div id=toc-bar class="d-flex align-items-center justify-content-between invisible"><span class="label text-truncate">自定义网站图标</span>
<button type=button class="toc-trigger btn me-1">
<i class="fa-solid fa-list-ul fa-fw"></i></button></div><button id=toc-solo-trigger type=button class="toc-trigger btn btn-outline-secondary btn-sm">
<span class="label ps-2 pe-1">文章内容</span>
<i class="fa-solid fa-angle-right fa-fw"></i>
</button>
<dialog id=toc-popup class=p-0><div class="header d-flex flex-row align-items-center justify-content-between"><div class="label text-truncate py-2 ms-4">自定义网站图标</div><button id=toc-popup-close type=button class="btn mx-1 my-1 opacity-75">
<i class="fas fa-close"></i></button></div><div id=toc-popup-content class="px-4 py-3 pb-4"><nav id=TableOfContents><ul><li><a href=#生成网站图标>生成网站图标</a></li><li><a href=#下载与替换>下载与替换</a></li></ul></nav></div></dialog><div class=content><p><a href=https://github.com/cotes2020/jekyll-theme-chirpy/><strong>Chirpy</strong></a><a href=https://www.favicon-generator.org/about/>网站图标</a>放置在 <code class=filepath>assets/img/favicons/</code> 目录中。您可能想用自己的图标替换它们。以下部分将指导您创建和替换默认网站图标。</p><h2 id=生成网站图标 id=生成网站图标><span class=me-2>生成网站图标</span>
<a href=#%e7%94%9f%e6%88%90%e7%bd%91%e7%ab%99%e5%9b%be%e6%a0%87 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>准备一张尺寸为 512x512 或更大的正方形图像PNG、JPG 或 SVG然后前往在线工具 <a href=https://realfavicongenerator.net/><strong>Real Favicon Generator</strong></a>,点击 <kbd>Select your Favicon image</kbd> 按钮上传您的图像文件。</p><p>在下一步中,网页将显示所有使用场景。您可以保留默认选项,滚动到页面底部,点击 <kbd>Generate your Favicons and HTML code</kbd> 按钮生成网站图标。</p><h2 id=下载与替换 id=下载与替换><span class=me-2>下载与替换</span>
<a href=#%e4%b8%8b%e8%bd%bd%e4%b8%8e%e6%9b%bf%e6%8d%a2 class="anchor text-muted"><i class="fas fa-hashtag"></i></a></h2><p>下载生成的包,解压并从提取的文件中删除以下两个文件:</p><ul><li><code class=filepath>browserconfig.xml</code></li><li><code class=filepath>site.webmanifest</code></li></ul><p>然后将剩余的图像文件(<code class=filepath>.PNG</code><code class=filepath>.ICO</code>)复制到您的 Hugo 站点的 <code class=filepath>assets/img/favicons/</code> 目录中,覆盖原始文件。如果您的 Hugo 站点还没有这个目录,只需创建一个。</p><p>下表将帮助您理解网站图标文件的变化:</p><div class=table-wrapper><table><thead><tr><th>文件</th><th style=text-align:center>来自在线工具</th><th style=text-align:center>来自 Chirpy</th></tr></thead><tbody><tr><td><code>*.PNG</code></td><td style=text-align:center></td><td style=text-align:center></td></tr><tr><td><code>*.ICO</code></td><td style=text-align:center></td><td style=text-align:center></td></tr></tbody></table></div><blockquote class=prompt-info><p>✓ 表示保留,✗ 表示删除。</p></blockquote><p>下次构建站点时,网站图标将被自定义版本替换。</p></div><div class="post-tail-wrapper text-muted"><div class="post-meta mb-3"><i class="far fa-folder-open fa-fw me-1"></i>
<a href=/zh-cn/categories/%E5%8D%9A%E5%AE%A2/>博客</a>
,
<a href=/zh-cn/categories/%E5%8D%9A%E5%AE%A2/%E6%95%99%E7%A8%8B/>教程</a></div><div class=post-tags><i class="fa fa-tags fa-fw me-1"></i>
<a href=/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/ class="post-tag no-text-decoration">网站图标</a></div><div class="post-tail-bottom d-flex justify-content-between align-items-center mt-5 pb-2"><div class=license-wrapper>本文由作者按照 <a href=https://creativecommons.org/licenses/by/4.0/>CC BY 4.0</a> 进行授权</div></div></div></article></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div class="toc-border-cover z-3"></div><section id=toc-wrapper class="invisible position-sticky ps-0 pe-4 pb-4"><h2 class="panel-heading ps-3 pb-2 mb-0">文章内容</h2><nav id=toc></nav></section></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><aside id=related-posts aria-labelledby=related-label><h3 class=mb-4 id=related-label>相关文章</h3><nav class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4 mb-4"><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/ class="post-preview card h-100"><div class=card-body><time data-ts=1565244600 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">撰写新文章</h4><div class=text-muted><p>本教程将指导您如何在 Chirpy 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。 &amp;lt;span class=&amp;quot;me-2&amp;quot;&amp;gt;命名和路径&amp;lt;/span&amp;gt; &amp;lt;a href=&amp;quot;#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84&amp;quot; …</p></div></div></a></article><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/ class="post-preview card h-100"><div class=card-body><time data-ts=1565355300 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">开始使用</h4><div class=text-muted><p>通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。</p></div></div></a></article><article class=col><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/ class="post-preview card h-100"><div class=card-body><time data-ts=1565235180 data-df=YYYY/MM/DD>%Y/%m/%d</time><h4 class="pt-0 my-2">文本和排版</h4><div class=text-muted><p>文本、排版、数学公式、图表、流程图、图片、视频等示例。</p></div></div></a></article></nav></aside><nav class="post-navigation d-flex justify-content-between" aria-label="Post Navigation"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/ class="btn btn-outline-primary" aria-label=上一篇><p>开始使用</p></a><div class="btn btn-outline-primary disabled" aria-label=下一篇><p>-</p></div></nav><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

44
zh-cn/post/index.html Normal file
View File

@ -0,0 +1,44 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/post/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="Posts"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="Posts"><meta itemprop=name content="Posts"><meta itemprop=datePublished content="2019-08-11T00:34:00+08:00"><meta itemprop=dateModified content="2019-08-11T00:34:00+08:00"><title>Posts |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><link rel=stylesheet href=/chirpy-starter/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/js/glightbox.min.js></script><script src=https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/post.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>Posts</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><main class=section-page><header class=section-header><h1>Posts</h1></header><div class=section-content></div><div class=section-pages><h2>Subsections & Pages</h2><ul class=page-list><li><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a><p class=page-description>通过这个全面概述开始学习 Chirpy 的基础知识。 您将学习如何安装、配置和使用您的第一个基于 Chirpy 的网站,以及如何将其部署到网络服务器。</p></li><li><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a><p class=page-description>通过这个全面概述开始学习Chirpy的基础知识。 您将学习如何安装、配置和使用您的第一个基于Chirpy的网站以及如何将其部署到网络服务器。</p></li><li><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a><p class=page-description>文本、排版、数学公式、图表、流程图、图片、视频等示例。</p></li></ul></div></main></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

46
zh-cn/post/index.xml Normal file
View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/</link><description>Recent content in Posts on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 11 Aug 2019 00:34:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/post/index.xml" rel="self" type="application/rss+xml"/><item><title>自定义网站图标</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</link><pubDate>Sun, 11 Aug 2019 00:34:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</guid><description>&lt;p>&lt;a href="https://github.com/cotes2020/jekyll-theme-chirpy/">&lt;strong>Chirpy&lt;/strong>&lt;/a> 的&lt;a href="https://www.favicon-generator.org/about/">网站图标&lt;/a>放置在 &lt;code class="filepath">assets/img/favicons/&lt;/code> 目录中。您可能想用自己的图标替换它们。以下部分将指导您创建和替换默认网站图标。&lt;/p>
&lt;h2 id="生成网站图标" id=生成网站图标>
&lt;span class="me-2">生成网站图标&lt;/span>
&lt;a href="#%e7%94%9f%e6%88%90%e7%bd%91%e7%ab%99%e5%9b%be%e6%a0%87" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>准备一张尺寸为 512x512 或更大的正方形图像PNG、JPG 或 SVG然后前往在线工具 &lt;a href="https://realfavicongenerator.net/">&lt;strong>Real Favicon Generator&lt;/strong>&lt;/a>,点击 &lt;kbd>Select your Favicon image&lt;/kbd> 按钮上传您的图像文件。&lt;/p></description></item><item><title>开始使用</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</link><pubDate>Fri, 09 Aug 2019 20:55:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</guid><description>&lt;blockquote class="prompt-warning">&lt;p>&lt;strong>NOTE:&lt;/strong> 该教程还没有完成从 Jekyll 版本的迁移,请谨慎参考。&lt;/p>&lt;/blockquote>
&lt;h2 id="创建站点仓库" id=创建站点仓库>
&lt;span class="me-2">创建站点仓库&lt;/span>
&lt;a href="#%e5%88%9b%e5%bb%ba%e7%ab%99%e7%82%b9%e4%bb%93%e5%ba%93" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建站点仓库时,根据您的需求有两种选择:&lt;/p>
&lt;h3 id="选项1-使用起始模板推荐" id=选项1-使用起始模板推荐>
&lt;span class="me-2">选项1. 使用起始模板(推荐)&lt;/span>
&lt;a href="#%e9%80%89%e9%a1%b91-%e4%bd%bf%e7%94%a8%e8%b5%b7%e5%a7%8b%e6%a8%a1%e6%9d%bf%e6%8e%a8%e8%8d%90" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h3>&lt;p>这种方法简化了升级过程,隔离了不必要的文件,非常适合那些想专注于写作而不需要太多配置的用户。&lt;/p></description></item><item><title>撰写新文章</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</link><pubDate>Thu, 08 Aug 2019 14:10:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</guid><description>&lt;p>本教程将指导您如何在 &lt;em>Chirpy&lt;/em> 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。&lt;/p>
&lt;h2 id="命名和路径" id=命名和路径>
&lt;span class="me-2">命名和路径&lt;/span>
&lt;a href="#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建一个新文件,使用 &lt;code>hugo new content/post/YYYY-MM-DD-TITLE.md&lt;/code>。您可以根据自己的喜好更改路径,但请注意,所有文章都应该放在根目录的 &lt;code class="filepath">content/post&lt;/code> 中。&lt;/p></description></item><item><title>文本和排版</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</link><pubDate>Thu, 08 Aug 2019 11:33:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</guid><description>&lt;h2 id="标题" id=标题>
&lt;span class="me-2">标题&lt;/span>
&lt;a href="#%e6%a0%87%e9%a2%98" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;!-- markdownlint-capture -->
&lt;!-- markdownlint-disable -->
&lt;h1 id="h1--标题" class=mt-4 mb-0 data-toc-skip=true id=h1--标题>
H1 — 标题
&lt;/h1>&lt;h2 id="h2--标题" class=mt-4 mb-0 data-toc-skip=true id=h2--标题>
H2 — 标题
&lt;/h2>&lt;h3 id="h3--标题" class=mt-4 mb-0 data-toc-skip=true id=h3--标题>
H3 — 标题
&lt;/h3>&lt;h4 id="h4--标题" class=mt-4 data-toc-skip=true id=h4--标题>
H4 — 标题
&lt;/h4>&lt;!-- markdownlint-restore -->
&lt;h2 id="段落" id=段落>
&lt;span class="me-2">段落&lt;/span>
&lt;a href="#%e6%ae%b5%e8%90%bd" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>这是一个段落示例。在这里,我们可以看到段落是如何在 Markdown 中呈现的。段落是由一个或多个连续的文本行组成,它们之间用一个或多个空行分隔。正常的段落不应该用空格或制表符缩进。这样可以保持文档的整洁和一致性。文本排版是网页设计和内容创作中的重要元素,良好的排版可以提高可读性和美观度。&lt;/p></description></item></channel></rss>

1
zh-cn/sitemap.xml Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/</loc><lastmod>2023-04-20T00:00:00+00:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/about/</loc><lastmod>2023-04-20T00:00:00+00:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/about/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/about/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/post/</loc><lastmod>2019-08-11T00:34:00+08:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/post/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/post/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/tags/</loc><lastmod>2019-08-11T00:34:00+08:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/tags/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/tags/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E5%8D%9A%E5%AE%A2/</loc><lastmod>2019-08-11T00:34:00+08:00</lastmod></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/categories/</loc><lastmod>2019-08-11T00:34:00+08:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/categories/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/categories/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%95%99%E7%A8%8B/</loc><lastmod>2019-08-11T00:34:00+08:00</lastmod></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/</loc><lastmod>2019-08-11T00:34:00+08:00</lastmod></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</loc><lastmod>2019-08-11T00:34:00+08:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/post/2019-08-11-customize-the-favicon/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</loc><lastmod>2019-08-09T20:55:00+08:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/post/2019-08-09-getting-started/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/</loc><lastmod>2019-08-09T20:55:00+08:00</lastmod></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/</loc><lastmod>2019-08-08T14:10:00+08:00</lastmod></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</loc><lastmod>2019-08-08T14:10:00+08:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/post/2019-08-08-write-a-new-post/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/</loc><lastmod>2019-08-08T11:33:00+08:00</lastmod></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</loc><lastmod>2019-08-08T11:33:00+08:00</lastmod><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/post/2019-08-08-text-and-typography/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/"/></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/categories/%E6%BC%94%E7%A4%BA/</loc><lastmod>2019-08-08T11:33:00+08:00</lastmod></url><url><loc>https://geekifan.github.io/chirpy-starter/zh-cn/archives/</loc><xhtml:link rel="alternate" hreflang="en" href="https://geekifan.github.io/chirpy-starter/archives/"/><xhtml:link rel="alternate" hreflang="zh-CN" href="https://geekifan.github.io/chirpy-starter/zh-cn/archives/"/></url></urlset>

44
zh-cn/tags/index.html Normal file
View File

@ -0,0 +1,44 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/tags/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="标签"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="标签"><meta itemprop=name content="标签"><meta itemprop=datePublished content="2019-08-11T00:34:00+08:00"><meta itemprop=dateModified content="2019-08-11T00:34:00+08:00"><title>标签 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/commons.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class="nav-item active"><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span>标签</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><article class=px-1><h1 class=dynamic-title>标签</h1><div class=content><div id=tags class="d-flex flex-wrap mx-xl-2"><div><a class=tag href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版<span class=text-muted>1</span></a></div><div><a class=tag href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南<span class=text-muted>1</span></a></div><div><a class=tag href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标<span class=text-muted>1</span></a></div><div><a class=tag href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作<span class=text-muted>1</span></a></div></div></div></article></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

1
zh-cn/tags/index.xml Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>标签 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/</link><description>Recent content in 标签 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 11 Aug 2019 00:34:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/tags/index.xml" rel="self" type="application/rss+xml"/><item><title>网站图标</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/</link><pubDate>Sun, 11 Aug 2019 00:34:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/</guid><description/></item><item><title>入门指南</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/</link><pubDate>Fri, 09 Aug 2019 20:55:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/</guid><description/></item><item><title>写作</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/</link><pubDate>Thu, 08 Aug 2019 14:10:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/</guid><description/></item><item><title>排版</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/</link><pubDate>Thu, 08 Aug 2019 11:33:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/</guid><description/></item></channel></rss>

View File

@ -0,0 +1,49 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="入门指南"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="入门指南"><meta itemprop=name content="入门指南"><meta itemprop=datePublished content="2019-08-09T20:55:00+08:00"><meta itemprop=dateModified content="2019-08-09T20:55:00+08:00"><title>入门指南 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/misc.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span><a href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/>标签</a></span>
<span>入门指南</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><div id=page-tag><h1 class=ps-lg-2><i class="fa fa-tag fa-fw text-muted"></i>
入门指南
<span class="lead text-muted ps-2">1</span></h1><ul class="content ps-0"><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a>
<span class="dash flex-grow-1"></span>
<time class="text-muted small text-nowrap" data-ts=1565355300 data-df=YYYY/MM/DD>%Y/%m/%d</time></li></ul></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>入门指南 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/</link><description>Recent content in 入门指南 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Fri, 09 Aug 2019 20:55:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/index.xml" rel="self" type="application/rss+xml"/><item><title>开始使用</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</link><pubDate>Fri, 09 Aug 2019 20:55:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-09-getting-started/</guid><description>&lt;blockquote class="prompt-warning">&lt;p>&lt;strong>NOTE:&lt;/strong> 该教程还没有完成从 Jekyll 版本的迁移,请谨慎参考。&lt;/p>&lt;/blockquote>
&lt;h2 id="创建站点仓库" id=创建站点仓库>
&lt;span class="me-2">创建站点仓库&lt;/span>
&lt;a href="#%e5%88%9b%e5%bb%ba%e7%ab%99%e7%82%b9%e4%bb%93%e5%ba%93" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建站点仓库时,根据您的需求有两种选择:&lt;/p>
&lt;h3 id="选项1-使用起始模板推荐" id=选项1-使用起始模板推荐>
&lt;span class="me-2">选项1. 使用起始模板(推荐)&lt;/span>
&lt;a href="#%e9%80%89%e9%a1%b91-%e4%bd%bf%e7%94%a8%e8%b5%b7%e5%a7%8b%e6%a8%a1%e6%9d%bf%e6%8e%a8%e8%8d%90" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h3>&lt;p>这种方法简化了升级过程,隔离了不必要的文件,非常适合那些想专注于写作而不需要太多配置的用户。&lt;/p></description></item></channel></rss>

View File

@ -0,0 +1,49 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="写作"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="写作"><meta itemprop=name content="写作"><meta itemprop=datePublished content="2019-08-08T14:10:00+08:00"><meta itemprop=dateModified content="2019-08-08T14:10:00+08:00"><title>写作 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/misc.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span><a href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/>标签</a></span>
<span>写作</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><div id=page-tag><h1 class=ps-lg-2><i class="fa fa-tag fa-fw text-muted"></i>
写作
<span class="lead text-muted ps-2">1</span></h1><ul class="content ps-0"><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a>
<span class="dash flex-grow-1"></span>
<time class="text-muted small text-nowrap" data-ts=1565244600 data-df=YYYY/MM/DD>%Y/%m/%d</time></li></ul></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>写作 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/</link><description>Recent content in 写作 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Thu, 08 Aug 2019 14:10:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/index.xml" rel="self" type="application/rss+xml"/><item><title>撰写新文章</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</link><pubDate>Thu, 08 Aug 2019 14:10:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/</guid><description>&lt;p>本教程将指导您如何在 &lt;em>Chirpy&lt;/em> 模板中撰写文章,即使您以前使用过 Hugo也值得阅读因为许多功能需要设置特定变量。&lt;/p>
&lt;h2 id="命名和路径" id=命名和路径>
&lt;span class="me-2">命名和路径&lt;/span>
&lt;a href="#%e5%91%bd%e5%90%8d%e5%92%8c%e8%b7%af%e5%be%84" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>创建一个新文件,使用 &lt;code>hugo new content/post/YYYY-MM-DD-TITLE.md&lt;/code>。您可以根据自己的喜好更改路径,但请注意,所有文章都应该放在根目录的 &lt;code class="filepath">content/post&lt;/code> 中。&lt;/p></description></item></channel></rss>

View File

@ -0,0 +1,49 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="排版"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="排版"><meta itemprop=name content="排版"><meta itemprop=datePublished content="2019-08-08T11:33:00+08:00"><meta itemprop=dateModified content="2019-08-08T11:33:00+08:00"><title>排版 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/misc.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span><a href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/>标签</a></span>
<span>排版</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><div id=page-tag><h1 class=ps-lg-2><i class="fa fa-tag fa-fw text-muted"></i>
排版
<span class="lead text-muted ps-2">1</span></h1><ul class="content ps-0"><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a>
<span class="dash flex-grow-1"></span>
<time class="text-muted small text-nowrap" data-ts=1565235180 data-df=YYYY/MM/DD>%Y/%m/%d</time></li></ul></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>排版 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/</link><description>Recent content in 排版 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Thu, 08 Aug 2019 11:33:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/index.xml" rel="self" type="application/rss+xml"/><item><title>文本和排版</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</link><pubDate>Thu, 08 Aug 2019 11:33:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/</guid><description>&lt;h2 id="标题" id=标题>
&lt;span class="me-2">标题&lt;/span>
&lt;a href="#%e6%a0%87%e9%a2%98" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;!-- markdownlint-capture -->
&lt;!-- markdownlint-disable -->
&lt;h1 id="h1--标题" class=mt-4 mb-0 data-toc-skip=true id=h1--标题>
H1 — 标题
&lt;/h1>&lt;h2 id="h2--标题" class=mt-4 mb-0 data-toc-skip=true id=h2--标题>
H2 — 标题
&lt;/h2>&lt;h3 id="h3--标题" class=mt-4 mb-0 data-toc-skip=true id=h3--标题>
H3 — 标题
&lt;/h3>&lt;h4 id="h4--标题" class=mt-4 data-toc-skip=true id=h4--标题>
H4 — 标题
&lt;/h4>&lt;!-- markdownlint-restore -->
&lt;h2 id="段落" id=段落>
&lt;span class="me-2">段落&lt;/span>
&lt;a href="#%e6%ae%b5%e8%90%bd" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>这是一个段落示例。在这里,我们可以看到段落是如何在 Markdown 中呈现的。段落是由一个或多个连续的文本行组成,它们之间用一个或多个空行分隔。正常的段落不应该用空格或制表符缩进。这样可以保持文档的整洁和一致性。文本排版是网页设计和内容创作中的重要元素,良好的排版可以提高可读性和美观度。&lt;/p></description></item></channel></rss>

View File

@ -0,0 +1,49 @@
<!doctype html><head><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css></head><html lang=zh-CN><head><meta charset=utf-8><meta name=theme-color media="(prefers-color-scheme: light)" content="#f7f7f7"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#1b1b1e"><meta name=mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="black-translucent"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"><meta property="og:url" content="https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/"><meta property="og:site_name" content="Chirpy"><meta property="og:title" content="网站图标"><meta property="og:locale" content="zh_CN"><meta property="og:type" content="website"><meta name=twitter:card content="summary"><meta name=twitter:title content="网站图标"><meta itemprop=name content="网站图标"><meta itemprop=datePublished content="2019-08-11T00:34:00+08:00"><meta itemprop=dateModified content="2019-08-11T00:34:00+08:00"><title>网站图标 |
Chirpy</title><link rel=apple-touch-icon sizes=180x180 href=/chirpy-starter/img/favicons/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/chirpy-starter/img/favicons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/chirpy-starter/img/favicons/favicon-16x16.png><link rel="shortcut icon" href=/chirpy-starter/img/favicons/favicon.ico><meta name=apple-mobile-web-app-title content="Chirpy"><meta name=application-name content="Chirpy"><meta name=msapplication-TileColor content="#da532c"><meta name=msapplication-config content="/chirpy-starter/img/favicons/browserconfig.xml"><meta name=theme-color content="#ffffff"><link rel=preconnect href=https://fonts.googleapis.com><link rel=dns-prefetch href=https://fonts.googleapis.com><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=dns-prefetch href=https://fonts.gstatic.com><link rel=preconnect href=https://cdn.jsdelivr.net><link rel=dns-prefetch href=https://cdn.jsdelivr.net><link rel=stylesheet href=https://geekifan.github.io/chirpy-starter/css/main.min.6135c0700b2b81f4338a5c119b7a78b2bd20208c6f27ae64a19d0ef65cba906c.css><link rel=stylesheet href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&amp;family=Source+Sans+Pro:wght@400;600;700;900&amp;display=swap"><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.1/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/tocbot@4.32.2/dist/tocbot.min.css><script src=/chirpy-starter/js/modules/theme.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/locale/zh-cn.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/relativeTime.js></script><script src=https://cdn.jsdelivr.net/npm/dayjs@1.11.13/plugin/localizedFormat.js></script><script defer src=/chirpy-starter/js/misc.js></script></head><body><aside aria-label=Sidebar id=sidebar class="d-flex flex-column align-items-end"><header class=profile-wrapper><a href=/chirpy-starter/zh-cn/ id=avatar class=rounded-circle><img src=/chirpy-starter/img/commons/avatar.jpg width=112 height=112 alt=avatar onerror='this.style.display="none"'></a>
<a class="site-title d-block" href=/chirpy-starter/zh-cn/>Chirpy</a><p class="site-subtitle fst-italic mb-0">一个专注于文本的博客主题</p></header><nav class="flex-column flex-grow-1 w-100 ps-0"><ul class=nav><li class=nav-item><a href=/chirpy-starter/zh-cn/ class=nav-link><i class="fa-fw fas fa-house"></i>
<span>主页</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/categories/ class=nav-link><i class="fa-fw fas fa-stream"></i>
<span>分类</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/tags/ class=nav-link><i class="fa-fw fas fa-tags"></i>
<span>标签</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/archives/ class=nav-link><i class="fa-fw fas fa-archive"></i>
<span>归档</span></a></li><li class=nav-item><a href=/chirpy-starter/zh-cn/about/ class=nav-link><i class="fa-fw fas fa-info-circle"></i>
<span>关于</span></a></li><li class="nav-item mt-4"><a class="nav-link no-hover"><i class="fa-fw fas fa-language"></i><div class=lang-dropdown><select class=lang-select onchange="location=this.value"><option value=https://geekifan.github.io/chirpy-starter/zh-cn/ selected>中文</option><option value=https://geekifan.github.io/chirpy-starter/en/>English</option></select></div></a></li></ul></nav><div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"><button type=button class="btn btn-link nav-link" aria-label="Switch Mode" id=mode-toggle>
<i class="fas fa-adjust"></i>
</button>
<span class=icon-border></span>
<a href=https://github.com/yourusername aria-label=github target=_blank rel="noopener noreferrer"><i class="fab fa-github"></i>
</a><a href=https://twitter.com/yourhandle aria-label=twitter target=_blank rel="noopener noreferrer"><i class="fab fa-twitter"></i>
</a><a href=mailto:your.email@example.com aria-label=email target=_blank rel="noopener noreferrer"><i class="fas fa-envelope"></i>
</a><a href=https://geekifan.github.io/chirpy-starter/zh-cn/index.xml aria-label=rss><i class="fas fa-rss"></i></a></div></aside><div id=main-wrapper class="d-flex justify-content-center"><div class="container d-flex flex-column px-xxl-5"><header id=topbar-wrapper class=flex-shrink-0 aria-label="Top Bar"><div id=topbar class="d-flex align-items-center justify-content-between px-lg-3 h-100"><nav id=breadcrumb aria-label=Breadcrumb><span><a href=/chirpy-starter/zh-cn/>首页</a>
</span><span><a href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/>标签</a></span>
<span>网站图标</span></nav><button type=button id=sidebar-trigger class="btn btn-link" aria-label=Sidebar>
<i class="fas fa-bars fa-fw"></i></button><div id=topbar-title></div><button type=button id=search-trigger class="btn btn-link" aria-label=Search>
<i class="fas fa-search fa-fw"></i>
</button>
<search id=search class="align-items-center ms-3 ms-lg-0"><i class="fas fa-search fa-fw"></i>
<input class=form-control id=search-input type=search aria-label=search autocomplete=off placeholder=搜索...>
</search><button type=button class="btn btn-link text-decoration-none" id=search-cancel>取消</button></div></header><div class="row flex-grow-1"><main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4"><div id=page-tag><h1 class=ps-lg-2><i class="fa fa-tag fa-fw text-muted"></i>
网站图标
<span class="lead text-muted ps-2">1</span></h1><ul class="content ps-0"><li class="d-flex justify-content-between px-md-3"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a>
<span class="dash flex-grow-1"></span>
<time class="text-muted small text-nowrap" data-ts=1565454840 data-df=YYYY/MM/DD>%Y/%m/%d</time></li></ul></div></main><aside aria-label=Panel id=panel-wrapper class="col-xl-3 ps-2 text-muted"><div class=access><section id=access-lastmod><h2 class=panel-heading>最近更新</h2><ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2"><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/>自定义网站图标</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-09-getting-started/>开始使用</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-write-a-new-post/>撰写新文章</a></li><li class="text-truncate lh-lg"><a href=/chirpy-starter/zh-cn/post/2019-08-08-text-and-typography/>文本和排版</a></li></ul></section><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div></aside></div><div class=row><div id=tail-wrapper class="col-12 col-lg-11 col-xl-9 px-md-4"><footer aria-label="Site Info" class="d-flex flex-column justify-content-center text-muted
flex-lg-row justify-content-lg-between align-items-lg-center pb-lg-3"><p>©
<time>2025</time>
<a href=https://github.com/geekifan>Yifan</a>.
<span data-bs-toggle=tooltip data-bs-placement=top title="除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。">保留部分权利。</span></p><p>本站采用 <a href=https://gohugo.io/ target=_blank rel=noopener>Hugo</a> 主题 <a data-bs-toggle=tooltip data-bs-placement=top title=v1.0.2 href=https://github.com/geekifan/hugo-theme-chirpy target=_blank rel=noopener>Chirpy</a></p></footer></div></div><div id=search-result-wrapper class="d-flex justify-content-center d-none"><div class="col-11 content"><div id=search-hints><section><h2 class=panel-heading>热门标签</h2><div class="d-flex flex-wrap mt-3 mb-1 me-3"><a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E6%8E%92%E7%89%88/>排版</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/>入门指南</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/>网站图标</a>
<a class="post-tag btn btn-outline-primary" href=https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E5%86%99%E4%BD%9C/>写作</a></div></section></div><div id=search-results class="d-flex flex-wrap justify-content-center text-muted mt-3"></div></div></div><script>const DEFAULT_CONFIG={search:{minChars:1,maxResults:5,fields:{title:!0,description:!0,section:!0,contents:!0},strictMode:!0}};class FastSearch{constructor({searchInput:e,resultsContainer:t,json:n,searchResultTemplate:s=null,noResultsText:o=null}){this.searchInput=e,this.resultsContainer=t,this.json=n,this.searchResultTemplate=s,this.noResultsText=o,this.init()}init(){this.loadSearchIndex(),this.searchInput.addEventListener("input",e=>{if(!this.searchIndex){this.resultsContainer.innerHTML='<li class="search-message">Loading search index...</li>';return}this.performSearch(this.searchInput.value)})}async loadSearchIndex(){try{const e=await fetch(this.json);if(!e.ok)throw new Error("Failed to load search index");const t=await e.json();this.searchIndex=t.map(e=>({...e,searchableTitle:e.title?.toLowerCase()||"",searchableDesc:e.desc?.toLowerCase()||"",searchableSection:e.section?.toLowerCase()||"",searchableContents:e.contents?.toLowerCase()||""}))}catch(e){console.error("Error loading search index:",e),this.resultsContainer.innerHTML='<li class="search-message">Error loading search index...</li>'}}escapeHtml(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""}containsTerm(e,t){return!!e&&!!t&&e.includes(t)}performSearch(e){if(e=e.toLowerCase().trim(),!e||!this.searchIndex||e.length<DEFAULT_CONFIG.search.minChars){this.resultsContainer.innerHTML="";return}const s=[e,...e.split(/\s+/).filter(e=>e.length>0)],t=[...new Set(s)],o=DEFAULT_CONFIG.search.strictMode,n=this.searchIndex.map(e=>{const s=this.checkFieldsForMatch(e,t[0]);if(o&&!s)return{item:e,score:0,matched:!1};let n=0,i=0,a=!1;t.forEach((t,s)=>{const r=s===0,o=this.checkFieldsForMatch(e,t);o&&(i++,o.inTitle&&(n+=r?10:5,a=!0),o.inDesc&&(n+=r?8:4),o.inSection&&(n+=r?6:3),o.inContents&&(n+=r?4:2))});const r=i/t.length,c=n*r*(a?1.5:1);return{item:e,score:c,matched:s}}).filter(e=>e.matched).sort((e,t)=>t.score-e.score).slice(0,DEFAULT_CONFIG.search.maxResults).map(e=>e.item);if(n.length===0){this.resultsContainer.innerHTML='<p class="mt-5">搜索结果为空</p>';return}const i=n.map(e=>{let t="",n="";return e.categories&&(t=e.categories.join(", "),t=`<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${t}</div>`),e.tags&&(n=e.tags.join(", "),n=`<div><i class="fa fa-tag fa-fw"></i>${n}</div>`),`
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="${this.escapeHtml(e.permalink)}">${this.escapeHtml(e.title)}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
${t}
${n}
</div>
</header>
<p>${this.escapeHtml(e.contents)}</p>
</article>
`}).join("");this.resultsContainer.innerHTML=i}checkFieldsForMatch(e,t){const n={inTitle:!1,inDesc:!1,inSection:!1,inContents:!1};return DEFAULT_CONFIG.search.fields.title&&this.containsTerm(e.searchableTitle,t)&&(n.inTitle=!0),DEFAULT_CONFIG.search.fields.description&&this.containsTerm(e.searchableDesc,t)&&(n.inDesc=!0),DEFAULT_CONFIG.search.fields.section&&this.containsTerm(e.searchableSection,t)&&(n.inSection=!0),DEFAULT_CONFIG.search.fields.contents&&this.containsTerm(e.searchableContents,t)&&(n.inContents=!0),!!(n.inTitle||n.inDesc||n.inSection||n.inContents)&&n}}const search=new FastSearch({searchInput:document.getElementById("search-input"),resultsContainer:document.getElementById("search-results"),json:`/chirpy-starter/zh-cn/index.json`})</script></div><aside aria-label="Scroll to Top"><button id=back-to-top type=button class="btn btn-lg btn-box-shadow">
<i class="fas fa-angle-up"></i></button></aside></div><div id=mask class="d-none position-fixed w-100 h-100 z-1"></div></body></html>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>网站图标 on Chirpy</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/</link><description>Recent content in 网站图标 on Chirpy</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 11 Aug 2019 00:34:00 +0800</lastBuildDate><atom:link href="https://geekifan.github.io/chirpy-starter/zh-cn/tags/%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87/index.xml" rel="self" type="application/rss+xml"/><item><title>自定义网站图标</title><link>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</link><pubDate>Sun, 11 Aug 2019 00:34:00 +0800</pubDate><guid>https://geekifan.github.io/chirpy-starter/zh-cn/post/2019-08-11-customize-the-favicon/</guid><description>&lt;p>&lt;a href="https://github.com/cotes2020/jekyll-theme-chirpy/">&lt;strong>Chirpy&lt;/strong>&lt;/a> 的&lt;a href="https://www.favicon-generator.org/about/">网站图标&lt;/a>放置在 &lt;code class="filepath">assets/img/favicons/&lt;/code> 目录中。您可能想用自己的图标替换它们。以下部分将指导您创建和替换默认网站图标。&lt;/p>
&lt;h2 id="生成网站图标" id=生成网站图标>
&lt;span class="me-2">生成网站图标&lt;/span>
&lt;a href="#%e7%94%9f%e6%88%90%e7%bd%91%e7%ab%99%e5%9b%be%e6%a0%87" class="anchor text-muted">&lt;i class="fas fa-hashtag">&lt;/i>&lt;/a>
&lt;/h2>&lt;p>准备一张尺寸为 512x512 或更大的正方形图像PNG、JPG 或 SVG然后前往在线工具 &lt;a href="https://realfavicongenerator.net/">&lt;strong>Real Favicon Generator&lt;/strong>&lt;/a>,点击 &lt;kbd>Select your Favicon image&lt;/kbd> 按钮上传您的图像文件。&lt;/p></description></item></channel></rss>