GeezerVison is showing github.com — feat(sponsors): add social accounts to sponsor schema, Sanity sync, a… · CodingCatDev/codingcat.dev@fdc0417
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/deploy.yml +8-4Lines changed: 8 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 42 | 42 | path: /tmp/sanity-production-backup.ndjson.gz | 43 | 43 | retention-days: 30 | 44 | 44 |
| 45 | | - - name: Sync Enriched Guest Socials to Sanity Dataset | 46 | | - run: node apps/sanity/scripts/sync-guest-socials.mjs | | 45 | + - name: Sync Enriched Guest & Sponsor Socials to Sanity Dataset | | 46 | + run: | | | 47 | + node apps/sanity/scripts/sync-guest-socials.mjs | | 48 | + node apps/sanity/scripts/sync-sponsor-socials.mjs | 47 | 49 | env: | 48 | 50 | SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }} | 49 | 51 | SANITY_API_WRITE_TOKEN: ${{ secrets.SANITY_API_WRITE_TOKEN }} | @@ -235,8 +237,10 @@ jobs: | 235 | 237 | path: /tmp/sanity-production-backup.ndjson.gz | 236 | 238 | retention-days: 30 | 237 | 239 |
| 238 | | - - name: Sync Enriched Guest Socials to Sanity Dataset | 239 | | - run: node apps/sanity/scripts/sync-guest-socials.mjs | | 240 | + - name: Sync Enriched Guest & Sponsor Socials to Sanity Dataset | | 241 | + run: | | | 242 | + node apps/sanity/scripts/sync-guest-socials.mjs | | 243 | + node apps/sanity/scripts/sync-sponsor-socials.mjs | 240 | 244 | env: | 241 | 245 | SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }} | 242 | 246 | SANITY_API_WRITE_TOKEN: ${{ secrets.SANITY_API_WRITE_TOKEN }} | |
Collapse file Copy file name to clipboardExpand all lines: apps/sanity/extract.json +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3777 | 3777 | }, | 3778 | 3778 | "optional": true | 3779 | 3779 | }, | | 3780 | + "socials": { | | 3781 | + "type": "objectAttribute", | | 3782 | + "value": { | | 3783 | + "type": "inline", | | 3784 | + "name": "socials" | | 3785 | + }, | | 3786 | + "optional": true | | 3787 | + }, | 3780 | 3788 | "url": { | 3781 | 3789 | "type": "objectAttribute", | 3782 | 3790 | "value": { | |
Collapse file Copy file name to clipboardExpand all lines: apps/sanity/schemas/documents/sponsor.ts +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,14 +2,22 @@ import { PiCurrencyDollarSimpleFill } from "react-icons/pi"; | 2 | 2 | import { defineField, defineType } from "sanity"; | 3 | 3 |
| 4 | 4 | import baseType from "../partials/base"; | | 5 | +import { socialsField } from "../partials/user"; | 5 | 6 |
| 6 | 7 | export default defineType({ | 7 | 8 | name: "sponsor", | 8 | 9 | title: "Sponsor", | 9 | 10 | icon: PiCurrencyDollarSimpleFill, | 10 | 11 | type: "document", | | 12 | + groups: [ | | 13 | + { | | 14 | + name: "socials", | | 15 | + title: "Social Links", | | 16 | + }, | | 17 | + ], | 11 | 18 | fields: [ | 12 | 19 | ...baseType.fields, | | 20 | + socialsField, | 13 | 21 | defineField({ | 14 | 22 | title: "Partner Landing / Tracking Link", | 15 | 23 | name: "url", | |
Collapse file Copy file name to clipboardExpand all lines: apps/sanity/schemas/partials/user.ts +94-92Lines changed: 94 additions & 92 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3,6 +3,99 @@ import { defineField, defineType } from "sanity"; | 3 | 3 | import baseType from "./base"; | 4 | 4 | import externalLink from "../custom/externalLink"; | 5 | 5 |
| | 6 | +export const socialsField = defineField({ | | 7 | + name: "socials", | | 8 | + title: "Social Links", | | 9 | + type: "object", | | 10 | + group: "socials", | | 11 | + fields: [ | | 12 | + defineField({ | | 13 | + name: "bluesky", | | 14 | + type: "string", | | 15 | + }), | | 16 | + defineField({ | | 17 | + name: "codepen", | | 18 | + type: "string", | | 19 | + }), | | 20 | + defineField({ | | 21 | + name: "devto", | | 22 | + type: "string", | | 23 | + }), | | 24 | + defineField({ | | 25 | + name: "discord", | | 26 | + type: "string", | | 27 | + }), | | 28 | + defineField({ | | 29 | + name: "dribble", | | 30 | + type: "string", | | 31 | + }), | | 32 | + defineField({ | | 33 | + name: "facebook", | | 34 | + type: "string", | | 35 | + }), | | 36 | + defineField({ | | 37 | + name: "github", | | 38 | + type: "string", | | 39 | + }), | | 40 | + defineField({ | | 41 | + name: "instagram", | | 42 | + type: "string", | | 43 | + }), | | 44 | + defineField({ | | 45 | + name: "lastfm", | | 46 | + type: "string", | | 47 | + }), | | 48 | + defineField({ | | 49 | + name: "linkedin", | | 50 | + type: "string", | | 51 | + }), | | 52 | + defineField({ | | 53 | + name: "email", | | 54 | + type: "string", | | 55 | + }), | | 56 | + defineField({ | | 57 | + name: "mastodon", | | 58 | + type: "string", | | 59 | + }), | | 60 | + defineField({ | | 61 | + name: "medium", | | 62 | + type: "string", | | 63 | + }), | | 64 | + defineField({ | | 65 | + name: "polywork", | | 66 | + type: "string", | | 67 | + }), | | 68 | + defineField({ | | 69 | + name: "stackoverflow", | | 70 | + type: "string", | | 71 | + }), | | 72 | + defineField({ | | 73 | + name: "substack", | | 74 | + type: "string", | | 75 | + }), | | 76 | + defineField({ | | 77 | + name: "threads", | | 78 | + type: "string", | | 79 | + }), | | 80 | + defineField({ | | 81 | + name: "tiktok", | | 82 | + type: "string", | | 83 | + }), | | 84 | + defineField({ | | 85 | + name: "twitch", | | 86 | + type: "string", | | 87 | + }), | | 88 | + defineField({ | | 89 | + name: "twitter", | | 90 | + type: "string", | | 91 | + }), | | 92 | + defineField({ | | 93 | + name: "youtube", | | 94 | + type: "string", | | 95 | + }), | | 96 | + ], | | 97 | +}); | | 98 | + | 6 | 99 | const content = defineType({ | 7 | 100 | ...baseType, | 8 | 101 | name: "content", | @@ -15,98 +108,7 @@ const content = defineType({ | 15 | 108 | ], | 16 | 109 | fields: [ | 17 | 110 | ...baseType.fields, | 18 | | - defineField({ | 19 | | - name: "socials", | 20 | | - title: "Social Links", | 21 | | - type: "object", | 22 | | - group: "socials", | 23 | | - fields: [ | 24 | | - defineField({ | 25 | | - name: "bluesky", | 26 | | - type: "string", | 27 | | - }), | 28 | | - defineField({ | 29 | | - name: "codepen", | 30 | | - type: "string", | 31 | | - }), | 32 | | - defineField({ | 33 | | - name: "devto", | 34 | | - type: "string", | 35 | | - }), | 36 | | - defineField({ | 37 | | - name: "discord", | 38 | | - type: "string", | 39 | | - }), | 40 | | - defineField({ | 41 | | - name: "dribble", | 42 | | - type: "string", | 43 | | - }), | 44 | | - defineField({ | 45 | | - name: "facebook", | 46 | | - type: "string", | 47 | | - }), | 48 | | - defineField({ | 49 | | - name: "github", | 50 | | - type: "string", | 51 | | - }), | 52 | | - defineField({ | 53 | | - name: "instagram", | 54 | | - type: "string", | 55 | | - }), | 56 | | - defineField({ | 57 | | - name: "lastfm", | 58 | | - type: "string", | 59 | | - }), | 60 | | - defineField({ | 61 | | - name: "linkedin", | 62 | | - type: "string", | 63 | | - }), | 64 | | - defineField({ | 65 | | - name: "email", | 66 | | - type: "string", | 67 | | - }), | 68 | | - defineField({ | 69 | | - name: "mastodon", | 70 | | - type: "string", | 71 | | - }), | 72 | | - defineField({ | 73 | | - name: "medium", | 74 | | - type: "string", | 75 | | - }), | 76 | | - defineField({ | 77 | | - name: "polywork", | 78 | | - type: "string", | 79 | | - }), | 80 | | - defineField({ | 81 | | - name: "stackoverflow", | 82 | | - type: "string", | 83 | | - }), | 84 | | - defineField({ | 85 | | - name: "substack", | 86 | | - type: "string", | 87 | | - }), | 88 | | - defineField({ | 89 | | - name: "threads", | 90 | | - type: "string", | 91 | | - }), | 92 | | - defineField({ | 93 | | - name: "tiktok", | 94 | | - type: "string", | 95 | | - }), | 96 | | - defineField({ | 97 | | - name: "twitch", | 98 | | - type: "string", | 99 | | - }), | 100 | | - defineField({ | 101 | | - name: "twitter", | 102 | | - type: "string", | 103 | | - }), | 104 | | - defineField({ | 105 | | - name: "youtube", | 106 | | - type: "string", | 107 | | - }), | 108 | | - ], | 109 | | - }), | | 111 | + socialsField, | 110 | 112 | defineField({ | 111 | 113 | name: "websites", | 112 | 114 | title: "Websites", | |
|