Revert back to using goqr.me API for comment QR
DDG doesn't seem to work in "production" for some reason, while it works perfectly fine locally :/
This commit is contained in:
@ -82,5 +82,5 @@ show_source = true
|
|||||||
host = "mstdn.social"
|
host = "mstdn.social"
|
||||||
# Used to determine who the original poster is
|
# Used to determine who the original poster is
|
||||||
user = "Daudix"
|
user = "Daudix"
|
||||||
# Display the QR code to Mastodon post (utilizes DuckDuckGo Instant Answer API)
|
# Display the QR code to Mastodon post
|
||||||
show_qr = true
|
show_qr = true
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#qrcode {
|
#qrcode {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
float: right;
|
float: right;
|
||||||
height: 160px;
|
height: 150px;
|
||||||
margin: 3rem 0 0 1rem;
|
margin: 3rem 0 0 1rem;
|
||||||
padding: 6px;
|
padding: 12.5px;
|
||||||
width: 160px;
|
width: 150px;
|
||||||
|
|
||||||
@media only screen and (max-width: 720px) {
|
@media only screen and (max-width: 720px) {
|
||||||
& {
|
& {
|
||||||
|
@ -17,18 +17,7 @@
|
|||||||
<section id="comments">
|
<section id="comments">
|
||||||
|
|
||||||
{% if config.extra.comments.show_qr %}
|
{% if config.extra.comments.show_qr %}
|
||||||
<img id="qrcode" class="no-hover pixels" alt="QR code to a Mastodon post" src="">
|
<img id="qrcode" class="no-hover pixels" alt="QR code to a Mastodon post" src="https://api.qrserver.com/v1/create-qr-code/?data=https://{{ host }}/@{{ username }}/{{ id }}&format=gif" />
|
||||||
<script>
|
|
||||||
const apiUrl = "http://api.duckduckgo.com/?q=qr%20https://{{ host }}/@{{ username }}/{{ id }}&format=json";
|
|
||||||
|
|
||||||
fetch(apiUrl)
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
const base64Data = data.Answer.match(/src="([^"]*)"/)[1];
|
|
||||||
document.getElementById("qrcode").src = base64Data;
|
|
||||||
})
|
|
||||||
.catch(error => console.error("Error fetching QR code:", error));
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h2>Comments</h2>
|
<h2>Comments</h2>
|
||||||
<p>
|
<p>
|
||||||
|
Reference in New Issue
Block a user