All Projects → gmisail → Nice

gmisail / Nice

Licence: MIT license
A static site generator that is not mean.

Programming Languages

haxe
709 projects
shell
77523 projects

Projects that are alternatives of or similar to Nice

next-prisma
🚀 Static site with Next.js 9.4 and Prisma.
Stars: ✭ 116 (+404.35%)
Mutual labels:  ssg
Portfolio
👤 Automatically generate a beautiful, responsive, static-site to display your GitHub projects.
Stars: ✭ 54 (+134.78%)
Mutual labels:  ssg
vitext
The Next.js like React framework for better User & Developer experience!
Stars: ✭ 376 (+1534.78%)
Mutual labels:  ssg
huge
This is HUGE! A Hugo framework.
Stars: ✭ 17 (-26.09%)
Mutual labels:  ssg
devdevdev
The next trendy apparel e-commerce store maybe?
Stars: ✭ 27 (+17.39%)
Mutual labels:  ssg
Next.js
The React Framework
Stars: ✭ 78,384 (+340700%)
Mutual labels:  ssg
oceanpress
将 Markdown 文件转换为 HTML 生成静态站点的工具,专为思源笔记实现了许多特有渲染效果。
Stars: ✭ 61 (+165.22%)
Mutual labels:  ssg
starter
Create a new Nuxt project, module, layer or start from a theme with our collection of starters.
Stars: ✭ 198 (+760.87%)
Mutual labels:  ssg
prpl
A modular static site generator built for longevity
Stars: ✭ 44 (+91.3%)
Mutual labels:  ssg
hugoblog
Hugoblog is responsive, simple, and clean that would fit for your personal blog based on Hugo Theme Static Site Generator (SSG)
Stars: ✭ 48 (+108.7%)
Mutual labels:  ssg
eleventy solo starter njk
Further development suspended as of 2021-09-11. Please refer instead to https://www.11ty.dev/docs/starter/ for a wide selection of other Eleventy starter sets.
Stars: ✭ 22 (-4.35%)
Mutual labels:  ssg
frontman
💎 A Ruby-based static website generator
Stars: ✭ 103 (+347.83%)
Mutual labels:  ssg
Stencil
A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
Stars: ✭ 9,880 (+42856.52%)
Mutual labels:  ssg
contentz
Create Content, Get a Highly Optimized Website
Stars: ✭ 57 (+147.83%)
Mutual labels:  ssg
chengpeiquan.com
My personal website. Base on Vite 2.0 and Vue 3.0. If you want to know how to use Vite to develop a project, you can refer to this repository.
Stars: ✭ 43 (+86.96%)
Mutual labels:  ssg
greenwood
Greenwood is your workbench for the web, focused on supporting modern web standards and development to help you create your next project.
Stars: ✭ 48 (+108.7%)
Mutual labels:  ssg
graphql-ssg
GraphQL data based Static Site Generator.
Stars: ✭ 30 (+30.43%)
Mutual labels:  ssg
statyk
⚡Dead statyk site generator
Stars: ✭ 26 (+13.04%)
Mutual labels:  ssg
corejam
A scaffolding for building progressive GraphQL powered jamstack applications.
Stars: ✭ 24 (+4.35%)
Mutual labels:  ssg
Aleph.js
The Full-stack Framework in Deno.
Stars: ✭ 3,448 (+14891.3%)
Mutual labels:  ssg

Logo

What is Nice?

Nice is a simple static site generator that makes it easy easier for developers to generate static webpages.

Installation

Nice is distributed through haxelib. To install, type into terminal:

haxelib install nice

Once 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.

mkdir MyNewSite
cd MyNewSite
haxelib run Nice create project
haxelib run Nice build

First, 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.

cd _public
python -m SimpleHTTPServer  # python 2
python3 -m http.server      # python 3

API

If you do not want to use the default frontend, you can use the external Javascript interface. You can install it through NPM:

npm install nice-site

var api = require('nice-site')

api.createProject();
api.createLayout("another-layout")
api.createPost("my-post")
api.createPage("another-page");
api.build()

Using 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.

Commands

Nice comes with a catalog of commands that make it incredibly easy to create, build, and manage your project.

haxelib run Nice build 
haxelib run Nice create <project/post/page/layout> <name>
haxelib run Nice delete <post/page/layout> <name>

It 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.

Theming

Nice does not come with a pre-installed theme or design. The user must design their own theme using HTML & Mustache.

You can use the following variables in your Mustache templates:

  • title - Title of the current post / page.
  • body - Body content (In your template, you MUST use triple braces ({{{body}}})! Without them, the page will not render properly)
  • pages - Array of your site's pages.
  • posts - Array of your site's posts.
  • date - the current post's Date object
  • date.day - the current post's day (integer from 1-31)
  • date.month - the current post's month (integer from 1 - 12)
  • date.year - the current post's year (4 digit integer)

_layout/index.html Example

<html>
    <body>
        <h1>My cool blog!</h1>
        <h3>{{title}}</h3>
        <p>{{{body}}}</p>
        <hr>
        <h2>Other posts</h2>
        <ul>
    	    {{#posts}}
            	<li><a href="https://github.com/_posts/{{_name}}">{{_title}}</a></li>
    	    {{/posts}}
        </ul>
    </body>
</html>

Note: All variables within the Post / Page object are prefixed with an underscore.

Posts 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.

Posts

Posts 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.

A normal post will look like this:

---
title: My Post Title!
date: 2001-01-23
---

<p>
Hello!
</p>

Dates follow the YAML standard. The values that you use in posts are exposed to the layouts using the Date object (the date variable.)

Pages

Pages are very similar to posts, however they are not sorted chronologically.

To 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.

A normal page will look like this:

---
title: About Me
---

<p>
Let me tell you about myself...
</p>

Configuration Files

Configuration files allow you to alter the build process and define variables that you can use in your layout files.

paths:
  assets: _assets
  layouts: _layouts
  pages: _pages
  posts: _posts
  output: _public

variables:
  title: john's site
  name:
    first: john
    last: smith
   
sort:
    posts: newest-to-oldest
    pages: order

To use the variables declared in config.yaml, you use the Mustache expression {{variables.NameOfVariable}}.

There 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.

Plugins

Plugins 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.

for(post in posts)
{
    var title = post.getTitle(); 
    var title_chars = title.split(''); 
    title_chars.reverse(); 
    post.setTitle(title_chars.join(''));
}

In 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].