<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>textboard &amp;mdash; Swagg::Blogg</title>
    <link>https://blog.swagg.net/tag:textboard</link>
    <description>or: How I Learned to Stop Worrying and Love the WWW&lt;br&gt;&lt;a href=&#34;https://www.swagg.net&#34;&gt;Home&lt;/a&gt;&amp;nbsp;&lt;a href=&#34;https://blog.swagg.net/feed/&#34;&gt;RSS&lt;/a&gt;</description>
    <pubDate>Fri, 24 Apr 2026 12:39:25 +0000</pubDate>
    <image>
      <url>https://i.snap.as/gopN8vBC.png</url>
      <title>textboard &amp;mdash; Swagg::Blogg</title>
      <link>https://blog.swagg.net/tag:textboard</link>
    </image>
    <item>
      <title>Stupid Meta...</title>
      <link>https://blog.swagg.net/stupid-meta?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[So there&#39;s these meta elements by Meta. Well not the meta element itself... But Open Graph. I wanted my links to look like this when I spam them in Discord:&#xA;&#xA;A link preview of an article from web3isgoinggreat.com&#xA;&#xA;Remember that scene from American Psycho where Christian Bale is sweating over a business card?&#xA;&#xA;So anyways, I look at the HTML and see these meta tags. That&#39;s gotta be it, I mean I see these then some tags that say something about Twitter and I don&#39;t want Twitter since I&#39;m really actually not a terrible person once you get to know me so I guess I&#39;ll implement these tags. The image seems easy enough, throw it in a Mojo template but what&#39;s annoying is I have my head entirely in the layout rather than the template itself. I first considered a partial template like I&#39;ve seen in Rails before but Mojo couldn&#39;t find the partial. I think this was due to me just using a single layout for all my templates associated with different controllers. My site is pretty simple so honestly I didn&#39;t want to copy the same layout for every controller.&#xA;&#xA;So I was left to hit the docs looking for some sort of feature or something that could help me out here. Finally I settled on the contentfor() helper. In my layout I put the following:&#xA;&#xA;head&#xA;  !-- Some stuff here... --&#xA;  %= content &#39;opengraph&#39; =%&#xA;  meta property=&#34;og:url&#34; content=&#34;&lt;%= urlfor-toabs %  &#34;  meta property=&#34;og:sitename&#34; content=&#34;Post::Text&#34;&#xA;  &lt;meta property=&#34;og:image&#34;&#xA;        content=&#34;%= urlfor(&#39;/images/logo.png&#39;)-toabs %  &#34;  meta property=&#34;og:image:type&#34; content=&#34;image/png&#34;&#xA;  meta property=&#34;og:image:width&#34; content=&#34;1200&#34;&#xA;  meta property=&#34;og:image:height&#34; content=&#34;1200&#34;&#xA;  &lt;meta property=&#34;og:image:alt&#34;&#xA;        content=&#34;Post::Text logo; a small nerdy anime girl giving a V sign&#34;  /head&#xA;&#xA;Now in my templates I simply do:&#xA;&#xA;% layout &#39;default&#39;;&#xA;% title &#39;New Thread&#39;;&#xA;% contentfor opengraph =  begin&#xA;  meta property=&#34;og:type&#34; content=&#34;website&#34;&#xA;  meta property=&#34;og:title&#34; content=&#34;&lt;%= title %&#34;  meta property=&#34;og:description&#34; content=&#34;Start a new thread.&#34;&#xA;% end&#xA;h2 class=&#34;page-title&#34;%= title %/h2&#xA;!-- Begin the rest of the page here... --&#xA;&#xA;Well that oughta do it! I mean I even made my image 1200 pixels wide, this oughta look breathtaking...&#xA;&#xA;A URL preivew of posttext.pl with a smaller image preview&#xA;&#xA;That&#39;s... A URL preview but why is my image so smol? It should be 4K ultra-HD like Molly White&#39;s site! I mean yeah there&#39;s these Twitter tags but why would it use those? There&#39;s not even a &#39;site name&#39; and I clearly see them in both our previews so it must be using Open Graph. Unless... It&#39;s using both. But there&#39;s no way it&#39;d do that I mean are the Twitter tags even considered a standard? Hell, is Open Graph even a standard? Out of desperation I try...&#xA;&#xA;% contentfor twittercard =  begin&#xA;  meta name=&#34;twitter:title&#34; content=&#34;&lt;%= title %&#34;  meta name=&#34;twitter:description&#34; content=&#34;Start a new thread.&#34;&#xA;% end&#xA;&#xA;And back to the layout:&#xA;&#xA;%= content &#39;twittercard&#39; =%&#xA;meta name=&#34;twitter:card&#34; content=&#34;summarylargeimage&#34;&#xA;meta name=&#34;twitter:creator&#34; content=&#34;@swaggboi@eattherich.club&#34;&#xA;&lt;meta name=&#34;twitter:site&#34;&#xA;      content=&#34;@posttext@fedi.seriousbusiness.international&#34;  &lt;meta name=&#34;twitter:image&#34;&#xA;      content=&#34;%= urlfor(&#39;/images/logo.png&#39;)-to_abs %  &#34;  &lt;meta name=&#34;twitter:image:alt&#34;&#xA;      content=&#34;Post::Text logo; a small nerdy anime girl giving a V sign&#34;  Well, what&#39;s it gunna be Discord? Make my day...&#xA;&#xA;The same link to posttext.pl but now the image is large&#xA;&#xA;😳&#xA;&#xA;Alright then... It&#39;s got the site title from Open Graph... And the image from the stupid Twitter tags. I guess. Cool.&#xA;&#xA;Well anyways that&#39;s done and Post::Text is finally live so I&#39;m happy. On to the next harebrained project! 🫡&#xA;&#xA;P.S. I know it&#39;s been a while since I&#39;ve blogged, my last prediction is partially becoming true already 💀&#xA;&#xA;perl&#xA;mojolicious&#xA;textboard&#xA;&#xA;Homepage&#xD;&#xA;Code&#xD;&#xA;Mail&#xD;&#xA;Social&#xD;&#xA;Chat&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>So there&#39;s these <code>&lt;meta&gt;</code> elements by Meta. Well not the <code>&lt;meta&gt;</code> element itself... But <a href="https://ogp.me">Open Graph</a>. I wanted my links to look like this when I spam them in <a href="https://discord.gg/6MXVZKU">Discord</a>:</p>

<p><img src="https://i.snap.as/fv9tGhOS.png" alt="A link preview of an article from web3isgoinggreat.com"/></p>

<p>Remember that scene from American Psycho where Christian Bale is sweating over a business card?</p>

<p>So anyways, I look at the HTML and see <a href="https://paste.lgts.xyz/?0f06b976abeb2060#6yuDpinXzC7vHXQmf4HoLKyurd3HaJdNjuNQ6Q3zMw4K">these</a> <code>&lt;meta&gt;</code> tags. That&#39;s gotta be it, I mean I see these then some tags that say something about Twitter and I don&#39;t want Twitter since I&#39;m really actually not a <a href="https://www.theguardian.com/world/2023/jun/03/twitter-conservative-media-elon-musk-ron-desantis">terrible person</a> once you get to know me so I guess I&#39;ll implement these tags. The image seems easy enough, throw it in a <a href="https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Embedded-Perl">Mojo template</a> but what&#39;s annoying is I have my <code>&lt;head&gt;</code> entirely in the <a href="https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Layouts">layout</a> rather than the template itself. I first considered a partial template like I&#39;ve seen in Rails before but Mojo couldn&#39;t find the partial. I think this was due to me just using a single layout for all my templates associated with different controllers. My site is pretty simple so honestly I didn&#39;t want to copy the same layout for every controller.</p>

<p>So I was left to hit the docs looking for some sort of feature or something that could help me out here. Finally I settled on the <a href="https://docs.mojolicious.org/Mojolicious/Plugin/DefaultHelpers#content_for">content_for()</a> helper. In my layout I put the following:</p>

<pre><code>&lt;head&gt;
  &lt;!-- Some stuff here... --&gt;
  &lt;%= content &#39;open_graph&#39; =%&gt;
  &lt;meta property=&#34;og:url&#34; content=&#34;&lt;%= url_for-&gt;to_abs %&gt;&#34;&gt;
  &lt;meta property=&#34;og:site_name&#34; content=&#34;Post::Text&#34;&gt;
  &lt;meta property=&#34;og:image&#34;
        content=&#34;&lt;%= url_for(&#39;/images/logo.png&#39;)-&gt;to_abs %&gt;&#34;&gt;
  &lt;meta property=&#34;og:image:type&#34; content=&#34;image/png&#34;&gt;
  &lt;meta property=&#34;og:image:width&#34; content=&#34;1200&#34;&gt;
  &lt;meta property=&#34;og:image:height&#34; content=&#34;1200&#34;&gt;
  &lt;meta property=&#34;og:image:alt&#34;
        content=&#34;Post::Text logo; a small nerdy anime girl giving a V sign&#34;&gt;
&lt;/head&gt;
</code></pre>

<p>Now in my templates I simply do:</p>

<pre><code>% layout &#39;default&#39;;
% title &#39;New Thread&#39;;
% content_for open_graph =&gt; begin
  &lt;meta property=&#34;og:type&#34; content=&#34;website&#34;&gt;
  &lt;meta property=&#34;og:title&#34; content=&#34;&lt;%= title %&gt;&#34;&gt;
  &lt;meta property=&#34;og:description&#34; content=&#34;Start a new thread.&#34;&gt;
% end
&lt;h2 class=&#34;page-title&#34;&gt;&lt;%= title %&gt;&lt;/h2&gt;
&lt;!-- Begin the rest of the page here... --&gt;
</code></pre>

<p>Well that oughta do it! I mean I even made my image 1200 pixels wide, this oughta look <em>breathtaking</em>...</p>

<p><img src="https://i.snap.as/ttM8gh3E.png" alt="A URL preivew of posttext.pl with a smaller image preview"/></p>

<p>That&#39;s... A URL preview but why is my image so smol? It should be 4K ultra-HD like <a href="https://web3isgoinggreat.com">Molly White&#39;s</a> site! I mean yeah there&#39;s <a href="https://paste.lgts.xyz/?7ee65dddb1a83f6e#AVtRxh5Lvnvk3bZP6ntMSLiMW3h6TkAP5zkjzZhJ1ucG">these Twitter tags</a> but why would it use <a href="https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards">those</a>? There&#39;s not even a &#39;site name&#39; and I clearly see them in both our previews so it must be using Open Graph. Unless... It&#39;s using <em>both</em>. But there&#39;s no way it&#39;d do that I mean are the Twitter tags even considered a standard? Hell, is Open Graph even a standard? Out of desperation I try...</p>

<pre><code>% content_for twitter_card =&gt; begin
  &lt;meta name=&#34;twitter:title&#34; content=&#34;&lt;%= title %&gt;&#34;&gt;
  &lt;meta name=&#34;twitter:description&#34; content=&#34;Start a new thread.&#34;&gt;
% end
</code></pre>

<p>And back to the layout:</p>

<pre><code>&lt;%= content &#39;twitter_card&#39; =%&gt;
&lt;meta name=&#34;twitter:card&#34; content=&#34;summary_large_image&#34;&gt;
&lt;meta name=&#34;twitter:creator&#34; content=&#34;<a href="/@/swaggboi@eattherich.club" class="u-url mention">@<span>swaggboi@eattherich.club</span></a>&#34;&gt;
&lt;meta name=&#34;twitter:site&#34;
      content=&#34;<a href="/@/posttext@fedi.seriousbusiness.international" class="u-url mention">@<span>posttext@fedi.seriousbusiness.international</span></a>&#34;&gt;
&lt;meta name=&#34;twitter:image&#34;
      content=&#34;&lt;%= url_for(&#39;/images/logo.png&#39;)-&gt;to_abs %&gt;&#34;&gt;
&lt;meta name=&#34;twitter:image:alt&#34;
      content=&#34;Post::Text logo; a small nerdy anime girl giving a V sign&#34;&gt;
</code></pre>

<p>Well, what&#39;s it gunna be Discord? Make my day...</p>

<p><img src="https://i.snap.as/jGrP0PB5.png" alt="The same link to posttext.pl but now the image is large"/></p>

<h2>😳</h2>

<p>Alright then... It&#39;s got the site title from Open Graph... And the image from the stupid Twitter tags. I guess. Cool.</p>

<p>Well anyways that&#39;s done and <a href="https://posttext.pl">Post::Text</a> is finally live so I&#39;m happy. On to the next harebrained project! 🫡</p>

<p>P.S. I know it&#39;s been a while since I&#39;ve blogged, my last prediction is partially becoming true already 💀</p>

<p><a href="https://blog.swagg.net/tag:perl" class="hashtag"><span>#</span><span class="p-category">perl</span></a>
<a href="https://blog.swagg.net/tag:mojolicious" class="hashtag"><span>#</span><span class="p-category">mojolicious</span></a>
<a href="https://blog.swagg.net/tag:textboard" class="hashtag"><span>#</span><span class="p-category">textboard</span></a></p>
<ul><li><a href="https://www.swagg.net">Homepage</a></li>
<li><a href="https://codeberg.org/swaggboi">Code</a></li>
<li><a href="mailto:swaggboi@slackware.uk">Mail</a></li>
<li><a href="https://eattherich.club/@swaggboi">Social</a></li>
<li><a href="https://discord.gg/6MXVZKU">Chat</a></li></ul>
]]></content:encoded>
      <guid>https://blog.swagg.net/stupid-meta</guid>
      <pubDate>Thu, 08 Jun 2023 02:29:02 +0000</pubDate>
    </item>
  </channel>
</rss>