id replace '%' '/' '.'

master
xaoxuu 4 years ago
parent dacd9ae05c
commit c735be7ab8
  1. 2
      _config.yml
  2. 2
      layout/_cover/index.ejs
  3. 4
      layout/_partial/header.ejs
  4. 2
      layout/_widget/category.ejs
  5. 2
      layout/_widget/grid.ejs
  6. 2
      layout/_widget/list.ejs
  7. 3
      source/js/app.js

@ -5,7 +5,7 @@ info:
docs: https://volantis.js.org/
cdn: # To use CDN, write 'use_cdn: true' in 'blog/_config.yml'.
# css: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.1.4.3/css/style.css
js: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.1.4/js/app.js
# js: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-volantis@2.1.4/js/app.js
############################### Style ###############################

@ -32,7 +32,7 @@
<% if (value.target) { %>
target="<%- value.target %>"
<% } %>
id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>">
id="<%= url_for(value.url).replace(/\/|%|\./g, "")?url_for(value.url).replace(/\/|%|\./g, ""):"home" %>">
<i class='<%= value.icon %> fa-fw'></i>&nbsp;<%= __('navbar.'+value.name) == ('navbar.'+value.name) ? value.name : __('navbar.'+value.name) %>
</a>
</li>

@ -63,7 +63,7 @@
target="<%- value.target %>"
<% } %>
<% if (value.url) { %>
id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>"
id="<%= url_for(value.url).replace(/\/|%|\./g, "")?url_for(value.url).replace(/\/|%|\./g, ""):"home" %>"
<% } %>>
<% if (value.icon) { %>
<i class='<%= value.icon %> fa-fw'></i>
@ -124,7 +124,7 @@
target="<%- value.target %>"
<% } %>
<% if (value.url) { %>
id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>"
id="<%= url_for(value.url).replace(/\/|%|\./g, "")?url_for(value.url).replace(/\/|%|\./g, ""):"home" %>"
<% } %>>
<% if (value.icon) { %>
<i class='<%= value.icon %> fa-fw'></i>

@ -7,7 +7,7 @@
<% site.categories.sort('path').each(function(category){ %>
<li><a class="flat-box<%= category.parent ? ' child' : ''%>"
title="<%- url_for(category.path) %>" href="<%- url_for(category.path) %>"
id="<%= url_for(category.path).replace(/\/|%/g, "")?url_for(category.path).replace(/\/|%/g, ""):"home" %>"
id="<%= url_for(category.path).replace(/\/|%|\./g, "")?url_for(category.path).replace(/\/|%|\./g, ""):"home" %>"
><div class='name'><%- category.name %></div><div class='badge'>(<%- category.posts.length %>)</div></a></li>
<% }) %>
</ul>

@ -11,7 +11,7 @@
<% if (row.target) { %>
target="<%- row.target %>"
<% } %>
id="<%= url_for(row.url).replace(/\/|%/g, "")?url_for(row.url).replace(/\/|%/g, ""):"home" %>">
id="<%= url_for(row.url).replace(/\/|%|\./g, "")?url_for(row.url).replace(/\/|%|\./g, ""):"home" %>">
<% if (row.img) { %>
<img src="<%- row.img %>">
<% } else if(row.avatar) { %>

@ -11,7 +11,7 @@
<% if (row.target) { %>
target="<%- row.target %>"
<% } %>
id="<%= url_for(row.url).replace(/\/|%/g, "")?url_for(row.url).replace(/\/|%/g, ""):"home" %>"
id="<%= url_for(row.url).replace(/\/|%|\./g, "")?url_for(row.url).replace(/\/|%|\./g, ""):"home" %>"
>
<div class='name'>
<% if(row.img) { %>

@ -134,7 +134,8 @@ var customSearch;
}
//set current active nav
var $active_link = null;
var idname = location.pathname.replace(/\/|%/g, "");
// replace '%' '/' '.'
var idname = location.pathname.replace(/\/|%|\./g, "");
if (idname.length == 0) {
idname = "home";
}

Loading…
Cancel
Save