-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline telegram script #433
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest is looks good to me, telegram widget will spawn following the script that called it
Without this patch
<div id="comments">
<div id="telegram-comments" class="comment"></div>
<noscript> Please enable JavaScript to view the comments powered by <a href="https://comments.app/">Telegram Comments</a>. </noscript>
</div>
With this patch
<div id="comments">
<div id="telegram-comments" class="comment">
<script type="text/javascript" src="https://comments.app/js/widget.js?3" data-comments-app-website="Mvf_8EPT" data-limit="5" data-colorful="1" data-dislikes="1"></script>
<noscript> Please enable JavaScript to view the comments powered by <a href="https://comments.app/">Telegram Comments</a>. </noscript>
</div>
</div>
layouts/partials/comment.html
Outdated
@@ -95,10 +95,11 @@ | |||
{{- if $telegram.outlined -}} | |||
{{- $attr = printf `%v data-outlined="1"` $attr -}} | |||
{{- end -}} | |||
{{- dict "Source" "https://comments.app/js/widget.js?2" "Defer" true "Attr" $attr | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} | |||
<script type="text/javascript" src="https://comments.app/js/widget.js?3" {{ with $attr }} {{ . | safeHTMLAttr }}{{ end }}></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need to remove defer
attribute. It make main page page load earlier as the script is executed when the page has finished parsing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need to remove
defer
attribute. It make main page page load earlier as the script is executed when the page has finished parsing.
Thank you very much for this fix, I see you marked in my PR, but this is not your template, the developer has abandoned this project?
Angthing new about this fix? |
You can apply this commit into your personal repo if you want. |
This change I moved to the new fork 😄 Since the developer has unfortunately abandoned the project 😞, I would like to take responsibility for its support and development in the future. 🔗 -> https://github.com/uPagge/uBlogger. I focused on adding new features, refreshed the design of the posts, fixed the bugs I found. Short and basic, what I have changed I will be glad if you look at it, you may like the updated design. |
Kudos, SonarCloud Quality Gate passed! |
I am trying to use the telegram comment widget. The widget inserts an iframe to the parent of the script node. Because scripts are appended to the end of the page, this ends up being the body and not the comments placeholder. I had to inline the script within the comments placeholder manually like this to get the comments to show in the right place.
You might have a better idea for how to do this (maybe using the scripts partial or something like that, I'm new to this templating system), but this is the expected result I'm looking for.