Phase Theme Optimization

Add Google Analylytics Code

The easiest way is to put Google’s Js code into one main js file, so that every page will include this source code.

  1. Create google.anlysis.js and this file in:

    1
    ..\themes\phase\source\js\google.anlysis.js
  2. Put Google source code into google.anlysis.js

  3. Inculde google.anlysis.js in

    1
    2
    ..\themes\phase\layout\_partial\after_footer.ejs
    <script src="<%- config.root %>js/google.anlysis.js"></script>

Done.

Add Read More

Replace the below codes in layout\_partial\article.ejs

1
2
3
4
5
<% if (item.excerpt && index){ %>
<%- item.excerpt %>
<% } else { %>
<%- item.content %>
<% } %>

to

1
2
3
4
5
6
7
8
<% if (item.excerpt && index){ %>
<%- item.excerpt %>
<p class="article-more-link">
<a href="<%- config.root %><%- item.path %>#more"><%= 'read more' %></a>
</p>
<% } else { %>
<%- item.content %>
<% } %>

Usage of Read More: add <!--more--> in markdown file.