Skip to content

Commit

Permalink
feat: theme upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
akijoey committed Aug 1, 2021
1 parent 157f71b commit 2711b31
Show file tree
Hide file tree
Showing 90 changed files with 8,066 additions and 7,211 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
coverage
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

83 changes: 48 additions & 35 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# hexo-theme-lotus

# layout

# page

# index:
# cover:
# aside:

# archives:
# cover:
# aside:

# tags:
# cover:
# aside:

# categories:
# cover:
# aside:








# Theme color for customize
# Notice: color value must in double quotes like "#000" or may cause error!
# ---------------
Expand Down Expand Up @@ -50,9 +79,9 @@ date: 7/28/2019

# Highlight theme
# ---------------
highlight_theme: light
highlight_theme: mac light
highlight_copy: true

highlight_shrink: true
code_word_wrap: false

# Nav settings
Expand Down Expand Up @@ -112,29 +141,25 @@ katex:
google_analytics:


# styles loaded in the end of the head
# styles (loaded in the end of the head)
styles:
- /style/main.css

# scripts loaded in the end of the body
local:
- /styles/main.css
remote:
- https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css # fontawesome
- https://fonts.googleapis.com/css?family=Titillium+Web # googlefont
- https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css # fancybox

# scripts (loaded in the end of the body)
scripts:
- /script/main.js

# cdn for third-party library
# ---------------
cdn:
css:
fontawesome: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css
# fontawesomeV5: https://use.fontawesome.com/releases/v5.8.1/css/all.css
googlefont: https://fonts.googleapis.com/css?family=Titillium+Web
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
js:
jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js
js-cookies: https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
lozy: https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js
# ribbon: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/js/piao.js
click: https://cdn.jsdelivr.net/gh/diygod/diygod.me@latest/themes/sagiri/src/cursor-effects.js
local:
- /scripts/main.js
remote:
- https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js # jquery
- https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js # fancybox
- https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js # js-cookies
- https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js # lozy
- https://cdn.jsdelivr.net/gh/diygod/diygod.me@latest/themes/sagiri/src/cursor-effects.js # click


# Post info settings
Expand Down Expand Up @@ -162,8 +187,6 @@ lodding_bg:
post_page: /img/404.jpg




post:
meta:

Expand Down Expand Up @@ -323,16 +346,6 @@ subtitle:
sub1: OUT OF THE LIGHT
sub2: INTO THE SHADOWS

#側邊欄顯示設置
aside:
card_author: true
card_announcement: true
card_recent_post: true
card_categories: true
card_tags: true
card_archives: true
card_webinfo: true


## chinese traditional to Simplified
translate:
Expand Down
2 changes: 1 addition & 1 deletion languages/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ post:
copyright:
author: Author
link: Link
copyright_notice: Copyright Notice
copyright_notice: Copyright
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'

search: Search
Expand Down
2 changes: 1 addition & 1 deletion languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ post:
copyright:
author: Author
link: Link
copyright_notice: Copyright Notice
copyright_notice: Copyright
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'

search: Search
Expand Down
18 changes: 12 additions & 6 deletions layout/archive.pug
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
extends layout/layout.pug

block content
include utils/mixins.pug
#archive
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
+articleSort(page.posts)
#archive.card
#archive-title= _p('page.articles') + ' - ' + site.posts.length
#archive-content
- let tmp
each article in page.posts.data
- let year = date(article.date, 'YYYY')
if tmp !== year
- tmp = year
.archive-content-item.year= year
.archive-content-item
time= date(article.date)
a(href=url_for(article.path))= article.title || 'No Title'
include partial/pagination.pug
//- #aside_content.aside_content
//- include partial/aside.pug
5 changes: 4 additions & 1 deletion layout/category.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
extends layout/layout.pug

block content
include partial/article.pug
if page.type === 'categories'
#category.card!= list_categories()
else
include partial/article.pug
23 changes: 22 additions & 1 deletion layout/layout/additional-head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,27 @@ else if (!is_post() && preload_img)
})
}
let highlight = 'undefined';
if ((config.highlight && config.highlight.enable) || (config.prismjs && config.prismjs.enable)) {
highlight = JSON.stringify({
plugin: config.highlight.enable ? 'highlighjs' : 'prismjs',
highlightCopy: theme.highlight_copy,
highlightLang: theme.highlight_lang,
highlightShrink: theme.highlight_shrink
})
}
-
const obj = {
test: '123'
}
script.
var GLOBAL_CONFIG = {
root: '!{config.root}',
algolia: !{algolia},
localSearch: !{localSearch},
translate: !{translate},
highlight_copy: '!{theme.highlight_copy}',
highlight: !{highlight},
copy: {
success: '!{_p("copy.success")}',
error: '!{_p("copy.error")}',
Expand All @@ -170,4 +184,11 @@ script.
},
type: '!{page.type}'
}
var config = {
isAnchor: true,
obj: JSON.parse('!{JSON.stringify(obj)}'),
error: {
cover: '!{theme.lodding_bg.post_page}'
}
}

17 changes: 2 additions & 15 deletions layout/layout/content.pug
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
main
if body
div!= body
else
block content
block content

//- toolbar
i.fa.fa-arrow-up#go-up(aria-hidden="true")
section#rightside.rightside
if theme.readmode.enable && is_post()
i#readmode.fa.fa-book(title=_p('rightside.readmode_title'))
i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
if theme.translate && theme.translate.enable
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title'))= theme.translate.default
if theme.nightshift.enable
i#nightshift.fa.fa-moon-o.nightshift(title=_p('rightside.night_mode_title'))
include ../partial/toolbar
14 changes: 4 additions & 10 deletions layout/layout/header.pug
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,8 @@ if (!is_home() && !is_post())
- var type = page.type || page.tag || page.category || page.title
- var title = type.charAt(0).toUpperCase() + type.slice(1)


//- sidebar button
if is_post()
if (page.toc != false && theme.toc.enable)
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
include ../partial/sidebar.pug


header.filter(style=bg_img)
include ../partial/navgation.pug
header
include ../partial/navigation.pug
#header-info
#header-title
span= title
Expand Down Expand Up @@ -76,3 +68,5 @@ header.filter(style=bg_img)
if is_home()
#header-down
i.fas.fa-angle-down
#header-background(class=(is_home() ? '' : 'filter'))
img(src=top_img)
1 change: 1 addition & 0 deletions layout/layout/layout.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include ../utils/variables.pug
include ../utils/mixins.pug

doctype html
html(lang=config.language)
Expand Down
22 changes: 1 addition & 21 deletions layout/page.pug
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
extends layout/layout.pug

block content
if page.type === 'tags'
.tag-cloud
.tag-cloud__title= _p('page.tag')
| -
span.tag-cloud__amount= site.tags.length
.tag-cloud-tags!= tagcloud({min_font: 20, max_font: 43, amount: 200, color: true, start_color: '#A4D8FA', end_color: '#0790E8'})
if page.comments !== false
include partial/comment.pug

else if page.type === 'categories'
#post-content.category-content
.category-lists
.category__title= _p('page.category')
| -
span.category__amount= site.categories.length
div!= list_categories()
if page.comments !== false
include partial/comment.pug

else
#page!= page.content
#page!= page.content
4 changes: 2 additions & 2 deletions layout/partial/article.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ section
- const side = index % 2 ? 'left' : 'right'
article.article.card
.article-cover(class=`article-cover-${side}`)
a(href=url_for(link))
img.lozad(data-src=`${cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=title)
a(href=url_for(link)).filter
img(data-src=`${cover}` title=title)

.article-info(class=`article-info-${side}`)
a.article-info-title(href=url_for(link))= title
Expand Down

0 comments on commit 2711b31

Please sign in to comment.