Skip to content

Commit

Permalink
fix: accomodate lastChecked property (#556)
Browse files Browse the repository at this point in the history
Co-authored-by: Tanay Pant <tanaypantprotonmail.com>
  • Loading branch information
tanay1337 authored Aug 9, 2024
1 parent a6e9ca8 commit 0a1a0e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/scripts/getResourcesOg.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const updateResourceOg = async () => {
date: resource.date,
description: description.length > 197 ? description.slice(0, 197) + '...' : description,
tags: resource.tags,
image: og.ogImage[0]?.url
image: og.ogImage[0]?.url,
lastChecked: resource.lastChecked
}
})
)
Expand All @@ -46,7 +47,8 @@ const updateResourceOg = async () => {
tags: resource.tags,
...(!(parseInt(og.ogImage[0].height) < 60) && {
image: og.ogImage[0].url
})
}),
lastChecked: resource.lastChecked
}
})
)
Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/validateResources.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const validateResource = (resource, index, resources) => {
console.log(`Invalid YouTube URL`)
return false
}
if (!resource.lastChecked) {
console.log(`The last checked property is missing. If adding a new resource, please add today's date`)
return false
}
return true
}

Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Please open an [issue](https://github.com/safe-global/safe-docs/issues/new?assig
"date": "2023-10-09",
"tags": [
"Tutorial"
]
],
"lastChecked": "2023-10-09"
}
```
- Run `pnpm get-resources-og` to fetch open graph metadata for the new resource automatically.
Expand Down

0 comments on commit 0a1a0e6

Please sign in to comment.