V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
JustSong
V2EX  ›  分享创造

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

  •  
  •   JustSong ·
    songquanpeng · 2021-12-26 22:34:19 +08:00 · 1623 次点击
    这是一个创建于 861 天前的主题,其中的信息可能已经有所发展或是发生改变。

    描述

    每日自动备份知乎热榜,生成 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 目录。
    第 1 条附言  ·  2021-12-27 00:24:49 +08:00

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

    jaded
        1
    jaded  
       2021-12-26 22:41:06 +08:00
    牛逼
    tousfun
        2
    tousfun  
       2021-12-27 14:56:10 +08:00 via iPhone
    有没有备份自己收藏的网页的库?
    JustSong
        3
    JustSong  
    OP
       2021-12-27 15:14:21 +08:00
    @919615766 不清楚,我一般直接用 OneNote 备份网页(提取其中的文章内容)
    gearkey
        4
    gearkey  
       2021-12-29 11:44:51 +08:00 via Android
    支持,好东西
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2331 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 15:51 · PVG 23:51 · LAX 08:51 · JFK 11:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.