{"id":17765760,"url":"https://github.com/brianpetro/custom-quartz","last_synced_at":"2025-04-01T13:43:59.410Z","repository":{"id":259521458,"uuid":"878059948","full_name":"brianpetro/custom-quartz","owner":"brianpetro","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-12T01:14:23.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T08:48:53.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianpetro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-24T17:54:07.000Z","updated_at":"2024-12-12T01:14:27.000Z","dependencies_parsed_at":"2024-10-26T06:50:53.126Z","dependency_job_id":"91ca557b-9aff-4ecb-b2c5-cf60fb7ebd3d","html_url":"https://github.com/brianpetro/custom-quartz","commit_stats":null,"previous_names":["brianpetro/custom-quartz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpetro%2Fcustom-quartz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpetro%2Fcustom-quartz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpetro%2Fcustom-quartz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpetro%2Fcustom-quartz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianpetro","download_url":"https://codeload.github.com/brianpetro/custom-quartz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246651504,"owners_count":20811991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T20:16:43.793Z","updated_at":"2025-04-01T13:43:59.386Z","avatar_url":"https://github.com/brianpetro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Custom Quartz Components (setup)\n\n## 1. Create symbolic links to the custom components directory adjacent to your `content` and `quartz` folders.\n\nWindows example:\n```bash\nmklink /D \"C:\\Users\\brian\\Documents\\docs.sc\\custom-quartz\" \"C:\\Users\\brian\\Documents\\custom-quartz\"\n```\n\nMacOS example:\n```bash\nln -s \"/Users/brian/Documents/custom-quartz\" \"/Users/brian/Documents/docs.sc/custom-quartz\"\n```\n\n## 2. Add `preserveSymlinks: true,` to `handleBuild()` in `cli/handlers.js`\n\n```diff\nexport async function handleBuild(argv) {\n  console.log(chalk.bgGreen.black(`\\n Quartz v${version} \\n`))\n  const ctx = await esbuild.context({\n    entryPoints: [fp],\n    outfile: cacheFile,\n    bundle: true,\n    keepNames: true,\n    minifyWhitespace: true,\n    minifySyntax: true,\n    platform: \"node\",\n    format: \"esm\",\n    jsx: \"automatic\",\n    jsxImportSource: \"preact\",\n    packages: \"external\",\n+   preserveSymlinks: true,\n```\n\n# CustomHead.tsx - Added Structured Data Support in Quartz\n\nThis component automatically adds structured data (`JSON-LD`) to the page's `\u003chead\u003e` tag. It uses the page's frontmatter and content to populate key SEO-related fields, including support for FAQ structured data. This document outlines the frontmatter options and content parsing that the component uses to create structured data.\n\n## Frontmatter Options\n\nThe following frontmatter properties influence the structured data output:\n\n**`title`**\n- **Type**: `string`\n- **Description**: The title of the content, used in structured data for `headline` and `og:title`.\n- **Fallback**: Uses locale-specific default title from i18n configuration.\n\n**`description`**\n- **Type**: `string`\n- **Description**: A description of the content, used for the `description` and `og:description` fields.\n- **Fallback**: Uses locale-specific default description from i18n configuration.\n\n**`date`**\n- **Type**: `string` (ISO 8601 date format)\n- **Description**: The date the content was originally published.\n- **Fallback**: Field is omitted if not provided.\n\n**`dateModified`**\n- **Type**: `string` (ISO 8601 date format)\n- **Description**: The date the content was last modified.\n- **Fallback**: Uses `lastModified` from file metadata.\n\n**`author`**\n- **Type**: `string`\n- **Description**: The name of the author of the content. Generates a Person schema type.\n- **Fallback**: Field is omitted if not provided.\n\n**`type`**\n- **Type**: `string` (Schema.org types)\n- **Description**: Specifies the Schema.org type of the page.\n- **Default**: `\"WebPage\"`\n- **Example**: `type: \"BlogPosting\"`\n\n**`keywords`**\n- **Type**: `string[]`\n- **Description**: An array of keywords that get joined with commas in the structured data.\n- **Example**: `keywords: [\"obsidian\", \"note-taking\", \"productivity\"]`\n\n**`articleSection`**\n- **Type**: `string`\n- **Description**: The section of the article.\n- **Example**: `articleSection: \"Technology\"`\n\n**`ogImage`**\n- **Type**: `string`\n- **Description**: Path to the Open Graph image for the page.\n- **Fallback**: Uses `/static/og-image.png`\n\n## FAQ Structured Data\n\n### Automatic Extraction of Q\u0026A Pairs\n\nThe `CustomHead.tsx` component can automatically extract question and answer pairs from your content to generate FAQ structured data. It does this by parsing the content for headings that end with a question mark (`?`) and considers the subsequent content as the answer.\n\n#### How It Works\n\n- **Question Identification**: Any heading (`h1` to `h6`) that ends with a question mark is identified as a question.\n- **Answer Content**: The content following the question heading, up until the next question heading or end of the document, is considered the answer.\n- **FAQ Schema Generation**: The extracted Q\u0026A pairs are formatted according to the [FAQPage schema](https://schema.org/FAQPage) and included in the page's structured data.\n\n#### Example Content\n\n```markdown\n# How do I install the Smart Connections plugin?\n\nTo install the Smart Connections plugin, navigate to the plugin marketplace and search for \"Smart Connections.\" Click \"Install\" and then \"Enable.\"\n\n# What features does the Smart Connections plugin offer?\n\nThe plugin offers features such as automatic linking, backlink management, and enhanced search capabilities to improve your productivity.\n```\n\n#### Generated FAQ Structured Data Example\n\n```json\n{\n  \"@context\": \"https://schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How do I install the Smart Connections plugin?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"To install the Smart Connections plugin, navigate to the plugin marketplace and search for \\\"Smart Connections.\\\" Click \\\"Install\\\" and then \\\"Enable.\\\"\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What features does the Smart Connections plugin offer?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"The plugin offers features such as automatic linking, backlink management, and enhanced search capabilities to improve your productivity.\"\n      }\n    }\n  ]\n}\n```\n\n### Important Notes\n\n- **Content Structure**: For the automatic FAQ extraction to work correctly, ensure your content follows the structure of questions as headings and answers as the content following them.\n- **Limitations**: Only headings that end with a question mark are considered. Other content will not be included in the FAQ structured data.\n- **Nested Questions**: Currently, nested questions or multiple levels of headings are not differentiated; all headings ending with a question mark are treated equally.\n\n## Additional Features\n\n### Publisher Information\n\nThe structured data automatically includes publisher information:\n\n- **Organization Name**: Uses `cfg.organization.name` or defaults to \"Smart Connections\"\n- **Logo**: Uses `/static/logo.png` from your base URL\n- **Logo Dimensions**: Fixed at 512x512 pixels\n\n### Language Support\n\n- Automatically includes the page's language using the `cfg.locale` setting (defaults to \"en\")\n\n## Example Frontmatter\n\n```yaml\ntitle: \"How to Use Smart Connections\"\ndescription: \"A detailed guide on setting up and using the Smart Connections plugin.\"\ndatePublished: \"2024-10-20\"\ndateModified: \"2024-10-22\"\nauthor: \"Brian Petro\"\ntype: \"BlogPosting\"\nkeywords: [\"obsidian\", \"smart connections\", \"productivity\"]\narticleSection: \"Technology\"\nogImage: \"assets/featured_image.jpg\"\n```\n\n## Generated Structured Data Example\n\n```json\n{\n  \"@context\": \"https://schema.org\",\n  \"@type\": \"BlogPosting\",\n  \"mainEntityOfPage\": {\n    \"@type\": \"WebPage\",\n    \"@id\": \"https://example.com/page\"\n  },\n  \"headline\": \"How to Use Smart Connections\",\n  \"description\": \"A detailed guide on setting up and using the Smart Connections plugin.\",\n  \"datePublished\": \"2024-10-20\",\n  \"dateModified\": \"2024-10-22\",\n  \"author\": {\n    \"@type\": \"Person\",\n    \"name\": \"Brian Petro\"\n  },\n  \"image\": {\n    \"@type\": \"ImageObject\",\n    \"url\": \"https://example.com/assets/featured_image.jpg\",\n    \"width\": 1200,\n    \"height\": 675\n  },\n  \"publisher\": {\n    \"@type\": \"Organization\",\n    \"name\": \"Smart Connections\",\n    \"logo\": {\n      \"@type\": \"ImageObject\",\n      \"url\": \"https://example.com/static/logo.png\",\n      \"width\": 512,\n      \"height\": 512\n    }\n  },\n  \"keywords\": \"obsidian, smart connections, productivity\",\n  \"articleSection\": \"Technology\",\n  \"inLanguage\": \"en\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianpetro%2Fcustom-quartz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianpetro%2Fcustom-quartz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianpetro%2Fcustom-quartz/lists"}