A CLI for publishing standard.site documents to ATProto sequoia.pub
standard site lexicon cli publishing

feat: add option to disable publishing (text) content #40

merged opened by willow.sh targeting main from willow.sh/sequoia: disable-text-content

Adds an option to disable publishing the text content since it may not be desired - defaults to true since that's the current behavior.

PR is dependent on #39 because of the json schema changes, so maybe best to look at that first

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:dfkjiu36xs6ogt7pux7i7o2b/sh.tangled.repo.pull/3mgemcc6tsb22
+23 -94
Interdiff #1 โ†’ #2
+22 -3
docs/docs/pages/config.mdx
··· 1 - import ConfigTable from '../../src/lib/ConfigTable.tsx' 2 - 3 1 # Configuration Reference 4 2 5 3 ## `sequoia.json` 6 4 5 + | Field | Type | Required | Default | Description | 6 + |-------|------|----------|---------|-------------| 7 + | `siteUrl` | `string` | Yes | - | Base URL of your website | 8 + | `contentDir` | `string` | Yes | - | Directory containing blog post files | 9 + | `publicationUri` | `string` | Yes | - | AT-URI of your publication record | 10 + | `imagesDir` | `string` | No | - | Directory containing cover images | 11 + | `publicDir` | `string` | No | `"./public"` | Static folder for `.well-known` files | 12 + | `outputDir` | `string` | No | - | Built output directory for inject command | 13 + | `pathPrefix` | `string` | No | `"/posts"` | URL path prefix for posts | 14 + | `pdsUrl` | `string` | No | `"https://bsky.social"` | PDS server URL, generated automatically | 15 + | `identity` | `string` | No | - | Which stored identity to use | 16 + | `frontmatter` | `object` | No | - | Custom frontmatter field mappings | 17 + | `frontmatter.slugField` | `string` | No | - | Frontmatter field to use for slug (defaults to filepath) | 18 + | `ignore` | `string[]` | No | - | Glob patterns for files to ignore | 19 + | `removeIndexFromSlug` | `boolean` | No | `false` | Remove `/index` or `/_index` suffix from slugs | 20 + | `stripDatePrefix` | `boolean` | No | `false` | Remove `YYYY-MM-DD-` date prefixes from slugs (Jekyll-style) | 21 + | `pathTemplate` | `string` | No | - | URL path template with tokens (overrides `pathPrefix` + slug) | 22 + | `bluesky` | `object` | No | - | Bluesky posting configuration | 23 + | `bluesky.enabled` | `boolean` | No | `false` | Post to Bluesky when publishing documents (also enables [comments](/comments)) | 24 + | `bluesky.maxAgeDays` | `number` | No | `30` | Only post documents published within this many days | 25 + | `ui` | `object` | No | - | UI components configuration | 26 + | `ui.components` | `string` | No | `"src/components"` | Directory where UI components are installed | 7 - <ConfigTable /> 8 27 9 28 ### Example 10 29
-1
docs/sequoia.json
··· 1 1 { 2 - "$schema": "../sequoia.schema.json", 3 2 "siteUrl": "https://sequoia.pub", 4 3 "contentDir": "docs/pages/blog", 5 4 "imagesDir": "docs/public",
-88
docs/src/lib/ConfigTable.tsx
··· 1 - import schema from "../../../sequoia.schema.json" with { type: "json" }; 2 - 3 - type PropertyInfo = { 4 - path: string; 5 - type: string; 6 - required: boolean; 7 - default?: string | number | boolean; 8 - description?: string; 9 - }; 10 - 11 - function extractProperties( 12 - properties: Record<string, unknown>, 13 - required: string[], 14 - parentPath: string, 15 - result: PropertyInfo[], 16 - ): void { 17 - for (const [key, value] of Object.entries(properties)) { 18 - const prop = value as Record<string, unknown>; 19 - const fullPath = parentPath ? `${parentPath}.${key}` : key; 20 - const isRequired = required.includes(key); 21 - 22 - if (prop.properties) { 23 - extractProperties( 24 - prop.properties as Record<string, unknown>, 25 - (prop.required as string[]) || [], 26 - fullPath, 27 - result, 28 - ); 29 - } else { 30 - result.push({ 31 - path: fullPath, 32 - type: prop.type, 33 - required: isRequired, 34 - default: prop.default, 35 - description: prop.description, 36 - } as PropertyInfo); 37 - } 38 - } 39 - } 40 - 41 - export default function ConfigTable() { 42 - const rows: PropertyInfo[] = []; 43 - extractProperties( 44 - schema.properties as Record<string, unknown>, 45 - schema.required as string[], 46 - "", 47 - rows, 48 - ); 49 - 50 - return ( 51 - <table className="vocs_Table"> 52 - <thead> 53 - <tr className="vocs_TableRow"> 54 - <th className="vocs_TableHeader">Field</th> 55 - <th className="vocs_TableHeader">Type</th> 56 - <th className="vocs_TableHeader">Required</th> 57 - <th className="vocs_TableHeader">Default</th> 58 - <th className="vocs_TableHeader">Description</th> 59 - </tr> 60 - </thead> 61 - <tbody> 62 - {rows.map((row) => ( 63 - <tr key={row.path} className="vocs_TableRow"> 64 - <td className="vocs_TableCell"> 65 - <code className="vocs_Code">{row.path}</code> 66 - </td> 67 - <td className="vocs_TableCell"> 68 - <code className="vocs_Code">{row.type}</code> 69 - </td> 70 - <td className="vocs_TableCell">{row.required ? "Yes" : ""}</td> 71 - <td className="vocs_TableCell"> 72 - {row.default === undefined ? ( 73 - "-" 74 - ) : ( 75 - <code className="vocs_Code"> 76 - {typeof row.default === "string" 77 - ? `"${row.default}"` 78 - : `${row.default}`} 79 - </code> 80 - )} 81 - </td> 82 - <td className="vocs_TableCell">{row.description || "โ€”"}</td> 83 - </tr> 84 - ))} 85 - </tbody> 86 - </table> 87 - ); 88 - }
+1 -2
packages/cli/package.json
··· 7 7 }, 8 8 "files": [ 9 9 "dist", 10 + "README.md" 10 - "README.md", 11 - "sequoia.schema.json" 12 11 ], 13 12 "main": "./dist/index.js", 14 13 "exports": {
packages/cli/src/commands/init.ts

This file has not been changed.

packages/cli/src/commands/update.ts

This file has not been changed.

packages/cli/src/lib/atproto.ts

This file has not been changed.

packages/cli/src/lib/config.ts

This patch was likely rebased, as context lines do not match.

packages/cli/src/lib/types.ts

This file has not been changed.

sequoia.schema.json

Failed to calculate interdiff for this file.

History

3 rounds 5 comments
sign up or login to add to the discussion
1 commit
expand
feat: add option to disable publishing (text) content
expand 2 comments

@stevedylan.dev merged conflicts fixed - the only issue I can foresee is that the diff checking system when you publish isn't aware of this field. We could fix that or I could open a PR that makes the diff system "simpler" by essentially building the site.standard.document for each post and then comparing that with the published site.standard.document for the post to see if there is a difference. That way it should catch any changes that it's currently missing. WDYT?

Good catch! I think a separate PR with your solution would work great. Will go ahead and merge this!

pull request successfully merged
2 commits
expand
feat: add json schema
feat: add option to disable publishing (text) content
expand 1 comment

Iโ€™ve had the in the back of my head; thank you for carrying it out! For some reason Tangled is saying there is some merge conflicts due to the last PR, so happy to merge once it gets cleared up!

2 commits
expand
feat: add json schema
feat: add option to disable publishing (text) content
expand 2 comments