Skip to content

Commit

Permalink
Site updated: 2016-11-18 18:13:08
Browse files Browse the repository at this point in the history
  • Loading branch information
xovel committed Nov 18, 2016
1 parent ba66dca commit ba649d0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 0 additions & 2 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@






<link rel="alternate" href="/atom.xml" title="清风轩" type="application/atom+xml" />

Expand Down
3 changes: 2 additions & 1 deletion article/minify-static-html-files.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<meta property="og:url" content="http://xovel.cn/article/minify-static-html-files.html">
<meta property="og:site_name" content="清风轩">
<meta property="og:description" content="博客优化之压缩HTML静态文件,本文介绍一种使用gulp的处理方式来解决这个问题。">
<meta property="og:updated_time" content="2016-11-16T09:14:27.211Z">
<meta property="og:updated_time" content="2016-11-18T10:12:39.105Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="博客优化之压缩HTML静态文件">
<meta name="twitter:description" content="博客优化之压缩HTML静态文件,本文介绍一种使用gulp的处理方式来解决这个问题。">
Expand Down Expand Up @@ -326,6 +326,7 @@ <h1 class="post-title" itemprop="name headline">
<figure class="highlight js"><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><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">gulp.task(<span class="string">'minify-html'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line"> <span class="keyword">return</span> gulp.src(<span class="string">'./public/**/*.html'</span>)</span><br><span class="line"> .pipe(htmlclean())</span><br><span class="line"> .pipe(htmlmin(&#123;</span><br><span class="line"> removeComments: <span class="literal">true</span>,</span><br><span class="line"> minifyJS: <span class="literal">false</span>,</span><br><span class="line"> minifyCSS: <span class="literal">true</span>,</span><br><span class="line"> minifyURLs: <span class="literal">false</span>,</span><br><span class="line"> &#125;))</span><br><span class="line"> .pipe(gulp.dest(<span class="string">'./public'</span>))</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>
<p>那么,在每一次deploy之前,在<code>Git Bash</code>下执行一次<code>gulp minify-html</code>即可对所有的HTML代码进行压缩。</p>
<p>CSS和JS的压缩可以编写类似的代码,这里不再赘述。</p>
<hr>


</div>
Expand Down
5 changes: 3 additions & 2 deletions atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link href="/atom.xml" rel="self"/>

<link href="http://xovel.cn/"/>
<updated>2016-11-16T09:14:27.211Z</updated>
<updated>2016-11-18T10:12:39.105Z</updated>
<id>http://xovel.cn/</id>

<author>
Expand All @@ -20,7 +20,7 @@
<link href="http://xovel.cn/article/minify-static-html-files.html"/>
<id>http://xovel.cn/article/minify-static-html-files.html</id>
<published>2016-11-16T09:07:40.000Z</published>
<updated>2016-11-16T09:14:27.211Z</updated>
<updated>2016-11-18T10:12:39.105Z</updated>

<content type="html">&lt;blockquote&gt;
&lt;p&gt;本文来自博客issue&lt;a href=&quot;https://github.com/xovel/xovel.github.io/issues/16&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;#16&lt;/a&gt;&lt;/p&gt;
Expand All @@ -45,6 +45,7 @@
&lt;figure class=&quot;highlight js&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;gulp.task(&lt;span class=&quot;string&quot;&gt;&#39;minify-html&#39;&lt;/span&gt;, &lt;span class=&quot;function&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;(&lt;span class=&quot;params&quot;&gt;&lt;/span&gt;) &lt;/span&gt;&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; &lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt; gulp.src(&lt;span class=&quot;string&quot;&gt;&#39;./public/**/*.html&#39;&lt;/span&gt;)&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; .pipe(htmlclean())&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; .pipe(htmlmin(&amp;#123;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; removeComments: &lt;span class=&quot;literal&quot;&gt;true&lt;/span&gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; minifyJS: &lt;span class=&quot;literal&quot;&gt;false&lt;/span&gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; minifyCSS: &lt;span class=&quot;literal&quot;&gt;true&lt;/span&gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; minifyURLs: &lt;span class=&quot;literal&quot;&gt;false&lt;/span&gt;,&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; &amp;#125;))&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt; .pipe(gulp.dest(&lt;span class=&quot;string&quot;&gt;&#39;./public&#39;&lt;/span&gt;))&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&amp;#125;);&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;
&lt;p&gt;那么,在每一次deploy之前,在&lt;code&gt;Git Bash&lt;/code&gt;下执行一次&lt;code&gt;gulp minify-html&lt;/code&gt;即可对所有的HTML代码进行压缩。&lt;/p&gt;
&lt;p&gt;CSS和JS的压缩可以编写类似的代码,这里不再赘述。&lt;/p&gt;
&lt;hr&gt;
</content>

<summary type="html">
Expand Down
2 changes: 2 additions & 0 deletions categories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@






<link rel="alternate" href="/atom.xml" title="清风轩" type="application/atom+xml" />

Expand Down
2 changes: 1 addition & 1 deletion sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<url>
<loc>http://xovel.cn/article/minify-static-html-files.html</loc>

<lastmod>2016-11-16T09:14:27.211Z</lastmod>
<lastmod>2016-11-18T10:12:39.105Z</lastmod>

</url>

Expand Down

0 comments on commit ba649d0

Please sign in to comment.