FastComments.com

Add Comments To a Website


むンストヌル

FastComments は、静的サむトでも動的サむトでも、ラむトテヌマでもダヌクテヌマでも、公開ペヌゞでも内郚ペヌゞでも、あなたのりェブサむトにコメントを远加する䜜業を簡単にしたす。むンストヌルが容易であり あらゆる皮類のサむトやりェブベヌスのアプリケヌションに適応できるようにするべきです。これにより、倚くの堎合、远加の蚭定を行うこずなくすぐにラむブコメントを利甚できたす。


WordPress Internal Link

WordPress サむトにコメントを远加するには、圓瀟の WordPress プラグむンをこちらでご確認ください。

プラグむンの完党なむンストヌルガむドずドキュメントはこちらにありたす。

このプラグむンはラむブコメント、SSO、およびノヌコヌドでのむンストヌルをサポヌトしおいたす。むンストヌル埌は管理ペヌゞのむンストヌルガむドに埓っおください それがあなたの WordPress むンストヌルをあなたのアカりントに接続する方法を案内したす。

FastComments を通じお圓瀟の WordPress プラグむンで残されたコメントは、自動的にあなたの WordPress むンストヌルに同期され、デヌタの管理暩を保持できたす。これは WordPress のデヌタベヌスサむズを抑えるために無効にするこずもできたす。

Vanilla JS / HTML スニペット Internal Link


The VanillaJS version of the widget is the simplest way to add comments to your website, not requiring any build systems or server side code.

Simply add the following code snippet to any page to add comments to your site:

Simple Code Snippet
Copy CopyRun External Link
1
2<script async src="https://cdn.fastcomments.com/js/embed-v2-async.min.js"></script>
3<div id="fastcomments-widget"></div>
4<script>
5window.fcConfigs = [{
6 "tenantId": "demo"
7}];
8</script>
9

You can use the same code snippet on many pages; it will automatically create a separate thread per page.

Many applications have an "HTML Embed Code" option. Select that and paste the code snippet above in.

You also don't need an account to try it! You might see "tenantId: demo" in the above snippet if you're not logged in. This way it will use the demo account.

You can find documentation on configuring the widget here.

All versions of the FastComments widget are wrappers around the core VanillaJS library. This allows us to add features

and fix issues in one place - and the changes automatically propagate to the other variants of the commenting widget.

Angular Internal Link

Angularで構築されたサむトにコメントを远加するには、圓瀟のAngularラむブラリをNPM こちら で芋぀けるこずができたす。

FastComments の Angular コメントりィゞェットは、VanillaJS のものず同じ機胜ラむブコメント、sso などをサポヌトしおいたす。

fastcomments-typescript がピア䟝存関係ずしお必芁です。これが TypeScript のコンパむルに含たれおいるこずを確認しおください。将来的には、このピア䟝存関係は @types/fastcomments に移され、むンストヌルが簡玠化されたす。

NPM経由のFastComments Angular
Copy Copy
1
2 npm install fastcomments-typescript --save
3 npm install ngx-fastcomments --save
4

このピア䟝存関係は tsconfig.json ファむルに远加する必芁がありたす。䟋:

fastcomments-typescript ピア䟝存関係の远加
Copy Copy
1
2"include": [
3 "src/**/*.ts",
4 "node_modules/fastcomments-typescript/src/index.ts"
5],
6

次に、FastCommentsModule をアプリケヌションに远加したす:

アプリにモゞュヌルを远加
Copy Copy
1
2import { BrowserModule } from '@angular/platform-browser';
3import { NgModule } from '@angular/core';
4
5import { AppComponent } from './app.component';
6import { FastCommentsModule } from 'ngx-fastcomments';
7
8@NgModule({
9 declarations: [
10 AppComponent
11 ],
12 imports: [
13 BrowserModule,
14 FastCommentsModule
15 ],
16 providers: [],
17 bootstrap: [AppComponent]
18})
19export class AppModule { }
20

䜿甚方法

開始するには、デモテナント甚のconfigオブゞェクトを枡したす:

䜿甚 - むンラむン構成
Copy Copy
1
2<lib-fastcomments [config]="{ tenantId: 'demo' }"></lib-fastcomments>
3

構成が耇雑になるこずがあるため、オブゞェクト参照を枡すこずもできたす:

䜿甚 - 構成にオブゞェクトを枡す
Copy Copy
1
2<lib-fastcomments [config]="fastcommentsConfig"></lib-fastcomments>
3
䜿甚 - EU
Copy Copy
1
2<lib-fastcomments [config]="{ tenantId: 'demo', region: 'eu' }"></lib-fastcomments>
3

りィゞェットは倉曎怜出を䜿甚するため、構成オブゞェクトの任意のプロパティを倉曎するずりィゞェットが再読み蟌みされたす。

Angularコンポヌネントがサポヌトする構成は こちら で確認できたす。


React Internal Link

Reactで構築されたサむトにコメントを远加するには、NPMで圓瀟のReactラむブラリを こちら で芋぀けるこずができたす。

FastComments の React コメントりィゞェットは、VanillaJS のものず同じすべおの機胜ラむブコメント、SSO などをサポヌトしたす。

NPM経由の FastComments React
Copy Copy
1
2npm install --save fastcomments-react
3
Yarn経由の FastComments React
Copy Copy
1
2yarn add fastcomments-react
3
React の䟋
Copy Copy
1
2import React, { Component } from 'react'
3
4import {FastCommentsCommentWidget} from 'fastcomments-react'
5
6class Example extends Component {
7 render() {
8 return <FastCommentsCommentWidget tenantId="demo" />
9 }
10}
11

EUにいる堎合は、region パラメヌタを次のように蚭定しおください:

React の䟋 - EU
Copy Copy
1
2 <FastCommentsCommentWidget tenantId="demo" region="eu" />
3

Reactコンポヌネントがサポヌトする蚭定は こちら で確認できたす。


Vue Internal Link

Vueで構築されたりェブサむトにコメントを远加するには、圓瀟のVueラむブラリがNPMで入手できたす こちら。

さらに、vue-next甚のラむブラリもNPMにありたす こちら

゜ヌスコヌドは GitHub で芋぀けるこずができたす。

FastComments Vue のコメントりィゞェットは、VanillaJS のものず同じすべおの機胜ラむブコメント、sso、などをサポヌトしたす。

以䞋の手順は Vue 3 向けのものですしばらく前から利甚可胜なため。ただし、FastComments は fastcomments-vue ラむブラリを通じお Vue 2 もサポヌトしおいたす。

NPM 経由の FastComments Vue
Copy Copy
1
2npm install --save fastcomments-vue-next
3
Yarn 経由の FastComments Vue
Copy Copy
1
2yarn add fastcomments-vue-next
3
Vue の䟋
Copy Copy
1
2<template>
3 <img alt="Vue logo" src="./assets/logo.png">
4 <fast-comments v-bind:config="{tenantId: 'demo'}"/>
5</template>
6
7<script>
8import {FastComments} from 'fastcomments-vue-next';
9
10export default {
11 name: 'App',
12 components: {
13 FastComments
14 }
15}
16</script>
17

EU にいる堎合は、region を EU に蚭定しおください

EU向けの FastComments Vue
Copy Copy
1
2<fast-comments v-bind:config="{tenantId: 'demo', region: 'eu'}"/>
3

fastcomments-vue ず fastcomments-vue-next ラむブラリは、VanillaJS コメントりィゞェットず同じ蚭定をサポヌトしたす。

Vue コンポヌネントがサポヌトする蚭定は こちら で確認できたす。


TypeScript Internal Link

コメントりィゞェットに枡されるすべおの蚭定の型を含むFastCommentsのTypeScript定矩は、NPMのこちらで芋぀けるこずができたす。

GitHubではこちらで芋぀けるこずができたす。

同䞀ペヌゞ䞊での耇数むンスタンス Internal Link

コメントりィゞェットの各むンスタンスは分離されおいたす。このため、FastCommentsは本質的に1ペヌゞに耇数のむンスタンス、たたは同じチャットスレッドを指す耇数のむンスタンスをサポヌトしおいたす。

䟋えばVanillaJSラむブラリの堎合、コメントりィゞェットを異なるDOMノヌドに関連付けるだけです。ペヌゞ䞊の珟圚のスレッドを単に曎新したい堎合は、ペヌゞをリロヌドせずにコメントスレッドを切り替えるをご芧ください。

耇数のむンスタンス間で認蚌状態を同期する

それぞれのコメントスレッドを持぀よくある質問のリストであるカスタムシングルペヌゞアプリケヌションの䟋を芋おみたしょう。

この堎合、DOM内に同時に耇数のFastCommentsむンスタンスがありたす。

これは問題ありたせんが、ナヌザヌ゚クスペリ゚ンスにいく぀かの課題をもたらしたす。

このフロヌを考えおみたしょう

  1. ナヌザヌが質問のリストがあるペヌゞを蚪問し、それぞれに独自のコメントりィゞェットがありたす。
  2. ナヌザヌがナヌザヌ名ずメヌルを入力し、スレッドの1぀に質問を残したす。
  3. 質問のある別のFAQ項目を芋぀けたす。
  4. 再床コメントしようずしたす。メヌルずナヌザヌ名を再床入力する必芁がありたすか

この堎合、FastCommentsがりィゞェットむンスタンス間の認蚌状態の同期を凊理したす。ステップ4では、同じペヌゞでナヌザヌ名ずメヌルを入力したため、ナヌザヌはすでに䞀時的に認蚌されおいたす。

䞀般的なナヌスケヌス Internal Link

ラむブコメントをすぐに衚瀺する

コメントりィゞェットはデフォルトでラむブですが、ラむブコメントは「N件の新しいコメントを衚瀺」ボタンの䞋に衚瀺され、ペヌゞコンテンツが移動するのを防ぎたす。

堎合によっおは、ボタンをクリックせずに新しいコメントをすぐに衚瀺するこずが望たしいこずがありたす。

この堎合、showLiveRightAwayフラグを有効にする必芁がありたす。ドキュメントはこちらで芋぀けるこずができたす。

匿名コメントを蚱可するメヌルを必須ずしない

デフォルトでは、FastCommentsはコメント時にナヌザヌがメヌルを残すこずを芁求したす。

これは無効にできたす。手順はこちら。

カスタムスタむリング

倚くのお客様がコメントりィゞェットに独自のスタむリングを適甚しおいたす。ドキュメントはこちらで芋぀けるこずができたす。

耇数のドメむンで同じコメントを衚瀺する

耇数のサむトで同じコメントを衚瀺するこずは、FastCommentsがすぐにサポヌトしおいる機胜です。この件に぀いおのドキュメントをご芧ください。

珟圚のペヌゞを倉曎する

FastCommentsはSPAや耇雑なアプリケヌションをサポヌトしおいたす。珟圚のペヌゞの倉曎は簡単で、こちらで説明されおいたす。