{"id":51117794,"url":"https://github.com/graphql-markdown/demo-hugo","last_synced_at":"2026-06-24T23:30:41.718Z","repository":{"id":361666004,"uuid":"1219304440","full_name":"graphql-markdown/demo-hugo","owner":"graphql-markdown","description":"GraphQL-Markdown + Hugo demo","archived":false,"fork":false,"pushed_at":"2026-05-31T18:35:03.000Z","size":1912,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T19:18:35.034Z","etag":null,"topics":["documentation","documentation-generator","graphql","hugo","hugo-book","markdown"],"latest_commit_sha":null,"homepage":"https://graphql-markdown.dev/","language":"JavaScript","has_issues":false,"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/graphql-markdown.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-23T18:34:09.000Z","updated_at":"2026-05-31T18:33:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/graphql-markdown/demo-hugo","commit_stats":null,"previous_names":["graphql-markdown/demo-hugo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/graphql-markdown/demo-hugo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-markdown%2Fdemo-hugo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-markdown%2Fdemo-hugo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-markdown%2Fdemo-hugo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-markdown%2Fdemo-hugo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphql-markdown","download_url":"https://codeload.github.com/graphql-markdown/demo-hugo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-markdown%2Fdemo-hugo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34753781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["documentation","documentation-generator","graphql","hugo","hugo-book","markdown"],"created_at":"2026-06-24T23:30:41.210Z","updated_at":"2026-06-24T23:30:41.713Z","avatar_url":"https://github.com/graphql-markdown.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL-Markdown + Hugo demo\n\nThis project demonstrates how to generate GraphQL documentation with GraphQL-Markdown for a [Hugo](https://gohugo.io/) site using the [Book theme](https://github.com/alex-shpak/hugo-book).\n\n**Live demo:** [graphql-markdown.dev/demo-hugo](https://graphql-markdown.dev/demo-hugo/)\n\n## 🚀 Project Structure\n\nInside your GraphQL-Markdown + [Hugo](https://gohugo.io/) project with the [Book theme](https://github.com/alex-shpak/hugo-book), you'll see:\n\n```text\n.\n├── content/\n│   └── graphql/                 # Generated GraphQL documentation\n│       ├── _index.md            # Homepage for /graphql/ section\n│       ├── operations/          # Queries, mutations, subscriptions\n│       ├── types/               # Objects, interfaces, inputs, scalars, enums\n│       └── directives/          # GraphQL directives\n├── static/\n│   ├── css/\n│   │   └── gqlmd-badges.css     # Badge styling\n│   └── logo.png                 # GraphQL-Markdown logo\n├── layouts/\n│   └── _partials/docs/inject/\n│       └── head.html            # Inject CSS for badges\n├── themes/\n│   └── book/                    # Hugo Book theme (submodule)\n├── schema.graphql               # Sample GraphQL schema\n├── graphql.config.mjs           # GraphQL-Markdown configuration\n├── scripts/\n│   └── custom-hugo-mdx.mjs      # Custom MDX formatter with lifecycle hooks\n├── hugo.toml                    # Hugo site configuration\n└── package.json\n```\n\n## 🎨 Features\n\n- ✨ Custom MDX formatter extending the Hugo preset with lifecycle hooks\n- 🎨 Color-coded type badges (deprecated, required, mutation, subscription)\n- 📄 Automatic page title rendering as H1 headings\n- 🗂️ Section index generation with automatic navigation links\n- ⚖️ Sequential weight assignment for proper sidebar ordering\n- 🔗 Clean URL paths without .md extensions in links\n- 📱 Responsive sidebar navigation via Hugo Book theme\n\n## 🧞 Commands\n\nAll commands are run from the root of the project, from a terminal:\n\n| Command | Action |\n| --- | --- |\n| `npm install` | Install dependencies |\n| `npm run generate` | Generate docs from the GraphQL schema |\n| `npm run dev` | Generate docs + serve a local Hugo preview |\n| `npm run build` | Generate docs + build a static site to `public/` |\n| `npm run clean` | Remove generated files and build output |\n\n## 🏎️ Quick start\n\n```bash\nnpm install\nnpm run dev\n```\n\nOpen `http://localhost:1313/graphql/`.\n\n\u003e 🧑‍🚀 Edit `schema.graphql` to use your own GraphQL schema.\n\n## 📋 How it Works\n\nThe generation pipeline uses lifecycle hooks for advanced customization:\n\n1. **beforeGenerateIndexMetafileHook** - Creates `_index.md` files for each section with proper frontmatter\n2. **afterRenderTypeEntitiesHook** - Adds:\n   - Navigation links to the section index\n   - Sequential `weight` values for sidebar ordering\n   - `type: docs` frontmatter for Hugo\n3. **formatMDXFrontmatter** - Renders page titles as H1 headings\n4. **formatMDXBadge** - Colors badges based on type (deprecated=red, required=blue, etc.)\n\nThe resulting Markdown is fully compatible with Hugo's Markdown processor, and badges render with custom CSS when `unsafe = true` is set in `hugo.toml`.\n\n## 👀 Want to learn more?\n\nCheck out [GraphQL-Markdown's docs](https://graphql-markdown.dev/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-markdown%2Fdemo-hugo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphql-markdown%2Fdemo-hugo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-markdown%2Fdemo-hugo/lists"}