Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 支持随机图片 url 统一配置 #1622

Merged
merged 3 commits into from Nov 20, 2023
Merged

[feat] 支持随机图片 url 统一配置 #1622

merged 3 commits into from Nov 20, 2023

Conversation

jiashu1024
Copy link
Contributor

@jiashu1024 jiashu1024 commented Nov 10, 2023

由于旧方式需要在每篇文章都得设置一次随机图片 url,文章较多的用户配置比较麻烦,且如果用的随机图片 api 跑路或者挂掉,又需要全部重新替换较为麻烦。本 pr 实现了从blog.config.js里统一配置随机图片 url 。为了避免替换了用户的头像和背景封面图,本 pr 设置了RANDOM_IMAGE_REPLACE_TEXT关键词变量,只有图片原url 里包含关键词才会替换。
本 pr 实现的功能

  • 随机主页封面
  • 随机文章配图

借助关键词可以实现的一些小feature

  • 配置images.unsplash.com关键词,只切换 notion 图床里的图片,用户自定义的图片 url 不会发生替换
  • 配置旧随机图片的 url,当用户是通过 notion 设置每篇文章的随机图片 url可一键替换到新随机图片 url
  • 只随机文章配图而不随机主页封面(用户不要上传主页封面图片到 notion 图床,而是在 notion 里配置其他图床的图片 url)不会触发主页封面和头像的随机

@tangly1024 tangly1024 merged commit d3b96ea into tangly1024:main Nov 20, 2023
2 of 3 checks passed
happyzhangyyds pushed a commit to happyzhangyyds/NotionNext that referenced this pull request Apr 30, 2024
[feat] 支持随机图片 url 统一配置
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants