Your sites Log in Sign up Menu

Developers

121 questions tagged ‘Developers’

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}} &#x21FE; {{/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}}">

Favicon and RSS feed icon?

Should the image being used as the favicon show up as the icon in an RSS reader app? In my RSS reader app, when I subscribe to my site, the placeholder is just the default "T" on a color background that the app uses for feeds that don't have a specified icon. Wondering if I need to set this explicitly in the feed.rss file in my template.

{{last}} is not defined inside {{archives}}

I know {{^last}}{{/last}} does work on Blot in principle, considering this question. However, it does not seem to work with {{#entries}}, even though some templates try to make use of it. Specifically, I am talking about the "Index" template, which tries to do the following on its archives.html part: {{#entries}} <a class="archive" href="{{{url}}}">{{title}}</a>{{^last}}&nbsp;&nbsp;·&nbsp;{{/last}} {{/entries}} In case of three posts in a single month, e. g. "abc", "def" and "ghi", I would expect the following to appear on the archives page: abc · def · ghi However, the {{^last}}{{/last}} block never seems to be executed, which leaves me with: abc def ghi (The spaces are probably added because of the line break in the HTML code.) I suspect that the items of {{#entries}} do not even have a last-property, which is why Mustache evaluates it to "false" (for all items)? Or is there some other problem? This happens with a freshly forked "Index" template, so I think it should work out of the box.

Is there a way to embed one text file within another one?

I have a snippet of text I would like to appear in multiple places around my site. Is there a way I can 'include' it in the content of pages or reference it directly from a custom template? I know I could create a partial within my template but I'm trying (for now) to keep content and structure seperate.

Previous 1 2 3 4 13 Next