• Stars
    star
    157
  • Rank 228,397 (Top 5 %)
  • Language
    Groovy
  • License
    Other
  • Created over 10 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Grain is a lightweight and powerful static website generator with custom themes to help create static, SEO-friendly websites or a blog in no time.

Banner

Twitter Follow Twitter Follow

Grain is a lightweight framework and a very powerful static website generator written in Groovy to help make website creation intuitive and enjoyable. Grain suits development of complex, static websites for companies and neat blogging websites for personal use. The framework builds on simple ideas and provides live reload to help you rapidly develop custom themes.

Documentation

All the Grain documentation is located in teh docs/General Docs.md file. You may learn more about using Grain in the following sections:

Key features

Grain comes with the following key features:

  • A preview mode that allows you to make changes and see them applied on the fly
  • Support for embedded Groovy code for any content files (stylesheets and JavaScript files)
  • Configurable conventions that allow you to process content sources using Groovy
  • Support for Markdown, reStructuredText, and AsciiDoctor
  • Compression and minification of source files
  • Code highlighting with Python Pygments
  • Built-in Sass and SCSS support

Themes & templates

A Grain website project is called a theme, and Grain has a few developed responsive themes that you can use. Consult the list of pre-built Grain themes below:

Getting started

Requirements

To run a Grain project, you need to use JDK 7 or later. Download and install the appropriate JDK for your operating system.

Installation

Grain requires no installation. You only need to download one of the themes and run the project — Grain will be loaded automatically as a JAR dependency.

If you're new to Grain, we recommend that you start with the Grain Octopress theme. It gives an overview of how you can efficiently use most Grain features.

If you consider building a Grain website from scratch, try out the Grain Theme Template.

Preview a Grain website

Navigate to the location of your newly created website and run the command below to launch the project in preview mode:

cd /path/to/your_site
./grainw

Here and further the command-line snippets are provided only for the Unix-like operation systems. If you're running Grain on Windows, use the grainw command instead of ./grainw.

Once the project is built, you can visit your favorite browser at http://localhost:4000 to view the website. You can add, change, or delete website files and see all the changes in the browser immediately after refreshing the page.

Generate and deploy

When you're ready to deploy your Grain-based website, you first need to generate all the website files by executing the following command:

./grainw generate

The website files are generated into the /path/to/your_site/target directory.

You can deploy the website files either manually or with the help of Grain:

./grainw deploy

Check the Deployment Configuration section for more information.

The Grain Community

There are many ways to get involved with the project:

  • Mailing List - reach us or ask the community for help
  • Issue Tracker - make Grain better by suggesting improvements
  • Twitter - keep up with the latest Grain news and announcements

Contributing

Any person or company wanting to contribute to Grain Framework should follow the following rules in order to their contribution being accepted.

Sign your work

We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.

Any contribution which contains commits that are not Signed-Off will not be accepted.

To sign off on a commit you simply use the --signoff or -s option when committing your changes to Git:

git commit -s -m "Adding a new widget driver for cogs."

This will automatically append the following data to your commit message:

Signed-off-by: Your Name <[email protected]>

By doing this, you certify the below:

Developer's Certificate of Origin 1.1

If you wish to sign-off commit messages for each commit without specifying -s or --signoff all the time, rename .git/hooks/commit-msg.sample to .git/hooks/commit-msg and uncomment the following lines:

SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

Developer's Certificate of Origin

To help track the author of a patch as well as the submission chain, and be clear that the developer has authority to submit a patch for inclusion into this project please sign off your work. The sign off certifies the following:

Developer's Certificate of Origin 1.1

By making a contribution to the project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

(e) I hereby grant to the project, SysGears, LLC and its successors; 
    and recipients of software distributed by the Project a perpetual,
    worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    copyright license to reproduce, modify, prepare derivative works of,
    publicly display, publicly perform, sublicense, and distribute this
    contribution and such modifications and derivative works consistent
    with this Project, the open source license indicated in the previous
    work or other appropriate open source license specified by the Project
    and approved by the Open Source Initiative(OSI)
    at http://www.opensource.org.

License

Grain is licensed under the Apache License, Version 2.0.

More Repositories

1

apollo-universal-starter-kit

Apollo Universal Starter Kit is a SEO-friendly, fully-configured, modular starter application that helps developers to streamline web, server, and mobile development with cutting-edge technologies and ultimate code reuse.
JavaScript
1,680
star
2

webpack-virtual-modules

Webpack Virtual Modules is a webpack plugin that lets you create, modify, and delete in-memory files in a way that webpack treats them as if they were physically presented in the file system.
TypeScript
494
star
3

mochapack

Mocha test runner with integrated webpack precompiler
TypeScript
184
star
4

create-apollo-app

Create Apollo App is a command-line tool designed to generate fully-configured starter Apollo GraphQL projects with essential dependencies for developing web, server and mobile applications and zero build configuration.
TypeScript
119
star
5

spinjs

SpinJS is now Zen! The project has been renamed and moved to Larix Framework.
TypeScript
43
star
6

selenium-automation-bundle

Selenium Automation Bundle is an extendable and adaptable solution that simplifies automated testing to help focus on writing tests with Selenide and TestNG using the best test design patterns.
Groovy
39
star
7

persistgraphql-webpack-plugin

PersistGraphQL Webpack Plugin
JavaScript
37
star
8

react-apollo-express-example

Example of Express, React, and Apollo application. Let's have a look on our blog to read in-depth tutorial on how to create your own! https://sysgears.com/articles/how-to-create-an-apollo-react-express-application/
JavaScript
25
star
9

domain-schema

Domain Driven Design Schema for JavaScript
JavaScript
22
star
10

apollo-logger

Apollo GraphQL Logger
TypeScript
19
star
11

pinyarn

pins Yarn to a specific version and downloads it automatically on demand
JavaScript
16
star
12

larix

Larix Meta Framework - a polyglot ecosystem for creating modular software with trivially addable and removable feature modules
TypeScript
15
star
13

grain-theme-portfolio

Grain Bootstrap Theme Stylish Portfolio
CSS
14
star
14

grain-theme-octopress

Octopress Grain Theme
CSS
13
star
15

scala-graphql-api-example

Scala
13
star
16

grain-theme-template

Template for new Grain themes
Groovy
12
star
17

java-berkleydb-queue

Lightweight fast persistent queue in Java using Berkley DB
Java
12
star
18

grain-theme-freelancer

Grain Bootstrap Theme Freelancer
CSS
11
star
19

grain-theme-agency

Grain Bootstrap Theme Agency
CSS
11
star
20

akka-spark-pipeline

An example project that implements a data pipeline using Scala, Akka, and Spark and works with document-oriented and graph databases to let you find out how frequently a specific technology is used with different technology stacks.
Scala
11
star
21

grain-theme-business

HTML
9
star
22

glace-dynamic-web-flow

Glace Dynamic Web Flow plugin
Groovy
9
star
23

scala-akka-graphql-kit

Scala starter kit for GraphQL applications
Scala
8
star
24

react-infinite-scroll-example

In your React application, you may need to implement infinite scroll pagination with Apollo. Here it is an example. And we explain how you can achieve this in your application using `apollo-link-state` in this publication: https://sysgears.com/articles/how-to-create-an-apollo-react-express-application/
JavaScript
8
star
25

glace-dynamic-web-flow-showcase

Glace Dynamic Web Flow plugin showcase
Groovy
7
star
26

grain-gradle-plugin

Gradle plugin for Grain
Groovy
7
star
27

apollo-cache-router

Apollo GraphQL Cache Router
TypeScript
7
star
28

apollo-cache-logger

Apollo Cache Logger
TypeScript
6
star
29

auth-with-play-silhouette-example

Scala
5
star
30

graphql-java-starter-kit

GraphQL Java Starter Kit — GraphQL Java app boilerplate for Server with React JavaScript code for Mobile and Web, stack: Java, Spring, Apollo, GraphQL, React 16, React Native, Expo, Express, SQLite, Twitter Bootstrap, Babel, Webpack
JavaScript
5
star
31

scala-spark-test-utils

5
star
32

scala-graphql-error-handling-example

Scala
4
star
33

graphql-codegen-webpack-plugin

Webpack Plugin for graphql-code-generator
TypeScript
4
star
34

grain-theme-clean-blog

Grain Bootstrap Theme Clean Blog
CSS
2
star
35

scala-graphql-subscriptions-on-websockets

Scala
2
star
36

amplify-app

Toolkit to create AWS Amplify apps even faster
TypeScript
2
star
37

restapp

RestApp is an SEO-friendly, fully-configured, modular starter application that helps developers to streamline web, server, and mobile development with cutting-edge technologies and ultimate code reuse.
JavaScript
2
star
38

fractal-objects

Fractal Objects - self-similar objects that can be multiplied together and the result will be a fractal object and have the same type and shape as multiplicands.
TypeScript
2
star
39

hoister

General purpose node_modules hoister
TypeScript
1
star
40

react-router-redux

JavaScript
1
star
41

scala-tapir-akka-http-example

Scala
1
star
42

node-hmr-plugin

Webpack plugin for running node process in development mode with HMR
JavaScript
1
star
43

grain-theme-sphinx

Grain Sphinx Theme
JavaScript
1
star