315 lines
73 KiB
HTML
315 lines
73 KiB
HTML
<!doctype html>
|
||
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><title>Icarus User Guide - Configuring the Theme - Icarus</title><link rel="manifest" href="/hexo-theme-icarus/manifest.json"><meta name="theme-color" content="#f7f7f7"><meta name="application-name" content="Icaurs - Hexo Theme"><meta name="msapplication-TileImage" content="/img/favicon.svg"><meta name="msapplication-TileColor" content="#f7f7f7"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-title" content="Icaurs - Hexo Theme"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="description" content="Icarus’ default theme configuration file is _config.icarus.yml. It defines the global layout and style settings of the theme and controls external features such as plugins and widgets. This article de"><meta property="og:type" content="blog"><meta property="og:title" content="Icarus User Guide - Configuring the Theme"><meta property="og:url" content="http://ppoffice.github.io/hexo-theme-icarus/Configuration/icarus-user-guide-configuring-the-theme/"><meta property="og:site_name" content="Icarus"><meta property="og:description" content="Icarus’ default theme configuration file is _config.icarus.yml. It defines the global layout and style settings of the theme and controls external features such as plugins and widgets. This article de"><meta property="og:locale" content="en_US"><meta property="og:image" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/covers/vector_landscape_2.svg"><meta property="article:published_time" content="2020-03-01T00:00:00.000Z"><meta property="article:author" content="PPOffice"><meta property="article:tag" content="Icarus User Guide"><meta property="article:tag" content="Getting Started"><meta property="twitter:card" content="summary"><meta property="twitter:image:src" content="http://ppoffice.github.io/hexo-theme-icarus/gallery/covers/vector_landscape_2.svg"><script type="application/ld+json">{"@context":"https://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"http://ppoffice.github.io/hexo-theme-icarus/Configuration/icarus-user-guide-configuring-the-theme/"},"headline":"Icarus User Guide - Configuring the Theme","image":[],"datePublished":"2020-03-01T00:00:00.000Z","author":{"@type":"Person","name":"PPOffice"},"publisher":{"@type":"Organization","name":"Icarus","logo":{"@type":"ImageObject","url":"http://ppoffice.github.io/img/logo.svg"}},"description":"Icarus’ default theme configuration file is _config.icarus.yml. It defines the global layout and style settings of the theme and controls external features such as plugins and widgets. This article de"}</script><link rel="canonical" href="http://ppoffice.github.io/hexo-theme-icarus/Configuration/icarus-user-guide-configuring-the-theme/"><link rel="icon" href="/hexo-theme-icarus/img/favicon.svg"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css"><link data-pjax rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@11.7.0/styles/atom-one-light.css"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;600&family=Source+Code+Pro"><link data-pjax rel="stylesheet" href="/hexo-theme-icarus/css/default.css"><style>body>.footer,body>.navbar,body>.section{opacity:0}</style><!--!--><!--!--><!--!--><!--!--><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cookieconsent@3.1.1/build/cookieconsent.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.10.0/dist/css/lightgallery.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css"><script src="https://www.googletagmanager.com/gtag/js?id=UA-72437521-5" async></script><script>window.dataLayer = window.dataLayer || [];
|
||
function gtag(){dataLayer.push(arguments);}
|
||
gtag('js', new Date());
|
||
|
||
gtag('config', 'UA-72437521-5');</script><!--!--><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css"><style>.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#3273dc;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px}</style><script src="https://cdn.jsdelivr.net/npm/pace-js@1.2.4/pace.min.js"></script><!--!--><!--!--><!-- hexo injector head_end start --><script>
|
||
(function () {
|
||
function switchTab() {
|
||
if (!location.hash) {
|
||
return;
|
||
}
|
||
|
||
const id = '#' + CSS.escape(location.hash.substring(1));
|
||
const $tabMenu = document.querySelector(`.tabs a[href="${id}"]`);
|
||
if (!$tabMenu) {
|
||
return;
|
||
}
|
||
|
||
const $tabMenuContainer = $tabMenu.parentElement.parentElement;
|
||
Array.from($tabMenuContainer.children).forEach($menu => $menu.classList.remove('is-active'));
|
||
Array.from($tabMenuContainer.querySelectorAll('a'))
|
||
.map($menu => document.getElementById($menu.getAttribute("href").substring(1)))
|
||
.forEach($content => $content.classList.add('is-hidden'));
|
||
|
||
if ($tabMenu) {
|
||
$tabMenu.parentElement.classList.add('is-active');
|
||
}
|
||
const $activeTab = document.querySelector(id);
|
||
if ($activeTab) {
|
||
$activeTab.classList.remove('is-hidden');
|
||
}
|
||
}
|
||
switchTab();
|
||
window.addEventListener('hashchange', switchTab, false);
|
||
})();
|
||
</script><!-- hexo injector head_end end --><meta name="generator" content="Hexo 7.3.0">
|
||
<style>.not-gallery-item { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; } .not-gallery-item > span { position: relative; z-index: 10; } .not-gallery-item img, .not-gallery-item .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; } .not-gallery-item img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .not-gallery-item-fallback { color: inherit; } .not-gallery-item-fallback img { opacity: 0 !important; }</style>
|
||
<link rel="alternate" href="/hexo-theme-icarus/atom.xml" title="Icarus" type="application/atom+xml">
|
||
</head><body class="is-2-column"><nav class="navbar navbar-main"><div class="container navbar-container"><div class="navbar-brand justify-content-center"><a class="navbar-item navbar-logo" href="/hexo-theme-icarus/"><img src="/hexo-theme-icarus/img/logo.svg" alt="Icarus" height="28"></a></div><div class="navbar-menu"><div class="navbar-start"><a class="navbar-item" href="/hexo-theme-icarus/">Home</a><a class="navbar-item" href="/hexo-theme-icarus/archives">Archives</a><a class="navbar-item" href="/hexo-theme-icarus/categories">Categories</a><a class="navbar-item" href="/hexo-theme-icarus/tags">Tags</a><a class="navbar-item" href="/hexo-theme-icarus/about">About</a></div><div class="navbar-end"><a class="navbar-item" target="_blank" rel="noopener" title="Discuss on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus/discussions"><i class="fas fa-comments"></i></a><a class="navbar-item" target="_blank" rel="noopener" title="Download on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus"><i class="fab fa-github"></i></a><a class="navbar-item is-hidden-tablet catalogue" title="Catalogue" href="javascript:;"><i class="fas fa-list-ul"></i></a><a class="navbar-item search" title="Search" href="javascript:;"><i class="fas fa-search"></i></a></div></div></div></nav><section class="section"><div class="container"><div class="columns"><div class="column order-2 column-main is-8-tablet is-8-desktop is-8-widescreen"><div class="card"><div class="card-image"><span class="image is-7by3"><img class="fill" src="/hexo-theme-icarus/gallery/covers/vector_landscape_2.svg" alt="Icarus User Guide - Configuring the Theme"></span></div><article class="card-content article" role="article"><div class="article-meta is-size-7 is-uppercase level is-mobile"><div class="level-left"><span class="level-item">Posted <time dateTime="2020-03-01T00:00:00.000Z" title="3/1/2020, 12:00:00 AM">2020-03-01</time></span><span class="level-item"><a class="link-muted" href="/hexo-theme-icarus/categories/Configuration/">Configuration</a></span><span class="level-item">17 minutes read (About 2553 words)</span></div></div><h1 class="title is-3 is-size-4-mobile">Icarus User Guide - Configuring the Theme</h1><div class="content"><p>Icarus’ default theme configuration file is <code>_config.icarus.yml</code>.
|
||
It defines the global layout and style settings of the theme and controls external features such as plugins and widgets.
|
||
This article details the general configurations of the theme.
|
||
It also explains what configuration files are used and how Icarus generate and validate these configurations.</p>
|
||
<span id="more"></span>
|
||
|
||
<article class="message message-immersive is-primary">
|
||
<div class="message-body">
|
||
<i class="fas fa-globe-asia mr-2"></i>This article is also available in
|
||
<a href="/hexo-theme-icarus/Configuration/icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97-%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE/">简体中文</a>.
|
||
</div>
|
||
</article>
|
||
|
||
<h2 id="General-Theme-Configurations"><a href="#General-Theme-Configurations" class="headerlink" title="General Theme Configurations"></a>General Theme Configurations</h2><h3 id="Configuration-Version"><a href="#Configuration-Version" class="headerlink" title="Configuration Version"></a>Configuration Version</h3><p>This version code is related to and but not always the same as the theme version code.
|
||
Icarus uses it to determine whether to upgrade the default theme configuration file.
|
||
You should not change it by yourself.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="number">5.0</span><span class="number">.0</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Theme-Variant"><a href="#Theme-Variant" class="headerlink" title="Theme Variant"></a>Theme Variant</h3><p>Choose a skin for Icarus.
|
||
<code>"default"</code> and <code>"cyberpunk"</code> are supported values currently.
|
||
You can take a look at the Cyberpunk variant <a href="/hexo-theme-icarus/uncategorized/cyberpunk-theme-variant/" title="Cyberpunk Theme Variant">here</a>.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">variant:</span> <span class="string">default</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Logo"><a href="#Logo" class="headerlink" title="Logo"></a>Logo</h3><p>Set the logo of your site.
|
||
It will display on the navigation bar and the footer.
|
||
The value of the <code>logo</code> can either be the path or URL to your logo image:</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">logo:</span> <span class="string">/img/logo.svg</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>or text if you set it like the following:</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">logo:</span></span><br><span class="line"> <span class="attr">text:</span> <span class="string">My</span> <span class="string">Beautiful</span> <span class="string">Site</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Favicon"><a href="#Favicon" class="headerlink" title="Favicon"></a>Favicon</h3><p>You can specify the path or URL to your site’s favicon in the <code>head</code> section.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">head:</span></span><br><span class="line"> <span class="attr">favicon:</span> <span class="string">/img/favicon.svg</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Web-App-Manifest"><a href="#Web-App-Manifest" class="headerlink" title="Web App Manifest"></a>Web App Manifest</h3><p>Icarus supports basic PWA <code>manifest.json</code> generation and meta tags.
|
||
To enable web app manifest, use the following configuration in your theme configuration file.
|
||
You can also refer to <a target="_blank" rel="noopener" href="https://developer.mozilla.org/en-US/docs/Web/Manifest">MDN</a> for details
|
||
on each manifest configuration setting.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml >folded</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">manifest:</span></span><br><span class="line"> <span class="comment"># Name of the web application (default to the site title)</span></span><br><span class="line"> <span class="attr">name:</span> <span class="string">Icaurs</span> <span class="bullet">-</span> <span class="string">Hexo</span> <span class="string">Theme</span></span><br><span class="line"> <span class="comment"># The displayed name of the web application</span></span><br><span class="line"> <span class="comment"># when there is not enough space to display full name</span></span><br><span class="line"> <span class="attr">short_name:</span> <span class="string">Icarus</span></span><br><span class="line"> <span class="comment"># The start URL of the web application</span></span><br><span class="line"> <span class="attr">start_url:</span> <span class="string">https://ppoffice.github.io/</span></span><br><span class="line"> <span class="comment"># The default theme color for the application</span></span><br><span class="line"> <span class="attr">theme_color:</span> <span class="string">"#3273dc"</span></span><br><span class="line"> <span class="comment"># A placeholder background color for the application page to display</span></span><br><span class="line"> <span class="comment"># before its stylesheet is loaded</span></span><br><span class="line"> <span class="attr">background_color:</span> <span class="string">"#3273dc"</span></span><br><span class="line"> <span class="comment"># The preferred display mode for the website</span></span><br><span class="line"> <span class="attr">display:</span> <span class="string">standalone</span></span><br><span class="line"> <span class="comment"># Image files that can serve as application icons for different contexts</span></span><br><span class="line"> <span class="attr">icons:</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="comment"># The path to the image file</span></span><br><span class="line"> <span class="attr">src:</span> <span class="string">icons/touch-icon-iphone.png</span></span><br><span class="line"> <span class="comment"># A string containing space-separated image dimensions</span></span><br><span class="line"> <span class="attr">sizes:</span> <span class="string">144x144</span></span><br><span class="line"> <span class="comment"># A hint as to the media type of the image (optional)</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">image/png</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="attr">src:</span> <span class="string">icons/touch-icon-ipad.png</span></span><br><span class="line"> <span class="attr">sizes:</span> <span class="string">152x152</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="attr">src:</span> <span class="string">icon/logo.ico</span></span><br><span class="line"> <span class="attr">sizes:</span> <span class="string">72x72</span> <span class="string">96x96</span> <span class="string">128x128</span> <span class="string">256x256</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Open-Graph"><a href="#Open-Graph" class="headerlink" title="Open Graph"></a>Open Graph</h3><p>You can set up Open Graph in the <code>head</code> section.
|
||
You should leave most of the settings blank in the configuration file.
|
||
Only set those settings in the front-matter of your post if you need them.
|
||
Please refer to <a target="_blank" rel="noopener" href="https://hexo.io/docs/helpers.html#open-graph">Hexo documentation</a> for details on each setting.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml >folded</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">head:</span></span><br><span class="line"> <span class="attr">open_graph:</span></span><br><span class="line"> <span class="comment"># Page title (og:title) (optional)</span></span><br><span class="line"> <span class="attr">title:</span> </span><br><span class="line"> <span class="comment"># Page type (og:type) (optional)</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">blog</span></span><br><span class="line"> <span class="comment"># Page URL (og:url) (optional)</span></span><br><span class="line"> <span class="attr">url:</span> </span><br><span class="line"> <span class="comment"># Page cover (og:image) (optional)</span></span><br><span class="line"> <span class="attr">image:</span> </span><br><span class="line"> <span class="comment"># Site name (og:site_name) (optional)</span></span><br><span class="line"> <span class="attr">site_name:</span> </span><br><span class="line"> <span class="comment"># Page author (article:author) (optional)</span></span><br><span class="line"> <span class="attr">author:</span> </span><br><span class="line"> <span class="comment"># Page description (og:description) (optional)</span></span><br><span class="line"> <span class="attr">description:</span> </span><br><span class="line"> <span class="comment"># Twitter card type (twitter:card)</span></span><br><span class="line"> <span class="attr">twitter_card:</span> </span><br><span class="line"> <span class="comment"># Twitter ID (twitter:creator)</span></span><br><span class="line"> <span class="attr">twitter_id:</span> </span><br><span class="line"> <span class="comment"># Twitter Site (twitter:site)</span></span><br><span class="line"> <span class="attr">twitter_site:</span> </span><br><span class="line"> <span class="comment"># Google+ profile link (deprecated)</span></span><br><span class="line"> <span class="attr">google_plus:</span> </span><br><span class="line"> <span class="comment"># Facebook admin ID</span></span><br><span class="line"> <span class="attr">fb_admins:</span> </span><br><span class="line"> <span class="comment"># Facebook App ID</span></span><br><span class="line"> <span class="attr">fb_app_id:</span> </span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Google-Structured-Data"><a href="#Google-Structured-Data" class="headerlink" title="Google Structured Data"></a>Google Structured Data</h3><p>You can set up Google Structured Data in the <code>head</code> section.
|
||
You should leave most of the settings blank in the configuration file.
|
||
Only set those settings in the front-matter of your post if you need them.
|
||
Please refer to <a target="_blank" rel="noopener" href="https://developers.google.com/search/docs/guides/intro-structured-data">Search for Developers</a>
|
||
for details on each setting.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml >folded</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">head:</span></span><br><span class="line"> <span class="attr">structured_data:</span></span><br><span class="line"> <span class="comment"># Page title (optional)</span></span><br><span class="line"> <span class="attr">title:</span> </span><br><span class="line"> <span class="comment"># Page description (optional)</span></span><br><span class="line"> <span class="attr">description:</span> </span><br><span class="line"> <span class="comment"># Page URL (optional)</span></span><br><span class="line"> <span class="attr">url:</span> </span><br><span class="line"> <span class="comment"># Page author (article:author) (optional)</span></span><br><span class="line"> <span class="attr">author:</span> </span><br><span class="line"> <span class="comment"># Page images (optional)</span></span><br><span class="line"> <span class="attr">image:</span> </span><br><span class="line"> <span class="comment"># The publisher of the article (optional)</span></span><br><span class="line"> <span class="attr">publisher:</span></span><br><span class="line"> <span class="comment"># The logo of the publisher (optional)</span></span><br><span class="line"> <span class="attr">publisher_logo:</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Page-Metadata"><a href="#Page-Metadata" class="headerlink" title="Page Metadata"></a>Page Metadata</h3><p>You can add custom <code><meta></code> tags to the generated HTML from the <code>meta</code> setting in the <code>head</code> section.
|
||
Each meta tag should appear as an item of the <code>meta</code> array.
|
||
The value of each <code>meta</code> item should be in the <code><field_name>=<field_value></code> format
|
||
with <code>field_name</code> and <code>field_value</code> represent the field and value of the <code><meta></code> tag respectively.
|
||
Separate the <code><field_name>=<field_value></code> pairs with <code>;</code> if the <code><meta></code> tag has multiple fields and values.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">head:</span></span><br><span class="line"> <span class="attr">meta:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">'name=theme-color;content=#123456'</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">'name=generator;content="Hexo 4.2.0"'</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="RSS"><a href="#RSS" class="headerlink" title="RSS"></a>RSS</h3><p>You can add a link to your RSS feed at the <code>rss</code> setting in the <code>head</code> section.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">head:</span></span><br><span class="line"> <span class="attr">rss:</span> <span class="string">/path/to/atom.xml</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Navigation-Bar"><a href="#Navigation-Bar" class="headerlink" title="Navigation Bar"></a>Navigation Bar</h3><p>The <code>navbar</code> section defines the menu items and links in the navigation bar.
|
||
You may put any menu item in the navigation bar by adding <code><link_name>: <link_url></code> to the <code>menu</code> setting.
|
||
To put links on the right side of the navigation bar, add <code><link_name>: <link_url></code> to the <code>links</code> setting.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">navbar:</span></span><br><span class="line"> <span class="comment"># Naviagtion menu items</span></span><br><span class="line"> <span class="attr">menu:</span></span><br><span class="line"> <span class="attr">Home:</span> <span class="string">/</span></span><br><span class="line"> <span class="attr">Archives:</span> <span class="string">/archives</span></span><br><span class="line"> <span class="attr">Categories:</span> <span class="string">/categories</span></span><br><span class="line"> <span class="attr">Tags:</span> <span class="string">/tags</span></span><br><span class="line"> <span class="attr">About:</span> <span class="string">/about</span></span><br><span class="line"> <span class="comment"># Links to be shown on the right of the navigation bar</span></span><br><span class="line"> <span class="attr">links:</span></span><br><span class="line"> <span class="attr">GitHub:</span> <span class="string">'https://github.com'</span></span><br><span class="line"> <span class="attr">Download on GitHub:</span></span><br><span class="line"> <span class="attr">icon:</span> <span class="string">fab</span> <span class="string">fa-github</span></span><br><span class="line"> <span class="attr">url:</span> <span class="string">'https://github.com/ppoffice/hexo-theme-icarus'</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>You can display a FontAwesome icon instead of text-only link with the following format:</p>
|
||
<figure class="highlight yaml"><figcaption><span>Link format</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="string"><link_name>:</span></span><br><span class="line"> <span class="attr">icon:</span> <span class="string"><fontawesome_icon_class_name></span></span><br><span class="line"> <span class="attr">url:</span> <span class="string"><link_url></span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Footer"><a href="#Footer" class="headerlink" title="Footer"></a>Footer</h3><p>The <code>footer</code> section defines the links on the right side of the page footer.
|
||
The link format is exactly the same as <code>links</code> in the <code>navbar</code> section.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">footer:</span></span><br><span class="line"> <span class="attr">links:</span></span><br><span class="line"> <span class="attr">Creative Commons:</span></span><br><span class="line"> <span class="attr">icon:</span> <span class="string">fab</span> <span class="string">fa-creative-commons</span></span><br><span class="line"> <span class="attr">url:</span> <span class="string">'https://creativecommons.org/'</span></span><br><span class="line"> <span class="attr">Attribution 4.0 International:</span></span><br><span class="line"> <span class="attr">icon:</span> <span class="string">fab</span> <span class="string">fa-creative-commons-by</span></span><br><span class="line"> <span class="attr">url:</span> <span class="string">'https://creativecommons.org/licenses/by/4.0/'</span></span><br><span class="line"> <span class="attr">Download on GitHub:</span></span><br><span class="line"> <span class="attr">icon:</span> <span class="string">fab</span> <span class="string">fa-github</span></span><br><span class="line"> <span class="attr">url:</span> <span class="string">'https://github.com/ppoffice/hexo-theme-icarus'</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>You can also display custom copyright text at the footer section:</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">footer:</span></span><br><span class="line"> <span class="attr">copyright:</span> <span class="string">Made</span> <span class="string">with</span> <span class="string">💖</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Code-Highlight"><a href="#Code-Highlight" class="headerlink" title="Code Highlight"></a>Code Highlight</h3><p>If you have enabled code highlighting in Hexo, you can customize the code blocks with <code>highlight</code> settings
|
||
in the <code>article</code> section.
|
||
Choose a theme from all themes listed under
|
||
<a target="_blank" rel="noopener" href="https://github.com/highlightjs/highlight.js/tree/9.18.1/src/styles">highlight.js/src/styles</a>.
|
||
Then, copy the file name (without the <code>.css</code> extension) to the <code>theme</code> setting.</p>
|
||
<p>To hide the “copy” button of every code block, set <code>clipboard</code> to <code>false</code>.
|
||
If you wish to fold or unfold all code blocks, set the <code>fold</code> setting to <code>"folded"</code> or <code>"unfolded"</code>.
|
||
You can also disable the folding feature by leaving the <code>fold</code> setting empty.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">article:</span></span><br><span class="line"> <span class="attr">highlight:</span></span><br><span class="line"> <span class="comment"># Code highlight themes</span></span><br><span class="line"> <span class="comment"># https://github.com/highlightjs/highlight.js/tree/master/src/styles</span></span><br><span class="line"> <span class="attr">theme:</span> <span class="string">atom-one-light</span></span><br><span class="line"> <span class="comment"># Show copy code button</span></span><br><span class="line"> <span class="attr">clipboard:</span> <span class="literal">true</span></span><br><span class="line"> <span class="comment"># Default folding status of the code blocks. Can be "", "folded", "unfolded"</span></span><br><span class="line"> <span class="attr">fold:</span> <span class="string">unfolded</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>Additionally, you can fold an individual code block in the Markdown file using the following syntax:</p>
|
||
<figure class="highlight plaintext"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">{% codeblock "optional file name" lang:code_language_name >folded %}</span><br><span class="line">...code block content...</span><br><span class="line">{% endcodeblock %}</span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Cover-Thumbnail"><a href="#Cover-Thumbnail" class="headerlink" title="Cover & Thumbnail"></a>Cover & Thumbnail</h3><p>You can add a cover image to your post by adding the <code>cover</code> property in post’s front-matter:</p>
|
||
<figure class="highlight yaml"><figcaption><span>post.md</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">title:</span> <span class="string">Getting</span> <span class="string">Started</span> <span class="string">with</span> <span class="string">Icarus</span></span><br><span class="line"><span class="attr">cover:</span> <span class="string">/gallery/covers/cover.jpg</span></span><br><span class="line"><span class="meta">---</span></span><br><span class="line"><span class="string">Post</span> <span class="string">content...</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>Similarly, you may set the thumbnail of your post in the front-matter as well:</p>
|
||
<figure class="highlight yaml"><figcaption><span>post.md</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">title:</span> <span class="string">Getting</span> <span class="string">Started</span> <span class="string">with</span> <span class="string">Icarus</span></span><br><span class="line"><span class="attr">thumbnail:</span> <span class="string">/gallery/covers/thumbnail.jpg</span></span><br><span class="line"><span class="meta">---</span></span><br><span class="line"><span class="string">Post</span> <span class="string">content...</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>The thumbnail will show in the archive page as well as in the recent post widget.</p>
|
||
<p>If you choose to use the image path in the front-matter, you need to ensure the path is absolute
|
||
or relative to the source directory of your site.
|
||
For example, to use <code><your blog>/source/gallery/image.jpg</code> as a thumbnail image, you need to put
|
||
<code>thumbnail: /gallery/image.jpg</code> in the front-matter.</p>
|
||
<h3 id="Read-Time"><a href="#Read-Time" class="headerlink" title="Read Time"></a>Read Time</h3><p>You can show a word counter and the estimated reading time of your article above the article title by
|
||
setting <code>readtime</code> to <code>true</code> in the <code>article</code> section.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">article:</span></span><br><span class="line"> <span class="attr">readtime:</span> <span class="literal">true</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Update-Time"><a href="#Update-Time" class="headerlink" title="Update Time"></a>Update Time</h3><p>To show an update time of an article, set <code>updated</code> time in the article’s front-matter:</p>
|
||
<figure class="highlight yaml"><figcaption><span>post.md</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">title:</span> <span class="string">Getting</span> <span class="string">Started</span> <span class="string">with</span> <span class="string">Icarus</span></span><br><span class="line"><span class="attr">updated:</span> <span class="number">2020-04-01 00:00:00</span></span><br><span class="line"><span class="meta">---</span></span><br><span class="line"><span class="string">Post</span> <span class="string">content...</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>Then, set <code>update_time</code> to <code>true</code> in the <code>article</code> section of your theme configuration file:</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">article:</span></span><br><span class="line"> <span class="attr">update_time:</span> <span class="literal">true</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>You may also set <code>update_time</code> to <code>false</code> to hide update time for all articles, or <code>auto</code>
|
||
to hide update time when it is the same as the article publication time.</p>
|
||
<h3 id="Article-Licensing"><a href="#Article-Licensing" class="headerlink" title="Article Licensing"></a>Article Licensing</h3><p>You can show a section at the end of your posts/pages describing the licensing of your work.
|
||
Both text and icons are accepted as license links.
|
||
This configuration is the same as <code>links</code> in the navigation bar or the footer:</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">article:</span></span><br><span class="line"> <span class="comment"># Article licensing block</span></span><br><span class="line"> <span class="attr">licenses:</span></span><br><span class="line"> <span class="attr">Creative Commons:</span></span><br><span class="line"> <span class="attr">icon:</span> <span class="string">fab</span> <span class="string">fa-creative-commons</span></span><br><span class="line"> <span class="attr">url:</span> <span class="string">'https://creativecommons.org/'</span></span><br><span class="line"> <span class="attr">'CC BY-NC-SA 4.0':</span> <span class="string">'https://creativecommons.org/licenses/by-nc-sa/4.0/'</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Sidebar"><a href="#Sidebar" class="headerlink" title="Sidebar"></a>Sidebar</h3><p>To make a sidebar fixed when you scroll the page, set the <code>sticky</code> setting of that sidebar to <code>true</code> in
|
||
the <code>sidebar</code> section.</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">sidebar:</span></span><br><span class="line"> <span class="attr">left:</span></span><br><span class="line"> <span class="attr">sticky:</span> <span class="literal">false</span></span><br><span class="line"> <span class="attr">right:</span></span><br><span class="line"> <span class="attr">sticky:</span> <span class="literal">true</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
|
||
<h3 id="Other-Configurations"><a href="#Other-Configurations" class="headerlink" title="Other Configurations"></a>Other Configurations</h3><p>You can refer to the <a href="/hexo-theme-icarus/tags/Icarus-User-Guide/">Icarus User Guide</a> to learn more about
|
||
third-party plugins, widgets, and CDN provider configurations.</p>
|
||
<h2 id="Configuration-Files-and-Priority"><a href="#Configuration-Files-and-Priority" class="headerlink" title="Configuration Files and Priority"></a>Configuration Files and Priority</h2><p>Apart from the default theme configuration file <code>_config.icarus.yml</code>, Icarus also looks at the following
|
||
locations for alternative configurations:</p>
|
||
<ul>
|
||
<li>The site configuration file at <code>_config.yml</code></li>
|
||
<li>Layout configuration files at <code>_config.post.yml</code> and <code>_config.page.yml</code></li>
|
||
<li>Post/page’s <a target="_blank" rel="noopener" href="https://hexo.io/docs/front-matter.html">front-matter</a></li>
|
||
<li>(Deprecated) Legacy theme configuration file at <code>themes/icarus/_config.yml</code></li>
|
||
<li>(Deprecated) Legacy layout configuration file at <code>themes/icarus/_config.post.yml</code> and <code>themes/icarus/_config.page.yml</code></li>
|
||
</ul>
|
||
<h3 id="Layout-Configuration-Files"><a href="#Layout-Configuration-Files" class="headerlink" title="Layout Configuration Files"></a>Layout Configuration Files</h3><p>Layout configuration files follow the same format and definitions as theme configuration files.
|
||
The configurations in <code>_config.post.yml</code> apply to all posts, and those in <code>_config.page.yml</code> apply to all custom pages.
|
||
They both override configurations in theme configuration files.</p>
|
||
<p>For example, you can adopt a two-column layout for all posts in <code>_config.post.yml</code>:</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.post.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">widgets:</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">recent_posts</span></span><br><span class="line"> <span class="attr">position:</span> <span class="string">left</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">categories</span></span><br><span class="line"> <span class="attr">position:</span> <span class="string">left</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">tags</span></span><br><span class="line"> <span class="attr">position:</span> <span class="string">left</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>while keeping a three-column layout in all other pages:</p>
|
||
<figure class="highlight yaml"><figcaption><span>_config.icarus.yml</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">widgets:</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">recent_posts</span></span><br><span class="line"> <span class="attr">position:</span> <span class="string">left</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">categories</span></span><br><span class="line"> <span class="attr">position:</span> <span class="string">right</span></span><br><span class="line"> <span class="bullet">-</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">tags</span></span><br><span class="line"> <span class="attr">position:</span> <span class="string">right</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<h3 id="Post-Page-Front-matter"><a href="#Post-Page-Front-matter" class="headerlink" title="Post/Page Front-matter"></a>Post/Page Front-matter</h3><p>If you wish to override theme configurations only for a certain post/page, you can set them in the front-matter
|
||
of that post/page.
|
||
For example, you can change the code block highlight theme of a single post by setting it in that post’s
|
||
front-matter like the following:</p>
|
||
<figure class="highlight yaml"><figcaption><span>source/_post/some-post.md</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">title:</span> <span class="string">My</span> <span class="string">first</span> <span class="string">post</span></span><br><span class="line"><span class="attr">date:</span> <span class="string">'2015-01-01 00:00:01'</span></span><br><span class="line"><span class="attr">article:</span></span><br><span class="line"> <span class="attr">highlight:</span></span><br><span class="line"> <span class="attr">theme:</span> <span class="string">atom-one-dark</span></span><br><span class="line"><span class="meta">---</span></span><br><span class="line"><span class="comment"># Some Post</span></span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>The above setting will always override the <code>article.highlight</code> in <code>_config.post.yml</code> and <code>_config.icarus.yml</code>
|
||
for that post.
|
||
This layered configuration scheme is handy for differentiating page customizations and optimizations
|
||
for different audiences.
|
||
For instance, you can enable faster CDNs or a localized comment service based on the country and language
|
||
of your page viewers.</p>
|
||
<p>However, it should be noted that post or page attributes defined by Hexo will not override the theme
|
||
configurations from the front-matter.
|
||
Examples are <code>title</code>, <code>date</code>, <code>updated</code>, <code>comments</code>, <code>layout</code>, <code>source</code>, <code>photos</code>, and <code>excerpt</code>.</p>
|
||
<h3 id="Site-Configuration-File"><a href="#Site-Configuration-File" class="headerlink" title="Site Configuration File"></a>Site Configuration File</h3><p>All configuration sources listed above, including theme configuration files, layout configuration files,
|
||
and post/page front-matter, will override the site configuration file only for configurations
|
||
used by Icarus.
|
||
For instance, <code>title</code> in the <code>_config.icarus.yml</code> will override <code>title</code> in the <code>_config.yml</code>, but
|
||
<code>new_post_name</code> will not since it is not used by Icarus.</p>
|
||
<p>Also, the <code>theme_config</code> option in the site configuration file will merge with and override theme
|
||
configurations from theme configuration files.
|
||
However, using this option is highly discouraged.</p>
|
||
<h3 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h3><p>In conclusion, the scopes of the configuration sources and their priorities are:</p>
|
||
<ul>
|
||
<li><p>For a certain post or page</p>
|
||
<ul>
|
||
<li>Post/Page front-matter overrides all following sources.</li>
|
||
<li>Layout configuration files override all following sources.</li>
|
||
<li><code>theme_config</code> option in the site configuration file overrides all following sources.</li>
|
||
<li>Theme configuration files override all following sources.</li>
|
||
<li>The site configuration file.</li>
|
||
</ul>
|
||
</li>
|
||
<li><p>For all posts or pages</p>
|
||
<ul>
|
||
<li>Layout configuration files override all following sources.</li>
|
||
<li><code>theme_config</code> option in the site configuration file overrides all following sources.</li>
|
||
<li>Theme configuration files override all following sources.</li>
|
||
<li>The site configuration file.</li>
|
||
</ul>
|
||
</li>
|
||
<li><p>For all posts, pages, and index pages</p>
|
||
<ul>
|
||
<li><code>theme_config</code> option in the site configuration file overrides all following sources.</li>
|
||
<li>Theme configuration files override all following sources.</li>
|
||
<li>The site configuration file.</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
<h2 id="Configuration-Generation-and-Validation"><a href="#Configuration-Generation-and-Validation" class="headerlink" title="Configuration Generation and Validation"></a>Configuration Generation and Validation</h2><p>All Icarus theme configurations are written in <a target="_blank" rel="noopener" href="https://yaml.org/">YAML language</a>.
|
||
Icarus will automatically generate the default configuration file <code>_config.icarus.yml</code> from a set of
|
||
<a target="_blank" rel="noopener" href="https://json-schema.org/">JSON schemas</a> if it does not exist.
|
||
That’s why you don’t see an example configuration file (such as <code>_config.yml.example</code>) under the theme directory.
|
||
Most of the JSON schemas are in the <code><icarus_directory>/include/schema</code> directory, while the others are
|
||
in the <a target="_blank" rel="noopener" href="https://github.com/ppoffice/hexo-component-inferno">ppoffice/hexo-component-inferno</a> repository.
|
||
You can attach the <code>--icarus-dont-generate-config</code> flag to your <code>hexo</code> commands to prevent automatic configuration
|
||
generation.</p>
|
||
<p>The theme also validates your configurations against these schemas every time you execute a <code>hexo</code> command.
|
||
If anything goes wrong during the validation, Icarus will print out the exact location of the misconfiguration
|
||
and its error type.
|
||
For example, the following messages tell us that the value of the <code>logo</code> setting should be either a string or an
|
||
object, instead of an integer.
|
||
You may skip the validation by appending the <code>--icarus-dont-check-config</code> flag to your <code>hexo</code> commands, but it is
|
||
not recommended to do so.</p>
|
||
<figure class="highlight plaintext"><figcaption><span>hexo log</span></figcaption><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">INFO === Checking package dependencies ===</span><br><span class="line">INFO === Checking the configuration file ===</span><br><span class="line">WARN Configuration file failed one or more checks.</span><br><span class="line">WARN Icarus may still run, but you will encounter unexcepted results.</span><br><span class="line">WARN Here is some information for you to correct the configuration file.</span><br><span class="line">WARN [</span><br><span class="line"> {</span><br><span class="line"> keyword: 'type',</span><br><span class="line"> dataPath: '.logo',</span><br><span class="line"> schemaPath: '#/properties/logo/type',</span><br><span class="line"> params: { type: 'string,object' },</span><br><span class="line"> message: 'should be string,object'</span><br><span class="line"> }</span><br><span class="line">]</span><br></pre></td></tr></tbody></table></figure>
|
||
|
||
<p>Additionally, Icarus will execute migration scripts to upgrade the default theme configuration file to the newest
|
||
version if it is not.
|
||
These scripts are in the <code><icarus_directory>/include/migration</code> directory.
|
||
You may disable the upgrade by appending the <code>--icarus-dont-upgrade-config</code> flag to your <code>hexo</code> commands.
|
||
Finally, Icarus will also check the Node.js package dependencies and remind you to install them if you haven’t.</p>
|
||
<article class="message message-immersive is-warning">
|
||
<div class="message-body">
|
||
<i class="fas fa-question-circle mr-2"></i>Something wrong with this article?
|
||
Click <a target="_blank" rel="noopener" href="https://github.com/ppoffice/hexo-theme-icarus/edit/site/source/_posts/en/Configuring-Theme.md">here</a>
|
||
to submit your revision.
|
||
</div>
|
||
</article>
|
||
|
||
|
||
<p><a style="background-color:black;color:white;text-decoration:none;padding:4px 6px;font-size:12px;line-height:1.2;display:inline-block;border-radius:3px" href="https://www.vecteezy.com/free-vector/vector-landscape" target="_blank" rel="noopener noreferrer" title="Vector Landscape Vectors by Vecteezy"><span style="display:inline-block;padding:2px 3px"><svg xmlns="http://www.w3.org/2000/svg" style="height:12px;width:auto;position:relative;vertical-align:middle;top:-1px;fill:white" viewBox="0 0 32 32"><path d="M20.8 18.1c0 2.7-2.2 4.8-4.8 4.8s-4.8-2.1-4.8-4.8c0-2.7 2.2-4.8 4.8-4.8 2.7.1 4.8 2.2 4.8 4.8zm11.2-7.4v14.9c0 2.3-1.9 4.3-4.3 4.3h-23.4c-2.4 0-4.3-1.9-4.3-4.3v-15c0-2.3 1.9-4.3 4.3-4.3h3.7l.8-2.3c.4-1.1 1.7-2 2.9-2h8.6c1.2 0 2.5.9 2.9 2l.8 2.4h3.7c2.4 0 4.3 1.9 4.3 4.3zm-8.6 7.5c0-4.1-3.3-7.5-7.5-7.5-4.1 0-7.5 3.4-7.5 7.5s3.3 7.5 7.5 7.5c4.2-.1 7.5-3.4 7.5-7.5z"></path></svg></span><span style="display:inline-block;padding:2px 3px">Vector Landscape Vectors by Vecteezy</span></a></p>
|
||
</div><div class="article-licensing box"><div class="licensing-title"><p>Icarus User Guide - Configuring the Theme</p><p><a href="http://ppoffice.github.io/hexo-theme-icarus/Configuration/icarus-user-guide-configuring-the-theme/">http://ppoffice.github.io/hexo-theme-icarus/Configuration/icarus-user-guide-configuring-the-theme/</a></p></div><div class="licensing-meta level is-mobile"><div class="level-left"><div class="level-item is-narrow"><div><h6>Author</h6><p>PPOffice</p></div></div><div class="level-item is-narrow"><div><h6>Posted on</h6><p>2020-03-01</p></div></div><div class="level-item is-narrow"><div><h6>Licensed under</h6><p><a class="icons" rel="noopener" target="_blank" title="Creative Commons" href="https://creativecommons.org/"><i class="icon fab fa-creative-commons"></i></a><a class="" rel="noopener" target="_blank" title="CC BY-NC-SA 4.0" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a></p></div></div></div></div></div><div class="article-tags is-size-7 mb-4"><span class="mr-2">#</span><a class="link-muted mr-2" rel="tag" href="/hexo-theme-icarus/tags/Icarus-User-Guide/">Icarus User Guide</a><a class="link-muted mr-2" rel="tag" href="/hexo-theme-icarus/tags/Getting-Started/">Getting Started</a></div><div class="sharethis-inline-share-buttons"></div><script src="//platform-api.sharethis.com/js/sharethis.js#property=5ab6f60ace89f00013641890&product=inline-share-buttons" defer></script></article></div><!--!--><nav class="post-navigation mt-4 level is-mobile"><div class="level-start"><a class="article-nav-prev level level-item link-muted" href="/hexo-theme-icarus/uncategorized/getting-started-with-icarus/"><i class="level-item fas fa-chevron-left"></i><span class="level-item">Getting Started with Icarus</span></a></div><div class="level-end"><a class="article-nav-next level level-item link-muted" href="/hexo-theme-icarus/uncategorized/faq/"><span class="level-item">FAQ</span><i class="level-item fas fa-chevron-right"></i></a></div></nav><!--!--></div><div class="column column-left is-4-tablet is-4-desktop is-4-widescreen order-1 is-sticky"><div class="card widget" data-type="profile"><div class="card-content"><nav class="level"><div class="level-item has-text-centered flex-shrink-1"><div><figure class="image is-128x128 mx-auto mb-2"><img class="avatar" src="/hexo-theme-icarus/img/avatar.png" alt="PPOffice"></figure><p class="title is-size-4 is-block" style="line-height:inherit;">PPOffice</p><p class="is-size-6 is-block">Web Developer</p><p class="is-size-6 is-flex justify-content-center"><i class="fas fa-map-marker-alt mr-1"></i><span>Earth, Solar System</span></p></div></div></nav><nav class="level is-mobile"><div class="level-item has-text-centered is-marginless"><div><p class="heading">Posts</p><a href="/hexo-theme-icarus/archives/"><p class="title">43</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">Categories</p><a href="/hexo-theme-icarus/categories/"><p class="title">9</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">Tags</p><a href="/hexo-theme-icarus/tags/"><p class="title">4</p></a></div></div></nav><div class="level"><a class="level-item button is-primary is-rounded" href="https://github.com/ppoffice" target="_blank" rel="me noopener">Follow</a></div><div class="level is-mobile is-multiline"><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="Github" href="https://github.com/ppoffice"><i class="fab fa-github"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="Facebook" href="https://facebook.com"><i class="fab fa-facebook"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="Twitter" href="https://twitter.com"><i class="fab fa-twitter"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="Dribbble" href="https://dribbble.com"><i class="fab fa-dribbble"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="me noopener" title="RSS" href="/hexo-theme-icarus/"><i class="fas fa-rss"></i></a></div></div></div><div class="card widget" id="toc" data-type="toc"><div class="card-content"><div class="menu"><h3 class="menu-label">Catalogue</h3><ul class="menu-list"><li><a class="level is-mobile" href="#General-Theme-Configurations"><span class="level-left"><span class="level-item">1</span><span class="level-item">General Theme Configurations</span></span></a><ul class="menu-list"><li><a class="level is-mobile" href="#Configuration-Version"><span class="level-left"><span class="level-item">1.1</span><span class="level-item">Configuration Version</span></span></a></li><li><a class="level is-mobile" href="#Theme-Variant"><span class="level-left"><span class="level-item">1.2</span><span class="level-item">Theme Variant</span></span></a></li><li><a class="level is-mobile" href="#Logo"><span class="level-left"><span class="level-item">1.3</span><span class="level-item">Logo</span></span></a></li><li><a class="level is-mobile" href="#Favicon"><span class="level-left"><span class="level-item">1.4</span><span class="level-item">Favicon</span></span></a></li><li><a class="level is-mobile" href="#Web-App-Manifest"><span class="level-left"><span class="level-item">1.5</span><span class="level-item">Web App Manifest</span></span></a></li><li><a class="level is-mobile" href="#Open-Graph"><span class="level-left"><span class="level-item">1.6</span><span class="level-item">Open Graph</span></span></a></li><li><a class="level is-mobile" href="#Google-Structured-Data"><span class="level-left"><span class="level-item">1.7</span><span class="level-item">Google Structured Data</span></span></a></li><li><a class="level is-mobile" href="#Page-Metadata"><span class="level-left"><span class="level-item">1.8</span><span class="level-item">Page Metadata</span></span></a></li><li><a class="level is-mobile" href="#RSS"><span class="level-left"><span class="level-item">1.9</span><span class="level-item">RSS</span></span></a></li><li><a class="level is-mobile" href="#Navigation-Bar"><span class="level-left"><span class="level-item">1.10</span><span class="level-item">Navigation Bar</span></span></a></li><li><a class="level is-mobile" href="#Footer"><span class="level-left"><span class="level-item">1.11</span><span class="level-item">Footer</span></span></a></li><li><a class="level is-mobile" href="#Code-Highlight"><span class="level-left"><span class="level-item">1.12</span><span class="level-item">Code Highlight</span></span></a></li><li><a class="level is-mobile" href="#Cover-Thumbnail"><span class="level-left"><span class="level-item">1.13</span><span class="level-item">Cover & Thumbnail</span></span></a></li><li><a class="level is-mobile" href="#Read-Time"><span class="level-left"><span class="level-item">1.14</span><span class="level-item">Read Time</span></span></a></li><li><a class="level is-mobile" href="#Update-Time"><span class="level-left"><span class="level-item">1.15</span><span class="level-item">Update Time</span></span></a></li><li><a class="level is-mobile" href="#Article-Licensing"><span class="level-left"><span class="level-item">1.16</span><span class="level-item">Article Licensing</span></span></a></li><li><a class="level is-mobile" href="#Sidebar"><span class="level-left"><span class="level-item">1.17</span><span class="level-item">Sidebar</span></span></a></li><li><a class="level is-mobile" href="#Other-Configurations"><span class="level-left"><span class="level-item">1.18</span><span class="level-item">Other Configurations</span></span></a></li></ul></li><li><a class="level is-mobile" href="#Configuration-Files-and-Priority"><span class="level-left"><span class="level-item">2</span><span class="level-item">Configuration Files and Priority</span></span></a><ul class="menu-list"><li><a class="level is-mobile" href="#Layout-Configuration-Files"><span class="level-left"><span class="level-item">2.1</span><span class="level-item">Layout Configuration Files</span></span></a></li><li><a class="level is-mobile" href="#Post-Page-Front-matter"><span class="level-left"><span class="level-item">2.2</span><span class="level-item">Post/Page Front-matter</span></span></a></li><li><a class="level is-mobile" href="#Site-Configuration-File"><span class="level-left"><span class="level-item">2.3</span><span class="level-item">Site Configuration File</span></span></a></li><li><a class="level is-mobile" href="#Conclusion"><span class="level-left"><span class="level-item">2.4</span><span class="level-item">Conclusion</span></span></a></li></ul></li><li><a class="level is-mobile" href="#Configuration-Generation-and-Validation"><span class="level-left"><span class="level-item">3</span><span class="level-item">Configuration Generation and Validation</span></span></a></li></ul></div></div><style>#toc .menu-list > li > a.is-active + .menu-list { display: block; }#toc .menu-list > li > a + .menu-list { display: none; }</style><script src="/hexo-theme-icarus/js/toc.js" defer></script></div><div class="card widget" data-type="categories"><div class="card-content"><div class="menu"><h3 class="menu-label">Categories</h3><ul class="menu-list"><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Configuration/"><span class="level-start"><span class="level-item">Configuration</span></span><span class="level-end"><span class="level-item tag">4</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/"><span class="level-start"><span class="level-item">Plugins</span></span><span class="level-end"><span class="level-item tag">12</span></span></a><ul><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Analytics/"><span class="level-start"><span class="level-item">Analytics</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Comment/"><span class="level-start"><span class="level-item">Comment</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Donation/"><span class="level-start"><span class="level-item">Donation</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Other/"><span class="level-start"><span class="level-item">Other</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Search/"><span class="level-start"><span class="level-item">Search</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Plugins/Share/"><span class="level-start"><span class="level-item">Share</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li></ul></li><li><a class="level is-mobile" href="/hexo-theme-icarus/categories/Widgets/"><span class="level-start"><span class="level-item">Widgets</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li></ul></div></div></div><div class="card widget" data-type="tags"><div class="card-content"><div class="menu"><h3 class="menu-label">Tags</h3><div class="field is-grouped is-grouped-multiline"><div class="control"><a class="tags has-addons" href="/hexo-theme-icarus/tags/Demo/"><span class="tag">Demo</span><span class="tag">19</span></a></div><div class="control"><a class="tags has-addons" href="/hexo-theme-icarus/tags/Getting-Started/"><span class="tag">Getting Started</span><span class="tag">4</span></a></div><div class="control"><a class="tags has-addons" href="/hexo-theme-icarus/tags/Icarus-User-Guide/"><span class="tag">Icarus User Guide</span><span class="tag">12</span></a></div><div class="control"><a class="tags has-addons" href="/hexo-theme-icarus/tags/Icarus%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97/"><span class="tag">Icarus用户指南</span><span class="tag">12</span></a></div></div></div></div></div></div><!--!--></div></div></section><footer class="footer"><div class="container"><div class="level"><div class="level-start"><a class="footer-logo is-block mb-2" href="/hexo-theme-icarus/"><img src="/hexo-theme-icarus/img/logo.svg" alt="Icarus" height="28"></a><p class="is-size-7"><span>© 2025 PPOffice</span> Powered by <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> & <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a></p></div><div class="level-end"><div class="field has-addons"><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Creative Commons" href="https://creativecommons.org/"><i class="fab fa-creative-commons"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Discuss on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus/discussions"><i class="fas fa-comments"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Download on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus"><i class="fab fa-github"></i></a></p></div></div></div></div></footer><script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script><script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script><script>moment.locale("en");</script><script>var IcarusThemeSettings = {
|
||
article: {
|
||
highlight: {
|
||
clipboard: true,
|
||
fold: 'unfolded'
|
||
}
|
||
}
|
||
};</script><script data-pjax src="/hexo-theme-icarus/js/column.js"></script><script src="/hexo-theme-icarus/js/animation.js"></script><a id="back-to-top" title="Back to top" href="javascript:;"><i class="fas fa-chevron-up"></i></a><script data-pjax src="/hexo-theme-icarus/js/back_to_top.js" defer></script><!--!--><!--!--><!--!--><script src="https://cdn.jsdelivr.net/npm/cookieconsent@3.1.1/build/cookieconsent.min.js" defer></script><script>window.addEventListener("load", () => {
|
||
window.cookieconsent.initialise({
|
||
type: "info",
|
||
theme: "edgeless",
|
||
static: false,
|
||
position: "bottom-left",
|
||
content: {
|
||
message: "This website uses cookies to improve your experience.",
|
||
dismiss: "Got it!",
|
||
allow: "Allow cookies",
|
||
deny: "Decline",
|
||
link: "Learn more",
|
||
policy: "Cookie Policy",
|
||
href: "https://www.cookiesandyou.com/",
|
||
},
|
||
palette: {
|
||
popup: {
|
||
background: "#edeff5",
|
||
text: "#838391"
|
||
},
|
||
button: {
|
||
background: "#4b81e8"
|
||
},
|
||
},
|
||
});
|
||
});</script><script src="https://cdn.jsdelivr.net/npm/lightgallery@1.10.0/dist/js/lightgallery.min.js" defer></script><script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.8.1/dist/js/jquery.justifiedGallery.min.js" defer></script><script>window.addEventListener("load", () => {
|
||
if (typeof $.fn.lightGallery === 'function') {
|
||
$('.article').lightGallery({ selector: '.gallery-item' });
|
||
}
|
||
if (typeof $.fn.justifiedGallery === 'function') {
|
||
if ($('.justified-gallery > p > .gallery-item').length) {
|
||
$('.justified-gallery > p > .gallery-item').unwrap();
|
||
}
|
||
$('.justified-gallery').justifiedGallery();
|
||
}
|
||
});</script><!--!--><!--!--><div id="outdated"><h6>Your browser is out-of-date!</h6><p>Update your browser to view this website correctly.&npsb;<a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update my browser now </a></p><p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">×</a></p></div><script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script><script>window.addEventListener("load", function () {
|
||
outdatedBrowser({
|
||
bgColor: '#f25648',
|
||
color: '#ffffff',
|
||
lowerThan: 'object-fit' // display on IE11 or below
|
||
});
|
||
});</script><!--!--><!--!--><!--!--><script data-pjax src="/hexo-theme-icarus/js/main.js" defer></script><div class="searchbox"><div class="searchbox-container"><div class="searchbox-header"><div class="searchbox-input-container"><input class="searchbox-input" type="text" placeholder="Type something..."></div><a class="searchbox-close" href="javascript:;">×</a></div><div class="searchbox-body"></div></div></div><script data-pjax src="/hexo-theme-icarus/js/insight.js" defer></script><script data-pjax>document.addEventListener('DOMContentLoaded', function () {
|
||
loadInsight({"contentUrl":"/hexo-theme-icarus/content.json"}, {"hint":"Type something...","untitled":"(Untitled)","posts":"Posts","pages":"Pages","categories":"Categories","tags":"Tags"});
|
||
});</script></body></html> |