Hello there,
I started developing a – my first – theme for https://talk.incommon.cc that you can preview on the theme creator.
It’s not yet used on IN COMMON because I need to fix the JavaScript. Help and pointers welcome!
Here’s a screenshot:
Hello there,
I started developing a – my first – theme for https://talk.incommon.cc that you can preview on the theme creator.
It’s not yet used on IN COMMON because I need to fix the JavaScript. Help and pointers welcome!
Here’s a screenshot:
I managed to replace accents in category names, but not in cooked posts yet:
<script type="text/discourse-plugin" version="0.1">
// Remove accents in titles since the font does not support them.
let stripAccentsFromTitles = function() {
$('h1, h2, h3, h4, h3 .category-name').each(function(_, e) {
e.textContent = e.textContent.normalize('NFD').replace(/[\u0300-\u036f]/g, "")
})
};
api.decorateCooked(stripAccentsFromTitles)
</script>
Ha! I manage to fix in cooked posts, but then, I lost category names ![]()
<script type="text/discourse-plugin" version="0.1">
// Remove accents in titles since the font does not support them.
api.decorateCooked($elem =>
$elem.children('h1, h2, h3, h4, .category-name').each(function(_, e) {
e.textContent = e.textContent.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
}));
</script>
I will let others explain what’s wrong to me, because it’s still Vogon poetry.
Duh. I give up. <= link to numerous commits to try (and fail) variations… Without understanding anything, I cannot do anything else.
Right, this is v0.4.1 of this theme. The accent removal mostly works with a few exceptions that belong to in-page events not covered yet. The code is a bit ugly since it’s redundant. I guess once I figure out the appEvents I can use a cleaner way to do my thing.
Here’s an example bug:
We can see the title has been converted to unaccented characters (on café).
But then when we scroll, the title moves to the banner, and this event is not covered by the stripAccentsFromTitle function
Does anyone have a pointer to a list of appEvents and how to use them?
p.s.: I can’t reply to myself more than three times, so I edited this post. Sorry.
흥미롭지만, 이 글꼴은 읽기 쉽지 않습니다. 발음 기호가 포함된 글꼴을 사용하는 것이 더 편하지 않을까요?
보통 읽는 속도를 늦추는 글꼴은 피하려고 합니다. 읽는 속도를 늦추는 것은 이해도를 높일 수 있는 텍스트에 더 적합하다고 생각하기 때문입니다.
P.S. 필요하신 경우, 글자 수를 채우기 위해 추가로 작성했습니다.