Ginere Site Generator

Ginere static site generation from templates

License

License

GroupId

GroupId

eu.ginere
ArtifactId

ArtifactId

ginere-site-generator
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Ginere Site Generator
Ginere static site generation from templates
Project URL

Project URL

http://ginere.eu
Project Organization

Project Organization

ginere solutions
Source Code Management

Source Code Management

https://github.com/ginere/ginere-site-generator

Download ginere-site-generator

How to add to project

<!-- https://jarcasting.com/artifacts/eu.ginere/ginere-site-generator/ -->
<dependency>
    <groupId>eu.ginere</groupId>
    <artifactId>ginere-site-generator</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/eu.ginere/ginere-site-generator/
implementation 'eu.ginere:ginere-site-generator:1.0.0'
// https://jarcasting.com/artifacts/eu.ginere/ginere-site-generator/
implementation ("eu.ginere:ginere-site-generator:1.0.0")
'eu.ginere:ginere-site-generator:jar:1.0.0'
<dependency org="eu.ginere" name="ginere-site-generator" rev="1.0.0">
  <artifact name="ginere-site-generator" type="jar" />
</dependency>
@Grapes(
@Grab(group='eu.ginere', module='ginere-site-generator', version='1.0.0')
)
libraryDependencies += "eu.ginere" % "ginere-site-generator" % "1.0.0"
[eu.ginere/ginere-site-generator "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
eu.ginere : ginere-base jar 1.2.0
com.google.javascript : closure-compiler jar r1810

test (1)

Group / Artifact Type Version
junit : junit jar 4.5

Project Modules

There are no modules declared in this project.

ginere-site-generator

http://ginere.eu

Ginere static site generation from templates

What it is about ?

When you create a static web site, there is a lot of work that can be optimezed, using templates variables and common widges. This tool helps you on that. This a java program that parses a directory structure and generates the html sites. It can be also executed as daemon, that means that you can modify your flies on the fly and see instatanements the results.

How it works ?

It use two folders, one that contains your site content, and another one that contains the common elements: widgets and templates. The tool will parcours your content folder and will creating the pages ussing the elements from the common folder and filling the variables.

In each folder inside your content folder you can put a properties in a file called "GlobalProperties.prop" inside this file you can define properties that will be used in your code. To get the value of one propertie the program will look at the GlobalProperties.prop file of the current folder, if that property is not here it look at the GlobalProperties.prop file of the parent folder until it reachs the root.

Just show me one example ?

Just create two folders, the content and common folders. Inside the content create the index.html file

<html>
	{widget.html}
</html>

Inside the comman filder create a file called widget.html:

Hello wolrd!

The result will be:

<html>
  Hello wolrd!
</html>

See examples/example1

Let's use variables.

The default variables for all the files of the folder are defined in a file called GlobalProperties.prop.

Create a GlobalProperties.prop inside the content folder

VARIABLE_NAME=This is the name of a variable.\nThis is a new Line, \
 but this is in the same line.

Modify your index.html to add the following:

<html>
  {widget.html}
</br>
|VARIABLE_NAME|
</html>
<html>
  Hello wolrd!
</br>
This is the name of a variable.
This is a new Line, but this is in the same line.
</html>
<html>
  {widget.html}
</br>
This is the second file:
</br>
|VARIABLE_NAME|
</html>
<html>
  Hello wolrd!
</br>
This is the second file:
</br>
This is the name of a variable.
This is a new Line, but this is in the same line.
</html>

Let's use a real template.

Ok the previous example where right but let's make something more usefull. Lets create to files that share the same

Let's create into the new content folder two file: page1.prop:

PAGE_NAME=Page 1
PAGE_CONTENT={page1-content.html}
template=template.html

page2.prop:

PAGE_NAME=Page 2
PAGE_CONTENT={page2-content.html}
template=template.html

The two previous files are like the GlobalProperties.prop, that means that they are defining properties. The template propertie means that we are going to create a new page bases on those files ussing template.html as the template and the values of the properties of the template will be replaced by those values. And lets create the new GlobalProperties.prop as :

SITE_DESCRIPTION=The site description
PAGE_NAME=No Name

Lests create a template into the common folder: template.html

<!DOCTYPE html>
<html lang="|LANG|">
  {head.html}
  <body>	
	|PAGE_CONTENT|	
	{footer.html}
  </body>
</html>

Remarks: - If the property is not defined into this file, like SITE_DESCRIPTION, the GlobalProperties.prop will be used instead. - We can put files to be included into the Variables like : PAGE_CONTENT. - We can include files from another file (like in the template.html) and so on.

Build in variables :

  |DATE[dd/MM/yyy HH:mm]|
  • |pagePath|, If the page is like examples\example4\content\folder\page2.html this will return: /content/folder/
  • |pageName|, If the page is examples\example4\content\folder\page2.html, this will return page2.html
  • |filePath|, If the file is like ../content/folder1/folder2/index.html, that will retun /folder1/forlder2. For windows users, file directory separator will be transformed into /
  • |fileName|, If the file is like examples\example4\content\folder\page2.html this will return page2.html.
  • |contextPath|, The same as the page Path

Multiple Folders :

Let's create Those folders:

content: | ├─> GlobalProperties.prop | ├─> page1.html | └-> folder: | ├─> GlobalProperties.prop | └-> page2.html

Properties inside properties CREO QUE NO Evaluate First the properties, Despues los includes

Where can I get the latest release?

Availables sources and releases:

	https://oss.sonatype.org/content/groups/public/eu/ginere/ginere-site-generator/

You can pull it from the central Maven repositories:

  <groupId>eu.ginere</groupId>
  <artifactId>ginere-site-generator</artifactId>
  <version>1.0.0</version>

Download snapshots and release artifacts from:

  https://oss.sonatype.org/content/groups/public

Download source from Github:

  https://github.com/ginere/ginere-site-generator

License

Code is under the Apache Licence v2 license.

Versions

Version
1.0.0