Skip to content

Commit

Permalink
update(mkdocs): enable comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Oct 18, 2024
1 parent cf960af commit 0d45aa0
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# english-blogs
# english-blog
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ authors:
- jmoura
categories:
- Announcements
date: 2024-10-21
comments: true
date: 2024-10-18
description: "In 2024, it's time to leave Teams and IRC behind to enter a new era where you can chat directly from QGIS with other GIS fellows. #GISChat #GISTribe"
icon: material/chat
license: beerware
Expand Down Expand Up @@ -119,7 +120,9 @@ Now, let's move to the `QChat` settings section:
- `play sounds`: toggle to play a sound when you're mentioned by another user. If enabled, you can adjust the volume and choose a notification sound.
- customize chat message colors with three color settings

## let's start chatting
----

## Let's start chatting

QTribu chat is included in a [dock widget](https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QDockWidget.html), meaning you can move and dock it wherever you like in the QGIS interface. To open the chat, you can either:

Expand All @@ -146,17 +149,19 @@ Note that:
- using `@all` in your message will notify all users in the room via the QGIS message bar
- double-clicking a message in QTribu chat will allow you to mention the user who sent it

## want to go further?
----

## Want to go further?

We've seen the client side of QTribu chat in QGIS. To route the messages through WebSockets, there’s also a backend. [The GitHub repository is available here](https://github.com/geotribu/gischat).

### set up your own instance
### Set up your own instance

If you'd like to set up your own QTribu chat backend, [you can follow the instructions on the repository](https://github.com/geotribu/gischat#deploy-a-self-hosted-instance). There's no need for a database, as it’s stateless and simply relies on WebSockets. It’s a [simple Docker image](https://hub.docker.com/r/gounux/gischat) that runs with a few environment variables.

There's also [a directory of QTribu chat instances](https://github.com/geotribu/gischat/blob/main/instances.json), which you can contribute to if you set up your own instance, making it visible and available to others. The `discover instances` button in the plugin settings opens this directory in a QGIS popup.

### develop a compatible client
### Develop a compatible client

If you’re interested in developing a compatible client, you can check out [the developer information on the GitHub repository](https://github.com/geotribu/gischat#developer-information).

Expand All @@ -169,6 +174,8 @@ Messages are sent over WebSocket, and there are [a few routes available](https:/

And more features coming soon :wink:

## conclusion
----

## Conclusion

QTribu chat is like having a virtual coffee corner, where technical discussions meet geographer jokes (the kind that only insiders find funny). So why not install QTribu chat today and turn your QGIS experience into a collaborative adventure? After all, who said mapping had to be boring? With QTribu chat, every map becomes a shared story, and every project an opportunity to laugh together. Ready to map and chat?
71 changes: 44 additions & 27 deletions content/theme/partials/comments.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,58 @@
{% if page.meta.comments %}
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
<!-- Generated snippet by giscus -->
<script src="https://giscus.app/client.js"
data-repo="geotribu/english-blog"
data-repo-id="R_kgDONCPthg"
data-category="Comments"
data-category-id="DIC_kwDONCPths4CjfE3"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="1"
data-input-position="top"
data-theme="preferred_color_scheme"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async>
</script>

<script src="https://giscus.app/client.js" data-repo="geotribu/site-contribuer" data-repo-id="R_kgDOItTqpQ"
data-category="Commentaires" data-category-id="DIC_kwDOItTqpc4CTXat" data-mapping="title" data-strict="0"
data-reactions-enabled="1" data-emit-metadata="1" data-input-position="top" data-theme="preferred_color_scheme"
data-lang="fr" data-loading="lazy" crossorigin="anonymous" async>
</script>

<!-- Synchronize Giscus theme with palette -->
<script>
<!-- Synchronize Giscus theme with palette -->
<script>
var giscus = document.querySelector("script[src*=giscus]")

/* Set palette on initial load */
// Set palette on initial load
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate" ? "dark" : "light"
giscus.setAttribute("data-theme", theme)
var theme = palette.color.scheme === "slate"
? "transparent_dark"
: "light"

// Instruct Giscus to set theme
giscus.setAttribute("data-theme", theme)


}

/* Register event handlers after documented loaded */
document.addEventListener("DOMContentLoaded", function () {
var ref = document.querySelector("[data-md-component=palette]")
ref.addEventListener("change", function () {
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate" ? "dark" : "light"
// Register event handlers after documented loaded
document.addEventListener("DOMContentLoaded", function() {
var ref = document.querySelector("[data-md-component=palette]")
ref.addEventListener("change", function() {
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate"
? "transparent_dark"
: "light"

/* Instruct Giscus to change theme */
var frame = document.querySelector(".giscus-frame")
frame.contentWindow.postMessage(
{ giscus: { setConfig: { theme } } },
"https://giscus.app"
)
}
})
// Instruct Giscus to change theme
var frame = document.querySelector(".giscus-frame")
frame.contentWindow.postMessage(
{ giscus: { setConfig: { theme } } },
"https://giscus.app"
)
}
})
})
</script>
</script>
{% endif %}
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ copyright:
!ENV [MKDOCS_SITE_COPYRIGHT, '<span class="copyleft">&copy;</span> Geotribu']

# Repository
repo_name: !ENV [GITHUB_REPOSITORY, "geotribu/english-blogs"]
repo_url: !ENV [MKDOCS_REPO_URL, "https://github.com/geotribu/english-blogs"]
repo_name: !ENV [GITHUB_REPOSITORY, "geotribu/english-blog"]
repo_url: !ENV [MKDOCS_REPO_URL, "https://github.com/geotribu/english-blog"]
edit_uri: !ENV [MKDOCS_EDIT_URI, "edit/main/content"]

# Custom folder structure
Expand Down

0 comments on commit 0d45aa0

Please sign in to comment.