{"id":19697168,"url":"https://github.com/janit/gatsby-barebones-markdown-typescript","last_synced_at":"2026-03-01T15:03:48.435Z","repository":{"id":69358420,"uuid":"105471397","full_name":"janit/gatsby-barebones-markdown-typescript","owner":"janit","description":"Simple barebones Gatsby.js static site generator with local Markdown and TypeScript enabled","archived":false,"fork":false,"pushed_at":"2017-10-01T20:34:01.000Z","size":88,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T18:39:22.764Z","etag":null,"topics":["gatsbyjs","graphql","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-10-01T20:17:37.000Z","updated_at":"2019-07-09T21:40:38.000Z","dependencies_parsed_at":"2023-02-22T01:30:33.075Z","dependency_job_id":null,"html_url":"https://github.com/janit/gatsby-barebones-markdown-typescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/janit/gatsby-barebones-markdown-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fgatsby-barebones-markdown-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fgatsby-barebones-markdown-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fgatsby-barebones-markdown-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fgatsby-barebones-markdown-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janit","download_url":"https://codeload.github.com/janit/gatsby-barebones-markdown-typescript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fgatsby-barebones-markdown-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29973180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T14:44:57.896Z","status":"ssl_error","status_checked_at":"2026-03-01T14:43:27.662Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["gatsbyjs","graphql","typescript"],"created_at":"2024-11-11T19:37:24.111Z","updated_at":"2026-03-01T15:03:48.395Z","avatar_url":"https://github.com/janit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gatsby.js barebones Markdown + TypeScript example\n\nGatsby.js is a static site generator that uses React as a templating / view engine and GraphQL as a data layer for doing queries to content repositories (local or remote).\n\nThis is very simple example of using \u003ca href=\"https://www.gatsbyjs.org\"\u003eGatsby.js\u003c/a\u003e and it's \u003ca href=\"http://graphql.org\"\u003eGraphQL\u003c/a\u003e data layer to fetch and render local \u003ca href=\"https://daringfireball.net/projects/markdown/syntax\"\u003eMarkdown\u003c/a\u003e files. In addition the \u003ca href=\"http://typescriptlang.org\"\u003eTypeScript\u003c/a\u003e support is enabled.\n\nThis project is based on \u003ca href=\"https://www.gatsbyjs.org/tutorial/\"\u003ethe official tutorial\u003c/a\u003e and is mostly just a simple boilerplate if I choose to use this somewhere, some day.\n\n## Installation\n\nInstall yarn and the Gatsby client as global. Then install packages and run develop\n\n```\n$ yarn\n$ gatsby develop\n```\n\nThe site will be available at http://localhost:8000 and the GraphQL explorer at http://localhost:8000/___graphql\n\n## GraphQL queries to load content from local Markdown files\n\nAs said, Gatsby uses GraphQL internally as an API, in this case there's two queries. The first one is to get all the Markdown files on `src/pages/index.tsx`:\n\n```graphql\nquery IndexQuery {\n  allMarkdownRemark {\n    totalCount\n    edges {\n      node {\n        id\n        frontmatter {\n          title\n          date(formatString: \"DD MMMM, YYYY\")\n        }\n        fields {\n          slug\n        }\n        excerpt\n      }\n    }\n  }\n}\n```\n\nto display individual posts, the template `src/templates/post.tsx` uses the following query:\n\n```graphql\nquery BlogPostQuery($slug: String!) {\n  markdownRemark(fields: { slug: { eq: $slug } }) {\n    html\n    frontmatter {\n      title\n      date\n    }\n  }\n}\n```\n\nNote that both of these are easy to construct and develop using the included GraphiQL shell running locally at: http://localhost:8000/___graphql\n\n## File structure\n\nHere is a brief overview of the file structure:\n\n- gatsby-config.js (main config)\n- gatsby-node.js (custom functionality for loading MD files dynamically )\n- src\n  - pages\n    - index.tsx (root page with listing)\n    - about.tsx (simple satic page)\n  - posts\n    - *.md (blog post content in Markdown)\n  - templates\n    - post.tsx (template for blog posts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanit%2Fgatsby-barebones-markdown-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanit%2Fgatsby-barebones-markdown-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanit%2Fgatsby-barebones-markdown-typescript/lists"}