Skip to content

Commit 7d0321b

Browse files
committed
Tuture Hub, Reborn
0 parents  commit 7d0321b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5318
-0
lines changed

.github/workflows/production.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Deploy (Production)
2+
3+
on:
4+
push:
5+
branches:
6+
- production
7+
schedule:
8+
- cron: '0 20 * * *' # 北京时间早上 4:00 部署
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-18.04
13+
14+
# Only run this action in tuture-dev/hub
15+
if: github.repository == 'tuture-dev/hub'
16+
17+
steps:
18+
- name: Configuring git identity
19+
run: |
20+
git config --global user.email "[email protected]"
21+
git config --global user.name mRcfps
22+
23+
- uses: actions/checkout@v1
24+
with:
25+
ref: production
26+
27+
- name: Update all submodules
28+
run: |
29+
git submodule foreach git fetch --all
30+
git submodule foreach git reset --hard origin/master
31+
32+
- name: Checkout production branch of next theme
33+
run: |
34+
cd themes/next && git checkout production
35+
36+
- name: Setup node environment
37+
uses: actions/setup-node@v1
38+
with:
39+
node-version: 12.x
40+
41+
- name: Install tuture globally
42+
run: |
43+
git clone --depth=1 https://github.com/tuture-dev/tuture.git
44+
cd tuture && yarn && yarn build:cli && npm install -g
45+
46+
- name: Install imagemagick
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install imagemagick -y --fix-missing
50+
51+
- name: Cache node modules
52+
uses: actions/cache@v1
53+
if: github.event_name != 'schedule'
54+
with:
55+
path: node_modules
56+
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
57+
restore-keys: |
58+
${{ runner.OS }}-build-${{ env.cache-name }}-
59+
${{ runner.OS }}-build-
60+
${{ runner.OS }}-
61+
62+
- name: Install npm dependencies
63+
run: |
64+
yarn
65+
66+
- name: Build entire site
67+
run: |
68+
yarn build:roadmaps
69+
yarn build:tutorials
70+
yarn clean
71+
yarn algolia
72+
yarn build
73+
env:
74+
IMG_QUALITY: 30 # 文章中图片的 JPG 压缩质量
75+
COVER_QUALITY: 70 # 文章封面的 JPG 压缩质量
76+
ID_DIGITS: 7 # 文章 ID 位数(后期需要增加 ID 位数以避免碰撞)
77+
HEXO_ALGOLIA_INDEXING_KEY: ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }}
78+
79+
- name: Deploy
80+
run: |
81+
git checkout -b $BRANCH_NAME
82+
node script/movePublicToRoot.js
83+
git add .
84+
git commit -m "Automatic deploy (`date`)"
85+
git remote add $REMOTE $CODING_REPO
86+
git push -f -u $REMOTE $BRANCH_NAME
87+
env:
88+
REMOTE: coding
89+
BRANCH_NAME: coding-pages
90+
CODING_REPO: ${{ secrets.CODING_REPO }}

.github/workflows/staging.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Deploy (Staging)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
schedule:
8+
- cron: '0 0 * * *' # every day
9+
10+
jobs:
11+
staging:
12+
runs-on: ubuntu-18.04
13+
14+
# Only run this action in tuture-dev/hub
15+
if: github.repository == 'tuture-dev/hub'
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
20+
- name: Update all submodules
21+
run: |
22+
git submodule foreach git fetch --all
23+
git submodule foreach git reset --hard origin/master
24+
25+
- name: Setup node environment
26+
uses: actions/setup-node@v1
27+
with:
28+
node-version: 12.x
29+
30+
- name: Install tuture globally
31+
run: |
32+
git clone --depth=1 https://github.com/tuture-dev/tuture.git
33+
cd tuture && yarn && yarn build:cli && npm install -g
34+
35+
- name: Install imagemagick
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install imagemagick -y --fix-missing
39+
40+
- name: Cache node modules
41+
uses: actions/cache@v1
42+
if: github.event_name != 'schedule'
43+
with:
44+
path: node_modules
45+
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
46+
restore-keys: |
47+
${{ runner.OS }}-build-${{ env.cache-name }}-
48+
${{ runner.OS }}-build-
49+
${{ runner.OS }}-
50+
51+
- name: Install npm dependencies
52+
run: |
53+
yarn
54+
55+
- name: Build entire site
56+
run: |
57+
yarn build:roadmaps
58+
yarn build:tutorials
59+
yarn clean
60+
yarn algolia
61+
yarn build
62+
env:
63+
IMG_QUALITY: 30 # 文章中图片的 JPG 压缩质量
64+
COVER_QUALITY: 70 # 文章封面的 JPG 压缩质量
65+
ID_DIGITS: 7 # 文章 ID 位数(后期需要增加 ID 位数以避免碰撞)
66+
HEXO_ALGOLIA_INDEXING_KEY: ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }}
67+
68+
- name: Staging
69+
run:
70+
node script/staging.js
71+
env:
72+
DEPLOY_ENV: staging
73+
SECRET_ID: ${{ secrets.SECRET_ID }}
74+
SECRET_KEY: ${{ secrets.SECRET_KEY }}
75+
STAGING_BUCKET_NAME: ${{ secrets.STAGING_BUCKET_NAME }}
76+
STAGING_BUCKET_REGION: ${{ secrets.STAGING_BUCKET_REGION }}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Update Submodules
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # every day
6+
7+
jobs:
8+
staging:
9+
runs-on: ubuntu-18.04
10+
11+
# Only run this action in tuture-dev/hub
12+
if: github.repository == 'tuture-dev/hub'
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
17+
- name: Update all submodules
18+
run: |
19+
git submodule foreach git fetch --all
20+
git submodule foreach git reset --hard origin/master
21+
22+
- name: Commit new submodules
23+
run: |
24+
git config --local user.email "[email protected]"
25+
git config --local user.name "GitHub Action"
26+
git diff-index --quiet HEAD || git commit -m "Automatic commit from update-submodules action (`date`)" -a
27+
28+
- name: Push changes
29+
uses: ad-m/github-push-action@master
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.DS_Store
2+
Thumbs.db
3+
db.json
4+
*.log
5+
node_modules/
6+
public/
7+
.deploy*/
8+
.vscode
9+
.env
10+
11+
source/_posts
12+
source/images/covers
13+
source/roadmaps
14+
!source/roadmaps/index.md
15+
16+
repos

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "themes/next"]
2+
path = themes/next
3+
url = https://github.com/tuture-dev/hexo-next-theme.git

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Tuture Hub
2+
3+
图雀社区教程合集!本项目是一个 hexo 博客,这里汇集了由社区贡献的、通过 [Tuture](https://tuture.co) 工具写成的优质实战教程。
4+
5+
**目前仅支持中文教程!Currently only Chinese tutorials are supported!**
6+
7+
## 本地查看
8+
9+
首先确保本地已安装 tuture,如果没有则通过 `npm install -g tuture` 安装。然后将仓库克隆到本地(包括所有 Git 子模块):
10+
11+
```bash
12+
$ git clone --recurse-submodules https://github.com/tutureproject/hub.git
13+
```
14+
15+
进入仓库,安装 npm 包,构建所有教程:
16+
17+
```bash
18+
$ cd hub
19+
$ npm install
20+
$ npm run buildTutorials
21+
```
22+
23+
最后打开 hexo 服务器:
24+
25+
```bash
26+
$ npm start
27+
```
28+
29+
## 贡献教程
30+
31+
首先,非常感谢你选择分享教程!分享教程非常容易,请阅读[分享教程指南](https://docs.tuture.co/guide/sharing.html)

_config.yml

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Hexo Configuration
2+
## Docs: https://hexo.io/docs/configuration.html
3+
## Source: https://github.com/hexojs/hexo/
4+
5+
# Site
6+
title: 图雀社区
7+
subtitle: 汇集精彩的实战技术教程
8+
description: 由 <a href="https://github.com/tuture-dev/tuture" target="_blank">Tuture</a> 工具写成,这里汇集了能够让你从头敲到尾并做出可运行项目的技术教程
9+
keywords: Web前端开发,小程序开发,移动端开发,后端实战教程
10+
author: 图雀社区
11+
language: zh-CN
12+
timezone:
13+
14+
# URL
15+
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
16+
url: https://tuture.co/
17+
root: /
18+
permalink: :year/:month/:day/:title/
19+
permalink_defaults:
20+
21+
# Directory
22+
source_dir: source
23+
public_dir: public
24+
tag_dir: tags
25+
archive_dir: archives
26+
category_dir: categories
27+
code_dir: downloads/code
28+
i18n_dir: :lang
29+
skip_render:
30+
31+
# Writing
32+
new_post_name: :title.md # File name of new posts
33+
default_layout: post
34+
titlecase: false # Transform title into titlecase
35+
external_link: true # Open external links in new tab
36+
filename_case: 0
37+
render_drafts: false
38+
post_asset_folder: true
39+
relative_link: false
40+
future: true
41+
highlight:
42+
enable: true
43+
line_number: false
44+
auto_detect: false
45+
tab_replace:
46+
47+
# Home page setting
48+
# path: Root path for your blogs index page. (default = '')
49+
# per_page: Posts displayed per page. (0 = disable pagination)
50+
# order_by: Posts order. (Order by date descending by default)
51+
index_generator:
52+
path: ''
53+
per_page: 10
54+
order_by: -date
55+
56+
# Category & Tag
57+
default_category: uncategorized
58+
category_map:
59+
tag_map:
60+
61+
# Date / Time format
62+
## Hexo uses Moment.js to parse and display date
63+
## You can customize the date format as defined in
64+
## http://momentjs.com/docs/#/displaying/format/
65+
date_format: YYYY-MM-DD
66+
time_format: HH:mm:ss
67+
68+
# Pagination
69+
## Set per_page to 0 to disable pagination
70+
per_page: 10
71+
pagination_dir: page
72+
73+
# Extensions
74+
## Plugins: https://hexo.io/plugins/
75+
## Themes: https://hexo.io/themes/
76+
theme: next
77+
78+
# Deployment
79+
## Docs: https://hexo.io/docs/deployment.html
80+
deploy:
81+
- type: git
82+
repo: [email protected]:tutureproject/tutureproject.github.io.git
83+
branch: master
84+
- type: git
85+
repo: [email protected]:tutureproject/tutureproject.github.io.git
86+
branch: src
87+
extend_dirs: /
88+
ignore_hidden: false
89+
ignore_pattern:
90+
public: .
91+
92+
algolia:
93+
applicationID: 73BSUE4RKU
94+
apiKey: 0b7cce26a4734cb760080065b3c4a4a1
95+
indexName: Tuture
96+
chunkSize: 5000
97+
98+
# Post wordcount display settings
99+
# Dependencies: https://github.com/theme-next/hexo-symbols-count-time
100+
symbols_count_time:
101+
symbols: true
102+
time: true
103+
total_symbols: true
104+
total_time: true

0 commit comments

Comments
 (0)