blog-hexo/public/posts/59577/index.html

799 lines
76 KiB
HTML
Raw Normal View History

2023-10-24 09:50:42 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
2023-11-03 14:25:01 +08:00
Cosy 入门
2023-10-24 09:50:42 +08:00
</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="Mozzie">
2024-03-15 15:38:52 +08:00
<link rel="canonical" href="https://maxshader.com/posts/59577/">
2023-10-24 09:50:42 +08:00
<link rel="icon" type="image/svg" href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 7h1a2 2 0 0 1 2 2v.5a.5.5 0 0 0 .5.5a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5a.5.5 0 0 0-.5.5v.5a2 2 0 0 1-2 2h-2"></path><path d="M8 7H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h1"></path><path d="M12 8l-2 4h3l-2 4"></path></g></svg>'>
2023-12-28 11:27:53 +08:00
<link rel="stylesheet" href="/css/b4c95347.css">
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
<script>window.i18n = {"tip-status-done":"完成","tip-status-default":"全部","tip-status-todo":"计划","tip-status-doing":"进行","tip-status-other":"其他","text-select":"选择","text-move":"移动","text-esc":"退出","January":"一月","February":"二月","March":"三月","April":"四月","May":"五月","June":"六月","July":"七月","August":"八月","September":"九月","October":"十月","November":"十一月","December":"十二月"}</script>
<meta name="generator" content="Hexo 7.0.0"></head>
2023-10-24 09:50:42 +08:00
<body id="app">
2023-12-25 16:39:03 +08:00
<aside id="aside-box" class="left-aside">
<div class="header">
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
<link rel="stylesheet" href="/css/61875ce9.css">
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
<div class="profile">
<a class="badge" href="/">
<span>Hi</span>
2023-10-24 09:50:42 +08:00
<span>Mozzie</span>
</a>
2023-12-25 16:39:03 +08:00
<cosy-tooltip id="left-aside-button" placement="right">
<span slot="content">
<span>显示 / 隐藏 左侧导航</span>
<cosy-short-key>[</cosy-short-key>
</span>
<cosy-icon>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20">
<g fill="none">
<path d="M16 4c1.104-.019 2 .896 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12zm1 2a1 1 0 0 0-1-1h-2.995v10H16a1 1 0 0 0 1-1V6zm-4.995 9V5H4.001a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8.004z" fill="currentColor"></path>
</g>
</svg>
</cosy-icon>
</cosy-tooltip>
2023-10-24 09:50:42 +08:00
</div>
2023-12-28 11:27:53 +08:00
<script src="/js/e0a67917.js"></script>
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
<cosy-search id="post-search" placeholder="搜索">
<div slot="short-key">
<cosy-short-key></cosy-short-key>
<cosy-short-key>K</cosy-short-key>
2023-10-24 09:50:42 +08:00
</div>
2023-12-25 16:39:03 +08:00
</cosy-search>
2023-10-24 09:50:42 +08:00
<script>
window.algolia = {
appId: "5DTW808BZ8",
SearchOnlyAPIKey: "27845b245efc8a2853cc0bdc7366ea26"
}
</script>
2023-12-28 11:27:53 +08:00
<script src="/js/62d6af47.js"></script>
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
</div>
<div class="aside-category">
2023-11-03 14:52:16 +08:00
2023-12-25 16:39:03 +08:00
<link rel="stylesheet" href="/css/db04a759.css">
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
<nav class="category-nav cosy-scrollbar">
<ul><li data-path="archives">
2023-11-10 13:44:10 +08:00
<a href="/archives">
2023-12-25 16:39:03 +08:00
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"><g fill="none"><path d="M3.5 3A1.5 1.5 0 0 0 2 4.5v4A1.5 1.5 0 0 0 3.5 10h9A1.5 1.5 0 0 0 14 8.5v-4A1.5 1.5 0 0 0 12.5 3h-9zM3 4.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5v-4zm.5 6.5A1.5 1.5 0 0 0 2 12.5v4A1.5 1.5 0 0 0 3.5 18h9a1.5 1.5 0 0 0 1.5-1.5v-4a1.5 1.5 0 0 0-1.5-1.5h-9zM3 12.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5v-4zm14-.063a2.003 2.003 0 0 1-2.5-1.937A2 2 0 0 1 16 8.563a2.005 2.005 0 0 1 1 0a2 2 0 0 1 0 3.874zM16.5 3a.5.5 0 0 1 .5.5v4.041a3.02 3.02 0 0 0-1 0V3.5a.5.5 0 0 1 .5-.5zm0 10.5c-.17 0-.337-.014-.5-.041V17.5a.5.5 0 0 0 1 0v-4.041c-.163.027-.33.041-.5.041z" fill="currentColor"></path></g></svg>
<div class="ellipsis">归档</div>
</a>
</li><li data-path="cosy-roadmap">
<a href="/cosy-roadmap">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"><g fill="none"><path d="M9.384 2a1 1 0 0 0-.966.742L4.616 17H2.5a.5.5 0 0 0 0 1h15a.5.5 0 0 0 0-1h-2.116L11.582 2.742A1 1 0 0 0 10.616 2H9.384zM5.651 17l.8-3H11.5a.5.5 0 0 0 0-1H6.717l.534-2H10.5a.5.5 0 0 0 0-1H7.517l1.867-7h1.232l3.733 14H5.651z" fill="currentColor"></path></g></svg>
<div class="ellipsis">路线图</div>
</a>
</li><li data-path="cosy-resume">
<a href="/cosy-resume">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"><g fill="none"><path d="M8.5 4.498a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0zm1.5-2.5a2.5 2.5 0 0 0-2.43 3.086L5.471 4.15a1.761 1.761 0 0 0-2.317.88c-.4.882-.008 1.917.877 2.31L7 8.662v2.287l-1.877 4.645a1.75 1.75 0 0 0 3.245 1.311l1.556-3.849a.073.073 0 0 1 .028-.038a.086.086 0 0 1 .046-.012c.02 0 .035.005.046.012a.074.074 0 0 1 .028.038l1.555 3.849a1.75 1.75 0 0 0 3.245-1.311L13 10.96V8.662l2.968-1.322a1.74 1.74 0 0 0 .877-2.31a1.761 1.761 0 0 0-2.317-.88l-2.097.934a2.5 2.5 0 0 0-2.43-3.086zM4.065 5.444a.761.761 0 0 1 1-.38l3.918 1.744a2.5 2.5 0 0 0 2.034 0l3.918-1.744a.761.761 0 0 1 1 .38a.739.739 0 0 1-.373.983l-2.969 1.321a1 1 0 0 0-.593.914v2.298a1 1 0 0 0 .073.375l1.872 4.633a.75.75 0 0 1-1.39.562l-1.556-3.849c-.364-.9-1.639-.9-2.003 0l-1.555 3.85a.75.75 0 1 1-1.39-.562l1.876-4.646A1 1 0 0 0 8 10.95V8.662a1 1 0 0 0-.593-.914L4.438 6.427a.739.739 0 0 1-.373-.983z" fill="currentColor"></path></g></svg>
<div class="ellipsis">简历</div>
</a>
2023-11-10 13:44:10 +08:00
</li></ul>
<ul><li class="">
2023-12-26 10:59:02 +08:00
<a href="/categories/CS/">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 4l-2 14.5l-6 2l-6-2L4 4z"></path><path d="M7.5 8h3v8l-2-1"></path><path d="M16.5 8H14a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h1.423a.5.5 0 0 1 .495.57L15.5 15.5l-2 .5"></path></g></svg>
2023-11-10 13:51:34 +08:00
<div class="ellipsis">
2023-12-26 10:59:02 +08:00
<span>CS</span>
2023-11-10 13:51:34 +08:00
</div>
2023-11-10 13:44:10 +08:00
</a>
</li><li class="">
2023-12-26 10:59:02 +08:00
<a href="/categories/EQ/">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5.636 5.636a9 9 0 0 1 13.397.747L13.414 12l5.619 5.617A9 9 0 1 1 5.636 5.636z"></path><circle cx="11.5" cy="7.5" r="1" fill="currentColor"></circle></g></svg>
2023-11-10 13:51:34 +08:00
<div class="ellipsis">
2023-12-26 10:59:02 +08:00
<span>EQ</span>
2023-11-10 13:51:34 +08:00
</div>
2023-11-10 13:44:10 +08:00
</a>
</li><li class="active">
<a href="/categories/Hexo/">
2023-11-10 13:51:34 +08:00
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-1"></path><path d="M8 16h8"></path><path d="M8.322 12.582l7.956.836"></path><path d="M8.787 9.168l7.826 1.664"></path><path d="M10.096 5.764l7.608 2.472"></path></g></svg>
<div class="ellipsis">
<span>Hexo</span>
</div>
2023-11-10 13:44:10 +08:00
</a>
2023-11-21 13:49:17 +08:00
</li><li class="">
2023-12-26 10:59:02 +08:00
<a href="/categories/%E8%87%AA%E5%AA%92%E4%BD%93/">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
2023-11-21 13:49:17 +08:00
<div class="ellipsis">
2023-12-26 10:59:02 +08:00
<span>自媒体</span>
2023-11-21 13:49:17 +08:00
</div>
</a>
2023-11-11 18:48:29 +08:00
</li><li class="">
2023-12-26 10:59:02 +08:00
<a href="/categories/%E8%AF%BB%E4%B9%A6/">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"><g fill="none"><path d="M4 16V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v11a1 1 0 0 1-1 1H5a1 1 0 0 0 1 1h9.5a.5.5 0 0 1 0 1H6a2 2 0 0 1-2-2zM15 4a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v11h10V4zM7.041 8h.973c.045-.773.192-1.485.42-2.059A3.002 3.002 0 0 0 7.04 8zM6 8.5a4 4 0 1 1 8 0a4 4 0 0 1-8 0zm6.959-.5a3.002 3.002 0 0 0-1.392-2.059c.227.574.374 1.286.419 2.059h.973zm-.973 1c-.045.773-.192 1.486-.42 2.059A3.002 3.002 0 0 0 12.96 9h-.973zm-1.002-1c-.046-.707-.189-1.324-.383-1.778c-.12-.28-.25-.474-.368-.591c-.117-.115-.195-.131-.233-.131c-.038 0-.116.016-.233.13c-.118.118-.248.312-.368.592c-.194.454-.337 1.07-.383 1.778h1.968zM9.016 9c.046.707.189 1.324.383 1.778c.12.28.25.474.368.591c.117.115.195.131.233.131c.038 0 .116-.016.233-.13c.118-.118.248-.313.368-.592c.194-.454.336-1.07.383-1.778H9.016zM8.014 9h-.973c.147.87.668 1.614 1.392 2.059c-.227-.573-.374-1.286-.419-2.059z" fill="currentColor"></path></g></svg>
2023-11-11 18:48:29 +08:00
<div class="ellipsis">
2023-12-26 10:59:02 +08:00
<span>读书</span>
</div>
</a>
</li><li class="">
<a href="/categories/%E8%B4%A2%E7%BB%8F/">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"></circle><path d="M14.8 9A2 2 0 0 0 13 8h-2a2 2 0 0 0 0 4h2a2 2 0 0 1 0 4h-2a2 2 0 0 1-1.8-1"></path><path d="M12 6v2m0 8v2"></path></g></svg>
<div class="ellipsis">
<span>财经</span>
2023-11-11 18:48:29 +08:00
</div>
</a>
2023-11-10 13:44:10 +08:00
</li></ul>
2023-12-25 16:39:03 +08:00
</nav>
2023-10-24 09:50:42 +08:00
2023-12-28 11:27:53 +08:00
<script src="/js/da8f6845.js"></script>
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
</div>
<div class="bottom">
<cosy-tooltip id="button-preference" placement="right">
<span slot="content">
<span>偏好</span>
<cosy-short-key></cosy-short-key>
<cosy-short-key>p</cosy-short-key>
</span>
<cosy-icon bordered id="button-about-cosy-theme">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16">
<g fill="none">
<path d="M8 6a2 2 0 1 0 0 4a2 2 0 0 0 0-4zM7 8a1 1 0 1 1 2 0a1 1 0 0 1-2 0zm3.618-3.602a.708.708 0 0 1-.824-.567l-.26-1.416a.354.354 0 0 0-.275-.282a6.072 6.072 0 0 0-2.519 0a.354.354 0 0 0-.275.282l-.259 1.416a.71.71 0 0 1-.936.538l-1.359-.484a.355.355 0 0 0-.382.095c-.569.627-1 1.367-1.262 2.173a.352.352 0 0 0 .108.378l1.102.931a.704.704 0 0 1 0 1.076l-1.102.931a.352.352 0 0 0-.108.378A5.986 5.986 0 0 0 3.53 12.02a.355.355 0 0 0 .382.095l1.36-.484a.708.708 0 0 1 .936.538l.258 1.416c.026.14.135.252.275.281a6.075 6.075 0 0 0 2.52 0a.353.353 0 0 0 .274-.281l.26-1.416a.71.71 0 0 1 .936-.538l1.359.484c.135.048.286.01.382-.095c.569-.627 1-1.367 1.262-2.173a.352.352 0 0 0-.108-.378l-1.102-.931a.703.703 0 0 1 0-1.076l1.102-.931a.352.352 0 0 0 .108-.378A5.985 5.985 0 0 0 12.47 3.98a.355.355 0 0 0-.382-.095l-1.36.484a.71.71 0 0 1-.111.03zm-6.62.58l.937.333a1.71 1.71 0 0 0 2.255-1.3l.177-.97a5.105 5.105 0 0 1 1.265 0l.178.97a1.708 1.708 0 0 0 2.255 1.3L12 4.977c.255.334.467.698.63 1.084l-.754.637a1.704 1.704 0 0 0 0 2.604l.755.637a4.99 4.99 0 0 1-.63 1.084l-.937-.334a1.71 1.71 0 0 0-2.255 1.3l-.178.97a5.099 5.099 0 0 1-1.265 0l-.177-.97a1.708 1.708 0 0 0-2.255-1.3L4 11.023a4.987 4.987 0 0 1-.63-1.084l.754-.638a1.704 1.704 0 0 0 0-2.603l-.755-.637c.164-.386.376-.75.63-1.084z" fill="currentColor"></path>
</g>
</svg>
</cosy-icon>
</cosy-tooltip>
2023-10-24 09:50:42 +08:00
</div>
</aside>
<main>
2023-12-26 10:56:25 +08:00
<link rel="stylesheet" href="/css/9bb9a539.css">
2023-10-24 09:50:42 +08:00
<div class="post-container">
2023-12-25 16:39:03 +08:00
<header>
<div class="left">
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
<link rel="stylesheet" href="/css/7d333f9e.css">
2023-10-24 09:50:42 +08:00
<nav class="breadcrumb">
2023-12-25 16:39:03 +08:00
<section>
<cosy-tooltip placement="bottom-left">
<span slot="content"><span>首页</span>
<cosy-short-key></cosy-short-key>
<cosy-short-key>H</cosy-short-key>
</span>
<cosy-icon href="/">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20">
<g fill="none">
<path d="M8.998 2.388a1.5 1.5 0 0 1 2.005 0l5.5 4.942A1.5 1.5 0 0 1 17 8.445V15.5a1.5 1.5 0 0 1-1.5 1.5H13a1.5 1.5 0 0 1-1.5-1.5V12a.5.5 0 0 0-.5-.5H9a.5.5 0 0 0-.5.5v3.5A1.5 1.5 0 0 1 7 17H4.5A1.5 1.5 0 0 1 3 15.5V8.445c0-.425.18-.83.498-1.115l5.5-4.942zm1.336.744a.5.5 0 0 0-.668 0l-5.5 4.942A.5.5 0 0 0 4 8.445V15.5a.5.5 0 0 0 .5.5H7a.5.5 0 0 0 .5-.5V12A1.5 1.5 0 0 1 9 10.5h2a1.5 1.5 0 0 1 1.5 1.5v3.5a.5.5 0 0 0 .5.5h2.5a.5.5 0 0 0 .5-.5V8.445a.5.5 0 0 0-.166-.371l-5.5-4.942z" fill="currentColor"></path>
</g>
</svg>
</cosy-icon>
</cosy-tooltip>
<svg class="arrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20">
2023-10-24 09:50:42 +08:00
<g fill="none">
<path d="M7.733 4.207a.75.75 0 0 1 1.06.026l5.001 5.25a.75.75 0 0 1 0 1.035l-5 5.25a.75.75 0 1 1-1.087-1.034L12.216 10l-4.51-4.734a.75.75 0 0 1 .027-1.06z" fill="currentColor"></path>
</g>
</svg>
2023-12-25 16:39:03 +08:00
<a class="ellipsis" href="/categories/Hexo/">
Hexo
</a>
<svg class="arrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20">
2023-10-24 09:50:42 +08:00
<g fill="none">
<path d="M7.733 4.207a.75.75 0 0 1 1.06.026l5.001 5.25a.75.75 0 0 1 0 1.035l-5 5.25a.75.75 0 1 1-1.087-1.034L12.216 10l-4.51-4.734a.75.75 0 0 1 .027-1.06z" fill="currentColor"></path>
</g>
</svg>
2023-12-25 16:39:03 +08:00
<span class="ellipsis">
Cosy 入门
</span>
</section>
2023-10-24 09:50:42 +08:00
</nav>
2023-10-19 22:44:47 +08:00
<script src="/js/31d6cfe0.js"></script>
2023-10-24 09:50:42 +08:00
2023-12-25 16:39:03 +08:00
</div>
<div class="right">
<cosy-tooltip id="toc-show-button" placement="left">
<span slot="content">
<span>显示 / 隐藏 文章目录</span>
<cosy-short-key>]</cosy-short-key>
</span>
<cosy-icon>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20">
<g fill="none">
<path d="M4 4c-1.104-.019-2 .896-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4zM3 6a1 1 0 0 1 1-1h2.995v10H4a1 1 0 0 1-1-1V6zm4.995 9V5h8.004a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H7.995z" fill="currentColor"></path>
</g>
</svg>
</cosy-icon>
</cosy-tooltip>
</div>
</header>
<div class="content">
<main class="cosy-scrollbar">
2023-10-24 09:50:42 +08:00
<div class="article-container">
<!-- 渲染文章内容 -->
2023-11-08 13:45:34 +08:00
<article>
2023-12-25 16:39:03 +08:00
<!-- 文章标题 -->
<h1 class="post-title">Cosy 入门</h1>
<div class="last-updated">
2024-03-15 15:38:52 +08:00
上次更新: 2024-03-15 14:47:16
2023-12-25 16:39:03 +08:00
</div>
<!-- 文章 -->
2023-12-26 10:56:25 +08:00
<h1 id="写在前面-💡"><a href="#写在前面-💡" class="headerlink" title="写在前面 💡"></a>写在前面 💡</h1><p>由于 hexo 的大版本更新, hexo-theme-cosy也有 <code>1.x.x</code><code>2.x.x</code> 版本</p>
<ul>
<li>hexo 6.3.0 -&gt; hexo-cosy-theme 1.x.x</li>
<li>hexo 7.0.0 -&gt; hexo-cosy-theme 2.x.x</li>
</ul>
<p>请确认您使用的 <code>hexo</code>版本、<code>hexo-theme-cosy</code>版本,以及 <code>_config.yml</code> 是否正确</p>
<blockquote>
<p>如果 <code>package.json</code> 是正确的,看看是否是 <code>xxx.lock</code> 文件锁了版本</p>
</blockquote>
<h1 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h1><p>hexo-theme-cosy 主题 <code>1.x.x 版本</code> 是在 Hexo <code>6.3.0</code> 版本下进行的开发、测试的。根据可靠消息Hexo <code>7.0.0</code> 版本不兼容 😂</p>
<p>如您使用的是 <code>6.3.x</code> 版本的 hexo 系统,遇到如下情况:</p>
2023-11-24 16:53:45 +08:00
<ul>
<li>代码高亮不正常</li>
<li>搜索显示不正常</li>
</ul>
2023-12-26 10:56:25 +08:00
<p>请检查 <code>package.json</code><code>dependencies</code> 中的 hexo 版本号,修改完 <code>6.3.0</code>,然后 <code>npm install</code> 重新安装依赖即可。</p>
<p>hexo-theme-cosy 主题的 github仓库、npm已经更新到 <code>2.x.x</code> 版本,默认是在 Hexo <code>7.0.0</code> 版本下开发,官方的代码高亮配置文件有所改变,会导致 <code>代码高亮</code> 失效,如果您使用的是 <code>7.0.x</code> 版本的 Hexo请调整如下配置</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># v7.0.0</span>
<span class="token key atrule">syntax_highlighter</span><span class="token punctuation">:</span> prismjs
<span class="token key atrule">prismjs</span><span class="token punctuation">:</span>
<span class="token key atrule">preprocess</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">line_number</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">line_threshold</span><span class="token punctuation">:</span> <span class="token number">0</span>
<span class="token key atrule">tab_replace</span><span class="token punctuation">:</span> <span class="token string">''</span>
<span class="token comment"># v6.3.0 </span>
<span class="token comment"># highlight:</span>
<span class="token comment"># enable: false</span>
<span class="token comment"># line_number: true</span>
<span class="token comment"># auto_detect: false</span>
<span class="token comment"># tab_replace: ""</span>
<span class="token comment"># wrap: true</span>
<span class="token comment"># hljs: false</span>
<span class="token comment"># prismjs:</span>
<span class="token comment"># enable: true</span>
<span class="token comment"># preprocess: true</span>
<span class="token comment"># line_number: true</span>
<span class="token comment"># line_threshold: 0</span>
<span class="token comment"># tab_replace: ""</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-24 16:53:45 +08:00
<h2 id="使用-npm-安装"><a href="#使用-npm-安装" class="headerlink" title="使用 npm 安装"></a>使用 npm 安装</h2><p>在主题的根目录</p>
2023-11-17 10:57:18 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml">npm i hexo<span class="token punctuation">-</span>theme<span class="token punctuation">-</span>cosy<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
2023-11-24 16:47:58 +08:00
<p>此外,需要新建一个 <code>_config.cosy.yml</code>,用来定义<code>主题配置</code></p>
<p>最后,修改<code>hexo</code>的配置: <code>_config.yml</code>,添加下面的内容:</p>
2023-11-17 10:57:18 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">theme</span><span class="token punctuation">:</span> cosy
<span class="token key atrule">algolia</span><span class="token punctuation">:</span>
<span class="token key atrule">appId</span><span class="token punctuation">:</span> 你的
<span class="token key atrule">apiKey</span><span class="token punctuation">:</span> 你的
<span class="token key atrule">adminApiKey</span><span class="token punctuation">:</span> 你的
<span class="token key atrule">SearchOnlyAPIKey</span><span class="token punctuation">:</span> 你的
<span class="token key atrule">chunkSize</span><span class="token punctuation">:</span> <span class="token number">5000</span>
<span class="token key atrule">indexName</span><span class="token punctuation">:</span> 你的algolia的index
<span class="token key atrule">fields</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> content
<span class="token punctuation">-</span> excerpt<span class="token punctuation">:</span>strip
<span class="token punctuation">-</span> categories
<span class="token punctuation">-</span> title
<span class="token punctuation">-</span> permalink
<span class="token punctuation">-</span> slug
<span class="token punctuation">-</span> tags
<span class="token punctuation">-</span> title<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-24 16:47:58 +08:00
<h2 id="传统方式-安装-Hexo-安装主题"><a href="#传统方式-安装-Hexo-安装主题" class="headerlink" title="传统方式 - 安装 Hexo 安装主题"></a>传统方式 - 安装 Hexo 安装主题</h2><p>将主题 <code>hexo-theme-cosy</code> 文件夹复制目录的 <code>themes</code> 目录下,然后在 <code>Hexo</code><code>_config.yml</code> 中修改下主题配置即可</p>
2023-11-03 14:25:01 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># 找到 theme 配置项</span>
2023-11-24 16:47:58 +08:00
<span class="token key atrule">theme</span><span class="token punctuation">:</span> hexo<span class="token punctuation">-</span>theme<span class="token punctuation">-</span>cosy<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
2023-11-03 14:25:01 +08:00
<h2 id="获取-Cosy"><a href="#获取-Cosy" class="headerlink" title="获取 Cosy"></a>获取 Cosy</h2><ul>
<li>进入 <a target="_blank" rel="noopener" href="https://github.com/17px/hexo-theme-cosy/tree/main">Cosy 代码仓库</a>,了解最新的主题开发进度</li>
<li><a target="_blank" rel="noopener" href="https://github.com/17px/hexo-theme-cosy/releases">发布页面</a> 下载 <code>hexo-theme-cosy.zip</code></li>
<li>解压至站点的 <code>themes</code> 目录下</li>
<li>在 Hexo 的 <code>_config.yml</code> 中启用</li>
2023-10-20 13:58:15 +08:00
</ul>
2023-11-24 16:47:58 +08:00
<h1 id="hexo-配置"><a href="#hexo-配置" class="headerlink" title="hexo 配置"></a>hexo 配置</h1><p><code>Hexo</code><code>_config.yml</code> 中调整</p>
2023-11-03 14:25:01 +08:00
<h2 id="基础配置"><a href="#基础配置" class="headerlink" title="基础配置"></a>基础配置</h2><pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># 网页标题</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">title</span><span class="token punctuation">:</span> 17px blog
2023-11-03 14:25:01 +08:00
<span class="token comment"># 侧边栏顶部显示</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">subtitle</span><span class="token punctuation">:</span> <span class="token string">"Mozzie"</span>
2023-11-03 14:25:01 +08:00
<span class="token comment"># 用于SEO的html元描述</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">description</span><span class="token punctuation">:</span> <span class="token string">""</span>
2023-11-03 14:25:01 +08:00
<span class="token comment"># 用于SEO的html关键字</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">keywords</span><span class="token punctuation">:</span>
2023-11-03 14:25:01 +08:00
<span class="token comment"># 文章版权声明显示作者名称</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">author</span><span class="token punctuation">:</span> Mozzie
2023-11-03 14:25:01 +08:00
<span class="token comment"># 在此处设置您的网站url</span>
2024-03-15 15:38:52 +08:00
<span class="token key atrule">url</span><span class="token punctuation">:</span> https<span class="token punctuation">:</span>//maxshader.com<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-10-20 13:58:15 +08:00
2023-11-03 14:25:01 +08:00
<h2 id="语言"><a href="#语言" class="headerlink" title="语言"></a>语言</h2><p>你可以在 <code>hexo-theme-cosy/languages</code> 中找到不同的语言文件,如果想切换语言,在配置文件中,填入 <code>yml</code> 的文件名</p>
2023-12-26 10:56:25 +08:00
<blockquote>
<p>hexo-theme-cosy v2版本只支持 zh-CN 和 en其他语言不再支持</p>
</blockquote>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">language</span><span class="token punctuation">:</span> en<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
2023-12-26 10:56:25 +08:00
<h2 id="文章语法高亮"><a href="#文章语法高亮" class="headerlink" title="文章语法高亮"></a>文章语法高亮</h2><p>关闭hexo默认的highlight.js语法高亮下面的配置基于 <code>hexo v6.3.0</code> 版本</p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">highlight</span><span class="token punctuation">:</span>
<span class="token key atrule">enable</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token key atrule">line_number</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">auto_detect</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token key atrule">tab_replace</span><span class="token punctuation">:</span> <span class="token string">""</span>
<span class="token key atrule">wrap</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">hljs</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token key atrule">prismjs</span><span class="token punctuation">:</span>
<span class="token key atrule">enable</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">preprocess</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">line_number</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">line_threshold</span><span class="token punctuation">:</span> <span class="token number">0</span>
<span class="token key atrule">tab_replace</span><span class="token punctuation">:</span> <span class="token string">""</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-12-26 10:56:25 +08:00
<p><code>7.0.0</code> 版本请使用这个配置:</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># v7.0.0</span>
<span class="token key atrule">syntax_highlighter</span><span class="token punctuation">:</span> prismjs
<span class="token key atrule">prismjs</span><span class="token punctuation">:</span>
<span class="token key atrule">preprocess</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">line_number</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">line_threshold</span><span class="token punctuation">:</span> <span class="token number">0</span>
<span class="token key atrule">tab_replace</span><span class="token punctuation">:</span> <span class="token string">''</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-24 16:47:58 +08:00
<h1 id="Cosy-主题配置"><a href="#Cosy-主题配置" class="headerlink" title="Cosy 主题配置"></a>Cosy 主题配置</h1><p>注意:</p>
<ul>
<li><p>采用 <code>npm</code> 的方式进行了主题安装那么是针对hexo根目录 <code>_config.cosy.yml</code></p>
</li>
<li><p>采用传统方式安装,则是针对 <code>/hexo-theme-cosy/_config.yml</code></p>
</li>
</ul>
2023-11-10 14:17:50 +08:00
<h2 id="文章分类图标"><a href="#文章分类图标" class="headerlink" title="文章分类图标"></a>文章分类图标</h2><blockquote>
<p>可以在 <a target="_blank" rel="noopener" href="https://www.xicons.org/">xicon</a> 获取丰富的图标</p>
</blockquote>
<p><code>主题_config.yml</code>文件中,添加<code>分类名称</code><code>图标svg</code>的映射,如值设置为 <code>false</code>,代表不显示该分类</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">category_meta</span><span class="token punctuation">:</span>
<span class="token key atrule">foo</span><span class="token punctuation">:</span> &lt;svg xmlns="http<span class="token punctuation">:</span>//www.w3.org/2000/svg" xmlns<span class="token punctuation">:</span>xlink="http<span class="token punctuation">:</span>//www.w3.org/1999/xlink" viewBox="0 0 24 24"<span class="token punctuation">></span>&lt;g fill="none" stroke="currentColor" stroke<span class="token punctuation">-</span>width="2" stroke<span class="token punctuation">-</span>linecap="round" stroke<span class="token punctuation">-</span>linejoin="round"<span class="token punctuation">></span>&lt;path d="M4 17v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2<span class="token punctuation">-</span>2v<span class="token punctuation">-</span>1"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>&lt;path d="M8 16h8"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>&lt;path d="M8.322 12.582l7.956.836"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>&lt;path d="M8.787 9.168l7.826 1.664"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>&lt;path d="M10.096 5.764l7.608 2.472"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>&lt;/g<span class="token punctuation">></span>&lt;/svg<span class="token punctuation">></span>
<span class="token key atrule">bar</span><span class="token punctuation">:</span> <span class="token boolean important">false</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
2023-10-20 13:58:15 +08:00
2023-11-03 14:25:01 +08:00
<h2 id="网站图标-favicon"><a href="#网站图标-favicon" class="headerlink" title="网站图标 favicon"></a>网站图标 favicon</h2><ul>
<li>支持 <code>svg</code></li>
<li>支持 <code>图片url</code>,如:<code>/img/favicon.png</code></li>
2023-10-20 13:58:15 +08:00
</ul>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">favicon</span><span class="token punctuation">:</span> <span class="token string">''</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
2023-12-26 10:56:25 +08:00
<h2 id="主题色-🆕-v2新增"><a href="#主题色-🆕-v2新增" class="headerlink" title="主题色 🆕 (v2新增)"></a>主题色 🆕 (v2新增)</h2><p>默认是针对 <code>css</code> 的变量 <code>var(--color-primary)</code> 进行全局主题色控制,保持多样性 😁</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token comment"># 基佬紫,天下无敌</span>
<span class="token key atrule">color</span><span class="token punctuation">:</span> hsl(238<span class="token punctuation">,</span>50%<span class="token punctuation">,</span>56%)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
2023-11-03 14:25:01 +08:00
<h2 id="ICP备案号"><a href="#ICP备案号" class="headerlink" title="ICP备案号"></a>ICP备案号</h2><p>😁 如不需要备案号,可直接删除</p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">icp</span><span class="token punctuation">:</span> 苏ICP备xxxxxxx号<span class="token punctuation">-</span>x<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
2023-12-26 10:56:25 +08:00
<h2 id="首页底部文字-🆕"><a href="#首页底部文字-🆕" class="headerlink" title="首页底部文字 🆕"></a>首页底部文字 🆕</h2><blockquote>
<p>v2版本移除了改配置默认显示到文章页底部</p>
</blockquote>
<p>😁 如不需要,可直接删除,或者改为 <code>false</code> </p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">motto</span><span class="token punctuation">:</span> <span class="token boolean important">false</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
2023-12-26 10:56:25 +08:00
<h2 id="文章版权申明-🆕"><a href="#文章版权申明-🆕" class="headerlink" title="文章版权申明 🆕"></a>文章版权申明 🆕</h2><p>v1 版本默认开启,当 <code>enable: false</code>,默认关闭</p>
<blockquote>
<p>v2 版本移除该配置以及模块</p>
</blockquote>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">postCopyright</span><span class="token punctuation">:</span>
<span class="token key atrule">enable</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">license</span><span class="token punctuation">:</span> CC BY<span class="token punctuation">-</span>NC<span class="token punctuation">-</span>SA 4.0
<span class="token key atrule">license_url</span><span class="token punctuation">:</span> https<span class="token punctuation">:</span>//creativecommons.org/licenses/by<span class="token punctuation">-</span>nc<span class="token punctuation">-</span>sa/4.0/<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-08 10:11:56 +08:00
<h2 id="katex-数学公式"><a href="#katex-数学公式" class="headerlink" title="katex 数学公式"></a>katex 数学公式</h2><p>可自行配置 <code>cdn</code>,全局默认关闭该插件</p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">katex</span><span class="token punctuation">:</span>
<span class="token key atrule">jsCdn</span><span class="token punctuation">:</span> //cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.js
2023-11-08 10:11:56 +08:00
<span class="token key atrule">cssCdn</span><span class="token punctuation">:</span> //cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.css<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
2023-10-20 13:58:15 +08:00
2023-11-08 10:11:56 +08:00
<p>为了加载速度,如果文章需要用到插件,请在文章头部增加,如</p>
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
<span class="token front-matter yaml language-yaml"><span class="token key atrule">use</span><span class="token punctuation">:</span> katex</span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<h2 id="mermaid-流程图"><a href="#mermaid-流程图" class="headerlink" title="mermaid 流程图"></a>mermaid 流程图</h2><p>在撰写时,请使用 <code>&#123;% mermaid %&#125;` 和 `&#123;% endmermaid %&#125;</code> 包裹,全局默认关闭该插件</p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown">&#123;% mermaid %&#125;
graph TD;
A --> B;
A --> C;
B --> D;
C --> D;
&#123;% endmermaid %&#125;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-03 14:25:01 +08:00
<p>相应配置如下</p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">mermaid</span><span class="token punctuation">:</span>
2023-11-15 10:21:41 +08:00
<span class="token comment"># 默认使用 neutral可选配置default | dark | forest | neutral</span>
<span class="token key atrule">theme</span><span class="token punctuation">:</span> neutral
<span class="token key atrule">cdn</span><span class="token punctuation">:</span> //cdn.jsdelivr.net/npm/mermaid@10.4.0/dist/mermaid.min.js<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-08 10:11:56 +08:00
<p>为了加载速度,如果文章需要用到插件,请在文章头部增加,如</p>
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
<span class="token front-matter yaml language-yaml"><span class="token key atrule">use</span><span class="token punctuation">:</span> mermaid<span class="token punctuation">,</span>katex<span class="token punctuation">...</span></span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
2023-10-20 13:58:15 +08:00
2023-11-03 14:25:01 +08:00
<h2 id="valine-文章评论"><a href="#valine-文章评论" class="headerlink" title="valine 文章评论"></a>valine 文章评论</h2><p>首先需要注册 <code>LeanCloud</code> 国际区用户,创建数据库</p>
2023-11-08 10:11:56 +08:00
<p>请根据相关地区法规,酌情,全局默认关闭该插件</p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">valine</span><span class="token punctuation">:</span>
<span class="token comment"># 替换</span>
<span class="token key atrule">appId</span><span class="token punctuation">:</span> appId
<span class="token comment"># 替换</span>
<span class="token key atrule">appKey</span><span class="token punctuation">:</span> appKey
<span class="token key atrule">avatar</span><span class="token punctuation">:</span> monsterid
<span class="token key atrule">cdn</span><span class="token punctuation">:</span> //unpkg.com/valine@latest/dist/Valine.min.js
<span class="token comment"># 替换</span>
2023-11-08 10:11:56 +08:00
<span class="token key atrule">serverURLs</span><span class="token punctuation">:</span> //xxxxxxxx.api.lncldglobal.com<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>为了加载速度,如果文章需要用到插件,请在文章头部增加,如</p>
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
<span class="token front-matter yaml language-yaml"><span class="token key atrule">use</span><span class="token punctuation">:</span> valine<span class="token punctuation">,</span>mermaid<span class="token punctuation">...</span></span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
2023-10-20 13:58:15 +08:00
2023-11-03 14:25:01 +08:00
<h1 id="algolia搜索"><a href="#algolia搜索" class="headerlink" title="algolia搜索"></a>algolia搜索</h1><p>博客自带的本地搜索,基于前端开发,存在或多或少的问题,建议换成 <code>algolia</code>,免费账户 总共有 <code>10,000</code> 条记录,每月有 <code>100,000</code> 的操作数</p>
2023-11-10 14:17:50 +08:00
<h2 id="关闭搜索"><a href="#关闭搜索" class="headerlink" title="关闭搜索"></a>关闭搜索</h2><p>主页左侧导航栏不再显示搜索,通知相关资源不会加载,在主题 <code>_config.yml</code> 中:</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">search</span><span class="token punctuation">:</span> <span class="token boolean important">false</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
2024-01-04 23:11:27 +08:00
<h2 id="注册-获取-Key"><a href="#注册-获取-Key" class="headerlink" title="注册 &amp; 获取 Key"></a>注册 &amp; 获取 Key</h2><ol>
2023-11-03 14:25:01 +08:00
<li><p>创建一个新的 <code>Index</code>,例如 <code>hex-blog</code></p>
2023-10-20 13:58:15 +08:00
</li>
2023-11-03 14:25:01 +08:00
<li><p>复制并保存:</p>
2023-10-20 13:58:15 +08:00
</li>
</ol>
<ul>
<li>Application ID</li>
<li>Search-Only API Key</li>
<li>Admin API Key</li>
<li>Usage API Key</li>
</ul>
2023-10-22 21:07:22 +08:00
<p><img src="/img/algolia-api-keys.png" alt="API Keys"></p>
2023-10-20 13:58:15 +08:00
<ol start="3">
2023-11-03 14:25:01 +08:00
<li>替换配置</li>
2023-10-20 13:58:15 +08:00
</ol>
2023-11-03 14:25:01 +08:00
<p><code>Hexo</code><code>_config.yml</code> 中加入</p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">algolia</span><span class="token punctuation">:</span>
2023-11-03 14:25:01 +08:00
<span class="token comment"># 替换</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">appId</span><span class="token punctuation">:</span> Application ID
2023-11-03 14:25:01 +08:00
<span class="token comment"># 替换</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">apiKey</span><span class="token punctuation">:</span> Usage API Key
2023-11-03 14:25:01 +08:00
<span class="token comment"># 请勿泄露,用于上报,替换</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">adminApiKey</span><span class="token punctuation">:</span> Admin API Key
2023-11-03 14:25:01 +08:00
<span class="token comment"># 替换</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">SearchOnlyAPIKey</span><span class="token punctuation">:</span> Search<span class="token punctuation">-</span>Only API Key
<span class="token key atrule">chunkSize</span><span class="token punctuation">:</span> <span class="token number">5000</span>
2023-11-03 14:25:01 +08:00
<span class="token comment"># 替换</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">indexName</span><span class="token punctuation">:</span> hex<span class="token punctuation">-</span>blog
<span class="token key atrule">fields</span><span class="token punctuation">:</span>
2023-11-07 16:12:40 +08:00
<span class="token punctuation">-</span> content
<span class="token punctuation">-</span> excerpt<span class="token punctuation">:</span>strip
2023-10-20 13:58:15 +08:00
<span class="token punctuation">-</span> categories
2023-11-07 16:12:40 +08:00
<span class="token punctuation">-</span> title
2023-10-20 13:58:15 +08:00
<span class="token punctuation">-</span> permalink
<span class="token punctuation">-</span> slug
<span class="token punctuation">-</span> tags
2023-11-07 16:12:40 +08:00
<span class="token punctuation">-</span> title<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-10-20 13:58:15 +08:00
2023-11-07 16:12:40 +08:00
<h2 id="安装-hexo-algoliasearch-next"><a href="#安装-hexo-algoliasearch-next" class="headerlink" title="安装 hexo-algoliasearch-next"></a>安装 hexo-algoliasearch-next</h2><p>这是 Hexo 博客帖子索引插件,自动化提交索引到 Algolia</p>
2023-10-20 13:58:15 +08:00
<blockquote>
2023-11-07 16:12:40 +08:00
<p>如出遇到问题,可阅读 <a target="_blank" rel="noopener" href="https://github.com/Becavalier/hexo-algoliasearch-next">hexo-algoliasearch-next 仓库</a> 最新说明</p>
2023-10-20 13:58:15 +08:00
</blockquote>
2023-11-03 14:25:01 +08:00
<p>安装命令:</p>
2023-11-07 16:12:40 +08:00
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash"><span class="token function">npm</span> <span class="token function">install</span> hexo-algoliasearch-next <span class="token parameter variable">--save</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
2023-10-20 13:58:15 +08:00
2023-11-03 14:25:01 +08:00
<h2 id="使用-algolia"><a href="#使用-algolia" class="headerlink" title="使用 algolia"></a>使用 algolia</h2><p>在每次博客发布之前,进行索引上传的操作,命令通常如下</p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">hexo clean
hexo generate
hexo algolia<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
2023-11-03 14:25:01 +08:00
<h1 id="🇨🇳-和风天气-Widget"><a href="#🇨🇳-和风天气-Widget" class="headerlink" title="🇨🇳 和风天气 Widget"></a>🇨🇳 和风天气 Widget</h1><p>Cosy 主要针对国内用户,在首页集成了和风天气的卡片,通过 <a target="_blank" rel="noopener" href="https://dev.qweather.com/docs/start/">和风天气开发服务</a> 注册</p>
<p>注册完成后,在配置中填入你的 <code>appKey</code><code>cityCode(城市代码)</code></p>
2023-10-20 13:58:15 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">weather</span><span class="token punctuation">:</span>
<span class="token key atrule">enable</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
2023-11-03 14:25:01 +08:00
<span class="token comment"># 替换</span>
2023-10-20 13:58:15 +08:00
<span class="token key atrule">cityCode</span><span class="token punctuation">:</span> cityCode
<span class="token key atrule">appKey</span><span class="token punctuation">:</span> appKey<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-03 14:25:01 +08:00
<p>其中 <code>cityCode</code> 可以在 <a target="_blank" rel="noopener" href="https://github.com/qwd/LocationList">官方的地区列表仓库</a> 中的 <code>China-City-List-latest.csv</code> 找到你所在城市的 <code>cityCode</code></p>
<h1 id="前置元数据"><a href="#前置元数据" class="headerlink" title="前置元数据"></a>前置元数据</h1><p>在 Hexo 的 Markdown 文件中,一个典型的 YAML 格式的 <code>Front Matter</code> 可能会是这样的:</p>
2023-10-20 16:29:07 +08:00
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
2023-11-03 14:25:01 +08:00
<span class="token front-matter yaml language-yaml"><span class="token key atrule">title</span><span class="token punctuation">:</span> 我的文章标题
2023-10-20 16:29:07 +08:00
<span class="token key atrule">categories</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> javascript
<span class="token key atrule">tags</span><span class="token punctuation">:</span>
2023-11-03 14:25:01 +08:00
<span class="token punctuation">-</span> 编程
2023-10-20 16:29:07 +08:00
<span class="token punctuation">-</span> JavaScript</span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-03 14:25:01 +08:00
<h2 id="top"><a href="#top" class="headerlink" title="top"></a>top</h2><p>实现文章置顶的功能,给定一个数值,可以进行排序,设定了 <code>top</code> 元数据的文章,会在分类列表中,使用 📌 标记</p>
<p>例如有三篇文章:</p>
2023-10-20 16:29:07 +08:00
<ul>
2023-11-03 14:25:01 +08:00
<li>文章1</li>
2023-10-20 16:29:07 +08:00
</ul>
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
2023-11-03 14:25:01 +08:00
<span class="token front-matter yaml language-yaml"><span class="token key atrule">title</span><span class="token punctuation">:</span> 文章1
2023-10-20 16:29:07 +08:00
<span class="token key atrule">top</span><span class="token punctuation">:</span> <span class="token number">0</span>
<span class="token key atrule">categories</span><span class="token punctuation">:</span>
2023-11-03 14:25:01 +08:00
<span class="token punctuation">-</span> javascript
<span class="token key atrule">tags</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> 编程
<span class="token punctuation">-</span> JavaScript</span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-10-20 16:29:07 +08:00
<ul>
2023-11-03 14:25:01 +08:00
<li>文章2</li>
2023-10-20 16:29:07 +08:00
</ul>
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
2023-11-03 14:25:01 +08:00
<span class="token front-matter yaml language-yaml"><span class="token key atrule">title</span><span class="token punctuation">:</span> 文章2
2023-10-20 16:29:07 +08:00
<span class="token key atrule">top</span><span class="token punctuation">:</span> <span class="token number">1</span>
<span class="token key atrule">categories</span><span class="token punctuation">:</span>
2023-11-03 14:25:01 +08:00
<span class="token punctuation">-</span> javascript
<span class="token key atrule">tags</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> 编程
<span class="token punctuation">-</span> JavaScript</span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-10-20 16:29:07 +08:00
<ul>
2023-11-03 14:25:01 +08:00
<li>文章3</li>
2023-10-20 16:29:07 +08:00
</ul>
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
2023-11-03 14:25:01 +08:00
<span class="token front-matter yaml language-yaml"><span class="token key atrule">title</span><span class="token punctuation">:</span> 文章3
2023-10-20 16:29:07 +08:00
<span class="token key atrule">categories</span><span class="token punctuation">:</span>
2023-11-03 14:25:01 +08:00
<span class="token punctuation">-</span> javascript
<span class="token key atrule">tags</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> 编程
<span class="token punctuation">-</span> JavaScript</span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-10-20 16:29:07 +08:00
2023-11-03 14:25:01 +08:00
<p>那么在 <code>javascript</code> 分类下,排序的顺序依次为:<code>文章1 &gt; 文章2 &gt; 文章3</code></p>
<h2 id="status"><a href="#status" class="headerlink" title="status"></a>status</h2><p>用于区分文章的状态,同时利用文章分类列表的<code>筛选</code>进行快速筛选Cosy 主题内置了 4 种状态</p>
2023-10-20 16:29:07 +08:00
<ul>
2023-11-03 14:25:01 +08:00
<li>done完成</li>
<li>doing进行中</li>
<li>todo待办</li>
<li>other废弃</li>
2023-10-20 16:29:07 +08:00
</ul>
2023-11-03 14:25:01 +08:00
<p>例如:</p>
2023-10-20 16:29:07 +08:00
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
2023-11-03 14:25:01 +08:00
<span class="token front-matter yaml language-yaml"><span class="token key atrule">title</span><span class="token punctuation">:</span> 文章1
2023-10-20 16:29:07 +08:00
<span class="token key atrule">categories</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> javascript
<span class="token key atrule">status</span><span class="token punctuation">:</span> done</span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-11-03 14:25:01 +08:00
<h1 id="自定义页面"><a href="#自定义页面" class="headerlink" title="自定义页面"></a>自定义页面</h1><p>Hexo 使用 Markdown或其他渲染引擎解析你的文章并生成静态文件以快速加载。除了默认生成的文章和归档页面之外Hexo 还允许你创建自定义页面。</p>
2023-12-26 10:56:25 +08:00
<h2 id="基本配置-🆕"><a href="#基本配置-🆕" class="headerlink" title="基本配置 🆕"></a>基本配置 🆕</h2><p>可以通过配置 <code>nav_meta</code> 属性关闭页面、更改图标</p>
<p>v1版本配置</p>
2023-11-10 14:17:50 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">nav_meta</span><span class="token punctuation">:</span>
<span class="token comment"># 不显示 timeline页面</span>
<span class="token key atrule">timeline</span><span class="token punctuation">:</span> <span class="token boolean important">false</span>
<span class="token comment"># 自定义图标</span>
<span class="token key atrule">roadmap</span><span class="token punctuation">:</span>
&lt;svg xmlns="http<span class="token punctuation">:</span>//www.w3.org/2000/svg" xmlns<span class="token punctuation">:</span>xlink="http<span class="token punctuation">:</span>//www.w3.org/1999/xlink" viewBox="0 0 24 24"<span class="token punctuation">></span>
&lt;g fill="none" stroke="currentColor" stroke<span class="token punctuation">-</span>width="2" stroke<span class="token punctuation">-</span>linecap="round" stroke<span class="token punctuation">-</span>linejoin="round"<span class="token punctuation">></span>
&lt;path d="M10.5 20.4l<span class="token punctuation">-</span>6.9<span class="token punctuation">-</span>6.9c<span class="token punctuation">-</span>.781<span class="token punctuation">-</span>.781<span class="token punctuation">-</span>.781<span class="token punctuation">-</span>2.219 0<span class="token punctuation">-</span>3l6.9<span class="token punctuation">-</span>6.9c.781<span class="token punctuation">-</span>.781 2.219<span class="token punctuation">-</span>.781 3 0l6.9 6.9c.781.781.781 2.219 0 3l<span class="token punctuation">-</span>6.9 6.9c<span class="token punctuation">-</span>.781.781<span class="token punctuation">-</span>2.219.781<span class="token punctuation">-</span>3 0z"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>
&lt;path d="M9 14v<span class="token punctuation">-</span>2c0<span class="token punctuation">-</span>.59.414<span class="token punctuation">-</span>1 1<span class="token punctuation">-</span>1h5"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>
&lt;path d="M13 9l2 2l<span class="token punctuation">-</span>2 2"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>
&lt;/g<span class="token punctuation">></span>
&lt;/svg<span class="token punctuation">></span>
<span class="token key atrule">resume</span><span class="token punctuation">:</span>
&lt;svg xmlns="http<span class="token punctuation">:</span>//www.w3.org/2000/svg" xmlns<span class="token punctuation">:</span>xlink="http<span class="token punctuation">:</span>//www.w3.org/1999/xlink" viewBox="0 0 24 24"<span class="token punctuation">></span>
&lt;g fill="none" stroke="currentColor" stroke<span class="token punctuation">-</span>width="2" stroke<span class="token punctuation">-</span>linecap="round" stroke<span class="token punctuation">-</span>linejoin="round"<span class="token punctuation">></span>
&lt;path d="M14 3v4a1 1 0 0 0 1 1h4"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>
&lt;path d="M5 8V5a2 2 0 0 1 2<span class="token punctuation">-</span>2h7l5 5v11a2 2 0 0 1<span class="token punctuation">-</span>2 2h<span class="token punctuation">-</span>5"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>
&lt;circle cx="6" cy="14" r="3"<span class="token punctuation">></span>&lt;/circle<span class="token punctuation">></span>
&lt;path d="M4.5 17L3 22l3<span class="token punctuation">-</span>1.5L9 22l<span class="token punctuation">-</span>1.5<span class="token punctuation">-</span>5"<span class="token punctuation">></span>&lt;/path<span class="token punctuation">></span>
&lt;/g<span class="token punctuation">></span>
&lt;/svg<span class="token punctuation">></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-12-26 10:56:25 +08:00
<p>v2版本配置</p>
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">nav_meta</span><span class="token punctuation">:</span>
<span class="token key atrule">archives</span><span class="token punctuation">:</span> svg
<span class="token key atrule">cosy-roadmap</span><span class="token punctuation">:</span> svg
<span class="token key atrule">cosy-resume</span><span class="token punctuation">:</span> svg<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
<h2 id="偏好设置-🆕-v2新增"><a href="#偏好设置-🆕-v2新增" class="headerlink" title="偏好设置 🆕 (v2新增)"></a>偏好设置 🆕 (v2新增)</h2><p>创建偏好设置页面</p>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">hexo new page cosy-preference<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h2 id="Roadmap-路线图-🆕"><a href="#Roadmap-路线图-🆕" class="headerlink" title="Roadmap 路线图 🆕"></a>Roadmap 路线图 🆕</h2><p>创建页面,你可以使用命令</p>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash"><span class="token comment"># v1版本请使用</span>
hexo new page roadmap
<span class="token comment"># v2版本请使用</span>
hexo new page cosy-roadmap<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
2023-10-30 11:56:47 +08:00
2023-11-03 14:25:01 +08:00
<p>成功后在 <code>source/</code> 文件夹下会生成一个新的文件夹 <code>/roadmap/index.md</code></p>
<p>你可以参照此模板,进行配置,参数说明:</p>
2023-10-30 11:56:47 +08:00
<ul>
2023-12-26 10:56:25 +08:00
<li>title: roadmap 页面 html 的标题</li>
2023-11-03 14:25:01 +08:00
<li>initYear: 默认显示的年份</li>
2023-10-30 11:56:47 +08:00
</ul>
2023-11-03 14:25:01 +08:00
<pre class="line-numbers language-markdown" data-language="markdown"><code class="language-markdown"><span class="token front-matter-block"><span class="token punctuation">---</span>
<span class="token front-matter yaml language-yaml"><span class="token key atrule">title</span><span class="token punctuation">:</span> 陈不渡 <span class="token punctuation">-</span> roadmap
<span class="token key atrule">layout</span><span class="token punctuation">:</span> roadmap
<span class="token key atrule">initYear</span><span class="token punctuation">:</span> <span class="token number">2023</span>
<span class="token key atrule">years</span><span class="token punctuation">:</span>
<span class="token key atrule">2022</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> 读书
<span class="token key atrule">start</span><span class="token punctuation">:</span> 01<span class="token punctuation">-</span><span class="token number">01</span>
<span class="token key atrule">end</span><span class="token punctuation">:</span> 1<span class="token punctuation">-</span><span class="token number">5</span>
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> 还是读书
<span class="token key atrule">start</span><span class="token punctuation">:</span> 02<span class="token punctuation">-</span><span class="token number">01</span>
<span class="token key atrule">end</span><span class="token punctuation">:</span> 05<span class="token punctuation">-</span><span class="token number">30</span>
<span class="token key atrule">2023</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> 越陌度阡
<span class="token key atrule">start</span><span class="token punctuation">:</span> 01<span class="token punctuation">-</span><span class="token number">01</span>
<span class="token key atrule">end</span><span class="token punctuation">:</span> 1<span class="token punctuation">-</span><span class="token number">2</span>
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> 枉用相存
<span class="token key atrule">start</span><span class="token punctuation">:</span> 02<span class="token punctuation">-</span><span class="token number">01</span>
<span class="token key atrule">end</span><span class="token punctuation">:</span> 06<span class="token punctuation">-</span><span class="token number">30</span>
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> 短歌行
<span class="token key atrule">start</span><span class="token punctuation">:</span> 10<span class="token punctuation">-</span><span class="token number">26</span>
<span class="token key atrule">end</span><span class="token punctuation">:</span> 10<span class="token punctuation">-</span><span class="token number">31</span>
<span class="token key atrule">content</span><span class="token punctuation">:</span> 对酒当歌,人生几何!譬如朝露,去日苦多。慨当以慷,忧思难忘。何以解忧?唯有杜康。青青子衿,悠悠我心。但为君故,沉吟至今。呦呦鹿鸣,食野之苹。
<span class="token punctuation">-</span> <span class="token key atrule">title</span><span class="token punctuation">:</span> 声律启蒙
<span class="token key atrule">start</span><span class="token punctuation">:</span> 11<span class="token punctuation">-</span><span class="token number">01</span>
<span class="token key atrule">end</span><span class="token punctuation">:</span> 11<span class="token punctuation">-</span><span class="token number">31</span>
<span class="token key atrule">content</span><span class="token punctuation">:</span> 花开红锦绣,水漾碧琉璃。去妇因探邻舍枣,出妻为种后园葵</span>
<span class="token punctuation">---</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-12-26 10:56:25 +08:00
<h2 id="Resume-简历页面-🆕"><a href="#Resume-简历页面-🆕" class="headerlink" title="Resume 简历页面 🆕"></a>Resume 简历页面 🆕</h2><p>创建页面,你可以使用命令</p>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash"><span class="token comment"># v1版本请使用</span>
hexo new page resume
<span class="token comment"># v2版本请使用</span>
hexo new page cosy-resume<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
2023-10-30 11:56:47 +08:00
2023-11-03 14:25:01 +08:00
<p>成功后在 <code>source/</code> 文件夹下会生成一个新的文件夹 <code>/resume/index.md</code></p>
<p>你可以参照此模板,进行配置,参数说明:</p>
2023-10-30 11:56:47 +08:00
<ul>
2023-11-03 14:25:01 +08:00
<li>title: resume 页面 html 的标题</li>
<li>avatar: 头像图片的地址</li>
2023-10-30 11:56:47 +08:00
</ul>
2023-11-03 14:25:01 +08:00
<pre class="line-numbers language-yaml" data-language="yaml"><code class="language-yaml"><span class="token key atrule">title</span><span class="token punctuation">:</span> 页面标题document.title
<span class="token key atrule">layout</span><span class="token punctuation">:</span> resume
<span class="token key atrule">avatar</span><span class="token punctuation">:</span> /img/avatar.png
<span class="token key atrule">name</span><span class="token punctuation">:</span> Hi<span class="token tag">!</span> Mozzie
<span class="token key atrule">role</span><span class="token punctuation">:</span> Full Stack
<span class="token key atrule">email</span><span class="token punctuation">:</span> himozzie@gmail.com
<span class="token key atrule">phone</span><span class="token punctuation">:</span> +86 180<span class="token punctuation">-</span>xxxx<span class="token punctuation">-</span>xxx
<span class="token key atrule">birth</span><span class="token punctuation">:</span> Jan 21<span class="token punctuation">,</span> <span class="token number">1994</span>
<span class="token key atrule">location</span><span class="token punctuation">:</span> Nanjing<span class="token punctuation">,</span> China
<span class="token key atrule">social</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> github
<span class="token key atrule">link</span><span class="token punctuation">:</span> https<span class="token punctuation">:</span>//github.com/17px
<span class="token key atrule">icon</span><span class="token punctuation">:</span> svg
<span class="token key atrule">about</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> 我的工作是建立你的网站,使其功能强大,用户友好,但同时具有吸引力。
<span class="token punctuation">-</span> 此外,我为您的产品添加了个人风格,并确保其引人注目且易于使用。我的目标是以最有创意的方式传达你的信息和身份。我为许多知名品牌公司设计网页。
<span class="token key atrule">skill</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> 熟悉Node具备后端开发能力有SpringBoot、Egg、Koa2、Midway等单个应用项目经验有Nestjs微服务应用项目经验
<span class="token punctuation">-</span> 具有Monoreo工程经验能够分离单个单元的前端和后端并应用DevOps
<span class="token key atrule">education</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">school</span><span class="token punctuation">:</span> 大学艺术学院
<span class="token key atrule">time</span><span class="token punctuation">:</span> 2012<span class="token punctuation">-</span><span class="token number">2016</span>
<span class="token key atrule">workExp</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">inc</span><span class="token punctuation">:</span> 创意研发
<span class="token key atrule">time</span><span class="token punctuation">:</span> 2021.09 ~ 至今
<span class="token punctuation">-</span> <span class="token key atrule">inc</span><span class="token punctuation">:</span> Web设计
<span class="token key atrule">time</span><span class="token punctuation">:</span> 2021.01 ~ 2021.09
<span class="token key atrule">projectExp</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> PC/React• 标注 ,算法数据中心
<span class="token key atrule">desc</span><span class="token punctuation">:</span> 这是一个xxx系统。它主要包括一个bc函数。我主要负责x、y和z模块的开发和维护。
<span class="token key atrule">list</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> 使用pnpm工作区管理Monorepo中的多个代码库支持多个框架共存共享通用组件库和功能
<span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> PC/React•Tavigator主动脉根部/外周
<span class="token key atrule">desc</span><span class="token punctuation">:</span> 这是一个xxx系统。它主要包括一个bc函数。我主要负责x、y和z模块的开发和维护。
<span class="token key atrule">portfolio</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">name</span><span class="token punctuation">:</span> 项目A
<span class="token key atrule">desc</span><span class="token punctuation">:</span> 项目A描述
<span class="token key atrule">iconSVG</span><span class="token punctuation">:</span> 复制svg的path到这里
<span class="token key atrule">link</span><span class="token punctuation">:</span> 网址http(s)<span class="token punctuation">:</span>//<span class="token punctuation">...</span>
<span class="token comment"># 更多 ...</span>
2023-11-08 13:45:34 +08:00
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
2023-12-25 16:39:03 +08:00
<div class="post-tags">
<!-- 文章tags -->
</div>
<p class="motto">重拾纯粹的写作</p>
2023-11-08 13:45:34 +08:00
</article>
2023-10-24 09:50:42 +08:00
<!-- 评论 -->
<div id="vcomments"></div>
</div>
</main>
2023-12-25 16:39:03 +08:00
<!-- toc -->
<cosy-drag-box id="toc-drag-box" trigger="left" min-width="220" uid="toc-box">
<div class="meta-container">
<div class="toc-wrapper cosy-scrollbar">
2023-12-26 10:56:25 +08:00
<p class="catalog">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 6h16"></path>
<path d="M4 12h16"></path>
<path d="M4 18h12"></path>
</g>
</svg>
<span>目录</span>
</p>
2023-12-25 16:39:03 +08:00
<!-- 文章toc -->
2024-01-04 23:11:27 +08:00
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%86%99%E5%9C%A8%E5%89%8D%E9%9D%A2-%F0%9F%92%A1"><span class="toc-number">1.</span> <span class="toc-text">写在前面 💡</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AE%89%E8%A3%85"><span class="toc-number">2.</span> <span class="toc-text">安装</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8-npm-%E5%AE%89%E8%A3%85"><span class="toc-number">2.1.</span> <span class="toc-text">使用 npm 安装</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BC%A0%E7%BB%9F%E6%96%B9%E5%BC%8F-%E5%AE%89%E8%A3%85-Hexo-%E5%AE%89%E8%A3%85%E4%B8%BB%E9%A2%98"><span class="toc-number">2.2.</span> <span class="toc-text">传统方式 - 安装 Hexo 安装主题</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%8E%B7%E5%8F%96-Cosy"><span class="toc-number">2.3.</span> <span class="toc-text">获取 Cosy</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#hexo-%E9%85%8D%E7%BD%AE"><span class="toc-number">3.</span> <span class="toc-text">hexo 配置</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE"><span class="toc-number">3.1.</span> <span class="toc-text">基础配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%AF%AD%E8%A8%80"><span class="toc-number">3.2.</span> <span class="toc-text">语言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E8%AF%AD%E6%B3%95%E9%AB%98%E4%BA%AE"><span class="toc-number">3.3.</span> <span class="toc-text">文章语法高亮</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Cosy-%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="toc-number">4.</span> <span class="toc-text">Cosy 主题配置</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%88%86%E7%B1%BB%E5%9B%BE%E6%A0%87"><span class="toc-number">4.1.</span> <span class="toc-text">文章分类图标</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BD%91%E7%AB%99%E5%9B%BE%E6%A0%87-favicon"><span class="toc-number">4.2.</span> <span class="toc-text">网站图标 favicon</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E8%89%B2-%F0%9F%86%95-v2%E6%96%B0%E5%A2%9E"><span class="toc-number">4.3.</span> <span class="toc-text">主题色 🆕 (v2新增)</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#ICP%E5%A4%87%E6%A1%88%E5%8F%B7"><span class="toc-number">4.4.</span> <span class="toc-text">ICP备案号</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%A6%96%E9%A1%B5%E5%BA%95%E9%83%A8%E6%96%87%E5%AD%97-%F0%9F%86%95"><span class="toc-number">4.5.</span> <span class="toc-text">首页底部文字 🆕</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E7%89%88%E6%9D%83%E7%94%B3%E6%98%8E-%F0%9F%86%95"><span class="toc-number">4.6.</span> <span class="toc-text">文章版权申明 🆕</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#katex-%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F"><span class="toc-number">4.7.</span> <span class="toc-text">katex 数学公式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#mermaid-%E6%B5%81%E7%A8%8B%E5%9B%BE"><span class="toc-number">4.8.</span> <span class="toc-text">mermaid 流程图</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#valine-%E6%96%87%E7%AB%A0%E8%AF%84%E8%AE%BA"><span class="toc-number">4.9.</span> <span class="toc-text">valine 文章评论</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#algolia%E6%90%9C%E7%B4%A2"><span class="toc-number">5.</span> <span class="toc-text">algolia搜索</span></a><ol class="toc-child"><li class="
2023-12-25 16:39:03 +08:00
</div>
</div>
</cosy-drag-box>
2023-10-24 09:50:42 +08:00
</div>
2023-12-25 16:39:03 +08:00
2023-10-24 09:50:42 +08:00
</div>
<script>
2023-11-08 10:11:56 +08:00
window.page = {
use: ''
}
2023-10-24 09:50:42 +08:00
window.katex = {
2023-11-08 10:11:56 +08:00
enable: "",
2023-10-24 09:50:42 +08:00
jsCdn: "//cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.js",
cssCdn: "//cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.css"
}
window.mermaid = {
2023-11-08 10:11:56 +08:00
enable: "",
2023-11-15 10:21:41 +08:00
theme: "",
2023-10-24 09:50:42 +08:00
cdn: "//cdn.jsdelivr.net/npm/mermaid@10.4.0/dist/mermaid.min.js",
}
window.valine = {
2023-11-08 10:11:56 +08:00
enable: "",
2023-10-24 09:50:42 +08:00
appId: 'TisMit6uhflounFqAN3ZGjgq-MdYXbMMI',
appKey: 'CdjirjYdz07U5i62ElsJvXUh',
avatar: 'monsterid',
cdn: '//unpkg.com/valine@latest/dist/Valine.min.js',
serverURLs: '//tismit6u.api.lncldglobal.com'
};
</script>
2023-12-28 11:27:53 +08:00
<script src="/js/5bf38c1b.js"></script>
2023-10-24 09:50:42 +08:00
</main>
</body>
2023-12-25 16:39:03 +08:00
2023-10-24 09:50:42 +08:00
<script>
2023-12-25 16:39:03 +08:00
window.theme = {
color: 'hsl(238,50%,56%)'
2023-10-24 09:50:42 +08:00
}
</script>
2023-12-25 16:39:03 +08:00
2023-12-28 11:27:53 +08:00
<script src="/js/82a967e8.js"></script>
2023-10-24 09:50:42 +08:00
2023-10-19 22:44:47 +08:00
</html>