Skip to content

Commit

Permalink
fix: fix Chinese urlencode displaying problem in permalink (#794)
Browse files Browse the repository at this point in the history
replace post.permalink with decodeURI(post.permalink)
replace page.permalink with decodeURI(page.permalink)
  • Loading branch information
longguzzz authored Aug 1, 2022
1 parent b9cbbb6 commit 677b820
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions layout/_partial/article.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<article itemscope itemtype="http://schema.org/Article" class="article post white-box reveal md <%- theme.custom_css.body.effect.join(' ') %> article-type-<%= post.layout %>" id="<%= post.layout %>" itemscope itemprop="blogPost">
<link itemprop="mainEntityOfPage" href="<%- post.permalink %>">
<link itemprop="mainEntityOfPage" href="<%- decodeURI(post.permalink) %>">
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="<%- config.title %>">
</span>
Expand Down Expand Up @@ -69,7 +69,7 @@
%>
<div class="copyright license">
<div class="license-title"><%- post.title %></div>
<div class="license-link"><a href="<%- page.permalink %>"><%- page.permalink %></a>
<div class="license-link"><a href="<%- decodeURI(page.permalink) %>"><%- decodeURI(page.permalink) %></a>
</div>
<div class="license-meta">
<div class="license-meta-item">
Expand Down Expand Up @@ -106,7 +106,7 @@
<blockquote>
<% (footer_widget.copyright.content||[]).forEach(function(row){ %>
<% if (row == 'permalink') { %>
<p><%- footer_widget.copyright.permalink %><a href=<%- page.permalink %>><%- page.permalink %></a></p>
<p><%- footer_widget.copyright.permalink %><a href=<%- decodeURI(page.permalink) %>><%- decodeURI(page.permalink) %></a></p>
<% } else { %>
<%- markdown(row) %>
<% } %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/post.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="post post-v3 white-box reveal <%- theme.custom_css.body.effect.join(' ') %>" itemscope itemtype="http://schema.org/Article" >
<link itemprop="mainEntityOfPage" href="<%- post.permalink %>">
<link itemprop="mainEntityOfPage" href="<%- decodeURI(post.permalink) %>">
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="<%- config.title %>">
</span>
Expand Down

0 comments on commit 677b820

Please sign in to comment.