diff --git a/lambdas/src/libs/airtable.ts b/lambdas/src/libs/airtable.ts index fa3ce7d..30f6b1b 100644 --- a/lambdas/src/libs/airtable.ts +++ b/lambdas/src/libs/airtable.ts @@ -24,40 +24,13 @@ export const getAllAirtablePackages = async (): Promise => { 'version', 'last_modified', 'full_name', + 'dl_count', ]), maintainer: record.fields?.maintainer || '', desc: record.fields?.desc || '', thumb_image_url: _.get(record.fields, 'thumb_image[0].url', '/Images/package-thumb-nolabel3.jpg') } as AirtablePackage; }); - /** - * // SAMPLE RECORD SHAPE w/ thumb_image is uploaded - { - slug: 'unicode_org', - name: 'unicode.org', - full_name: 'unicode.org', - homepage: 'https://unicode.org', - version: '71.1.1', - last_modified: '2022-09-26T19:46:25.000Z', - thumb_image: [ - { - id: 'attQVgaRUXOYinsWy', - width: 640, - height: 534, - url: 'https://dl.airtable.com/.attachments/f2465c36a0060919368e2f53305694f9/cfab76a8/gen-art-1.png', - filename: 'gen-art-1.png', - size: 184878, - type: 'image/png', - thumbnails: [Object] - } - ] - } - TODO IMAGE UPLOAD to S3/CDN: - if thumb_image_url is empty - get thumb_image data - upload to s3 - update thumb_image_url in airtable - */ return packages; } @@ -73,6 +46,7 @@ export const insertPackagesToAirtable = async (newPackages: Partial & { diff --git a/src/data/packages.json b/src/data/packages.json index 46cadfe..a9a8304 100644 --- a/src/data/packages.json +++ b/src/data/packages.json @@ -7,7 +7,9 @@ "version": "2.5.1", "installs": 3986221, "maintainer": "", - "thumb_image_url": "/Images/package-thumb-nolabel.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel.jpg", + "dl_count": 1, + "last_modified": "2022-09-26T19:46:25.000Z" }, { "name": "svg2png", @@ -17,7 +19,9 @@ "version": "0.1.3", "installs": 1233, "maintainer": "pascal", - "thumb_image_url": "/Images/package-thumb-nolabel4.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel4.jpg", + "dl_count": 2, + "last_modified": "2022-09-30T15:39:15.000Z" }, { "name": "cmake", @@ -27,7 +31,9 @@ "version": "3.24.2", "installs": 1729267, "maintainer": "pascal", - "thumb_image_url": "/Images/package-thumb-nolabel3.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel3.jpg", + "dl_count": 3, + "last_modified": "2022-09-27:39:15.000Z" }, { "name": "h2c", @@ -37,7 +43,9 @@ "version": "1.0", "installs": 96, "maintainer": "h2o", - "thumb_image_url": "/Images/package-thumb-nolabel.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel.jpg", + "dl_count": 4, + "last_modified": "2022-09-25:39:15.000Z" }, { "name": "libmagic", @@ -47,7 +55,9 @@ "version": "5.43", "installs": 162436, "maintainer": "", - "thumb_image_url": "/Images/package-thumb-nolabel3.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel3.jpg", + "dl_count": 5, + "last_modified": "2022-09-24:39:15.000Z" }, { "name": "deno", @@ -57,7 +67,9 @@ "version": "1.26.1", "installs": 204033, "maintainer": "Ryan Dahl", - "thumb_image_url": "/Images/package-thumb-nolabel2.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel2.jpg", + "dl_count": 6, + "last_modified": "2022-09-23:39:15.000Z" }, { "name": "fontconfig", @@ -67,7 +79,9 @@ "version": "2.14.0", "installs": 2485083, "maintainer": "Max Miedinger", - "thumb_image_url": "/Images/package-thumb-nolabel.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel.jpg", + "dl_count": 7, + "last_modified": "2022-09-22:39:15.000Z" }, { "name": "pkg-config", @@ -77,7 +91,9 @@ "version": "0.29.2", "installs": 2634164, "maintainer": "pascal", - "thumb_image_url": "/Images/package-thumb-nolabel4.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel4.jpg", + "dl_count": 8, + "last_modified": "2022-09-21:39:15.000Z" }, { "name": "shared-mime-info", @@ -87,7 +103,9 @@ "version": "2.2", "installs": 642619, "maintainer": "Mr.Mime", - "thumb_image_url": "/Images/package-thumb-nolabel3.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel3.jpg", + "dl_count": 9, + "last_modified": "2022-09-21:39:15.000Z" }, { "name": "ttfautohint", @@ -97,7 +115,9 @@ "version": "1.8.4", "installs": 4696, "maintainer": "pascal", - "thumb_image_url": "/Images/package-thumb-nolabel.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel.jpg", + "dl_count": 10, + "last_modified": "2022-09-20:39:15.000Z" }, { "name": "numactl", @@ -107,7 +127,9 @@ "version": "2.0.16", "installs": 1120, "maintainer": "FSS", - "thumb_image_url": "/Images/package-thumb-nolabel2.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel2.jpg", + "dl_count": 11, + "last_modified": "2022-09-19:39:15.000Z" }, { "name": "flex", @@ -117,6 +139,8 @@ "version": "2.6.4", "installs": 35001, "maintainer": "", - "thumb_image_url": "/Images/package-thumb-nolabel4.jpg" + "thumb_image_url": "/Images/package-thumb-nolabel4.jpg", + "dl_count": 12, + "last_modified": "2022-09-18:39:15.000Z" } ] \ No newline at end of file diff --git a/src/layouts/partials/package-thumbnail.html b/src/layouts/partials/package-thumbnail.html index e7bdd7d..fd9d023 100644 --- a/src/layouts/partials/package-thumbnail.html +++ b/src/layouts/partials/package-thumbnail.html @@ -1,4 +1,4 @@ -
+
{{- .name -}}