Skip to content

Commit

Permalink
Merge pull request doodlewind#19 from doodlewind/f_pagic
Browse files Browse the repository at this point in the history
Pagic 静态站生成
  • Loading branch information
doodlewind authored Sep 29, 2020
2 parents 137b829 + 3bc435f commit 0b096ff
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: gh-pages

on: [push, pull_request]

jobs:
build-and-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Build
env:
DENO_INSTALL: /home/runner/.deno
run: |
curl -fsSL https://deno.land/x/install/install.sh | sh
export PATH="$DENO_INSTALL/bin:$PATH"
deno --version
deno upgrade --version 1.4.2
deno install --unstable --allow-env --allow-read --allow-write --allow-net -n pagic https://deno.land/x/[email protected]/mod.ts
pagic build
- name: Deploy
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
cname: cn.history.js.org
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
.vscode
dist
33 changes: 33 additions & 0 deletions pagic.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// 使用方式:安装 Deno v1.3.3, Pagic v0.9.1
// curl -fsSL https://deno.land/x/install/install.sh | sh
// deno install --unstable --allow-read --allow-write --allow-net --name=pagic https://deno.land/x/pagic/mod.ts
// ~/.deno/bin/pagic build --serve --watch

export default {
srcDir: './',
theme: 'docs',
plugins: ['sidebar', 'prev_next'],
title: 'JavaScript 20 年',
description: '自 1995 年语言诞生到 2015 年 ES6 规范制定为止,共计 20 年的 JavaScript 语言演化经历。',
github: 'https://github.com/doodlewind/jshistory-cn',
nav: [
// { text: '阅读', link: '/' },
],
sidebar: {
'/': [
'README.md',
'part-1.md',
'part-2.md',
'part-3.md',
'part-4.md',
'appendices.md',
'notes.md',
'references.md',
],
},
tools: {
editOnGithub: true,
backToTop: true,
},
port: 8011
}

0 comments on commit 0b096ff

Please sign in to comment.