Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion layout/mixins.pug
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ mixin make_post(item, is_detail)
if is_detail
p.post-abstract!= item.content
else
p.post-abstract!= truncate(strip_html(item.content.replace(/<pre(?: |>)[^]*?<\/pre>/gm, ' ')), {length: 160})
if item.description
p.post-abstract!= item.description
else if item.excerpt
p.post-abstract!= item.excerpt
else
p.post-abstract!= truncate(strip_html(item.content.replace(/<pre(?: |>)[^]*?<\/pre>/gm, ' ')), {length: theme.truncate_len ? theme.truncate_len : 160})

mixin make_page_links()
if site.pages
Expand Down
6 changes: 6 additions & 0 deletions layout/partial/footer.pug
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
footer
- var currYear = new Date().getYear() + 1900;
p &copy;&nbsp;
if theme.startYear
!=theme.startYear
| -
!=currYear
| &nbsp;
a(target="_blank", href=config.url, rel="noopener noreferrer")!=theme.author ? theme.author : config.author ? config.author : config.title
if theme.beian
p
a(target="_blank", href="http://beian.miit.gov.cn/", rel="noopener noreferrer")!=theme.beian
p Theme&nbsp;
a(target="_blank", href="https://github.com/SumiMakito/hexo-theme-typography", rel="noopener noreferrer") Typography
| &nbsp;by&nbsp;
Expand Down
6 changes: 6 additions & 0 deletions layout/partial/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ html(lang="zh-CN")
script(src= url_for('js/google-analytics.js'))
script(src= url_for('js/typography.js'))

if(theme.hitokoto)
script()
|function hitokoto(){$("#hitokoto").html("&nbsp;");$.get("
= theme.hitokoto.api
|",{},function(response){$("#hitokoto").html(response.hitokoto)},"JSON");}hitokoto()

5 changes: 4 additions & 1 deletion layout/partial/sidebar.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
div#side-bar.col-sm-3.col-xs-12.side-container.invisible
div.vertical-text.site-title
h3.site-title-small(tabindex="-1")
a.a-title(href=config.root)= theme.title_secondary
if theme.hitokoto
a#hitokoto.a-title(href=config.root)= theme.title_secondary
else
a.a-title(href=config.root)= theme.title_secondary
h1.site-title-large(tabindex="-1")
a.a-title(href=config.root)= theme.title_primary
//h6(onclick="triggerSiteNav()") Trigger
Expand Down
2 changes: 1 addition & 1 deletion layout/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ block site_title
!= page.title + " · " + config.title

block description
- var desc = page.desc || strip_html(page.content).replace(/^\s*/, '').replace(/\s*$/, '').substring(0, 150);
- var desc = page.desc || strip_html(page.description) || strip_html(page.excerpt) || strip_html(page.content).replace(/^\s*/, '').replace(/\s*$/, '').substring(0, 150);
meta(name="description", content=desc)
meta(name="og:description", content=desc)
meta(name="twitter:site", content=config.title)
Expand Down
2 changes: 1 addition & 1 deletion source/js/typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ function updateSidebar() {
} else {
//$('#site-nav').show();
//siteNavShown = true;
$('#main-container').addClass('col-sm-9');
var sidebarW =
stage.width() - $('#main-container').outerWidth() + (window.innerWidth - stage.innerWidth()) / 2;
$('#side-bar').outerWidth(sidebarW);
console.log("sidebarW=" + sidebarW);
$('#main-container').addClass('col-sm-9');
}
}
$(document).ready(function () {
Expand Down