-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrss.xml
112 lines (112 loc) · 15.6 KB
/
rss.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>HT知识星球</title>
<link>https://xhtgit.github.io/HTworld.github.io</link>
<description></description>
<language>zh-CN</language>
<pubDate>Fri, 14 Apr 2023 10:08:43 +0800</pubDate>
<lastBuildDate>Fri, 14 Apr 2023 10:08:43 +0800</lastBuildDate>
<category>Git</category>
<category>博客搭建</category>
<category>web开发安全</category>
<item>
<guid isPermalink="true">https://xhtgit.github.io/HTworld.github.io/2023/04/14/Hexo+GitHub%20Pages%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA-%E6%89%93%E9%80%A0%E4%BD%A0%E7%9A%84%E7%9F%A5%E8%AF%86%E4%B8%96%E7%95%8C/</guid>
<title>Hexo+GitHub Pages个人博客搭建-打造你的知识世界</title>
<link>https://xhtgit.github.io/HTworld.github.io/2023/04/14/Hexo+GitHub%20Pages%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA-%E6%89%93%E9%80%A0%E4%BD%A0%E7%9A%84%E7%9F%A5%E8%AF%86%E4%B8%96%E7%95%8C/</link>
<category>博客搭建</category>
<pubDate>Fri, 14 Apr 2023 10:08:43 +0800</pubDate>
<description><![CDATA[ <h3 id="介绍"><a class="markdownIt-Anchor" href="#介绍">#</a> 介绍</h3>
<h5 id="github-pages"><a class="markdownIt-Anchor" href="#github-pages">#</a> GitHub Pages</h5>
<p>GitHub Pages 是一个静态网站托管服务。<br>
GitHub Pages 是设计用来托管你的个人页面,组织页面,或者 Github 仓库的项目页面。</p>
<h5 id="hexo"><a class="markdownIt-Anchor" href="#hexo">#</a> Hexo</h5>
<p>Hexo 是一款基于 Node.js 的静态博客框架,依赖少易于安装使用,可以方便的生成静态网页托管在 GitHub 和 Coding 上,是搭建博客的首选框架。大家可以进入<span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL3poLWNuLw=="> hexo 官网</span>进行详细查看,因为 Hexo 的创建者是台湾人,对中文的支持很友好,可以选择中文进行查看。</p>
<p>框架文档地址:<span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL3poLWNuLw==">Hexo</span>\</p>
<p>我的博客地址:<a href="https://xhtgit.github.io/HTworld.github.io/">HT 知识星球 (xhtgit.github.io)</a></p>
<h3 id="安装环境"><a class="markdownIt-Anchor" href="#安装环境">#</a> 安装环境</h3>
<pre><code> 安装NodeJS 和 Git
</code></pre>
<p>首先确定自己是否已经安装 nodejs 和 git</p>
<pre><code>node -v
npm -v
git -v
</code></pre>
<p><img data-src="https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/738657eb44754334a75298a9fb203012~tplv-k3u1fbpfcp-watermark.image?" alt="image.png"><br>
如果都显示版本的话则表明安装成功</p>
<h3 id="安装hexo框架"><a class="markdownIt-Anchor" href="#安装hexo框架">#</a> 安装 Hexo 框架</h3>
<figure class="highlight plaintext"><table><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><br><span class="line">npm install -g hexo-cli</span><br><span class="line"></span><br><span class="line">//初始化项目</span><br><span class="line">hexo init &lt;文件名&gt;</span><br><span class="line"></span><br><span class="line">//启动服务</span><br><span class="line">hexo server</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<h3 id="一键部署到github"><a class="markdownIt-Anchor" href="#一键部署到github">#</a> 一键部署到 GitHub</h3>
<p>建立名为 <code>&lt;你的 GitHub 用户名&gt;.github.io</code> 的储存库</p>
<ul>
<li>安装 <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2hleG9qcy9oZXhvLWRlcGxveWVyLWdpdA==">hexo-deployer-git</span></li>
<li>在 <code>_config.yml</code> 中添加以下配置(如果配置已经存在,请将其替换为如下):</li>
</ul>
<!---->
<pre><code>deploy:
type: git
repo: https://github.com/&lt;username&gt;/&lt;project&gt;
# example, https://github.com/hexojs/hexojs.github.io
branch: &lt;branch-name&gt;
</code></pre>
<ul>
<li>执行 <code>hexo clean &amp;&amp; hexo generate &amp;&amp; hexo deploy</code> <br>
执行完 hexo d 后会跳出 github 授权的框</li>
</ul>
<h3 id="修改主题"><a class="markdownIt-Anchor" href="#修改主题">#</a> 修改主题</h3>
<p>在官方文档的 Themes 里面选择自己喜欢的主题</p>
<p><img data-src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/1119d47fbf9f47489b362c911d9030a1~tplv-k3u1fbpfcp-watermark.image?" alt="image.png"><br>
点击其名称进入其仓库,复制主题地址,将主题下载到项目 themes 文件夹内,最好阅读主题 Readme.md 下载主题相关插件</p>
<pre><code>git clone &lt;主题仓库地址&gt;
</code></pre>
<p>修改 <code>_config.yml</code> 内的 <code>theme</code> 设定,即可切换主题</p>
<p><img data-src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ee69504e65904efca760f255e12d81bf~tplv-k3u1fbpfcp-watermark.image?" alt="image.png"><br>
然后通过输入命令 hexo server 本地运行查看效果<br>
<img data-src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/65ab58eaf44e4a36a9c8aea3a33da8e2~tplv-k3u1fbpfcp-watermark.image?" alt="image.png"><br>
确认无误后,通过上述部署命令再次部署到 GitHub</p>
]]></description>
</item>
<item>
<guid isPermalink="true">https://xhtgit.github.io/HTworld.github.io/2023/04/13/console.log%E4%B9%9F%E4%BC%9A%E5%BC%95%E5%8F%91%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F%EF%BC%9F/</guid>
<title>console.log也会引发内存泄漏?</title>
<link>https://xhtgit.github.io/HTworld.github.io/2023/04/13/console.log%E4%B9%9F%E4%BC%9A%E5%BC%95%E5%8F%91%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F%EF%BC%9F/</link>
<category>web开发安全</category>
<pubDate>Thu, 13 Apr 2023 19:40:21 +0800</pubDate>
<description><![CDATA[ <h4 id="前言"><a class="markdownIt-Anchor" href="#前言">#</a> 前言</h4>
<p>console.log () 是一个 JavaScript 中的函数,用于在控制台输出信息。它可以接受一个或多个参数,每个参数之间用逗号隔开,输出的内容可以是字符串、数字、布尔值、对象、数组等。<br>
但是我们可能没有意识到一个简单的 console.log 可能也会引起内存泄漏。</p>
<h4 id="详解"><a class="markdownIt-Anchor" href="#详解">#</a> 详解</h4>
<p>console.log 本身并不会导致内存泄漏,因为它只是用于输出日志信息的一个方法。然而,在某些情况下,console.log 可能会导致内存泄漏,具体原因如下:</p>
<ol>
<li>在循环中使用 console.log:如果在循环中使用 console.log,它会不断地将日志信息输出到控制台,这可能会导致内存占用不断增加,最终导致内存泄漏。</li>
<li>在闭包中使用 console.log:如果在闭包中使用 console.log,它会将闭包中引用的变量一直保持在内存中,即使闭包已经不再使用,这些变量也不会被释放,从而导致内存泄漏。</li>
<li>在长时间运行的程序中使用 console.log:如果在长时间运行的程序中频繁使用 console.log,它会占用大量内存,导致内存泄漏。</li>
</ol>
<p>因此,为了避免 console.log 导致内存泄漏,应该尽量避免在循环或闭包中使用它,同时在长时间运行的程序中也应该减少使用。</p>
<figure class="highlight plaintext"><table><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><br><span class="line">function Test()&#123;</span><br><span class="line"> let arr = [1,2,3,4,5,6]</span><br><span class="line"> console.log(arr)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>如上例子:Test 函数的 arr 在执行完后会被销毁,但由于 console.log 的存在,控制台会保持对该对象的引用,随着你打开控制台,递给 console.log 的对象,影响了它的<strong>垃圾回收</strong>,导致内存居高不下。引起内存泄漏。那我们可以大胆去假设一下,是不是因为打开 devtools 才有内存泄漏,不打开就不会呢?</p>
<h4 id="总结"><a class="markdownIt-Anchor" href="#总结">#</a> 总结:</h4>
<p>console.log 本身并不会导致内存泄漏,它只是将信息打印到控制台中。但是,在开发过程中,如果频繁使用 console.log 输出大量数据,会导致内存占用过高,从而导致内存泄漏。此外,如果在生产环境中没有将 console.log 语句删除或注释掉,也会导致内存泄漏。因为 console.log 语句会占用系统资源,而在生产环境中这些信息并不需要输出到控制台中,因此应该将它们删除或注释掉。</p>
]]></description>
</item>
<item>
<guid isPermalink="true">https://xhtgit.github.io/HTworld.github.io/2023/03/22/Git-daily/</guid>
<title>Git祖传宝典</title>
<link>https://xhtgit.github.io/HTworld.github.io/2023/03/22/Git-daily/</link>
<category>Git</category>
<pubDate>Wed, 22 Mar 2023 00:44:22 +0800</pubDate>
<description><![CDATA[ <div class="hbe hbe-container" id="hexo-blog-encrypt" data-wpm="抱歉, 这个密码看着不太对, 请再试试." data-whm="OOPS, these decrypted content may changed, but you can still have a look.">
<script id="hbeData" type="hbeData" data-hmacdigest="3c9fc84997ac215ded08da06deb25e7fdd53b6ad7b20c7870f30283729992510">f5acefd70429a87fe5021e27622ec11262cf35a3195d9ed4f533188af1e265bfbbcdebdf02cfbff3b8d4eefbb958a5707d6eb81112ffaa68ce0dd97a7485d4526fb2c912ce2b1507df03ba087473274f4db88db362f527185230cc32a67514f997da5041f139a358794ab32c767af473ef19da3666fd14a459849160634c56ff761906eb8f944d1cfa1540622be3a5062eff55c499c2ecc66aac87718e7b8fa383783ac2058a2051f7ec0371e0bf79c4244953f3952970e268d80574583d46c4d970df41b986da05f414dbc51812bd4a8523730397ec0eea9ef35d1cd7fea2f8f37a8ba6d308d0c9734d4ffebde7a0b0b46d9af33e750d867df2368fd8f7d78009dfd82f3b56d8f45cea56a1efd7882cd58c4c9c005ff4fb2fc49bb9f1b00c32759d6c72f77ec04a67125cff534501c89a8d737dbc3afe09bc0c28bf2411cc36580a458002625ac727f15ca2f58e30e6cf2fba1a7a18474b4cf6f7f3e94c5b2e228eaf7ebb4e2eec0420b40bce5cff6a69b022eb7aaf43c4bf8a74c1a493a5e4107f032f2daa396857bfa9d7b3e3ff09683deefc29d255fb07c41c8191b8578c28a6f7ce45058b50616512421554b39dc3ce0e1f355f5ee3bb89a2a3ea7f1a516a169a1868a596d07aafe9d499c76700db129e40ce6539d74df303d579814cdfb32fe96793dbac6d5efcd9e55715ea6f6fbed96127aa99c9fa7bdf33b4b4975fa609f2c75baa54cfd01fd2af40a6e08d42649e41334702597973fc6de9815e68c79c3476b1c0f624eb8ffe04863204f30bdb2f89706d91b58957584187cace29a4428d4302fa4c8369ca90547b77af917fc4d789b1b3269208397fb79a732e1819ad3c7e116606266cc99cb5d49c4393c9cb40b3cc1d6dddda47d587500ebce12687f878f1979d7f94018af6d4f6ea633268b8f29a5b5ab67682903bbbad680cfb3b773261042ccee227e28acd249531390ee90d113316986484f632a9018c30453b075484106c70efab998edf0f149eed601c5358e33c5af6774a099824269cf482e49b3497d9e491b1254385c2e19ae0c6e31c59c42e4ff5cb3e7645d3c61494cb1ec408124c865129d96dcc812d1dadb44cea362a579fdf0650dd62c741292f639ec67798e8a899f515abc7b045760fcec1931a4e099e99f7938321f1ea09dd14397e22faeb48282740ba7f06ff6bf32ea1ad35cb459a871d1c2038346a009190e173b021e77b6996e6f23cb9690a5cd0d2a971fdde8d996acdc2c7ac5bff7640d7c16450ec98eee3ac450356824954f6a1aae4e4b6979b8a1b58b43670b8c0ede5fa4dfeb1ad109776c86147d3082b582f938be9b1d02274cb97994dc8bedb48eb62bd45b9c36cfb740e438ae14bb43d558d99e7f2986f73c6a5d8cf5fbd408b3b7cbfdf94964ff6044a1ddcfd4a2aee52c6604fda69ccb46c83ec5dc160beca005769797fe10300c60e1c8350b4747f189591bf84a54de3e331bd205da2e6ce90114ce9142b4503ded3a59267c8575181901a3daf195551f64639416911a99fd463ae0065331772813fb9d91243add6ffb566a684b5b1f207e59e92799454bfc775221b3e016704a7fb1bf3595f79d58de5a006092021ded1daf450f3058959f5ba11b6d3688595d113795f3b0717e1419971ccab6e284b7152c1f7d546ece015034d79ad8c8190b183a7181f5b1153fbdc4b2dfc279853574a4e791c6c9955b746c6e43ce830024fd0f91b3813a6cd3c347b0dc652ddc66565e9e3cedb7bb4fc656ee123cc3d2557031214a359d6b646c78f4ee805299df9eeac35f2f4ecba73dca32248f67f0bc5d02852642366531a2f4a6198d7685cc65f56a512d3df8c6bf03177d7edbdf4b54310826307751ac1b3828c720a121a57a580195b7a04ad5a8d96b6b3bf02ef5f035051dcdde9a612dab937841b2e024d93fbd8886f17273b43adefa04426bf0645117519e4c62f8c57f13c6d2242982082b2837d6bad644e230ebd4da1a41cf20791fee50641555ba7346f6b9be90598caeb2fd069577d0dda8da65232aa76b556a623e83ccbefdc2c2896c3e8227d6b848666dcfe</script>
<div class="hbe hbe-content">
<div class="hbe hbe-input hbe-input-default">
<input class="hbe hbe-input-field hbe-input-field-default" type="password" id="hbePass">
<label class="hbe hbe-input-label hbe-input-label-default" for="hbePass">
<span class="hbe hbe-input-label-content hbe-input-label-content-default">这里需要密码才能访问。</span>
</label>
</div>
</div>
</div>
<script data-pjax src="/HTworld.github.io/lib/hbe.js"></script><link href="/HTworld.github.io/css/hbe.style.css" rel="stylesheet" type="text/css"> ]]></description>
</item>
</channel>
</rss>