Skip to content

Commit

Permalink
Merge pull request #31 from EvanNotFound/dev
Browse files Browse the repository at this point in the history
v0.4.4
  • Loading branch information
EvanNotFound authored Dec 23, 2022
2 parents 03bd34a + 56abd60 commit 672e99e
Show file tree
Hide file tree
Showing 19 changed files with 240 additions and 216 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,15 @@

"Redefine" hexo theme is **a simple & fast & pure theme**, but with **no compromise**. This theme contains lots of widely use functions and great web design.

"Theme Redefine" is based on [hexo-theme-keep](https://github.com/XPoet/hexo-theme-keep), but with **prettier interface** and **more functions**.

[![NPM version](https://img.shields.io/npm/v/hexo-theme-redefine?color=red&logo=npm&style=flat-square)](https://www.npmjs.com/package/hexo-theme-redefine) [![npm](https://img.shields.io/npm/dw/hexo-theme-redefine?logo=npm&style=flat-square)](https://www.npmjs.com/package/hexo-theme-redefine) [![Github License](https://img.shields.io/github/license/EvanNotFound/hexo-theme-redefine.svg?style=flat-square)](https://github.com/EvanNotFound/hexo-theme-redefine/blob/main/LICENSE) [![Required Hexo version](https://img.shields.io/badge/hexo-%3E=5.0.0-blue?style=flat-square&logo=hexo)](https://hexo.io) [![Node.js Version](https://img.shields.io/badge/node-%3E=12.0-success.svg?style=flat-square&logo=Node.js&longCache=true)](https://hexo.io)



## 📷 Screenshots


![redefine-rendered-1](https://user-images.githubusercontent.com/68590232/208184324-f2640ade-587a-4f46-8ad1-7b4c1b31394f.png)

![redefine-rendered-2](https://user-images.githubusercontent.com/68590232/208184329-a534de4b-8808-4275-b22f-b4e317aeaa3a.png)

![redefine-rendered-3](https://user-images.githubusercontent.com/68590232/208184337-5d0c9e28-c863-4bd6-a2ce-f8b360096a20.png)
![redefine-rendered-1](https://user-images.githubusercontent.com/68590232/208305420-b3096ebf-b819-4b70-aad2-efca12818295.png)
![redefine-rendered-2](https://user-images.githubusercontent.com/68590232/208305422-f4b2fed2-c144-474c-8d3c-acd52e4f3ff5.png)
![redefine-rendered-3](https://user-images.githubusercontent.com/68590232/208305423-28960206-96d3-4af8-b76e-d687fb8a0f38.png)



Expand Down
9 changes: 3 additions & 6 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@

## 📷 屏幕截图

![redefine-rendered-1](https://user-images.githubusercontent.com/68590232/208184324-f2640ade-587a-4f46-8ad1-7b4c1b31394f.png)

![redefine-rendered-2](https://user-images.githubusercontent.com/68590232/208184329-a534de4b-8808-4275-b22f-b4e317aeaa3a.png)

![redefine-rendered-3](https://user-images.githubusercontent.com/68590232/208184337-5d0c9e28-c863-4bd6-a2ce-f8b360096a20.png)

![redefine-rendered-1](https://user-images.githubusercontent.com/68590232/208305420-b3096ebf-b819-4b70-aad2-efca12818295.png)
![redefine-rendered-2](https://user-images.githubusercontent.com/68590232/208305422-f4b2fed2-c144-474c-8d3c-acd52e4f3ff5.png)
![redefine-rendered-3](https://user-images.githubusercontent.com/68590232/208305423-28960206-96d3-4af8-b76e-d687fb8a0f38.png)

## 🌐 在线演示站

Expand Down
8 changes: 3 additions & 5 deletions README_zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@

## 📷 屏幕截圖

![redefine-rendered-1](https://user-images.githubusercontent.com/68590232/208184324-f2640ade-587a-4f46-8ad1-7b4c1b31394f.png)

![redefine-rendered-2](https://user-images.githubusercontent.com/68590232/208184329-a534de4b-8808-4275-b22f-b4e317aeaa3a.png)

![redefine-rendered-3](https://user-images.githubusercontent.com/68590232/208184337-5d0c9e28-c863-4bd6-a2ce-f8b360096a20.png)
![redefine-rendered-1](https://user-images.githubusercontent.com/68590232/208305420-b3096ebf-b819-4b70-aad2-efca12818295.png)
![redefine-rendered-2](https://user-images.githubusercontent.com/68590232/208305422-f4b2fed2-c144-474c-8d3c-acd52e4f3ff5.png)
![redefine-rendered-3](https://user-images.githubusercontent.com/68590232/208305423-28960206-96d3-4af8-b76e-d687fb8a0f38.png)


## 🌐 在線演示站
Expand Down
7 changes: 4 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ post:
# ---------------------------------------------------------------------------------------
# Code copy
# ---------------------------------------------------------------------------------------
code_copy:
enable: true
code_block:
copy: true # enable code copy button
style: mac # mac | simple

# ---------------------------------------------------------------------------------------
# Table of Contents in the Sidebar
Expand Down Expand Up @@ -256,4 +257,4 @@ footer:
# ---------------------------------------------------------------------------------------
# Redefine Theme version (Please don't modify)
# ---------------------------------------------------------------------------------------
version: 0.4.3
version: 0.4.4
2 changes: 1 addition & 1 deletion languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ link: Link
# ----------------------------------------
site_uv: Visitor Count
site_pv: Totalviews

read_more: Read more
wordcount: Words
min2read: Mins

Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/friends-link.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1><%- __('links') %></h1>
<h1 style="margin: 15px 5px;"><%- __('links') %></h1>
<div class="friends-link-container">
<ul class="friends-link-list">
<% for (const f of theme.links) { %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/scripts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%- __js('js/local-search.js') %>
<% } %>

<% if (theme.code_copy.enable) { %>
<% if (theme.code_block.copy) { %>
<%- __js('js/code-copy.js') %>
<% } %>

Expand Down
3 changes: 3 additions & 0 deletions layout/_partial/tagcloud.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<% if (site.tags.length){ %>
<div class="fade-in-down-animation">
<div class="tagcloud-container">
<div class="tagcloud-header">
<h1 style="margin: 15px 5px; margin-bottom: 30px;"><%- __('tags') %></h1>
</div>
<div class="tagcloud-content">
<%- tagcloud({
min_font: 1,
Expand Down
3 changes: 3 additions & 0 deletions layout/category-list.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div class="fade-in-down-animation">
<div class="category-list-container">
<div class="tagcloud-header">
<h1 style="margin: 15px 0px; margin-bottom: 30px;"><%- __('categories') %></h1>
</div>
<div class="category-list-content">
<%- list_categories(site.categories, {
class: 'all-category'
Expand Down
3 changes: 2 additions & 1 deletion layout/home-content.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
</h3>
<div class="home-article-content markdown-body">
<% if (post.excerpt) { %>
<% if (post.excerpt && post.excerpt == "false") { %>
<% } else if (post.excerpt && post.excerpt !== "false") { %>
<%- post.excerpt %>
<% } else { %>
<%- truncate(strip_html(post.content), {length: 128}) %>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-redefine",
"version": "0.4.3",
"version": "0.4.4",
"private": false,
"description": "\"Redefine\" hexo theme is a simple & fast & pure theme, but with no compromise.",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/export-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ hexo.extend.helper.register('export_config', function () {
toc: theme.toc,
style: theme.style,
local_search: theme.local_search,
code_copy: theme.code_copy,
code_block: theme.code_block,
side_tools: theme.side_tools,
pjax: theme.pjax,
lazyload: theme.lazyload,
Expand Down
107 changes: 107 additions & 0 deletions source/css/common/codeblock/code-block.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
disable-user-select() {
-moz-user-select none
-ms-user-select none
-webkit-user-select none
user-select none
}

.highlight-container[data-rel]{
position relative
}

.highlight-container:hover .copy-btn, .highlight-container .copy-btn:focus {
opacity 1
}

.copy-btn {
cursor pointer
display inline-block
font-weight bold
line-height 1.8
opacity 0
outline 0
padding 2px 6px
position absolute
vertical-align middle
white-space nowrap
font-size 1rem
color var(--default-text-color)
disable-user-select()
transition-t("opacity", "0", "0.2", "ease-in-out")


background var(--background-color)
border 0
right 0
top 0
}


if (hexo-config('code_block.style') == 'mac') {
.highlight-container[data-rel]{
background var(--second-background-color)
border-radius 14px
box-shadow var(--shadow-color-2) 0px 6px 24px 0px, var(--shadow-color-1) 0px 0px 0px 1px
padding-top 20px
margin-top 10px

&::before {
position absolute
content:attr(data-rel)
line-height 38px
border-radius 50%
box-shadow none
height 12px
left 12px
position absolute
width auto
margin-left 80px
top 0
color var(--default-text-color)
font-weight bold
font-size 16px
}

&::after{
content ' '
position absolute
-webkit-border-radius 50%
border-radius 50%
background #fc625d
width 12px
height 12px
top 0
left 20px
margin-top 13px
-webkit-box-shadow 20px 0px #fdbc40, 40px 0px #35cd4b
box-shadow 20px 0px #fdbc40, 40px 0px #35cd4b
z-index 3
}
}
} else {
.highlight-container[data-rel]{
background var(--highlight-background)
border-radius 18px
padding-top 20px
margin-top 10px

&::before {
position absolute
content:attr(data-rel)
line-height 42px
border-radius 18px
box-shadow none
height 12px
left 4px
position absolute
width auto
margin-left 15px
top 2px
color var(--default-text-color)
font-weight bold
font-size 16px
}

}
}

86 changes: 52 additions & 34 deletions source/css/common/codeblock/code-theme.styl
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,71 @@
$code-foreground = lighten($default-text-color, 2%)
$code-background = darken($background-color, 5%)
$highlight-foreground = lighten($default-text-color, 2%)
$highlight-background = #21252b
$highlight-gutter-color = lighten($default-text-color, 5%)
$highlight-gutter-bg-color = #21252b
$highlight-comment = #57A64A
$highlight-red = #BD63C5
$highlight-orange = #B8D7A3
$highlight-yellow = #eab700
$highlight-green = #718c00
$highlight-aqua = #3e999f
$highlight-blue = #4271ae
$highlight-purple = #8959a8
$highlight-deletion = #600
$highlight-addition = #144212
$highlight-background = #f6f6f6
$highlight-gutter-color = #373D3F
$highlight-gutter-bg-color = #EEEEEE

$highlight-keyword = #d73a49
$highlight-link = #d73a49
$highlight-built-in = #6f42c1
$highlight-number = #005cc5
$highlight-string = #032f62
$highlight-regexp = #e36209
$highlight-subst = #24292e
$highlight-comment = #6a737d
$highlight-doctag = #22863a
$highlight-variable = #005cc5
$highlight-attr = #22863a
$highlight-bullet = #6f42c1
$highlight-addition = #144212
$highlight-deletion = #600


$night-code-foreground = lighten($dark-default-text-color, 2%)
$night-code-background = lighten($dark-background-color, 10%)
$night-highlight-foreground = lighten($dark-default-text-color, 2%)
$night-highlight-background = #21252b
$night-highlight-gutter-color = lighten($dark-default-text-color, 5%)
$night-highlight-gutter-color = #bebec6
$night-highlight-gutter-bg-color = #21252b
$night-highlight-comment = #57A64A
$night-highlight-red = #BD63C5
$night-highlight-orange = #B8D7A3
$night-highlight-yellow = #f0c674
$night-highlight-green = #b5bd68
$night-highlight-aqua = #8abeb7
$night-highlight-blue = #81a2be
$night-highlight-purple = #b294bb
$night-highlight-deletion = #600
$night-highlight-addition = #144212

$dark-highlight-keyword = #569CD6
$dark-highlight-link = #569CD6
$dark-highlight-built-in = #4EC9B0
$dark-highlight-number = #B8D7A3
$dark-highlight-string = #D69D85
$dark-highlight-regexp = #9A5334
$dark-highlight-subst = #DCDCDC
$dark-highlight-comment = #57A64A
$dark-highlight-doctag = #608B4E
$dark-highlight-meta = #9B9B9B
$dark-highlight-variable = #BD63C5
$dark-highlight-attr = #9CDCFE
$dark-highlight-section = gold
$dark-highlight-bullet = #D7BA7D
$dark-highlight-addition = #144212
$dark-highlight-deletion = #600

code-theme(mode) {
--code-foreground mode == 'light' ? $code-foreground : $night-code-foreground
--code-background mode == 'light' ? $code-background : $night-code-background
--highlight-background mode == 'light' ? $highlight-background : $night-highlight-background
--highlight-foreground mode == 'light' ? $highlight-foreground : $night-highlight-foreground
--highlight-comment mode == 'light' ? $highlight-comment : $night-highlight-comment
--highlight-red mode == 'light' ? $highlight-red : $night-highlight-red
--highlight-orange mode == 'light' ? $highlight-orange : $night-highlight-orange
--highlight-yellow mode == 'light' ? $highlight-yellow : $night-highlight-yellow
--highlight-green mode == 'light' ? $highlight-green : $night-highlight-green
--highlight-aqua mode == 'light' ? $highlight-aqua : $night-highlight-aqua
--highlight-blue mode == 'light' ? $highlight-blue : $night-highlight-blue
--highlight-purple mode == 'light' ? $highlight-purple : $night-highlight-purple
--highlight-gutter-color mode == 'light' ? $highlight-gutter-color : $night-highlight-gutter-color
--highlight-gutter-bg-color mode == 'light' ? $highlight-gutter-bg-color : $night-highlight-gutter-bg-color
--highlight-keyword mode == 'light' ? $highlight-keyword : $dark-highlight-keyword
--highlight-link mode == 'light' ? $highlight-link : $dark-highlight-link
--highlight-built-in mode == 'light' ? $highlight-built-in : $dark-highlight-built-in
--highlight-number mode == 'light' ? $highlight-number : $dark-highlight-number
--highlight-string mode == 'light' ? $highlight-string : $dark-highlight-string
--highlight-regexp mode == 'light' ? $highlight-regexp : $dark-highlight-regexp
--highlight-subst mode == 'light' ? $highlight-subst : $dark-highlight-subst
--highlight-comment mode == 'light' ? $highlight-comment : $dark-highlight-comment
--highlight-doctag mode == 'light' ? $highlight-doctag : $dark-highlight-doctag
--highlight-meta mode == 'light' ? $highlight-meta : $dark-highlight-meta
--highlight-variable mode == 'light' ? $highlight-variable : $dark-highlight-variable
--highlight-attr mode == 'light' ? $highlight-attr : $dark-highlight-attr
--highlight-section mode == 'light' ? $highlight-section : $dark-highlight-section
--highlight-bullet mode == 'light' ? $highlight-bullet : $dark-highlight-bullet
--highlight-addition mode == 'light' ? $highlight-addition : $dark-highlight-addition
--highlight-deletion mode == 'light' ? $highlight-deletion : $dark-highlight-deletion
}


Expand Down
Loading

0 comments on commit 672e99e

Please sign in to comment.