Skip to content

Commit b3b06cf

Browse files
author
Sergei Orlow
committed
✨ Update og image template
1 parent 1f78c39 commit b3b06cf

File tree

12 files changed

+89
-25
lines changed

12 files changed

+89
-25
lines changed

assets/img/og.jpg

-77.7 KB
Binary file not shown.

content/2021/04/recurring-dates-in-notion-for-real/hero.jpg renamed to content/2021/04/automatically-recurring-dates-in-notion/hero.jpg

File renamed without changes.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: 'Automatically recurring dates in Notion'
3+
date: '2021-04-08'
4+
tags:
5+
- productivity
6+
- time-management
7+
- notion
8+
song: 'https://music.apple.com/ru/album/love-is-madness-feat-halsey/1440900559?i=1440900578&l=en'
9+
image: './hero.jpg'
10+
imageAlt: 'Brett Jordan (Unsplash)'
11+
description: "You can get your tasks to automatically recur - you set the interval, the formula does the rest. Here's how."
12+
featured: true
13+
published: false
14+
imageShare: './og-image.png'
15+
---
16+
17+
One of the features Notion notoriously lacks is recurring dates. There are multiple ways to mimic this behaviour, and in this article I'll share the one I find the most complete and informative.
18+
19+
[TL;DR 👇](#tldr)
20+
21+
To do this, we need a formula that and a bit of Maths. We'll take the date when recursion begins, and assign an interval at which it recurs. We'll then add a formula property, that will provide the next date recursion should happen, skipping all occurrencies in the past. I.e.:
22+
23+
> If the task started on Feb **1 2021**, it repeats **biweekly**, and today is **Apr 13 2021** - the next occurrence is going to be on **Apr 26 2021**.
24+
>
25+
> - ~~Feb 01 2021~~
26+
> - ~~Feb 15 2021~~
27+
> - ~~Mar 01 2021~~
28+
> - ~~Mar 15 2021~~
29+
> - ~~Mar 29 2021~~
30+
> - ~~Apr 12 2021~~
31+
> - Apr 26 2021
32+
33+
To make it work this way, we need subtract
34+
35+
## TL;DR
36+
37+
1. Create a date property called "Date"
38+
2. Create a formula property called "Due"
39+
3. Put this to the "Due" formula:
40+
41+
```excel
42+
if(now() > prop("End Date"), prop("End Date"), if(prop("Status") == "Done!", prop("Date"), if(not empty("Repeat") and prop("Date") > now(), prop("Date"), if(prop("Repeat") == "Daily", dateAdd(prop("Date"), floor(floor((timestamp(now()) - timestamp(prop("Date"))) / 86400000) / 1) * 1 + 1, "days"), if(prop("Repeat") == "Weekly", dateAdd(prop("Date"), floor(floor((timestamp(now()) - timestamp(prop("Date"))) / 86400000) / 7) * 7 + 7, "days"), if(prop("Repeat") == "Biweekly", dateAdd(prop("Date"), floor(floor((timestamp(now()) - timestamp(prop("Date"))) / 86400000) / 14) * 14 + 14, "days"), if(prop("Repeat") == "Monthly", if(dateAdd(dateAdd(prop("Date"), year(now()) - year(prop("Date")), "years"), month(now()) - month(prop("Date")), "months") < now(), dateAdd(dateAdd(prop("Date"), year(now()) - year(prop("Date")), "years"), month(now()) - month(prop("Date")) + 1, "months"), dateAdd(dateAdd(prop("Date"), year(now()) - year(prop("Date")), "years"), month(now()) - month(prop("Date")), "months")), if(prop("Repeat") == "Quarterly", if(dateAdd(dateAdd(dateAdd(prop("Date"), round((month(now()) - month(prop("Date"))) / 3) * 3, "months"), year(now()) - year(prop("Date")), "years"), 24, "hours") < now(), dateAdd(dateAdd(prop("Date"), round((month(now()) - month(prop("Date"))) / 3) * 3 + 3, "months"), year(now()) - year(prop("Date")), "years"), dateAdd(dateAdd(prop("Date"), round((month(now()) - month(prop("Date"))) / 3) * 3, "months"), year(now()) - year(prop("Date")), "years")), if(contains(prop("Repeat"), "Semi-annually"), if(dateAdd(dateAdd(dateAdd(prop("Date"), round((month(now()) - month(prop("Date"))) / 6) * 6, "months"), year(now()) - year(prop("Date")), "years"), 24, "hours") < now(), dateAdd(dateAdd(prop("Date"), round((month(now()) - month(prop("Date"))) / 6) * 6 + 6, "months"), year(now()) - year(prop("Date")), "years"), dateAdd(dateAdd(prop("Date"), round((month(now()) - month(prop("Date"))) / 6) * 6, "months"), year(now()) - year(prop("Date")), "years")), if(contains(prop("Repeat"), "Annually"), if(dateAdd(dateAdd(prop("Date"), year(now()) - year(prop("Date")), "years"), 24, "hours") < now(), dateAdd(prop("Date"), year(now()) - year(prop("Date")) + 1, "years"), dateAdd(prop("Date"), year(now()) - year(prop("Date")), "years")), prop("Date")))))))))))
43+
```
417 KB
Loading

content/2021/04/recurring-dates-in-notion-for-real/index.md

Lines changed: 0 additions & 19 deletions
This file was deleted.
-114 KB
Binary file not shown.

gatsby-config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ module.exports = {
6969
'gatsby-remark-autolink-headers',
7070
'gatsby-plugin-catch-links',
7171
'gatsby-remark-embedder',
72+
{
73+
resolve: `gatsby-remark-katex`,
74+
options: {
75+
// Add any KaTeX options from https://github.com/KaTeX/KaTeX/blob/master/docs/options.md here
76+
strict: `ignore`,
77+
},
78+
},
7279
{
7380
resolve: 'gatsby-remark-highlight-code',
7481
options: {

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@
7979
"gatsby-remark-external-links": "^0.0.4",
8080
"gatsby-remark-highlight-code": "^2.2.0",
8181
"gatsby-remark-images": "^4.0.0",
82+
"gatsby-remark-katex": "^4.2.0",
8283
"gatsby-source-filesystem": "^3.0.0",
8384
"gatsby-transformer-remark": "^3.0.0",
8485
"gatsby-transformer-sharp": "^3.0.0",
86+
"katex": "^0.13.2",
8587
"postcss": "^8.2.9",
8688
"react": "^17.0.1",
8789
"react-dom": "^17.0.1",
-2.39 MB
Binary file not shown.

scripts/preview-images.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ const main = async () => {
6363
const destinationFile = join(file.directory, `og-image.png`)
6464

6565
if (file['generate-card'] !== false && !existsSync(destinationFile)) {
66-
await takeScreenshot(`${baseUrl}${file.slug}/image_share`, 1200, 630, destinationFile)
66+
await takeScreenshot(
67+
`${baseUrl}${file.directory.split('/content/')[1]}/image_share`,
68+
1200,
69+
630,
70+
destinationFile,
71+
)
6772
console.log(`Created ${destinationFile}`)
6873
}
6974
}

0 commit comments

Comments
 (0)