V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
JustSong

基于 GitHub Action + GitHub Pages + Docsify 的全自动知乎热榜备份

  •  
  •   JustSong ·
    songquanpeng · Dec 26, 2021 · 2556 views
    This topic created in 1591 days ago, the information mentioned may be changed or developed.

    描述

    每日自动备份知乎热榜,生成 Markdown 文件,并构建静态网站。

    在线预览: https://zhihu.justsong.cn/

    仓库地址: https://github.com/songquanpeng/zhihu-archiver

    Fork 示例仓库地址: https://github.com/justsong-lab/zhihu-archiver

    部署

    部署方式 #1:GitHub Action + GitHub Pages

    1. 首先 fork 本项目;
    2. 之后去 Actions 页面启动 workflow 。
    3. 去仓库设置页面启用 GitHub Pages ,选择 master 分支下的 docs 目录。

    部署方式 #2:自己的服务器 + GitHub Pages

    1. 首先 fork 本项目;
    2. 之后在你的服务器下 clone 你的 fork ,并进入项目目录;
    3. 配置 Python 环境并安装依赖:
      sudo apt install python-is-python3 python3-pip
      pip install -r requirements.txt
      
    4. 给脚本执行权限:chmod u+x ./update.sh
    5. 之后设置 crontab 如下:
      0 18 * * * cd /path/to/zhihu-archiver && ./update.sh
      
    6. 再之后去仓库设置页面启用 GitHub Pages ,选择 master 分支下的 docs 目录。
    Supplement 1  ·  Dec 27, 2021

    Docsify 移动端貌似配置有点问题,侧边栏没显示,以下是示例链接,方便移动端查看:https://zhihu.justsong.cn/#/2021-12/

    jaded
        1
    jaded  
       Dec 26, 2021
    牛逼
    tousfun
        2
    tousfun  
       Dec 27, 2021 via iPhone
    有没有备份自己收藏的网页的库?
    JustSong
        3
    JustSong  
    OP
       Dec 27, 2021
    @919615766 不清楚,我一般直接用 OneNote 备份网页(提取其中的文章内容)
    gearkey
        4
    gearkey  
       Dec 29, 2021 via Android
    支持,好东西
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   757 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 21:17 · PVG 05:17 · LAX 14:17 · JFK 17:17
    ♥ Do have faith in what you're doing.