Skip to content

Commit

Permalink
Merge pull request #381 from EvanNotFound/dev
Browse files Browse the repository at this point in the history
v2.6.3
  • Loading branch information
EvanNotFound authored Jun 18, 2024
2 parents d6d9925 + 0357c43 commit b6a3493
Show file tree
Hide file tree
Showing 59 changed files with 252 additions and 321 deletions.
Original file line number Diff line number Diff line change
@@ -1,46 +1,32 @@
# workflow 名称,执行时的标题
name: Publish to Aliyun

# 触发条件
on:
release:
types: [published]

# 不清楚干嘛的,保留着
workflow_dispatch:

# 真正的任务
jobs:
# job 名称
build:
# 运行环境
aliyun-cdn-publish:
runs-on: ubuntu-latest

# 步骤
# 1. checkout repo
steps:
- name: Checkout Repository
uses: actions/checkout@v3

# 2. 配置 node
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18


# 3. OSS 脚本相关配置
- name: Setup Aliyun OSS
uses: manyuanrong/setup-ossutil@master
with:
endpoint: ${{ secrets.ALI_ENDPOINT }}
access-key-id: ${{ secrets.ALI_ACCESSKEYID }}
access-key-secret: ${{ secrets.ALI_ACCESSKEYSECRET }}

# 4. 执行 OSS 脚本,ossutil 用法 `https://help.aliyun.com/document_detail/50452.html`

- name: Upload to Aliyun OSS
# run: ossutil cp -r source/ oss://${{ secrets.ALI_BUCKET }}/projects/hexo-theme-redefine/${{ github.event.release.name }}/source/
run: |
VERSION=$(echo ${{ github.event.release.name }} | sed 's/v//') # Remove the 'v' prefix from the release name
VERSION=$(echo ${{ github.event.release.name }} | sed 's/v//')
ossutil cp -r source/ oss://${{ secrets.ALI_BUCKET }}/projects/hexo-theme-redefine@$VERSION/source/
8 changes: 4 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ on:
workflow_dispatch:

jobs:
publish-npm:
npm-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: '20.x'
registry-url: https://registry.npmjs.org/

- run: npm publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,38 @@ on:
- dev
pull_request: # Trigger the workflow on pull request activities
branches:
- main # Specify the target branch for PRs
- dev
- main

jobs:
Deploy-Preview:
preview-deployment:
runs-on: ubuntu-latest
# if: >
# github.event_name == 'workflow_dispatch' ||
# (github.event_name == 'push' && github.repository == 'EvanNotFound/hexo-theme-redefine') ||
# (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'EvanNotFound/hexo-theme-redefine')
steps:
- id: script
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const isPr = [ 'pull_request', 'pull_request_target' ].includes(context.eventName)
core.setOutput('ref', isPr ? context.payload.pull_request.head.ref : context.ref)
core.setOutput('repo', isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name)
- name: Checkout theme repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: 'theme' # Checkout the theme repository into a directory named 'theme'
ref: ${{ steps.script.outputs.ref }}
repository: ${{ steps.script.outputs.repo }}

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.x' # Specify your required Node.js version

- name: Clone Hexo site repository
run: git clone https://github.com/EvanNotFound/redefine-demo.git hexo-site

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x' # Ensure compatibility with Python 3.x

Expand Down Expand Up @@ -114,17 +111,4 @@ jobs:
ALIAS_DOMAINS: |
redefine-preview.vercel.app
redefine-preview-git-{SHA}.vercel.app
PR_PREVIEW_DOMAIN: "redefine-preview-pr-{PR}.vercel.app"


# - name: Pull Vercel Environment Information
# run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
# working-directory: ${{ env.HEXO_SITE_DIR }}

# - name: Build Project Artifacts
# run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
# working-directory: ${{ env.HEXO_SITE_DIR }}

# - name: Deploy Project Artifacts to Vercel
# run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
# working-directory: ${{ env.HEXO_SITE_DIR }}
PR_PREVIEW_DOMAIN: "redefine-preview-pr-{PR}.vercel.app"
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ on:
- main

jobs:
Deploy-Production:
production-deployment:
runs-on: ubuntu-latest

steps:
- name: Checkout theme repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: 'theme' # Checkout the theme repository into a directory named 'theme'

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '20.x' # Specify your required Node.js version

Expand All @@ -42,21 +42,9 @@ jobs:
npm uninstall hexo-theme-redefine
npm run build
# - name: Install Vercel CLI
# run: npm install --global vercel@canary

- name: Change directory to hexo-site
run: echo "HEXO_SITE_DIR=${{ github.workspace }}/hexo-site" >> $GITHUB_ENV

# - uses: amondnet/vercel-action@v20 #deploy
# with:
# vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
# vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required
# github-token: ${{ secrets.GITHUB_TOKEN }} #Optional
# vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required
# working-directory: ${{ env.HEXO_SITE_DIR }}

- name: Deploy to Vercel Action
uses: EvanNotFound/[email protected]
with:
Expand All @@ -69,16 +57,3 @@ jobs:
PRODUCTION: true
DEPLOY_PR_FROM_FORK: true
PR_PREVIEW_DOMAIN: "redefine-preview-pr-{PR}.vercel.app"


# - name: Pull Vercel Environment Information
# run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
# working-directory: ${{ env.HEXO_SITE_DIR }}

# - name: Build Project Artifacts
# run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
# working-directory: ${{ env.HEXO_SITE_DIR }}

# - name: Deploy Project Artifacts to Vercel
# run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
# working-directory: ${{ env.HEXO_SITE_DIR }}
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<a title="zh-TW" href="README_zh-TW.md"><img src="https://img.shields.io/badge/-%E7%B9%81%E4%BD%93%E4%B8%AD%E6%96%87-545759?style=for-the-badge" alt="繁体中文"></a>
</div>

<a href="https://redefine.ohevan.com"><img align="center" src="https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/e1d4d384-5cb5-43f9-ad8b-d694480581ca" alt="Redefine"></a>
<a href="https://redefine.ohevan.com"><img align="center" src="https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/f2ff10f6-a740-4120-ba04-1b2a518fb019" alt="Redefine"></a>



# hexo-theme-redefine

The "Redefine" Hexo theme captures **simplicity, speed, and purity** without sacrificing functionality or design. With a sleek, modern look and a host of practical features, it combines beauty with utility effortlessly.
Hexo-theme-Redefine reimagines simplicity, speed, and purity, without sacrificing functionality or design. Its sleek, modern aesthetic is packed with useful features, blending style and practicality seamlessly.

Building on the solid foundation of [hexo-theme-keep](https://github.com/XPoet/hexo-theme-keep), "Redefine" enhances the style and integrates valuable writing modules and plugins. This theme invites personalization, with extensive customization options that let you tailor every detail to your liking. Your blogging journey becomes a unique, user-friendly experience, reflecting your personal style and needs.
Building on the solid foundation of hexo-theme-keep, "Redefine" elevates the style and incorporates valuable writing tools and plugins. It offers extensive customization options, allowing you to tailor every detail to your preferences. With Redefine, your blogging experience becomes unique and effortless, showcasing your personal style and needs.

<p align="center">
<a href="https://www.npmjs.com/package/hexo-theme-redefine">
Expand Down
4 changes: 1 addition & 3 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a title="zh-TW" href="README_zh-TW.md"><img src="https://img.shields.io/badge/-%E7%B9%81%E4%BD%93%E4%B8%AD%E6%96%87-545759?style=for-the-badge" alt="繁体中文"></a>
</div>

<a href="https://redefine.ohevan.com"><img align="center" src="https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/e1d4d384-5cb5-43f9-ad8b-d694480581ca" alt="Redefine"></a>
<a href="https://redefine.ohevan.com"><img align="center" src="https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/f2ff10f6-a740-4120-ba04-1b2a518fb019" alt="Redefine"></a>


# hexo-theme-redefine
Expand Down Expand Up @@ -90,7 +90,6 @@ theme: redefine
```
## ⏫ 更新
Theme Redefine 经常发布新版本,你可以通过如下命令更新 Theme Redefine。
Expand All @@ -109,7 +108,6 @@ $ git pull
```



## 📄 文档

请阅读 [Redefine 主题官方文档](https://redefine-docs.ohevan.com/) 进行主题配置与安装,非常简单易懂。
Expand Down
2 changes: 1 addition & 1 deletion README_zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://img.shields.io/badge/-%E7%B9%81%E9%AB%94%E4%B8%AD%E6%96%87-A31F34?style=for-the-badge" alt="language">
</div>

<a href="https://redefine.ohevan.com"><img align="center" src="https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/e1d4d384-5cb5-43f9-ad8b-d694480581ca" alt="Redefine"></a>
<a href="https://redefine.ohevan.com"><img align="center" src="https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/f2ff10f6-a740-4120-ba04-1b2a518fb019" alt="Redefine"></a>



Expand Down
15 changes: 8 additions & 7 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ articles:
link_icon: true # Whether to display link icon
title_alignment: left # Title alignment. left, center
headings_top_spacing: # Top spacing for headings from h1-h6
h1: 5rem
h2: 4rem
h3: 2.8rem
h4: 2.5rem
h5: 2.2rem
h6: 2rem
h1: 3.2rem
h2: 2.4rem
h3: 1.9rem
h4: 1.6rem
h5: 1.4rem
h6: 1.3rem
# Word count. Requires hexo-wordcount (npm install hexo-wordcount). See https://github.com/willin/hexo-wordcount
word_count:
enable: true # Whether to enable
Expand Down Expand Up @@ -335,6 +335,7 @@ comment:
emoji: [] # Waline emojis, see https://waline.js.org/guide/features/emoji.html
recaptchaV3Key: wasd # Google reCAPTCHA v3 key. See https://waline.js.org/reference/client/props.html#recaptchav3key
turnstileKey: # Turnstile key. See https://waline.js.org/reference/client/props.html#turnstilekey
reaction: false # Waline reaction. See https://waline.js.org/reference/client/props.html#reaction
# Gitalk comment system. See https://github.com/gitalk/gitalk
gitalk:
clientID: # GitHub Application Client ID
Expand Down Expand Up @@ -445,7 +446,7 @@ cdn:
# Whether to enable CDN
enable: false
# CDN Provider
provider: aliyun # zstatic, sustech, staticfile, bootcdn, cdnjs, jsdelivr, unpkg, aliyun, custom
provider: zstatic # zstatic, sustech, staticfile, bootcdn, cdnjs, jsdelivr, unpkg, aliyun, custom
# Custom CDN URL
# format example: https://cdn.custom.com/hexo-theme-redefine/${version}/source/${path}
# The ${path} must leads to the root of the "source" folder of the theme
Expand Down
1 change: 1 addition & 0 deletions layout/_partials/comments/waline.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
serverURL: '<%= theme.comment.config.waline.serverUrl %>',
lang: '<%= theme.comment.config.waline.lang %>',
dark: 'body[class~="dark-mode"]',
reaction: <%- waline_reaction_config(theme.comment.config.waline.reaction) %>,
requiredMeta: ['nick', 'mail'],
emoji: [<%- theme.comment.config.waline.emoji && theme.comment.config.waline.emoji.map(
(item) => `'${item}'`
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<% } %>
</div>
<% if (theme.global.website_counter.enable === true) { %>
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %> src="<%= theme.global.website_counter.url ? theme.global.website_counter.url : "//vercount.one/js" %>"></script>
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %> src="<%= theme.global.website_counter.url ? theme.global.website_counter.url : "https://vercount.one/js" %>"></script>
<div class="relative text-center lg:absolute lg:right-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-right">
<% if (theme.global.website_counter.site_uv) { %>
<span id="busuanzi_container_site_uv" class="lg:!block">
Expand Down
11 changes: 5 additions & 6 deletions layout/_partials/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@
<% } }%>
<% } }%>

<% if (theme.global.preloader) { %>
<%- partial('_partials/preloader') %>
<% } %>

<%- css('css/style') %>

<% if (theme.developer && theme.developer.enable) {%>
Expand All @@ -99,8 +95,8 @@
<%- renderCSS('assets/build/styles.css') %>
<% } %>

<%- renderCSS('fonts/fonts.css') %>
<%- renderCSS('fonts/Satoshi/satoshi.css') %>
<%- renderCSS('fonts/GeistMono/geist-mono.css') %>
<%- renderCSS('fonts/Geist/geist.css') %>
<!--- Font Part-->
<% if (theme.home_banner.custom_font.enable) { %>
<link href="<%- theme.home_banner.custom_font.url %>" rel="stylesheet">
Expand All @@ -115,6 +111,9 @@
<link href="<%- theme.global.fonts.english.url %>" rel="stylesheet">
<% } %>

<% if (theme.global.preloader) { %>
<%- renderJS('js/libs/anime.min.js')%>
<% } %>

<%- export_config() %>

Expand Down
Loading

0 comments on commit b6a3493

Please sign in to comment.