Developers
135 questions tagged ‘Developers’
How to avoid showing the hamburger?
Hi! I'm using the Photo template, how can I avoid showing the menu nav hidden under the hamburger on mobile? And keep showing the links as I don't have too many. Thanks!
Template Sharing URL change?
If I share my current active template, does the URL break if I make additional changes to the template after the Share is initiated?
How to display the day of publication?
I have a template that presents entries by month and in that {{month}} {{year}} metadata works. But for each blog entry I want to include the day the blog was published. So if it was publised on the 20/4/2024 then just 20 would be returned. {{day}} would seem the logical construct but it does not work. I also can't find in the documentation where it says {{month}} & {{year}} are up to be used - if I could find that list, hopefully it might shed more light on all this. Thanks as ever.
Custom meta in feed.rss?
I've added custom meta to feed.rss without an issue before, but my recent attempt isn't working quite right. {{#metadata}} <figure> <figcaption>Listen:</figcaption> <audio controls src="{{audio}}"></audio> <a href="{{audio}}">Download audio</a> </figure> {{/metadata}} Where {{audio}} = the MP3's URL. The audio player is showing in the feed even when posts do not have {{audio}} custom meta data. Any suggestions?
Adding a tag-based indictor after {{Previous}} and {{Next}}
I use the following on the archives page to put a unicode arrow after a linkpost: <div class="column left"> <a href="{{{url}}}">{{title}} {{#tagged.linkpost}} ⇾ {{/tagged.linkpost}} </a> </div> I tried to use the same method within the Next and Previous sections shown below, but it showed the unicode arrow next to every post. My guess is that it's getting the Next/Previous values at pageload, but may not have visiblity to the tags for those entries to be able to handle what I'm trying to accomplish in the Previous and Next area. Is it possible? <div class="column rightpostfooter"> {{#tags}} <a class="small tag" href="/tagged/{{slug}}">{{name}} </a> {{/tags}}<br> {{#date}} <span class="small">{{date}}</span> {{/date}}<br> {{#next}} <a class="link" href="{{{url}}}"><span class="smalllink">{{title}}</span></a> {{/next}}<br> {{#previous}} <a class="link" href="{{{url}}}"><span class="smalllink">{{title}}</span></a> {{/previous}}<br> </div>
Adding ai.txt to my site?
Where would one put an ai.txt file on their site? Spawning.ai says to put it on the "root" of you website? Is that just the home folder of my site in dropbox? Thanks! https://spawning.ai/ai-txt
RSS feed title customization for specific tags?
I use the below code for putting a unicode arrow after a title on the archives page for linkposts. Is it possible to add a similar customization to the feed.rss template so that the title would get the arrow in RSS reader apps? I want folks consuming the RSS feed to know there's a linked post to go read beyond my comments. I also have a YAML value for linkpost, if that somehow works better for this use case than the tag value. {{#allEntries}} <div class="row"> <div class="column left"> <a href="{{{url}}}">{{title}} {{#tagged.linkpost}} ⇾ {{/tagged.linkpost}} </a> </div> <div class="column right"> <span class="smalldate">{{date}}</span> </div> </div> {{/allEntries}}
Hide specific posts in Previous section?
Is it possible to remove irrelevant posts that have different tag variables in the Previous and Next post sections? For instance, a post with the tag "dog" should not display any posts with the tag "cat" in the Previous section. Here is my current solution: {{#tagged.dog}} {{^tagged.cat}} {{previous}} {{/tagged.cat}} {{/tagged.dog}} However, this only solves half of the problem. If the previous post had the "cat" tag, then there will be a blank space in the Previous section. This is because it is a linear filter rather than an iteration loop. I'm looking for a better approach that not only blocks out irrelevant posts but also shows previous posts with the same tag.
Hide images on home but show on tagged page?
Hi! I'd like to set up a "stream" page that just shows inspirational images that I collect and drop into a folder. Ideally these images only appear on the stream page and not on the home page. How can I accomplish this?
Is there a Mustache template key for the request URL path available?
I'm looking to integrate GoatCounter's tracking pixel: https://www.goatcounter.com/help/pixel Per their docs, this looks like: <img src="https://MYCODE.goatcounter.com/count?p=/url-goes-here"> I'd like to be able to use Blot's existing templating logic to do something like: <img src="https://MYCODE.goatcounter.com/count?p=/{{req.url.path}}">