{"id":27729950,"url":"https://github.com/clean-commit/gatsby-starter-henlo","last_synced_at":"2025-04-28T05:01:56.110Z","repository":{"id":37106627,"uuid":"270961687","full_name":"clean-commit/gatsby-starter-henlo","owner":"clean-commit","description":"The most advanced starter for Gatsby \u0026 Decap CMS. Extensible, block based starter for Decap CMS. Built with performance in mind, styled with TailwindCSS.","archived":false,"fork":false,"pushed_at":"2025-04-09T11:12:01.000Z","size":46185,"stargazers_count":30,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T11:44:51.913Z","etag":null,"topics":["decap-cms","gatsby","gatsby-starter","gatsby-starter-kit","gatsbyjs","henlo","jamstack","netlify","netlify-cms","postcss","seo","tailwind","tailwindcss","tailwindcss-v4"],"latest_commit_sha":null,"homepage":"https://henlo.cleancommit.io","language":"JavaScript","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/clean-commit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-06-09T09:38:08.000Z","updated_at":"2025-04-09T11:13:13.000Z","dependencies_parsed_at":"2024-12-03T12:37:23.132Z","dependency_job_id":null,"html_url":"https://github.com/clean-commit/gatsby-starter-henlo","commit_stats":null,"previous_names":[],"tags_count":13,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clean-commit%2Fgatsby-starter-henlo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clean-commit%2Fgatsby-starter-henlo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clean-commit%2Fgatsby-starter-henlo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clean-commit%2Fgatsby-starter-henlo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clean-commit","download_url":"https://codeload.github.com/clean-commit/gatsby-starter-henlo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251254262,"owners_count":21559791,"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":["decap-cms","gatsby","gatsby-starter","gatsby-starter-kit","gatsbyjs","henlo","jamstack","netlify","netlify-cms","postcss","seo","tailwind","tailwindcss","tailwindcss-v4"],"created_at":"2025-04-28T05:01:37.516Z","updated_at":"2025-04-28T05:01:56.006Z","avatar_url":"https://github.com/clean-commit.png","language":"JavaScript","funding_links":[],"categories":["Starter Template"],"sub_categories":[],"readme":"![Henlo Starter](https://repository-images.githubusercontent.com/270961687/4085d990-9083-451d-b39b-5316579adf09)\n\n# Gatsby Starter Henlo (v1.3.0)\n\n[![Netlify Status](https://api.netlify.com/api/v1/badges/43532afb-3488-432b-8185-a745645a90d8/deploy-status)](https://app.netlify.com/sites/henlo/deploys)\n\n[Official Website / Demo](http://henlo.cleancommit.io)\n\nGatsby Starter Henlo is the most advanced Decap CMS starter for Gatsby.js. We built it with Page Builder setup in mind. All pages are created out of programmable blocks, aiming to provide the best DX \u0026 admin UX possible.\n\nThis repo contains an example website that is built with [Gatsby](https://www.gatsbyjs.com/docs/), and [Decap CMS](https://decapcms.org/docs/intro/).\n\nIt follows the [JAMstack architecture](https://jamstack.org) by using Git as a single source of truth, and [Netlify](https://www.netlify.com) for continuous deployment, and CDN distribution.\n\n## Features\n\n- 💇‍♀️ TailwindCSS V4 support with PostCSS \u0026 Tailwind Merge\n- Support for Gatsby v5\n- 💪 Battle-tested starting point for small \u0026 large web projects\n- 📄 Form Builder that enables Admins to create multiple forms with ease \u0026 Netlify Forms integration.\n- 🌗 Darkmode support\n- 🗺 Sitemaps using `gatsby-plugin-sitemap`\n- 🔥 Perfect score on Lighthouse for SEO, Accessibility and Performance\n- 🔌 Support for Gatsby API functions\n- 🎇 Crazy fast images with `gatsby-plugin-image`\n- 🕵️‍♂️ Complete SEO configuration with graphql fragment and reusable components based on Head API\n- Netlify deploy configuration\n- Example pages, collections, CMS configuration with Decap CMS \u0026 hooks\n- Readme template for custom projects\n- Easy Decap CMS configuration using [Manual Initialization](https://decapcms.org/docs/manual-initialization/#gatsby-focus-wrapper)\n- ..and more\n\n## Prerequisites\n\n- Node 20\n- [Gatsby CLI](https://www.gatsbyjs.org/docs/)\n- [Netlify CLI](https://github.com/netlify/cli)\n\n## Getting Started (Recommended)\n\nDecap CMS can run in any frontend web environment, but the quickest way to try it out is by running it on a pre-configured starter site with Netlify. Use the button below to build and deploy your own copy of the repository:\n\n\u003ca href=\"https://app.netlify.com/start/deploy?repository=https://github.com/clean-commit/gatsby-starter-henlo\"\u003e\u003cimg src=\"https://www.netlify.com/img/deploy/button.svg\" alt=\"Deploy to Netlify\"\u003e\u003c/a\u003e\n\nAfter clicking that button, you’ll authenticate with GitHub and choose a repository name. Netlify will then automatically create a repository in your GitHub account with a copy of the files from the template. Next, it will build and deploy the new site on Netlify, bringing you to the site dashboard when the build is complete. Next, you’ll need to set up Netlify’s Identity service to authorize users to log in to the CMS.\n\n## Getting Started (Without Netlify)\n\n```\n$ gatsby new [SITE_DIRECTORY_NAME] https://github.com/clean-commit/gatsby-starter-henlo\n$ cd [SITE_DIRECTORY_NAME]\n$ yarn dev\n```\n\n### Access Locally\n\nPulldown a local copy of the Github repository Netlify created for you, with the name you specified in the previous step\n\n```\n$ git clone https://github.com/[GITHUB_USERNAME]/[REPO_NAME].git\n$ cd [REPO_NAME]\n$ yarn \u0026\u0026 yarn dev\n```\n\nTo test the CMS locally, you'll need to start your local development server \u0026 [run local instance of Decap CMS](https://decapcms.org/docs/working-with-a-local-git-repository)\n\n```\n$ yarn dev\n$ yarn cms\n// or\n$ npx decap-server\n```\n\nYour admin configuration will be available at http://localhost:8000/admin\n\n### Deployment\n\nWe've added additional commands for quick deployments with Netlify CLI. To deploy the website to Netlify simply run.\n\n```\n$ yarn deploy:prod\n```\n\nThe website will build locally and then deploy to production.\n\nBefore deploying to Netlify, you need to:\n\n- Define GATSBY_APP_URL to your domain\n- Update redirects in netlify.toml to reflect your website (example is set up)\n\n### Folder structure\n\n```\n├── cms                      # Decap CMS configuration\n│   ├── blocks\n│   ├── collections\n│   ├── fields\n│   ├── previews\n│   └── cms.js\n├── content                  # Your content lives here\n│   ├── authors\n│   ├── blog\n│   ├── forms\n│   └── pages\n├── public\n├── src\n│   ├── api                  # Gatsby functions should be placed here\n│   ├── blocks               # Blocks that create sections\n│   ├── components           # Reusable components\n│   │   └── UI               # UI specialized components\n│   ├── hooks                # Hooks used in the project\n│   ├── lib                  # misc\n│   ├── pages\n│   ├── resolvers\n│   │   ├── Image.js         # Required for previews\n│   │   └── Link.js          # Resolves links to gatsby and outside links\n│   ├── settings             # Place for theme settings\n│   ├── styles\n│   └── templates            # Templates used to render page types\n│       ├── page-builder.js\n│       └── post.js\n├── static\n├── _headers\n├── .env.example             # Example env -\u003e GATSBY_APP_URL is required to run the app\n├── gatsby-config.js         # Config files for gatsby\n├── gatsby-node.js           # Page generation setup \u0026 types interferrence\n└── tailwind.config.js       # Tailwind configuration\n```\n\n### Setting up the CMS\n\nFollow the [Decap CMS Quick Start Guide](https://decapcms.org/docs/gatsby/#enable-identity-and-git-gateway) to set up authentication, and hosting.\n\n**Important**\nThis template can be mostly changed by the user within the CMS itself (Settings type). For sitemaps to work correctly, you'll need to provide ENV variable `GATSBY_APP_URL` which defaults to https://example.com, this url will be used in setting up meta values in the head of the documents and links URL in the CMS.\n\nCMS configuration was placed within `cms` directory in the root of the project. This allows us to work efficiently on fields and collections without mixing CMS config with Gatsby code.\n\nHenlo uses Manual Initialization to take advantage of componetized approach to managing configuration for Decap CMS. Thanks to that you don't have to control the CMS from centralized YAML file.\n\nTo ensure best experience we use 2 custom widgets that are maintained by us -\u003e [ID Widget](https://github.com/clean-commit/netlify-cms-widget-id) that provides unmutable IDs for content items and [Permalink Widget](https://github.com/clean-commit/netlify-cms-widget-permalink) that enables you to create custom permalinks with ease.\n\n```javascript\nimport CMS from 'decap-cms-app'\nimport { Widget as UuidWidget } from 'netlify-cms-widget-id'\nimport { Widget as PermalinkWidget } from 'netlify-cms-widget-permalink'\nimport authors from './collections/authors'\nimport pages from './collections/pages'\nimport posts from './collections/posts'\nimport settings from './collections/settings'\nimport PagePreview from './previews/Page'\n\n// Preview for all PageBuilder based pages\n\nconst config = {\n  config: {\n    load_config_file: false,\n    display_url: process.env.GATSBY_APP_URL, // Enables urls based on env variable\n    local_backend: true,\n    backend: {\n      name: 'git-gateway',\n    },\n    slug: {\n      encoding: 'ascii',\n      clean_accents: true,\n    },\n    media_folder: '/static/img',\n    public_folder: '/img',\n    collections: [pages, posts, authors, settings],\n  },\n}\n\nCMS.registerPreviewStyle('../commons.css')\nCMS.registerPreviewTemplate('pages', PagePreview)\n\nCMS.registerWidget(UuidWidget)\nCMS.registerWidget(PermalinkWidget)\n\nCMS.init(config)\n```\n\n#### Adding blocks\n\nBlocks are defined in `cms/blocks/index.js` file. We're leveraging use of exported functions and variables from other fields to avoid repetition within the code.\n\nThis is extremely important due to the way GraphQL works with Markdown based files. Each field will have to be present on all page queries -\u003e we can't differetiate between different sections.\n\nThat's why it's important to reuse names of fields, hence usage of imports.\n\n```javascript\nimport { Buttons, Title, Content, SelectField, ImageField } from '../fields';\n\nconst Config = {\n  label: 'Blocks',\n  name: 'blocks',\n  widget: 'list',\n  types: [\n    {\n      label: 'Hero',\n      name: 'hero',\n      widget: 'object',\n      fields: [\n        Title,\n        Content,\n        Buttons,\n        SelectField('default', ['default', 'centered', 'full']),\n      ],\n    },\n...\n```\n\nTo add new block you have tp add new `Type` to `cms/blocks/index.js` file, and modify `Blocks` fragment located in `src/components/PageBuilder.js`\n\nAs you can see below we're adding all fields used by all sections. This causes issues with Gatsby's [Schema Inference](https://www.gatsbyjs.com/docs/schema-inference/). Gatsby needs an example of the field to know what type of field it is.\n\nThat's why we rely on `dont-remove.md` this file contains all possible fields used in the starter, so you're never encounter a problem with types inference!\n\n```\nexport const query = graphql`\n  fragment Blocks on MarkdownRemarkFrontmatter {\n    blocks {\n      type\n      title\n      content\n      columns {\n        title\n        content\n      }\n      photo {\n        image {\n          childImageSharp {\n            gatsbyImageData(\n              width: 800\n              quality: 72\n              placeholder: DOMINANT_COLOR\n              formats: [AUTO, WEBP, AVIF]\n            )\n          }\n        }\n        alt\n      }\n      variant\n      buttons {\n        button {\n          content\n          url\n          variant\n        }\n      }\n    }\n  }\n`\n```\n\nTo keep the GraphQL query small, we opt to reuse the field names across blocks, but if new type is added it has to be defined in graphql using createSchemaCustomization function. **Without the definition you may encounter errors** during build process.\n\n### Adding Favicons\n\nFavicons can be generated using this [Favicon Generator](https://www.favicon-generator.org/) After generating the icons, drop the contents of downloaded file into `static/img/favicons` directory\n\n### Preloading fonts\n\nSince 0.4.0 Henlo supports [`gatsby-plugin-preload-fonts`](https://www.gatsbyjs.com/plugins/gatsby-plugin-preload-fonts/) plugin out of the box. To create the preload cache you need to start development server and then run `preload-fonts` command. This will generate the `font-preload-cache.json` file in the root of your project. When your projects builds fonts will be added automatically to head of the document.\n\n```\nyarn dev\nyarn preload-fonts\n```\n\n## Browser support\n\nGatsby tends to add a lot of polyfills to support older browser versions. In package.json file you can adjust which sites your project should support. As default Henlo will use `defaults` setting. If you want to learn more about the browser support visit official [Gatsby How-To Guide on this subject](https://www.gatsbyjs.com/docs/how-to/custom-configuration/browser-support/)\n\n# CONTRIBUTING\n\nContributions are always welcome, no matter how large or small. Before contributing,\nplease read the [code of conduct](CODE_OF_CONDUCT.md).\n\n# Additional guides\n\nHere's a list of helpful articles that will help you with your first steps using Henlo!\n\n- [Efficient Decap CMS config with Manual Initialization](https://mrkaluzny.com/blog/dry-netlify-cms-config-with-manual-initialization?utm_source=GitHub\u0026utm_medium=henlo-gatsby)\n- [How to optimize SEO with Gatsby \u0026 Netlify](https://mrkaluzny.com/blog/how-to-optimize-seo-with-gatsby-netlify?utm_source=GitHub\u0026utm_medium=henlo-gatsby)\n- [Full Text Search with Gatsby \u0026 Decap CMS](https://mrkaluzny.com/blog/full-text-search-with-gatsby-and-netlify-cms?utm_source=GitHub\u0026utm_medium=henlo-gatsby)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclean-commit%2Fgatsby-starter-henlo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclean-commit%2Fgatsby-starter-henlo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclean-commit%2Fgatsby-starter-henlo/lists"}