Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@detalk/static

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@detalk/static

The fastest way to use detalk on your website.

  • 1.2.0-alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Detalk Static

⚡ The static files of Detalk(a simple comment plugin).

⚡ 您部署 Detalk 的最快方式。

如何使用

载入

在浏览器中,通常,您需要引入我们提供的 JavaScript 文件。它会暴露 window.detalk 接口。

<script src="https://cdn.jsdelivr.net/npm/@detalk/static@latest/dist/detalk.js"></script>
<!-- 我们推荐您将 @latest 替换为所需的版本号 -->

或者使用简短的链接:

<script src="https://cdn.jsdelivr.net/npm/@detalk/static@latest"></script>
<!-- 我们推荐您将 @latest 替换为所需的版本号 -->

当然,我们提供单独的 CSS 文件和 不含 CSS 的 JavaScript 构建:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@detalk/static@latest/dist/detalk.css">
<script src="https://cdn.jsdelivr.net/npm/@detalk/static@latest/dist/detalk-nocss.js"></script>
<!-- 我们推荐您将 @latest 替换为所需的版本号 -->

初始化

然后,您需要使用下方代码初始化:

detalk.init({
    // 挂载点 (CSS 选择器)
    el: "#app", // <div id="app"></div>
    // 后端地址
    url: "https://detalk.deta.dev/",
    // 当前页面的路径
    path: window.location.href,
    // 是否开启实时预览
    previewOnInput: false, // default is false
    // 评论加载完成后
    onCommentLoaded: function () {
        // 此处可为代码高亮等插件
    },
});

通常,一个页面只能挂载一个 Detalk。否则部分组件可能会出现错误。

FAQs

Package last updated on 06 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc