Permalink
Browse files

Use url_for helper

  • Loading branch information...
tommy351 committed Jun 9, 2014
1 parent a1fe635 commit d29cbb83356373af27e7b98643f29a27804364af
@@ -17,8 +17,8 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<% if (theme.fancybox){ %>
<link rel="stylesheet" href="<%- config.root %>fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="<%- config.root %>fancybox/jquery.fancybox.pack.js"></script>
<%- css('fancybox/jquery.fancybox') %>
<%- js('fancybox/jquery.fancybox.pack') %>
<% } %>
<%- js('js/script') %>
@@ -21,7 +21,7 @@
<% last = year; %>
<section class="archives-wrap">
<div class="archive-year-wrap">
<a href="<%- config.root %>archives/<%= year %>" class="archive-year"><%= year %></a>
<a href="<%- url_for('archives/' + year) %>" class="archive-year"><%= year %></a>
</div>
<div class="archives">
<% } %>
@@ -15,7 +15,7 @@
<%- post.excerpt %>
<% if (theme.excerpt_link){ %>
<p class="article-more-link">
<a href="<%- config.root %><%- post.path %>#more"><%= theme.excerpt_link %></a>
<a href="<%- url_for(post.path) %>#more"><%= theme.excerpt_link %></a>
</p>
<% } %>
<% } else { %>
@@ -5,7 +5,7 @@
<div class="outer">
<div id="footer-info" class="inner">
&copy; <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %><br>
Powered by <a href="http://zespia.tw/hexo/" target="_blank">Hexo</a>
Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
</div>
</div>
</footer>
@@ -3,19 +3,19 @@
<div id="header-outer" class="outer">
<div id="header-title" class="inner">
<h1 id="logo-wrap">
<a href="<%- config.root %>" id="logo"><%= config.title %></a>
<a href="<%- url_for() %>" id="logo"><%= config.title %></a>
</h1>
<% if (theme.subtitle){ %>
<h2 id="subtitle-wrap">
<a href="<%- config.root %>" id="subtitle"><%= theme.subtitle %></a>
<a href="<%- url_for() %>" id="subtitle"><%= theme.subtitle %></a>
</h2>
<% } %>
</div>
<div id="header-inner" class="inner">
<nav id="main-nav">
<a id="main-nav-toggle" class="nav-icon"></a>
<% for (var i in theme.menu){ %>
<a class="main-nav-link" href="<%- theme.menu[i] %>"><%= i %></a>
<a class="main-nav-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a>
<% } %>
</nav>
<nav id="sub-nav">
@@ -1,5 +1,5 @@
<nav id="mobile-nav">
<% for (var i in theme.menu){ %>
<a href="<%- theme.menu[i] %>" class="mobile-nav-link"><%= i %></a>
<a href="<%- url_for(theme.menu[i]) %>" class="mobile-nav-link"><%= i %></a>
<% } %>
</nav>
@@ -1,3 +1,3 @@
<a href="<%- config.root %><%- post.path %>" class="<%= class_name %>">
<a href="<%- url_for(post.path) %>" class="<%= class_name %>">
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
</a>
@@ -2,8 +2,8 @@
<div class="article-gallery">
<div class="article-gallery-photos">
<% post.photos.forEach(function(photo, i){ %>
<a class="article-gallery-img fancybox" href="<%- photo %>" rel="gallery_<%= post._id %>">
<img src="<%- photo %>" itemprop="image">
<a class="article-gallery-img fancybox" href="<%- url_for(photo) %>" rel="gallery_<%= post._id %>">
<img src="<%- url_for(photo) %>" itemprop="image">
</a>
<% }) %>
</div>
@@ -1,7 +1,7 @@
<% if (post.prev || post.next){ %>
<nav id="article-nav">
<% if (post.prev){ %>
<a href="<%- config.root %><%- post.prev.path %>" id="article-nav-newer" class="article-nav-link-wrap">
<a href="<%- url_for(post.prev.path) %>" id="article-nav-newer" class="article-nav-link-wrap">
<strong class="article-nav-caption">Newer</strong>
<div class="article-nav-title">
<% if (post.prev.title){ %>
@@ -13,7 +13,7 @@
</a>
<% } %>
<% if (post.next){ %>
<a href="<%- config.root %><%- post.next.path %>" id="article-nav-older" class="article-nav-link-wrap">
<a href="<%- url_for(post.next.path) %>" id="article-nav-older" class="article-nav-link-wrap">
<strong class="article-nav-caption">Older</strong>
<div class="article-nav-title"><%= post.next.title %></div>
</a>
@@ -1,11 +1,11 @@
<% if (post.link){ %>
<h1 itemprop="name">
<a class="<%= class_name %>" href="<%- post.link %>" target="_blank" itemprop="url"><%= post.title %></a>
<a class="<%= class_name %>" href="<%- url_for(post.link) %>" target="_blank" itemprop="url"><%= post.title %></a>
</h1>
<% } else if (post.title){ %>
<% if (index){ %>
<h1 itemprop="name">
<a class="<%= class_name %>" href="<%- config.root %><%- post.path %>"><%= post.title %></a>
<a class="<%= class_name %>" href="<%- url_for(post.path) %>"><%= post.title %></a>
</h1>
<% } else { %>
<h1 class="<%= class_name %>" itemprop="name">
@@ -5,7 +5,7 @@
<ul>
<% site.posts.sort('date', -1).limit(5).each(function(post){ %>
<li>
<a href="<%- config.root %><%- post.path %>"><%= post.title || '(no title)' %></a>
<a href="<%- url_for(post.path) %>"><%= post.title || '(no title)' %></a>
</li>
<% }) %>
</ul>

0 comments on commit d29cbb8

Please sign in to comment.