GithubHelp home page GithubHelp logo

sunlianlong.github.io's Introduction

文章源码

代码fork自CodingYang,使用 vuepress-theme-reco

有些注意事项:

  1. 不使用一级标题,使用 yaml 来编辑元数据。日期中要注意前面补齐 0。

  2. vue-router版本已锁定为3.4.5,非已了解勿动(issues)

---
title: Node 爬虫编写
date: 2020-03-25
tags:
  - Node.js
categories:
  - 技术
---
这里的内容会被显示成摘要。

1. 可以放置文案;
2. 可以放置图片作为文章封面。

<!-- more -->
  1. 评论使用 Valine,自行申请key,当前已注释

  2. 编译结果在/public/,而非docs/.vuepress/dist

  3. Github Action 脚本可用,只要 push blog 分支,自动将生成静态文件文件写入 master 分支,Page 直接访问。同时支持使用 scp 静态复制文件到服务器。

相关命令

没有安装 yarn 的,把以下命令中的 yarn 替换为 npm run

# 安装依赖
yarn install

# 本地启动
yarn dev

# 编译
yarn build

# 编译为非根目录站点 (还需修改package.json中的script中的参数)
yarn buildSubpath

# 自动上传静态部署文件
yarn autopush

其他说明

使用 vuepress 创建 SEO 友好的静态文章站。一键发布到 github page,内置 github action 自动部署脚本。

vuepress 通过一定号称简单的配置之后,为每一个 md 文件生成静态 html 脚本,并通过主题挂接起来。用来写文档是非常不错的。写文章就要做一点工作,踩一点坑。

demo 演示

github 源码

注意 yaml

必须放在 md 文件在最上方才能生效

无法热更新

修改 config.js 后,是没办法热更新的,只能 ctrl+c 结束任务然后重新 yarn dev

使用 Github Aciton 自动发布到 Github Page

开启项目 action。

开启 page。并使用 master 分支为 Page 源地址。

设置 secret。在Settings-tTokens里选择第一项 repo 生成 token,复制 token 到项目 Settings-Secrets 下新建的ACCESS_TOKEN

然后 git push 就好,CI 脚本自动发布。

如果要发布到非根目录。要 修改 package.json 中 buildSubpath 命令里的两处: VUEPRESS_BASE=/sun/ 中的 sun 替换为自己要部署的子目录名。然后修改 Action 脚本 nodejs.yml 中最后一行脚本中的 npm run buildnpm run buildSubpath

相关技术

vuepress

主题文档

sunlianlong.github.io's People

Contributors

sunlianlong avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.