Site updated: 2022-09-14 13:04:45

This commit is contained in:
2022-09-14 13:04:46 +08:00
parent 6fa4f3db96
commit 7cda139e67
13 changed files with 151 additions and 57 deletions

93
rss.xml
View File

@ -22,53 +22,100 @@
<link>https://blog.jingxiyuan.cn/2022/09/14/Hexo%E5%AE%89%E8%A3%85%E6%91%B8%E7%B4%A2/</link>
<pubDate>Wed, 14 Sep 2022 12:23:55 +0800</pubDate>
<description><![CDATA[ &lt;h1 id=&#34;hexo博客安装&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#hexo博客安装&#34;&gt;#&lt;/a&gt; hexo 博客安装&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;&#34;&gt;安装 nodejs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;&#34;&gt;安装 git&lt;/a&gt; &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9ub2RlanMub3JnL2VuLw==&#34;&gt;安装 nodejs&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9naXQtc2NtLmNvbS8=&#34;&gt;安装 git&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;安装 hexowindows 需进入 git bash&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install -g hexo-cli&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;初始化博客目录&lt;/p&gt;
&lt;p&gt;&lt;code&gt;hexo init blog&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;进入博客目录&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cd blog&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;初始化 hexo 到博客目录&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id=&#34;shoka主题安装&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#shoka主题安装&#34;&gt;#&lt;/a&gt; shoka 主题安装&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;下载主题 &lt;/p&gt;
&lt;p&gt;&lt;code&gt;git clone &lt;/code&gt; &lt;a href=&#34;https://github.com/amehime/hexo-theme-shoka.git&#34;&gt; &lt;code&gt;https://github.com/amehime/hexo-theme-shoka.git&lt;/code&gt; &lt;/a&gt; &lt;code&gt; ./themes/shoka&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;&lt;code&gt;git clone &lt;/code&gt; &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cHM6Ly9naXRodWIuY29tL2FtZWhpbWUvaGV4by10aGVtZS1zaG9rYS5naXQ=&#34;&gt;https://github.com/amehime/hexo-theme-shoka.git&lt;/span&gt; &lt;code&gt; ./themes/shoka&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;卸载 hexo-renderer-marked 以及别的 markdown 文件渲染器 &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm un hexo-renderer-marked --save&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm un hexo-renderer-marked --save&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;安装md 文件渲染器,压缩 css/js/html&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-renderer-multi-markdown-it --save&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;安装(给生成的 css 文件们添加浏览器前缀) &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-autoprefixer --save&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-renderer-multi-markdown-it --save&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;安装(给生成的 css 文件们添加浏览器前缀)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-autoprefixer --save&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;安装(站内搜索功能) &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-algoliasearch --save&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;安装(文章或站点字数及阅读时间统计) &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-symbols-count-time --save&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;安装(生成 Feed 文件) &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-algoliasearch --save&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;安装(文章或站点字数及阅读时间统计)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-symbols-count-time --save&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;安装(生成 Feed 文件)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm i hexo-feed --save&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id=&#34;hexo部分常用命令&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#hexo部分常用命令&#34;&gt;#&lt;/a&gt; Hexo 部分常用命令&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;清除静态文件&lt;/p&gt;
&lt;p&gt;&lt;code&gt;hexo clean&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;生成静态文件 &lt;/p&gt;
&lt;p&gt;&lt;code&gt;hexo g&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;&lt;code&gt;hexo clean&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;生成静态文件&lt;/p&gt;
&lt;p&gt;&lt;code&gt;hexo g&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;安装 git 推送插件 &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install hexo-deployer-git --save&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install hexo-deployer-git --save&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;推送静态文件到 git &lt;/p&gt;
&lt;p&gt;&lt;code&gt;hexo d&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;安装hexo-admin编写博客插件&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#安装hexo-admin编写博客插件&#34;&gt;#&lt;/a&gt; 安装 hexo-admin编写博客插件&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;npm install hexo-admin --save&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;hexo-admin 编辑 url&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://localhost:4000/admin&#34;&gt; &lt;code&gt;http://localhost:4000/admin&lt;/code&gt; &lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;settings 设置用户名、密码、Secret&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://localhost:4000/admin/#/settings&#34;&gt; &lt;code&gt;http://localhost:4000/admin/#/settings&lt;/code&gt; &lt;/a&gt; &lt;/p&gt;
&lt;p&gt;把底部生成的配置拷入 hexo 配合文件中 (_config.yml)&lt;br /&gt;
&lt;code&gt;admin: username: username password_hash: ````10$L.XAIqIWgTc5S1zpvV3MEu7/rH34p4Is/nq824smv8EZ3lIPCp1su secret: &#39;my super secret phrase&#39; #用单引号包裹 deployCommand: &#39;hexo-publish.sh&#39; #windows用hexo-publish.batlinux用hexo-publish.sh&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;hexo-publishsh&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#hexo-publishsh&#34;&gt;#&lt;/a&gt; &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cDovL2hleG8tcHVibGlzaC5zaA==&#34;&gt;hexo-publish.sh&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;#!/usr/bin/env sh hexo clean hexo g hexo d&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;hexo-publishbat&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#hexo-publishbat&#34;&gt;#&lt;/a&gt; hexo-publish.bat&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;@echo off cd D:\blog d: @cmd /c &amp;quot;hexo clean&amp;amp;&amp;amp; hexo g&amp;amp;&amp;amp;hexo d&amp;amp;&amp;amp;echo success&amp;quot;&lt;/code&gt;&lt;/p&gt;
]]></description>
&lt;p&gt;&lt;a href=&#34;http://localhost:4000/admin/#/settings&#34;&gt; &lt;code&gt;http://localhost:4000/admin/#/settings&lt;/code&gt; &lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;把底部生成的配置拷入 hexo 配合文件中 (_config.yml)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&#34;highlight yml&#34;&gt;&lt;figcaption data-lang=&#34;YAML&#34;&gt;&lt;/figcaption&gt;&lt;table&gt;&lt;tr&gt;&lt;td data-num=&#34;1&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&lt;span class=&#34;token key atrule&#34;&gt;admin&lt;/span&gt;&lt;span class=&#34;token punctuation&#34;&gt;:&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;2&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&lt;span class=&#34;token key atrule&#34;&gt;username&lt;/span&gt;&lt;span class=&#34;token punctuation&#34;&gt;:&lt;/span&gt; username&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;3&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&lt;span class=&#34;token key atrule&#34;&gt;password_hash&lt;/span&gt;&lt;span class=&#34;token punctuation&#34;&gt;:&lt;/span&gt; xxxxxx&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;4&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&lt;span class=&#34;token key atrule&#34;&gt;secret&lt;/span&gt;&lt;span class=&#34;token punctuation&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;token string&#34;&gt;&#39;my super secret phrase&#39;&lt;/span&gt; &lt;span class=&#34;token comment&#34;&gt;#用单引号包裹&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;5&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&lt;span class=&#34;token key atrule&#34;&gt;deployCommand&lt;/span&gt;&lt;span class=&#34;token punctuation&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;token string&#34;&gt;&#39;hexo-publish.sh&#39;&lt;/span&gt; &lt;span class=&#34;token comment&#34;&gt;#windows 用 hexo-publish.batlinux 用 hexo-publish.sh&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;&lt;h4 id=&#34;hexo-publishsh&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#hexo-publishsh&#34;&gt;#&lt;/a&gt; &lt;span class=&#34;exturl&#34; data-url=&#34;aHR0cDovL2hleG8tcHVibGlzaC5zaA==&#34;&gt;hexo-publish.sh&lt;/span&gt;&lt;/h4&gt;
&lt;figure class=&#34;highlight bash&#34;&gt;&lt;figcaption data-lang=&#34;bash&#34;&gt;&lt;/figcaption&gt;&lt;table&gt;&lt;tr&gt;&lt;td data-num=&#34;1&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&lt;span class=&#34;token shebang important&#34;&gt;#!/usr/bin/env sh&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;2&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;hexo clean&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;3&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;hexo g&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;4&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;hexo d&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;&lt;h4 id=&#34;hexo-publishbat&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#hexo-publishbat&#34;&gt;#&lt;/a&gt; hexo-publish.bat&lt;/h4&gt;
&lt;figure class=&#34;highlight bash&#34;&gt;&lt;figcaption data-lang=&#34;bash&#34;&gt;&lt;/figcaption&gt;&lt;table&gt;&lt;tr&gt;&lt;td data-num=&#34;1&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;@echo off&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;2&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&lt;span class=&#34;token builtin class-name&#34;&gt;cd&lt;/span&gt; D:&lt;span class=&#34;token punctuation&#34;&gt;\&lt;/span&gt;blog&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;3&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;d:&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-num=&#34;4&#34;&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;@cmd /c &lt;span class=&#34;token string&#34;&gt;&#34;hexo clean&amp;amp;&amp;amp; hexo g&amp;amp;&amp;amp;hexo d&amp;amp;&amp;amp;echo success&#34;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt; ]]></description>
</item>
<item>
<guid isPermalink="true">https://blog.jingxiyuan.cn/2022/09/13/hello-world/</guid>