Closed vensing closed 3 years ago
@vensing Appreciate further details :smile: so how to upload those static images to jsdelivr CDN via github actions?
Just create a github repo to save static resources,and then push your images or other resources to the repo. So you can load images with format like that https://cdn.jsdelivr.net/gh/username/reponame@version/folder/sample.png
@vensing got it, thanks~
More detailed usage:https://github.com/jsdelivr/jsdelivr#github
@vensing jsdelivr cdn for js/css can be enabled by default through the theme's configuration:
# LoveIt 更改 | 0.2.7 第三方库文件的 CDN 设置
[params.cdn]
# CDN 数据文件名称, 默认不启用
# ("jsdelivr.yml")
# 位于 "themes/LoveIt/assets/data/cdn/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/cdn/"
data = "jsdelivr.yml"
and I'll try to speed up the static images using the method you provided.
晚安,明天再搞了hhh
Good night!
Just create a github repo to save static resources,and then push your images or other resources to the repo. So you can load images with format like that https://cdn.jsdelivr.net/gh/username/reponame@version/folder/sample.png
it seems there is no need to create a repo to save static resources,
I just replace all image path from ![](/images/xxx.png "title")
to ![](https://cdn.jsdelivr.net/gh/ryan4yin/ryan4yin.space@gh-pages/images/xxx.png "title")
, and everything works fine.
yeah,it works!
now the only problem is, how to add friend links just like: https://chee5e.space/friends/ or https://matnoble.me/search/
I found an implementatin: https://github.com/MatNoble/matnoble.me/blob/master/layouts/shortcodes/friend.html, But I can't make it work.
@vensing I tried to copy your implementation https://github.com/vensing/vensing.github.io/blob/source-action/source/friends/index.md, but the result is terrible...
Since I used hexo to build site, so hugo page implementation will be different. I will take a look at hugo.
@vensing thanks~ I temporarily add friend links
in pure markdown: https://ryan4yin.space/friends/
I have completed the code transplant. It works on PC and mobile. So I will send an email with md file to you, maybe css style should move to scss file of your site theme.
@vensing wow~ this is really great! :smile:
Please check your email and test to see if the code works properly.
@vensing it works very well~
It may be possible to use the jsdelivr CDN to speed up the loading of static images : ) Set up a repository and then load the static resources using the JsDelivr CDN service.