Skip to content

Commit bf905ef

Browse files
committed
WIP - comments with giscus. Minor post updates
1 parent d1b1cd8 commit bf905ef

File tree

4 files changed

+62
-7
lines changed

4 files changed

+62
-7
lines changed

_includes/comments.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- The comments switcher -->
2+
{% if page.comments and site.comments.provider %}
3+
{% capture path %}comments/{{ site.comments.provider }}.html{% endcapture %}
4+
{% include {{ path }} %}
5+
{% endif %}

_includes/comments/giscus.html

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!-- https://giscus.app/ -->
2+
<script>
3+
(function () {
4+
const themeMapper = Theme.getThemeMapper('light', 'dark_dimmed');
5+
const initTheme = themeMapper[Theme.visualState];
6+
7+
let lang = '{{ site.comments.giscus.lang | default: lang }}';
8+
{%- comment -%} https://github.com/giscus/giscus/tree/main/locales {%- endcomment -%}
9+
if (lang.length > 2 && !lang.startsWith('zh')) {
10+
lang = lang.slice(0, 2);
11+
}
12+
13+
let giscusAttributes = {
14+
src: 'https://giscus.app/client.js',
15+
'data-repo': '{{ site.comments.giscus.repo}}',
16+
'data-repo-id': '{{ site.comments.giscus.repo_id }}',
17+
'data-category': '{{ site.comments.giscus.category }}',
18+
'data-category-id': '{{ site.comments.giscus.category_id }}',
19+
'data-mapping': '{{ site.comments.giscus.mapping | default: 'pathname' }}',
20+
'data-strict' : '{{ site.comments.giscus.strict | default: '0' }}',
21+
'data-reactions-enabled': '{{ site.comments.giscus.reactions_enabled | default: '1' }}',
22+
'data-emit-metadata': '0',
23+
'data-theme': initTheme,
24+
'data-input-position': '{{ site.comments.giscus.input_position | default: 'bottom' }}',
25+
'data-lang': lang,
26+
'data-loading': 'lazy',
27+
crossorigin: 'anonymous',
28+
async: ''
29+
};
30+
31+
let giscusNode = document.createElement('script');
32+
Object.entries(giscusAttributes).forEach(([key, value]) =>
33+
giscusNode.setAttribute(key, value)
34+
);
35+
36+
const $footer = document.querySelector('footer');
37+
$footer.insertAdjacentElement("beforebegin", giscusNode);
38+
39+
addEventListener('message', (event) => {
40+
if (event.source === window && event.data && event.data.id === Theme.ID) {
41+
const newTheme = themeMapper[Theme.visualState];
42+
43+
const message = {
44+
setConfig: {
45+
theme: newTheme
46+
}
47+
};
48+
49+
const giscus =
50+
document.getElementsByClassName('giscus-frame')[0].contentWindow;
51+
giscus.postMessage({ giscus: message }, 'https://giscus.app');
52+
}
53+
});
54+
})();
55+
</script>

_posts/2025-06-16-pycon-us-ai-and-future-of-programming.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Will AI Replace Junior Developers? I Asked Experts at Pycon US
3-
date: 2025-06-17 19:20:00 +05:30
3+
date: 2025-06-16 19:20:00 +05:30
44
categories: [ Python, Pycon ]
55
tags: [ python, events, pycon, ai ] # TAG names should always be lowercase
66
---
77
I attended Pycon US in Pittsburgh - This was my first in-person Pycon US.
88

99
At this PyCon, I decided to try something different. I skipped most of the talks and focused on the hallway track - just walking around, meeting people, and asking questions.
1010

11-
I was also presenting a poster at PyCon - on using Python to improve at chess. [Link](https://github.com/adarshdigievo/talks/tree/main/Pycon%20US%2025%20-%20Improving%20in%20Chess)
11+
I was also presenting a poster at PyCon - on using Python to improve at chess. [Get the materials for the presentation here.](https://github.com/adarshdigievo/talks/tree/main/Pycon%20US%2025%20-%20Improving%20in%20Chess)
1212

1313
Before the conference, I had prepared a few questions I wanted to ask the Python people:
1414

includes/comments.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)