Your sites Log in Sign up Menu

Developers

128 questions tagged ‘Developers’

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.

Adding an attribute to title on Archives page based on a tag?

On my main entries page, if a post is a link post I've updated the CSS to show a unicode arrow symbol after the title so people will know the title will take them to another location. I'm trying to achieve the same behavior on the archives page. This could be driven based on a tag value of 'linkpost'. Is this possible? Example of how it looks on main page (would like the same symbol to appear after the post title on archives based on a tag value being present):

Change the URL of tag index pages?

I'm creating an photography website with photos sorted by tags. But instead of tags, I want to use the term "album". Is is possible to change the url from https://example.com/tagged/france to https://example.com/album/france ? Thanks and keep up the good work with Blot!

Centering navigation on Blog template on mobile only?

I'm using a forked version of the Blog template for Tangible Life. I like the desktop layout with left and right justified elements, but they look odd on mobile size classes. How can I achieve a centered blog title, then Pages and Search/RSS icons centered below that on mobile only?

Redirect feed.xml to Blot's feed.rss?

Had my URL previously at micro.blog which uses feed.xml. So I tried various things including /feed.xml https://blog.mydomain.me/feed.rss with no luck. the feed.xml still returns a 404. Tried various other things but nothing works. Is this possible to redirect?

Previous 1 2 3 4 5 13 Next