Giter VIP home page Giter VIP logo

clip's Introduction

Clip

这是 https://clip.owenyoung.com/ 项目的模版项目,如果你想复制一个类似的项目请从这里开始。

流程

使用 https://github.com/theowenyoung/markdownload 浏览器扩展,把网页的文章,按日期保存到本地,然后用https://rust-lang.github.io/mdBook/ 生成网页,并使用Vercel发布。

Online Demo: https://clip-template.vercel.app/

如何使用?

注意,当前我只测试了 macos 和 linux,没有 windows 机器,但是欢迎贡献~

  1. 点此Fork 本项目到你的自己的 Github 账户, 你可以改名为clip

  2. 本地克隆你 fork 后的项目,记得要克隆到Downloads目录,因为浏览器扩展下载的文章只允许下载到Downloads目录:

记得把下面的地址换成你的 repo 地址

cd ~/Downloads
git clone [email protected]:theowenyoung/clip.git
  1. 本地安装依赖,依赖的二进制完美都会安装在当前项目目录下的bin目录内,这样不会污染别的地方,这个命令会安装mdbook,deno到本地目录:
cd ~/Downloads/clip
make install
  1. 本地启动运行
make serve

此时,打开 http://localhost:8000 应该就能看到文章。

文章都是保存在content/2022/11/14/{slug}/index.md的,如果有图片,图片也保存在该目录下。我使用我修改的一个插件,它负责把文章保存到本地目录下。

  1. 安装插件,请在https://github.com/theowenyoung/markdownload/releases 下载最新版插件,firefox 浏览器可以打开about:addons页面,选择从文件安装。 chrome 浏览器手动安装步骤请参考这里

  2. 安装后,可以从浏览器的扩展页面,进入该扩展的配置页面,然后导入我的这个配置文件,之后,可以按照你自己的需求修改配置。

现在可以打开一篇文章,比如:

https://www.owenyoung.com/inspires/

试试使用插件保存文章,保存后,本地运行:

make serve

就可以看到预览页面。

  1. 发布到 Vercel,直接在 https://vercel.com/dashboard 新建一个项目,然后选择从 Github 中导入即可,本项目下已经有vercel.json 配置文件了。

配置

网站的标题之类的配置都在book.toml下,照猫画虎修改即可。 查看所有可配置的东西,请参阅这里

高级

我在这个项目里会使用 Github Actions,把当日的文章汇总成一个 epub 文件,然后发送 email 到我的 kindle 邮箱里,这样就能在 kindle 阅读这些保存下来的文章。

如果你不修改相关配置的话,默认是不开启的,每日自动输出当日的 epub 文件的。

如果你想启用的话,需要把.github/workflows/build-daily.yml里面的注释去掉,然后发送 email 需要用到 https://www.mailjet.com/的 API,免费额度每日 200 封,足够个人使用。

具体配置可以参考我的 clip 配置,等有人需要,我再完善这部分文档吧,或者欢迎你贡献呀!

clip's People

Contributors

theowenyoung 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.