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

vitepress-plugin-comment-with-giscus

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vitepress-plugin-comment-with-giscus - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

13

dist/giscus.d.ts
import { Ref } from 'vue';
import { PageData } from 'vitepress';
import { PageData, Route } from 'vitepress';
import { GiscusProps } from '@giscus/vue/dist/types';
declare const giscusTalk: (frontmatter: Ref<PageData['frontmatter']>, props: GiscusProps) => void;
type vitepressAPI = {
frontmatter: Ref<PageData['frontmatter']>;
route: Route;
};
/**
* 创建评论区
* @param props giscus配置
* @param vitepressObj 前言和路由
*/
declare const giscusTalk: (props: GiscusProps, vitepressObj: vitepressAPI) => void;
export default giscusTalk;

15

dist/giscus.js
import giscus from '@giscus/vue';
import { createApp, h, nextTick, onMounted, watch } from 'vue';
import { useRoute } from 'vitepress';
/**

@@ -74,12 +73,16 @@ * 添加评论容器

};
const giscusTalk = (frontmatter, props) => {
const route = useRoute();
/**
* 创建评论区
* @param props giscus配置
* @param vitepressObj 前言和路由
*/
const giscusTalk = (props, vitepressObj) => {
onMounted(() => {
setGiscus(props, frontmatter);
setGiscus(props, vitepressObj.frontmatter);
setThemeWatch();
});
watch(() => route.path, () => nextTick(() => {
setGiscus(props, frontmatter);
watch(() => vitepressObj.route.path, () => nextTick(() => {
setGiscus(props, vitepressObj.frontmatter);
}));
};
export default giscusTalk;
{
"name": "vitepress-plugin-comment-with-giscus",
"version": "1.1.0",
"version": "1.1.1",
"description": "vitepress comment plugin based on giscus",

@@ -5,0 +5,0 @@ "workspaces": [

@@ -26,3 +26,3 @@ # README

import giscusTalk from 'vitepress-plugin-comment-with-giscus';
import { useData } from 'vitepress';
import { useData, useRoute } from 'vitepress';
export default {

@@ -35,6 +35,7 @@ ...DefaultTheme,

setup() {
// Get frontmatter
// Get frontmatter and route
const { frontmatter } = useData();
const route = useRoute();
// Comment component
giscusTalk(frontmatter, {
giscusTalk({
repo: 'your github repository',

@@ -44,2 +45,4 @@ repoId: 'your repository id',

mapping: 'pathname'
}, {
frontmatter, route
});

@@ -46,0 +49,0 @@ }

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