FastComments.com

הוספת תגובות לאתר ה-Jekyll שלך


זוהי הספרייה הרשמית של Jekyll עבור FastComments.

הטמעו ווידג'טים של תגובות חיות, צ'אט וביקורות באתר ה-Jekyll שלכם.

מאגר

צפה ב-GitHub


תצוגה חיה Internal Link

כדי לראות כל תג שפועל מקומית מול ה-demo tenant הציבורי, שכפל את המאגר והפעל:

cd example
bundle install
bundle exec jekyll serve

לכל ווידג'ט יש דף משלו תחת example/ שאותו אתה יכול להעתיק ישירות לתוך אתר Jekyll שלך.

התקנה Internal Link

Gem

הוסף את ה-gem לקבוצת :jekyll_plugins בקובץ Gemfile של האתר שלך:

group :jekyll_plugins do
  gem "fastcomments-jekyll"
end

ואז:

bundle install

(תואם ל-Jekyll 3.7+ ו-4.x.)

תגיות Internal Link

תגתיאור
fastcommentsמערכת תגובות חיה עם תגובות משנה, הצבעה, ניהול ועדכונים בזמן אמת
fastcomments_comment_countספירת תגובות עבור העמוד הנוכחי
fastcomments_comment_count_bulkספירות תגובות עבור דפים מרובים בעמוד רשימה/אינדקס אחד
fastcomments_live_chatווידג'ט צ'אט בזמן אמת
fastcomments_collab_chatתגובות שיתופיות בתוך הטקסט (הערות טקסט)
fastcomments_image_chatהערות על תמונות
fastcomments_recent_commentsתגובות אחרונות ברחבי האתר
fastcomments_recent_discussionsשרשורי דיון פעילים לאחרונה
fastcomments_reviews_summaryסיכום ביקורות בדירוג כוכבים
fastcomments_top_pagesהדפים הנדונים ביותר
fastcomments_user_activity_feedפיד פעילות לכל משתמש

דוגמאות

{% raw %}{# ספירת תגובות. הווידג'ט מציג את התווית שלו, לדוגמה "0 תגובות" #}
{% fastcomments_comment_count %}

{# צ'אט בזמן אמת #}
{% fastcomments_live_chat %}

{# צ'אט שיתופי. כוונו אותו לאלמנט תוכן באמצעות בוחר CSS #}
<article id="post-body">
  <p>Highlight me to leave a comment.</p>
</article>
{% fastcomments_collab_chat target="#post-body" %}

{# צ'אט תמונה. כוונו אותו לאלמנט תמונה באמצעות בוחר CSS #}
<img id="hero" src="/hero.jpg" alt="Hero image">
{% fastcomments_image_chat target="#hero" %}

{# סיכום ביקורות #}
{% fastcomments_reviews_summary %}

{# פיד פעילות משתמש. דורש מזהה משתמש #}
{% fastcomments_user_activity_feed user_id="demo:demo-user" %}

{# ספירות תגובות מרובות עבור אינדקס בלוג #}
{% for post in site.posts %}
  <a href="\{{ post.url }}">\{{ post.title }}</a>
  <span class="fast-comments-count" data-fast-comments-url-id="\{{ post.url }}"></span>
{% endfor %}
{% fastcomments_comment_count_bulk %}{% endraw %}

הגדרות Internal Link

Config comes from three places. Later sources win:

  1. Global defaults in _config.yml under the fastcomments: key.
  2. Page context, derived automatically for page-scoped widgets (see below).
  3. Tag attributes written on the tag itself.

So a url_id on the tag overrides the page-derived value, which overrides any global default.

תחביר התכונות

Attributes are key=value pairs in snake_case:

{% raw %}{% fastcomments url_id="my-stable-id" readonly=true count=20 %}{% endraw %}
  • Quoted values ("..." or '...') are literal strings.
  • Unquoted true/false become booleans, and numbers become numbers.
  • Unquoted anything else is resolved as a Liquid variable from the page context, e.g. url_id=page.slug. (Liquid does not expand {% raw %}\{{ ... }}{% endraw %} inside a tag's attributes, so use the bare page.slug form rather than "{% raw %}\{{ page.slug }}{% endraw %}".)

Snake_case attribute and config keys are mapped automatically to the camelCase keys FastComments expects (tenant_idtenantId, url_idurlId, page_titlepageTitle, has_dark_backgroundhasDarkBackground, and so on). Any other option from the widget configuration passes straight through the same way.

ערכים נגזרים מהדף

For the page-scoped widgets (fastcomments, fastcomments_comment_count, fastcomments_live_chat, fastcomments_collab_chat, fastcomments_image_chat) these are filled in automatically from the current page unless you set them yourself:

  • url_idpage.url (a stable identifier independent of the visiting domain)
  • urlsite.url + page.url (only when url is set in _config.yml)
  • page_titlepage.title

Site-wide widgets (recent comments/discussions, top pages, reviews summary, user activity feed, bulk count) are not tied to a page and do not derive these.

שהות נתונים באיחוד האירופי

EU customers add region: eu, either globally:

fastcomments:
  tenant_id: your-tenant-id
  region: eu

or per tag: {% raw %}{% fastcomments region="eu" %}{% endraw %}. Widgets then load from the EU CDN.



מצב תחזוקה Internal Link

אלו רכיבים שהם עטיפות סביב רכיבי ה-VanillaJS הליבה שלנו. אנחנו יכולים לעדכן את אותם רכיבים באופן אוטומטי (לתקן באגים, להוסיף תכונות) בלי לפרסם את הספרייה הזו, כך שאפילו אם היא לא תפורסם לזמן מה — זה לא אומר ש-FastComments אינו בפיתוח פעיל! אתם מוזמנים לבדוק את הבלוג שלנו לעדכונים. שינויים מפרים ב-API או תכונות משמעותיות לעולם לא ישולבו בספריית הליבה הבסיסית ללא העלאת גרסה בספרייה הזו.


צריך עזרה?

אם תיתקל בבעיות או יש לך שאלות לגבי ספריית Jekyll, אנא:

תרומות

תרומות מתקבלות בברכה! אנא בקר במאגר ה-GitHub לקבלת הנחיות לתרומה.