Not a care in the world.
Not a care in the world.
I’m looking forward to people complaining about daylight savings time just so I can get a break from election coverage.
Stoot now has an option that will remove the Open Graph / Meta Tags card associated with the first link in a mastodon post. If you are interested in the tags that Mastodon sees, you can go to OpenGraph XYZ to put in your favorite URLs. Here a direct link to your fifth favorite. Mastodon takes the information meta tags from the first URL and makes them look nice when you post. For example, I posted a toot1 with a link to a post that created. I will get something like the following.
You can now add a toot to your blog without including the Open Graph tag.
{{< stoot instance="$InstanceTLD" id="$ID" enableOGCard="true" >}}
The new enableOGCard option defaults to true so that it doesn’t unexpectedly change on people who have an older version of this plugin.
About a week ago, I got a message asking why stoot would render the image twice for the same mastodon toot.
Honestly, I had no idea it was doing this and haven’t looked at the code since I had packaged it up two weeks ago.
But, I didn’t want to leave this person without any help so I started to look into the issue and was able to reproduce the problem with a toot from someone I was already following.
Here is the code to embed it if you are using the stoot plugin
{{< stoot instance="writing.exchange" id="113300475439404467" >}}
A very pretty picture, but I don’t know if seeing it twice in succession.
For me to understand something better, I like to diagram it as I step through the code. I’ve included this diagram that shows you what div tags are created when using stoot. If you can always check out the code on GitHub.
toot-author-name and toot-author-name that go to the same account page.@name@server format that mastodon likes to use.<meter> elements to convey theThe problem is coming from the toot-card and I didn’t want to change all the cards, because someone might have become reliant on this behaviour or worse - never noticed it.
I didn’t want to make people work hard to style the included card, so I removed some styling from the CSS.
There are two div tags in the toot card that you can use to make things work to your satisfaction.
The problem is coming from the toot-card and I didn’t want to change all the cards, because someone might have become reliant on this behaviour or worse - never noticed it.
After idenifying the part of the code that controlled the cards, I set a conditional around it.
{{ if eq $enableOGCard "true"}}
{{ with $json.card }}
{{- $cardData := . -}}
{{- with $cardData.image -}}
<a href="{{ $cardData.url }}" rel="'noopener">
<div class="toot-card">
<div class="toot-card-image">
<img src="{{ $cardData.image }}"
alt="Card image from {{ $masIns }} toot {{ $id }}"
loading="lazy" class="toot-card-image-image" />
</div>
<div class="toot-card-content">
<p class="card-title">{{ $cardData.title }}</p>
<p class="card-description">{{ $cardData.description }}</p>
</div>
</div>
</a>
{{- end -}}
{{ end }}
{{ end }}
At the top of the file, we have the following line that sets the value to a default in case it is isn’t specified.
{{ $enableOGCard := .Get "enableOGCard" | default "true" }}
Time to close all the tabs and call it a night.
I would like to change the alt text for the incoming images, but I think I would have to learn more about what is offered from mastodon using this API.
I want to that @lmika for giving me some advice about the go programming language. I also want to thank @DaveyCraney for giving me some feedback about stoot.
And I want to thank you for making it to the end of this article.
I am really hating the different names for slightly different things right now. ↩︎
Sharing pictures of tables in excel should be frowned upon.
Finish
a project.
Start closing the windows filled with tabs and then realize all the other projects.
Go to bed realizing that although you have more to do, you have accomplished something.
Bath time for Lillie!
I have to look into a way for this not to be as scary for her.
I’m planning on going to later today. I’m hoping to talk about masonry, but I think I’ll just get side tracked with coffee.
What a morning!
Hello @lmika, do you know someplace that I can find a quick start guide for the go language? I’m trying to debug an issue with stoot.