{"id":27296065,"url":"https://github.com/gmisail/nice","last_synced_at":"2025-07-16T08:09:51.608Z","repository":{"id":65459119,"uuid":"122147370","full_name":"gmisail/Nice","owner":"gmisail","description":"A static site generator that is not mean.","archived":false,"fork":false,"pushed_at":"2019-12-27T22:37:08.000Z","size":1349,"stargazers_count":24,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-15T01:48:24.606Z","etag":null,"topics":["haxe","html","ssg","static-site-generator","web"],"latest_commit_sha":null,"homepage":"","language":"Haxe","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/gmisail.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}},"created_at":"2018-02-20T02:36:13.000Z","updated_at":"2024-09-29T17:33:02.000Z","dependencies_parsed_at":"2023-01-24T14:45:54.144Z","dependency_job_id":null,"html_url":"https://github.com/gmisail/Nice","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gmisail/Nice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmisail%2FNice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmisail%2FNice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmisail%2FNice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmisail%2FNice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmisail","download_url":"https://codeload.github.com/gmisail/Nice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmisail%2FNice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265495421,"owners_count":23776627,"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":["haxe","html","ssg","static-site-generator","web"],"created_at":"2025-04-11T23:30:02.071Z","updated_at":"2025-07-16T08:09:51.587Z","avatar_url":"https://github.com/gmisail.png","language":"Haxe","readme":"![Logo](/NiceLogo.png)\n\n## What is Nice?\n\nNice is a simple static site generator that makes it ~~easy~~ easier for developers to generate static webpages. \n\n## Installation\n\nNice is distributed through haxelib. To install, type into terminal:\n\n`haxelib install nice`\n\nOnce you have Nice installed, you need to set up your website. Nice makes it very easy to hit the ground running with a new project.\n\n```\nmkdir MyNewSite\ncd MyNewSite\nhaxelib run Nice create project\nhaxelib run Nice build\n```\n\nFirst, you will create a new folder. Inside of this folder, you are going to create a new project and then build it. Easy, right? If you want to see your site in action, you can start a web server inside of the `_public` folder.\n\n```\ncd _public\npython -m SimpleHTTPServer  # python 2\npython3 -m http.server      # python 3\n```\n\n### API\n\nIf you do not want to use the default frontend, you can use the external Javascript interface. You can install it through NPM:\n\n`npm install nice-site`\n\n```\nvar api = require('nice-site')\n\napi.createProject();\napi.createLayout(\"another-layout\")\napi.createPost(\"my-post\")\napi.createPage(\"another-page\");\napi.build()\n```\n\nUsing the API, you can do what you can do with the command line interface: create projects, posts, pages, and layouts, as well as build the project. \n\n## Commands\n\nNice comes with a catalog of commands that make it incredibly easy to create, build, and manage your project.\n\n```\nhaxelib run Nice build \nhaxelib run Nice create \u003cproject/post/page/layout\u003e \u003cname\u003e\nhaxelib run Nice delete \u003cpost/page/layout\u003e \u003cname\u003e\n```\n\nIt is encouraged that you create an alias to the `haxelib run Nice` command, since it a burden to type out. Because the `nice` command is a default Unix command, consider assigning `haxelib run Nice` to something like `nice-util` or `nicelib`.\n\n## Theming\n\nNice does not come with a pre-installed theme or design. The user must design their own theme using HTML \u0026 Mustache.\n\nYou can use the following variables in your Mustache templates:\n\n- title - Title of the current post / page.\n- body - Body content (In your template, you MUST use triple braces ({{{body}}})! Without them, the page will not render properly)\n- pages - Array of your site's pages.\n- posts - Array of your site's posts.\n- date - the current post's Date object\n- date.day - the current post's day (integer from 1-31)\n- date.month - the current post's month (integer from 1 - 12)\n- date.year - the current post's year (4 digit integer)\n\n### _layout/index.html Example\n\n```\n\u003chtml\u003e\n    \u003cbody\u003e\n        \u003ch1\u003eMy cool blog!\u003c/h1\u003e\n        \u003ch3\u003e{{title}}\u003c/h3\u003e\n        \u003cp\u003e{{{body}}}\u003c/p\u003e\n        \u003chr\u003e\n        \u003ch2\u003eOther posts\u003c/h2\u003e\n        \u003cul\u003e\n    \t    {{#posts}}\n            \t\u003cli\u003e\u003ca href=\"/_posts/{{_name}}\"\u003e{{_title}}\u003c/a\u003e\u003c/li\u003e\n    \t    {{/posts}}\n        \u003c/ul\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n\u003e Note:\n\u003e All variables within the Post / Page object are prefixed with an underscore.\n\nPosts and pages are exposed to layouts as an Array of posts. You can change the order by modifying the `sort` property in the configuration file.\n\n## Posts\n\nPosts are very easy to create; all you have to do is create a new file in the `_posts` folder with a HTML extension. You can do this manually or by using the command `haxelib run nice create post PutYourPostNameHere`.\n\nA normal post will look like this:\n\n```\n---\ntitle: My Post Title!\ndate: 2001-01-23\n---\n\n\u003cp\u003e\nHello!\n\u003c/p\u003e\n```\n\nDates follow the [YAML standard.](https://github.com/mikestead/hx-yaml) The values that you use in posts are exposed to the layouts using the Date object (the `date` variable.)\n\n## Pages\n\nPages are very similar to posts, however they are not sorted chronologically.\n\nTo create a new page, all you have to do is create a new file in the `_pages` folder with a HTML extension. Much like posts, there are two ways to do this: manually or with the command line. Using the command line, you will need to run the `haxelib run nice create page PutYourPageNameHere` command.\n\nA normal page will look like this:\n\n```\n---\ntitle: About Me\n---\n\n\u003cp\u003e\nLet me tell you about myself...\n\u003c/p\u003e\n```\n\n## Configuration Files\n\nConfiguration files allow you to alter the build process and define variables that you can use in your layout files. \n\n```\npaths:\n  assets: _assets\n  layouts: _layouts\n  pages: _pages\n  posts: _posts\n  output: _public\n\nvariables:\n  title: john's site\n  name:\n    first: john\n    last: smith\n   \nsort:\n    posts: newest-to-oldest\n    pages: order\n```\n\nTo use the variables declared in `config.yaml`, you use the Mustache expression `{{variables.NameOfVariable}}`.\n\nThere are 3 different sorting styles: `newest-to-oldest`, `oldest-to-newest`, and `order`. If a sorting style is not specified, posts and pages will be in the same order as they are in the `_posts` and `_pages` folder.\n\n## Plugins\n\nPlugins are written in a Haxe's official scripting language, hscript. They allow the user to customize the build process without having to recompile the Nice library itself. Installing plugins is incredibly easy; all you need to do is create a folder named `_plugins` in the root directory of your project and add `.hscript` files to it. \n\n```\nfor(post in posts)\n{\n    var title = post.getTitle(); \n    var title_chars = title.split(''); \n    title_chars.reverse(); \n    post.setTitle(title_chars.join(''));\n}\n```\n\nIn this example, we are looping through every post in the posts folder, getting the name, reversing it, and then setting it to the reversed version. Although not very practical, it represents what can be done using the plugins system. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmisail%2Fnice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmisail%2Fnice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmisail%2Fnice/lists"}