feat: hashover comments integration

This commit is contained in:
2023-12-19 21:18:21 +01:00
parent 1caf73dce1
commit 22fcc7b96c
3 changed files with 226 additions and 253 deletions

View File

@@ -5,9 +5,9 @@ version: 1.0.0
description: "Paxover is a theme for Tymoteusz Jóźwiak's personal website"
icon: empire
author:
name: Tymoteusz Jóźwiak
email: tymoteusz@jozwiak.top
url: https://jozwiak.top
name: Tymoteusz Jóźwiak
email: tymoteusz@jozwiak.top
url: https://jozwiak.top
homepage: https://codeberg.org/tymoteuszjozwiak/paxover
demo: https://jozwiak.top
keywords: paxover
@@ -15,250 +15,235 @@ bugs: https://codeberg.org/tymoteuszjozwiak/paxover/issues
license: MIT
dependencies:
- { name: grav, version: ">=1.6.0" }
- { name: grav, version: ">=1.6.0" }
form:
validation: loose
validation: loose
fields:
blog_section:
type: section
title: Blog settings
underline: true
fields:
blog_section:
type: section
title: Blog settings
underline: true
blog.slug:
type: text
label: Blog slug
help: Route to the blog page
size: medium
default: "/blog"
blog.slug:
type: text
label: Blog slug
help: Route to the blog page
size: medium
default: "/blog"
blog.tag_title:
type: text
label: Tag title
help: Title displayed on tag view page
size: medium
default: "Tag"
blog.tag_title:
type: text
label: Tag title
help: Title displayed on tag view page
size: medium
default: "Tag"
blog.tags_title:
type: text
label: Tags title
help: Title displayed on tag list
size: medium
default: "Tagi"
blog.tags_title:
type: text
label: Tags title
help: Title displayed on tag list
size: medium
default: "Tagi"
blog.series_title:
type: text
label: Series title
help: Title displayed on series field
size: medium
default: "Seria"
blog.series_title:
type: text
label: Series title
help: Title displayed on series field
size: medium
default: "Seria"
blog.pagination_limit:
type: text
label: Blog pagination limit
help: Limit of posts displayed on one page
size: medium
default: "7"
blog.pagination_limit:
type: text
label: Blog pagination limit
help: Limit of posts displayed on one page
size: medium
default: "7"
blog.pagination_newer:
type: text
label: Pagination "newer"
help: Title displayed on "newer" button
size: medium
default: "Nowsze"
blog.pagination_newer:
type: text
label: Pagination "newer"
help: Title displayed on "newer" button
size: medium
default: "Nowsze"
blog.pagination_older:
type: text
label: Pagination "older"
help: Title displayed on "older" button
size: medium
default: "Starsze"
blog.pagination_older:
type: text
label: Pagination "older"
help: Title displayed on "older" button
size: medium
default: "Starsze"
blog.share:
type: text
label: Share section title
size: medium
default: "Udostępnij"
blog.share:
type: text
label: Share section title
size: medium
default: "Udostępnij"
blog.share_buttons:
type: list
label: Share buttons
btnLabel: Add button
blog.share_buttons:
type: list
label: Share buttons
btnLabel: Add button
fields:
.name:
type: text
label: Name
size: medium
.class:
type: text
label: Class (e.g. btn-twitter)
size: medium
.attributes:
type: text
label: Attributes (e.g. disabled)
size: medium
.link:
type: text
label: Link
size: medium
.url_param:
type: text
label: URL param (e.g. url)
size: medium
.title:
type: text
label: Title
size: medium
.title_en:
type: text
label: Title [EN]
size: medium
fields:
.name:
type: text
label: Name
size: medium
.class:
type: text
label: Class (e.g. btn-twitter)
size: medium
.attributes:
type: text
label: Attributes (e.g. disabled)
size: medium
.link:
type: text
label: Link
size: medium
.url_param:
type: text
label: URL param (e.g. url)
size: medium
.title:
type: text
label: Title
size: medium
.title_en:
type: text
label: Title [EN]
size: medium
social_section:
type: section
title: Main page settings
underline: true
social_section:
type: section
title: Main page settings
underline: true
social_buttons:
type: list
label: Social buttons
btnLabel: Add button
social_buttons:
type: list
label: Social buttons
btnLabel: Add button
fields:
.name:
type: text
label: Name
size: medium
.class:
type: text
label: Class (e.g. btn-twitter)
size: medium
.attributes:
type: text
label: Attributes (e.g. disabled)
size: medium
.link:
type: text
label: Link
size: medium
.title:
type: text
label: Title
size: medium
.title_en:
type: text
label: Title [EN]
size: medium
fields:
.name:
type: text
label: Name
size: medium
.class:
type: text
label: Class (e.g. btn-twitter)
size: medium
.attributes:
type: text
label: Attributes (e.g. disabled)
size: medium
.link:
type: text
label: Link
size: medium
.title:
type: text
label: Title
size: medium
.title_en:
type: text
label: Title [EN]
size: medium
contact:
type: textarea
label: Contact
help: Contact info displayed on main page
size: big
default: ""
contact:
type: textarea
label: Contact
help: Contact info displayed on main page
size: big
default: ""
contact_en:
type: textarea
label: Contact EN
help: English version of the previous field
size: big
default: ""
contact_en:
type: textarea
label: Contact EN
help: English version of the previous field
size: big
default: ""
lang_title_en:
type: text
label: Lang title EN
help: Main language title displayed on english version of main page
size: medium
default: ""
lang_title_en:
type: text
label: Lang title EN
help: Main language title displayed on english version of main page
size: medium
default: ""
footer_section:
type: section
title: Footer settings
underline: true
footer_section:
type: section
title: Footer settings
underline: true
footer.title:
type: text
label: Footer link title
size: medium
default: ""
footer.title:
type: text
label: Footer link title
size: medium
default: ""
footer.title_en:
type: text
label: Footer link title EN
help: English translation of footer link title
size: medium
default: ""
footer.title_en:
type: text
label: Footer link title EN
help: English translation of footer link title
size: medium
default: ""
footer.url:
type: text
label: Footer link
help: Footer link
size: medium
default: ""
footer.url:
type: text
label: Footer link
help: Footer link
size: medium
default: ""
footer.year:
type: number
label: Footer year
help: Website start year displayed in footer
size: medium
default: "2022"
footer.year:
type: number
label: Footer year
help: Website start year displayed in footer
size: medium
default: "2022"
owner_title:
type: text
label: Owner title
size: medium
default: "Owner"
owner_title:
type: text
label: Owner title
size: medium
default: "Owner"
wordcount_title:
type: text
label: Word count title
size: medium
default: "słów"
wordcount_title:
type: text
label: Word count title
size: medium
default: "słów"
analytics:
type: textarea
label: Analytics script
help: Script inserted at the bottom of every page
size: big
default: ""
analytics:
type: textarea
label: Analytics script
help: Script inserted at the bottom of every page
size: big
default: ""
cusdis_section:
type: section
title: Cusdis integration settings
underline: true
hashover_section:
type: section
title: hashover integration settings
underline: true
cusdis.domain:
type: text
label: Cusdis domain
help: Domain where your Cusdis instance is hosted
size: medium
default: "cusdis.com"
hashover.domain:
type: text
label: hashover domain
help: Domain where your hashover instance is hosted
size: medium
cusdis.app_id:
type: text
label: Cusdis App ID
help: ID from Cusdis dashboard (e.g. 35b01c49-15f9-46b3-807f-9240f6cadc1a)
size: medium
default: ""
hashover.title:
type: text
label: Comments section title
size: medium
default: "Komentarze"
cusdis.title:
type: text
label: Comments section title
size: medium
default: "Komentarze"
cusdis.disable_comments:
type: text
label: Disable comments info text
help: Information displayed where the comments are disabled
size: medium
default: "Komentarze są wyłączone dla tego artykułu"
cusdis.lang:
type: textarea
label: Cusdis language override
help: More info at https://cusdis.com/doc#/advanced/i18n?id=contributing-more-languages
size: big
default: ""
hashover.disable_comments:
type: text
label: Disable comments info text
help: Information displayed where the comments are disabled
size: medium
default: "Komentarze są wyłączone dla tego artykułu"

View File

@@ -7,23 +7,21 @@ contact:
contact_en:
lang_title_en:
blog:
slug:
tag_title:
tags_title:
series_title:
pagination_limit:
pagination_newer:
pagination_older:
share:
share_buttons:
slug:
tag_title:
tags_title:
series_title:
pagination_limit:
pagination_newer:
pagination_older:
share:
share_buttons:
footer:
title:
title_en:
url:
year:
cusdis:
domain:
app_id:
title:
disable_comments:
lang:
title:
title_en:
url:
year:
hashover:
domain:
title:
disable_comments:

View File

@@ -1,19 +1,9 @@
{% if theme_config.cusdis.domain %}
<h2 class="left">{{ theme_config.cusdis.title|raw }}</h2>
{% if theme_config.hashover.domain %}
<h2 class="left">{{ theme_config.hashover.title|raw }}</h2>
{% if page.header.disableComments %}
<p class="left">{{ theme_config.cusdis.disable_comments|raw }}</p>
<p class="left">{{ theme_config.hashover.disable_comments|raw }}</p>
{% else %}
{% if theme_config.cusdis.lang %}
<script>{{ theme_config.cusdis.lang|raw }}</script>
{% endif %}
<div id="cusdis_thread"
data-host="https://{{ theme_config.cusdis.domain }}"
data-app-id="{{ theme_config.cusdis.app_id }}"
data-page-id="{{ page.slug }}"
data-page-url="{{ page.url(true) }}"
data-page-title="{{ page.title }}"
data-theme="auto"
></div>
<script async defer src="https://{{ theme_config.cusdis.domain }}/js/cusdis.es.js"></script>
<div id="hashover"></div>
<script async defer src="https://{{ theme_config.cusdis.domain }}/comments.php"></script>
{% endif %}
{% endif %}