{"id":26018945,"url":"https://github.com/moonwave99/goffre","last_synced_at":"2026-04-11T14:32:55.552Z","repository":{"id":142636151,"uuid":"430066626","full_name":"moonwave99/goffre","owner":"moonwave99","description":"Mini static site generator","archived":false,"fork":false,"pushed_at":"2026-02-18T22:30:55.000Z","size":1003,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-19T00:28:56.663Z","etag":null,"topics":["front-matter","js","markdown","nodejs","static-site-generator"],"latest_commit_sha":null,"homepage":"https://moonwave99.github.io/goffre/","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/moonwave99.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-11-20T10:00:38.000Z","updated_at":"2026-02-18T22:30:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d65131c-9f59-4ed0-b8cf-166bb2c0e793","html_url":"https://github.com/moonwave99/goffre","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/moonwave99/goffre","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fgoffre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fgoffre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fgoffre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fgoffre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moonwave99","download_url":"https://codeload.github.com/moonwave99/goffre/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fgoffre/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31684523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["front-matter","js","markdown","nodejs","static-site-generator"],"created_at":"2025-03-06T06:39:39.346Z","updated_at":"2026-04-11T14:32:55.545Z","avatar_url":"https://github.com/moonwave99.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goffre\n\nGoffre is a minimal static site generator available to the **node.js** ecosystem.\n\nIt uses [handlebars][handlebars] as templating system and [markdown + frontmatter][mdfront] as data layer, or whatever you decide to pass to `render()`.\n\n## Installation\n\n```bash\nnpm install @moonwave99/goffre --save\n```\n\n## Basic Usage\n\n```js\nimport { load, render } from \"@moonwave99/goffre\";\n\ntry {\n  const { pages } = await load();\n  const results = await render({ pages });\n  console.log(`Generated ${results.length} pages`);\n} catch (error) {\n  console.log(\"Error generating site\", error);\n}\n```\n\nDefault paths:\n\n- **markdown files**: `./data` - used by `load()`\n- **output folder**: `./dist` - used by `render()`\n- **handlebars views**: `./src/views` - used by `render()`\n\nSee [examples](#examples) for a more advanced use case, and the [documentation][docs] for the complete reference.\n\n## Data collecting and rendering are separate steps\n\nThis is the key for the maximum flexibility: `load()` gets all the `.md` files inside the data folder, and populates its return `pages` each with a unique `slug`.\n\nThe markdown body is available in the `content` key, and the YAML front matter is destructured - the output of `load()` of the following file:\n\n```yaml\n---\ntitle: \"Goffre | Mini static site generator\"\nslug: \"index\"\n---\nGoffre is a minimal static site generator available to the **node.js** ecosystem.\n```\n\nwill be:\n\n```js\n{\n    title: \"Goffre | Mini static site generator\",\n    slug: \"index\",\n    content: \"Goffre is a minimal static site generator available to the **node.js** ecosystem.\"\n}\n```\n\n**Note:** the markdown body is not yet parsed at this stage.\n\nThe `render()` method writes then every incoming page to `{page.slug}.html` - you can add further pages to the collected ones, like the text you are reading from the main `README.md` file of the repository:\n\n```js\nconst { pages } = await load({ dataPath });\nconst results = await render({\n  buildPath,\n  sitePath,\n  pages: [\n    ...pages,\n    {\n      title: \"Goffre | Mini static site generator\",\n      description:\n        \"Goffre is a minimal static site generator available to the node.js ecosystem.\",\n      slug: \"index\",\n      content: await readFile(path.join(\"..\", \"README.md\"), \"utf8\"),\n    },\n  ],\n});\n```\n\n## For a better development experience\n\nGoffre does not provide any watching / serving features out of the box, but don't worry.\n\n**Serving**: if you use [webpack][webpack] for bundling the frontend CSS and JS, just use its [dev server][webpack-dev-server] - see the [configuration file for this very page][webpack-config] as reference. If you don't, a simple [http-server][http-server] will do.\n\n**Watching**: use [nodemon][nodemon] to watch the _generation script_, the _data folder_ and the _handlebars views folder_:\n\n```bash\n$ nodemon -e js,json,md,handlebars --watch index.js --watch data --watch src/views\n```\n\nThe scripts of `package.json` will look more or less like:\n\n```json\n{\n  \"clean\": \"rm -rf dist\",\n  \"dev:client\": \"webpack serve --mode development\",\n  \"dev:site\": \"nodemon -e js,json,md,handlebars --watch index.js --watch data --watch src/views\",\n  \"build:client\": \"webpack --mode production\",\n  \"build:site\": \"node index.js\"\n}\n```\n\nJust `npm run dev:client` and `npm run dev:site` in two terminal tabs and you are done. Don't forget to `npm install` the needed dependencies of course!\n\n## Examples\n\n- [devblog][examples-devblog] - a personal website with blog posts and project pages\n- this page of course\n\n[handlebars]: https://handlebarsjs.com/\n[mdfront]: https://www.google.com/search?q=markdown+frontmatter\n[webpack]: https://webpack.js.org/\n[webpack-dev-server]: https://webpack.js.org/configuration/dev-server/\n[http-server]: https://www.npmjs.com/package/http-server\n[nodemon]: https://www.npmjs.com/package/nodemon\n[docs]: https://github.com/moonwave99/goffre/tree/main/examples/devblog\n[webpack-config]: https://github.com/moonwave99/goffre/blob/main/homepage/webpack.config.cjs\n[examples-devblog]: https://goffre-examples-devblog.netlify.app/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoonwave99%2Fgoffre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoonwave99%2Fgoffre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoonwave99%2Fgoffre/lists"}