.finally understanding the promise chain
The value of Promises in Javascript cannot be overstated. They are used everywhere, helping to navigate the asynchronous maze that comes ...
JavaScript Async PromisesThe value of Promises in Javascript cannot be overstated. They are used everywhere, helping to navigate the asynchronous maze that comes ...
JavaScript Async PromisesIf you have been working with an icon set and noticed that your icons are not vertically centered, then you are not alone. I was working ...
CSS UI/UXWith the release of our CSS Framework, Platform UI, it might be fun to actually build something with it! At RitterIM, we have an interna...
CSS Frameworks Static SitesIt’s been a few years, several great people, an awesome company, and a cool thing we made 😀 Once upon a time, we had a mixed bag of fram...
CSS Frameworks RIMdevI’m a huge fan of animation on the web, especially when it comes to user interaction. A simple way to include such a thing on webpages is...
CSS SCSS JavaScript UI/UX frontendI dedicate this blog post to all the QA testers that expose all the flaws in my code. For a few years now I thought I had it all figured...
CSS SCSS Mobile UX UI/UX frontendOne of the perks being with Ritter, and on the dev team, is you can choose the hardware that makes you happy and productive! Team members...
macOS RIMdevAs a technical writer, I create software documentation. But many times, I find myself looking at in-product copy and wondering about cont...
Documentation Technical writing UX writing Content designDocs and contextual help We recently started a push towards integrating Docs content into our software platform. The goal is to pull in...
Documentation Hugo XML RSSHave you ever wanted to change the value of a Sass variable based on screen size, a state, or for any other reason that might require cha...
css SassEver been confused about naming a branch with Git? Looking for a good naming convention? Well, I might have an answer for you. I’m not sa...
GitHubWe often use GitHub to create a compare view, and list pull requests (PRs) for releases. However, GitHub limits the number of commits you...
Documentation GitHub GitUsing our Hugo-based documentation site, we typically publish release notes once per week. My usual process includes the following: M...
Documentation Hugo ArchetypesAs someone who basically gets by when it comes to writing Javascript, I tend to look at things from a “I bet I could do this with CSS” st...
CSS SCSS Mobile UX UI/UX frontendThis is an updated post of the original here. Whether you’re new to the frontend at RIMdev or looking for more about our Frontend team...
Team RIMdev FrontendIf you’ve ever worked in Azure Data Studio, you may find tab colors very useful. They allow you to visually separate different connectio...
Documentation Azure Data StudioIf you’re not familiar with Platform UI, it’s a utility rich CSS framework we created. As we look to migrate all of our apps and static ...
UI UX CSS SassGet ready to celebrate because, as of Friday, September 18, 2020, Evan You, creator of Vue.js, announced Vue 3 is officially released. He...
vue3 frontend developmentTypically with ASP.NET Core 3.1 when no specific authorization requirements are set all endpoints are publicly accessible. When you’re wo...
asp.net coreIf you have used slots in Vue, you know that it provides a clean way to vary content that is displayed in child components. For example, ...
VueJS Slots Scoped Slots JavaScriptSo much work has gone into rimdev.io, and we like to keep content fresh, or at least let you know you may be reading an old or outdated article. Enter the freshness scale.
Leading every article on rimdev.io is a heart rate icon (hover over it for our rating scale). Doesn’t seem that difficult, so how did we get there using Jekyll?
Get values for today
and posted
; subtract posted
from today
. If you’re new to liquid syntax, it’s the minus
pipe.
{% capture today %}{{ "now" | date: "%s" }}{% endcapture %}
{% capture posted %}{{ page.date | date: "%s" }}{% endcapture %}
{% capture freshness %}{{ today | minus: posted | date: "%s" | date: "%j" | floor }}{% endcapture %}
So this worked great, we had our freshness date, right? What about articles a post dated for the same day, today? Let’s see if they’re the same day of the year %j
(1-365). Note freshness | times: 1
, freshness
is a string until here.
{% capture compareToday %}{{ today | date: "%j" | floor }}{% endcapture %}
{% capture comparePosted %}{{ posted | date: "%j" | floor }}{% endcapture %}
{% if compareToday == comparePosted %}
{% assign freshness = 0 %}
{% else %}
{% assign freshness = freshness | times: 1 %}
{% endif %}
From here, we assigned classes to determine freshness, you can handle it how you see fit!
{% if freshness <= 30 %}
{% assign class = "new" %}
{% endif %}
{% if freshness > 31 and freshness < 190 %}
{% assign class = "old" %}
{% endif %}
{% if freshness > 191 and freshness < 364 %}
{% assign class = "stale" %}
{% endif %}
{% if freshness > 365 %}
{% assign class = "rubbish" %}
{% endif %}