{"id":13572065,"url":"https://github.com/ducksoupdev/gulp-site-generator","last_synced_at":"2026-01-11T10:59:57.086Z","repository":{"id":27440138,"uuid":"30918228","full_name":"ducksoupdev/gulp-site-generator","owner":"ducksoupdev","description":"A static site generator using Gulp","archived":true,"fork":false,"pushed_at":"2017-08-27T07:23:02.000Z","size":288,"stargazers_count":183,"open_issues_count":9,"forks_count":29,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-09-28T06:41:54.255Z","etag":null,"topics":["gulp","handlebars","static-site-generator"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ducksoupdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-17T13:32:30.000Z","updated_at":"2024-04-01T04:46:18.000Z","dependencies_parsed_at":"2022-09-02T07:23:18.562Z","dependency_job_id":null,"html_url":"https://github.com/ducksoupdev/gulp-site-generator","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducksoupdev%2Fgulp-site-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducksoupdev%2Fgulp-site-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducksoupdev%2Fgulp-site-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducksoupdev%2Fgulp-site-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ducksoupdev","download_url":"https://codeload.github.com/ducksoupdev/gulp-site-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235059234,"owners_count":18929279,"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":["gulp","handlebars","static-site-generator"],"created_at":"2024-08-01T14:01:12.488Z","updated_at":"2025-10-03T01:30:41.681Z","avatar_url":"https://github.com/ducksoupdev.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Static site generator using Gulp\n\n[![Build Status](https://travis-ci.org/ducksoupdev/gulp-site-generator.svg?branch=master)](https://travis-ci.org/ducksoupdev/gulp-site-generator)\n[![Coverage Status](https://coveralls.io/repos/ducksoupdev/gulp-site-generator/badge.svg?branch=master)](https://coveralls.io/r/ducksoupdev/gulp-site-generator?branch=master)\n\nThis is a simple static site generator which is perfect for a personal, blog or documentation site.\n\nIt is similar to other static site generators in that it takes your Markdown content, renders it, optimises it and creates a production-ready site that can be served by Nginx, Apache or another web server.\n\n## Features\n\n* Convert Markdown files to static HTML\n* [Handlebars](http://handlebarsjs.com) templates and partials\n* Sass compiling and minification\n* Css reducing (Uncss)\n* Javascript concatenating and minification\n* Asset copying\n* Image compression\n* HTML compression\n* RSS feed creation\n* Server for viewing built site\n* Clobber for cleaning build directory\n* Save content as draft\n* Convert draft templates\n* Creates a `build/` directory with built content and assets\n\n## Installation\n\nThis project is ideal when used as a Git sub-module or installed along-side your site so you can update it when new releases are made.\n\n### Getting the generator\n\n#### Git sub-module\n\n    $ mkdir my-static-site\n    $ cd my-static-site\n    $ git init\n    $ git submodule add https://github.com/ducksoupdev/gulp-site-generator.git tools\n\n#### Straightforward checkout\n\n    $ mkdir my-static-site\n    $ cd my-static-site\n    $ git clone https://github.com/ducksoupdev/gulp-site-generator.git tools\n\n### Installing the dependencies\n\nThe generator requires Gulp to be installed globally. If you don't have it you can install it using:\n\n    $ npm install -g gulp\n\nThe generator has some dependencies that need to be installed using the following script:\n\n    $ node tools/install\n\nThe script creates the following files in the root of your site:\n\n* `package.json` - the node modules required by the generator\n* `gulpfile.js` - the gulp file for all the generator tasks\n* `site.json` - the metadata for your site\n* `src/content` - the content folder for the markdown files including some sample ones\n* `src/images` - a sample image\n* `src/sass` - a sample sass file\n* `src/templates` - a set of Handlebar templates for creating pages and posts\n\nOnce created, the next thing is to install the required node modules:\n\n    $ npm install\n\nFinally, you can run the generator to create the sample site:\n\n    $ gulp\n\nThe generator will create a `build/` folder with the compiled and optimised site ready to be deployed to your web server.\n\nSo putting it all together, the installation steps are:\n\n    $ mkdir my-static-site\n    $ cd my-static-site\n    $ git init\n    $ git submodule add https://github.com/ducksoupdev/gulp-site-generator.git tools\n    $ npm install -g gulp\n    $ node tools/install\n    $ npm install\n    $ gulp\n\n## Updating\n\nUpdating the generator submodule to the latest version can be done using git:\n\n    $ cd tools\n    $ git remote update\n    $ git pull\n    $ cd ..\n\nThe generator has an update script that can then be run:\n\n    $ node tools/update\n\nThe script updates the `package.json` in the root of your site and updates any dependencies to the latest versions.\n\n## Tasks\n\nWhen you have created templates, content and assets, the default task will run the generator:\n\n    $ gulp\n\nThe following tasks can also be run individually:\n\n* **develop** - a live-reload task for developing your site where changes are reloaded automatically including draft posts and pages - view at http://localhost:8080\n* **sass** - converts sass files to css\n* **clobber** - removes the `build/` directory\n* **server** - view your built site locally at http://localhost:8080\n* **help** - lists available tasks\n\n## Configuration\n\nThe metadata file `site.json` contains all configuration required by your site. The following properties are used by the generator.\nYou are free to add properties to this file for use in your Handlebars templates.\n\n* title (string) (required) - the title of your site\n* description (string) (required) - a description of your site\n* url (string) (required) - the URL of your site\n* rss (string) (required) - the RSS feed XML file\n* maxItems (number) (optional) - the number to use for pagination\n* authors (object) (optional) - an map of authors with metadata\n* concatJs (array) (optional) - a list of javascript files to combine and minify\n* styleSheet (string) (optional) - the name of your main CSS file created by the sass task\n* imageCompression (boolean) (optional) - a boolean value to enable/disable image compresssion on build\n* uncssIgnore (array) (optional) - a list of selectors that uncss should ignore (for example \".container\" or \"#my-element\")\n\n## Content\n\nContent must be added to the `src/content` directory.\n\n### Pages and posts\n\nPages and posts must created in the `src/content/pages` and `src/content/posts` directories.\n\nPages and posts are Markdown files with a YAML front-matter block. The front matter must be the first thing in the file and must take the form of valid YAML set between triple-dashed lines. Here is a basic example:\n\n    ---\n    title: Home\n    template: index.hbs\n    ---\n\n    The rest of the template goes here as markdown text.\n\nBetween these triple-dashed lines, you can set predefined variables (see below). These variables will then be available to you in any Handlebars templates or includes that the page or post in question relies on.\n\n* title (required) - the title of the page or post\n* template (required) - the Handlebars template to use to compile the page or post\n* slug (optional) - the URL slug which is used as the directory name when the page or post is built\n* date (optional) - used for posts and in the format YYYY-MM-DD\n* author (optional) - used for posts and the author key in the `site.json` file\n* status (optional) - set to 'draft' to ignore the page or post when running the generator\n\n### Assets\n\nImages, javascripts, fonts etc can all be added to the `src/` directory. You are free to create directories for these and name them accordingly.\n\nContent is created in the `src/content/pages` or `src/content/posts`.\n\nThe generator is opinionated in that it expects certain files in particular directories.\nTo help with this, [an example site](https://github.com/ducksoupdev/gulp-site-generator-example) is available that shows you how to structure your site with the generator.\n\n### Templates\n\nHandlebars is used for rendering templates. Partials located in `src/templates/partials` are automatically available to your Handlebar templates.\n\nHelpers are available to your Handlebar templates and partials, these are:\n\n* date - format a date in a particular format (uses Moment)\n\n    `{{date format=\"MMM Do, YYYY\"}}`\n\n* excerpt - returns an excerpt of the text of your content, use 'words' or 'characters' to set the length\n\n    `{{excerpt words=\"50\"}}`\n\n* content - returns an excerpt of content and is tag aware, use 'words' or 'characters' to set the length\n\n    `{{content words=\"50\"}}`\n\n* resolve - resolves the path to an asset relative to the site root\n\n    `{{resolve \"/favicon.ico\"}}`\n\n## Further information\n\nThe [example site](https://github.com/ducksoupdev/gulp-site-generator-example) is a good place to start and shows a basic structure of a site with templates and content.\n\nIf you encounter any issues or have any feedback, please [send me a tweet](http://twitter.com/ducksoupdev) or raise a bug on the issue tracker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducksoupdev%2Fgulp-site-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fducksoupdev%2Fgulp-site-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducksoupdev%2Fgulp-site-generator/lists"}