jaywcjlove / jaywcjlove/refs-cli

Add local attachment support for static resources

Open
#41 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
29
Forks
7
PR merge metrics
No merged PRs in 30d

Description

我注意到,目前用户在 Markdown 文章中引用图片前,貌似需要先将图片上传到 CDN 或图床,如果是这样,这个工作流程会比较繁琐。
我提议为 refs-cli 添加一个本地附件系统:
1. 用户可以在博客源目录下创建一个 `attachment` 目录。
2. 他们可以将静态资源(图片、PDF 等)放入此目录 。
3. 在 Markdown 中,他们可以使用相对路径引用这些文件(例如:`![image](./attachment/my-image.png)`) 。
4. CLI 会将整个 `attachment` 目录复制到输出的构建文件夹中,并且与.html的相对地址与 step 3 中的相对路径保持一致。
如此,html中可以使用本地的图片,而不必把图片先上传到图床

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the refs-cli CLI path that converts Markdown into HTML and writes the build output. Trace how relative resource references are handled, then verify that a source attachment directory is copied into the output while preserving the relative paths used in Markdown. Done means local images and other static files render from the generated HTML without an external CDN.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs
Domain
build-system, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.