{"id":13691998,"url":"https://github.com/darccio/zas","last_synced_at":"2025-04-07T09:15:33.706Z","repository":{"id":137887300,"uuid":"9123930","full_name":"darccio/zas","owner":"darccio","description":"Most simple static website generator in Golang.","archived":false,"fork":false,"pushed_at":"2025-03-13T00:31:01.000Z","size":144,"stargazers_count":203,"open_issues_count":3,"forks_count":14,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-03T11:41:12.146Z","etag":null,"topics":["go","static-site-generation","static-site-generator"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darccio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","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},"funding":{"github":["darccio"]}},"created_at":"2013-03-31T00:26:02.000Z","updated_at":"2025-04-01T00:16:54.000Z","dependencies_parsed_at":"2024-01-16T09:27:13.964Z","dependency_job_id":"8794ed5f-2b0c-41ce-9c31-457dffbfc5db","html_url":"https://github.com/darccio/zas","commit_stats":null,"previous_names":["darccio/zas","imdario/zas"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darccio%2Fzas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darccio%2Fzas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darccio%2Fzas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darccio%2Fzas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darccio","download_url":"https://codeload.github.com/darccio/zas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247622988,"owners_count":20968575,"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":["go","static-site-generation","static-site-generator"],"created_at":"2024-08-02T17:00:52.394Z","updated_at":"2025-04-07T09:15:33.664Z","avatar_url":"https://github.com/darccio.png","language":"Go","funding_links":["https://github.com/sponsors/darccio"],"categories":["Finished Items"],"sub_categories":["Static Site Generator"],"readme":"# ![Zas](http://i.imgur.com/e9abWRX.png)\n\nMost simple static site generator ever.\n\n## Why another one? C'mon, you must be kidding\n\nI just wanted to set up a simple website, just some pages, using Jekyll, and it didn't feel right. I didn't want a blog.\n\nI checked other projects, but they were incomplete, cumbersome, or solved the wrong problem (blogs, blogs everywhere). I wanted a zen-like experience: a layout and some Markdown files as pages with unobtrusive structure and configuration.\n\nYes, it is another NIH, but... I think Zas is a different kind of beast. I admit that I probably overlooked some projects at the moment.\n\n### What is the difference?\n\n1. Gophers. Yes, there is [Hugo](http://gohugo.io/) (kudos!) but... Who wants to learn another directory layout? There is also [Hastie](https://github.com/mkaz/hastie) and [lots of other static site generators](https://jamstack.org/generators/).\n2. Pure Markdown. And HTML, if you want.\n3. Just a loop. Zas loops over all .md and .html files in the current directory (and subdirectories), ignoring other files (including dot-files).\n4. Your imagination is your limit. Zas has a simple extension mechanism based on subcommands. Do you need to handle a blog with Zas? Install/create a new extension and do it!\n5. Unobtrusive structure, no `_` files. More in the [Usage section](#usage).\n\n## Usage\n\nInstall:\n\n```sh\ngo install github.com/darccio/zas/cmd/zas@latest\n```\n\nGo to your site's directory and do:\n\n```sh\nzas init\n```\n\nZas will create a `.zas` directory with sane defaults. Put your layout in `.zas/layout.html`, and you are good to go.\n\n```sh\nzas\n```\n\nYes. Enough. Your delightful site is on .zas/deploy. Enjoy.\n\nWhat is happening here? Well, Zas calls the `generate` subcommand by default. This subcommand accepts the following flags:\n\n* `-verbose`: print ALL the things!\n* `-full`: generate all the input files. By default, it has an incremental mode that keeps source and deploys directories in sync.\n\n## Configuration and extension\n\nZas is like water. It can flow, or it can cr... Nah, Zas doesn't crash (please fill an issue if it does).\n\nEverything is configurable at .zas/config.yml. It is initialized with default values every time you create a repository. Beware, it happens every time you execute init.\n\nYou can override the `site` config section in two ways:\n\n1. HTML comment in files (most precedence).\n2. `.zas.yml` file at the directory level. Its scope is its directory and subdirectories (until another `.zas.yml` is found).\n\nTo extend Zas functionality, you can use and create plugins. You can develop them in any language (not only in Golang) thanks to Unix magic. And more gophers.\n\n### Plugins\n\nAny prefixed by `zs` or `mzs` is a potential Zas plugin. All plugins are Zas subcommands.\n\nFor example, we invoke an imaginary plugin called `zshello` as a subcommand:\n\n```sh\n$ zas hello\nHello!\n\n$ zas hello World\nHello World!\n```\n\nThat's all. Zas passes any command-line argument after subcommand name to `zshello`.\n\n**Beware:** Zas won't pass any configuration information. Plugins are responsible for reading configuration, even from directory and page levels. Helper libraries in different languages are welcome!\n\nAlso, plugins are free to use `.zas` directory for their own needs. I recommend creating this directory's structure to avoid colliding issues:\n\n```text\n.zas\n+-- plugins\n|   +-- github.com\n|       +-- imdario\n|           +-- myplugin\n+-- ...    \n```\n\nAny `zs` plugin can be invoked through a script tag with type `application/zas+myplugin`. Arguments can be passed with data-args attribute, which content will be used as command-line invoke.\n\n```html\n\u003cscript type=\"application/zas+myplugin\" data-args=\"arg1 arg2 ... argN\"\u003e\u003c/script\u003e\n```\n\nThe tag is deleted after execution. Any output in stdout will replace the tag.\n\nAll plugins will be called in order. Oh, you can even ask for async execution with same-name attribute (hint: async).\n\n#### What's the deal with \"mzs\" prefix? (a.k.a. MIME types plugins)\n\nThese are MIME type plugins. Zas uses embed tags to allow easy integration beyond command line. Any MIME type can be configured in `.zas/config.yml` under mimetypes section.\n\n```yaml\nmimetypes:\n  text/markdown: markdown\n  text/yaml+myplugin: myplugin\n```\n\nIf Zas finds an embed tag with a type attribute set to `text/yaml+myplugin`, it will invoke `mzsmyplugin`. Zas expects to process the plugin's stdout as HTML. It also pipes stderr to the user's shell. Any plugin will be called passing the current file's path as an argument.\n\n```html\n\u003cembed src=\"navigation.md\" type=\"text/markdown\" /\u003e\n```\n\nMaybe you are asking yourself: \"Where is mzsmarkdown?\". Nowhere! It is a particular case where Zas calls an exported method Markdown. I wanted to allow anyone to override internal Markdown processing if they wish.\n\nIf you develop a new plugin, please contact me, and I will list it here :) Please, keep in mind: make it [idempotent](http://en.wikipedia.org/wiki/Idempotence).\n\n## Building sites\n\nYour site layout will look like this:\n\n```sh\n$ ls\n$\n```\n\nJust kidding. A site would be:\n\n```sh\n$ ls -laR\ntotal 8\ndrwxr-xr-x   5 Dario  staff   170 30 mar 16:18 .\ndrwxr-xr-x   6 Dario  staff   204 30 mar 13:17 ..\ndrwxr-xr-x  13 Dario  staff   442 27 mar 20:05 .git\ndrwxr-xr-x   3 Dario  staff   102 30 mar 13:18 .zas\n-rw-r--r--   1 Dario  staff   941 30 mar 16:19 about.md\n-rw-r--r--@  1 Dario  staff  1645 30 mar 15:31 index.md\ndrwxr-xr-x   4 Dario  staff   136 30 mar 16:20 section\n    \n# [...]\n    \n./.zas:\ntotal 0\ndrwxr-xr-x  4 Dario  staff   136 30 mar 16:22 .\ndrwxr-xr-x  7 Dario  staff   238 30 mar 16:19 ..\n-rw-r--r--  1 Dario  staff    29 30 mar 13:18 config.yml\n-rw-r--r--  1 Dario  staff  2438 30 mar 16:22 layout.html\n    \n./section:\ntotal 0\ndrwxr-xr-x  4 Dario  staff  136 30 mar 16:20 .\ndrwxr-xr-x  7 Dario  staff  238 30 mar 16:19 ..\n-rw-r--r--  1 Dario  staff  718 30 mar 16:19 index.md\n-rw-r--r--  1 Dario  staff  991 30 mar 16:20 more.md\n```\n\nAll .md files will be converted to HTML and copied in `.zas/deploy` using `.zas/layout.html` as layout and copying any other files and their structure. The former is also true for HTML files.\n\nKeep in mind that any file will be treated as a Go text template before any further processing. You have access to these fields and methods from anywhere:\n\n* `{{.Body}}`: the file itself in HTML.\n* `{{.Title}}`: autodetected title (first H1 header in file), overridden by `title` property in page's config.\n* `{{.Path}}`: file's path (also valid as URL).\n* `{{.Site.BaseURL}}`: URL where this site will be deployed, e.g. http://example.com (without final slash).\n* `{{.Site.Image}}`: URL to main image. Useful for Open Graph and Twitter meta tags.\n* `{{.Page}}`: YAML map from first HTML comment (in Markdown and HTML files). It is optional.\n* `{{.Directory}}`: YAML map from above (up to project's directory) or current directory's `.zas.yml` file. It is optional.\n* `{{.URL}}`: full URL for this file.\n* `{{.Extra /path/}}`: direct access to map holding `.zas/config.yml` as it is. You can access to any value with its full path. E.g. BaseURL is also available as `/site/baseurl`.\n* `{{.Resolve id}}`: indirect access to site, directory and page config. It works with simple keys (no paths), checking for them in page, directory and site config (as `/site/\u003cid\u003e`), in this order.\n* `{{.Language}}`: file current language, if defined in the first comment (as YAML property `language`). By default, `/site/language` value.\n\n### What about layout.html?\n\nIt is plain HTML. No frills. Just add a placeholder `{{.Body}}` in your template.\n\nFirst header level 1 from Markdown files will be made available as `{{.Title}}`, unless it is overridden.\n\n### But... I want to do pages beyond post-like format\n\nNo problem! Just use our old friend `\u003cembed\u003e`. Imagine `\u003clayout\u003e` is a valid tag.\n\n```html\n\u003clayout\u003e\n  \u003cnav\u003e\n    \u003cembed src=\"navigation.md\" type=\"text/markdown\" /\u003e\n  \u003c/nav\u003e\n  \u003carticle\u003e\n    \u003cembed src=\"section/index.md\" type=\"text/markdown\" /\u003e\n  \u003c/article\u003e\n\u003c/layout\u003e\n```\n\nWhat does it mean? It means you can have .html files with embedded markdown files. Or anything else supported by Zas.\n\n## 你会说普通话?\n\n對不起。T我不会说普通话。That's all my Chinese! If you are here, I guess you will enjoy I18N support in Zas.\n\n### I18N?\n\nYeah, internationalization: you can build multilingual sites with Zas!\n\nYou only need to do three simple steps. First, create an i18n.yml file inside your .zas directory, like this:\n\n```yaml\nMain page:\n  zh: 首页\n  ru: Заглавная страница \n  es: Portada\n  ca: Portada\nCreate account:\n  zh: 创建账户\n  ru: Создать учётную запись\n  es: Crear una cuenta\n  ca: Crea un compte\nLog in:\n  zh: 登录\n  ru: Войти\n  es: Acceder\n  ca: Inicia la sessió\n```\n\nSet your site's main language in `.zas/config.yml`:\n\n```yaml\nsite:\n  language: en\n```\n\nAlso, set each file's language in first comment or, if you have lots of files, as a `.zas.yml` in a subdirectory where to group them.\n\n```sh\n.zas/\nindex.md\nfaq.md\n+-- zh\n    +-- .zas.yml\n    +-- index.md\n    +-- faq.md\n+-- ru\n    +-- .zas.yml\n    +-- index.md\n    +-- faq.md\n+-- es\n    +-- .zas.yml\n    +-- index.md\n    +-- faq.md\n+-- ca\n    +-- .zas.yml\n    +-- index.md\n    +-- faq.md\n```\n\nYour `.zas.yml` will look like this, i.e. for Russian (ru):\n\n```yaml\nlanguage: ru\n```\n\n## Roadmap\n\nThere is no roadmap. I wrote some possible enhancements [here](https://github.com/darccio/zas/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement).\n\nFeel free to open an issue if you think Zas should do something specific in its core.\n\n## Contact me\n\nIf I can help you, you have an idea or you are using Zas in your projects, don't hesitate to drop me a line (or a pull request): [@darccio](https://twitter.com/darccio)\n\n## About\n\nWritten by [Dario Castañé](http://dario.im).\n\n## License\n\nZas is under [AGPL v3](http://www.gnu.org/licenses/agpl-3.0.html) license.\n\n## Other cool projects\n\nRecently I found this cool generator inspired by zas: [zs](https://github.com/zserge/zs). I'm happy to be a humble reference for somebody :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarccio%2Fzas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarccio%2Fzas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarccio%2Fzas/lists"}