Git Product home page Git Product logo

Comments (17)

Lete114 avatar Lete114 commented on August 23, 2024

没明白你的意思

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

跨域主要可能产生在图片,那么用https://images.weserv.nl?url=这样转接显示

img标签无视跨域问题,所以即使有跨域,对img标签无影响

from cardlink.

appotry avatar appotry commented on August 23, 2024

web外行,本地插件获取链接信息,生成卡片插入文章,怎么样?

有个url 卡片 插件可以参考

hexo-valkyr-url

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

本仓库只能运行在浏览器端

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

无法在nodejs中运行

from cardlink.

appotry avatar appotry commented on August 23, 2024

太遗憾了,我还以为是类似爬虫采集获取信息的

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

如果你想在hexo中使用你可以这样做

<!-- 引入 js -->
<script src="cardlink.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', cardLink)
</script>

假设你已经在你的hexo博客主题上正确引入 cardLink,然后再文章的markdown中编写

// 文章内容....

<a href="https://blog.imlete.cn" cardlink target="_blank">blog.imlete.cn</a>

// 文章内容...

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

这种写法兼容性更高,如果使用hexo-valkyr-url的话它的格式并非markdown的格式,而是hexo插件规定的语法解析后生成的,如果你未来要迁移到其它博客系统,其它博客系统无法识别hexo-valkyr-url的语法

from cardlink.

appotry avatar appotry commented on August 23, 2024

hexo-valkyr-url 是不理想,两者优点能集合到一起就更好了

看我使用效果 URL卡片

能实现一个简单爬虫插件,爬取链接信息,生成hexo-valkyr-url 类似卡片是最理想的

兼容,只能说美观和兼容不可兼得,markdown语法都有不同标准,个人笔记,就全markdown,作为展示的blog,美观就更重要一些了,牺牲兼容是可以谅解的

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

你是想再本地构建的时候爬取指定链接网站的信息做成卡片后生成html文件吗?

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

如果是这样的话,文章很多的话,请求量就会增大,设置可能在请求的时候产生错误,这样会影响构建速度

from cardlink.

appotry avatar appotry commented on August 23, 2024

如果是这样的话,那么文章多了,请求量就会增大,设置可能在请求的时候产生错误,这样会影响构建速度

可以建立一个缓存系统 前段时间建议douban插件加入缓存系统 TankNee/hexo-douban-card#17

缓存到本地,优先本地查找,找不到再网络查找

这样就不会影响构建速度了,最终网页速度,体验也更好一些

from cardlink.

appotry avatar appotry commented on August 23, 2024

缓存到本地之后,还可以手动修改某些信息为自定义内容,这样体验就更棒了

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

嗯,你感兴趣可以自己写个hexo插件,hexo与本仓库无关

from cardlink.

appotry avatar appotry commented on August 23, 2024

想搞,但可惜个人js不擅长,不是主力编码语言

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

我觉得在CardLink浏览器端做挺好的,首先它不受任何形式的网站影响,可兼容性大部分网站

如果要做成服务端或客户端形式,那么用一套代码实现是不可能的

比如: 本身是用python做的爬虫抓取网站信息,那么就只能在python语言中使用并不能在java,go,nodejs等语言中使用,除非每个语言都要实现一遍,这样一来维护成本太高

from cardlink.

Lete114 avatar Lete114 commented on August 23, 2024

另外,知乎也有卡片式链接,它并不是后端做的,而是去请求一个api,让服务端去爬取目标网站的相关信息最后返回给浏览器(为了解决跨域问题),通过js生成卡片式链接,填充后端反回的信息,最后渲染到页面上

from cardlink.

Related Issues (8)

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.