Skip to content

NinjasCL/chercan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Chercan Static Site Generator

Dependencies

Just Wren CLI is needed. (Although Python3 is used for local server mode.).

  • Installation:

  • MacOS: make wren-macos

  • Linux: make wren-linux

πŸ‘©β€πŸ’» Structure

.
β”œβ”€β”€ LICENSE
β”œβ”€β”€ Makefile
β”œβ”€β”€ README.adoc
β”œβ”€β”€ chercan
β”‚Β Β  β”œβ”€β”€ build.wren
β”‚Β Β  └── config.wren
β”œβ”€β”€ content
β”‚Β Β  β”œβ”€β”€ hello
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ hello.adoc
β”‚Β Β  β”‚Β Β  └── hello.html
β”‚Β Β  β”œβ”€β”€ hello.wren
β”‚Β Β  └── index.wren
β”œβ”€β”€ docs
β”‚Β Β  β”œβ”€β”€ hello.html
β”‚Β Β  β”œβ”€β”€ index.html
β”‚Β Β  β”œβ”€β”€ normalize.css
β”‚Β Β  └── sakura-vader.css
β”œβ”€β”€ static
β”‚Β Β  β”œβ”€β”€ normalize.css
β”‚Β Β  └── sakura-vader.css
β”œβ”€β”€ themes
β”‚Β Β  └── default
β”‚Β Β      β”œβ”€β”€ default.wren.html
β”‚Β Β      β”œβ”€β”€ home.wren.html
β”‚Β Β      └── partials
β”‚Β Β          β”œβ”€β”€ footer.wren.html
β”‚Β Β          └── header.wren.html
└── wren
└── run

πŸš€ Usage

Create your files inside content. Only root level *.wren files supported for now (Wren CLI limitations).

  • ./run new <name>: It will create a new wren file inside content.

  • ./run new:adoc <name>: It will create a new filename with its *.wren and *.adoc inside content.

  • ./run build: It will execute make build. (Builds wren files).

  • ./run build:adoc: It would only build asciidoc files. (Requires AsciiDoctor).

  • ./run build:all: It will execute make build-all (Builds wren and asciidoc files).

  • ./run serve: It will execute make serve. (Requires Python3).

Asciidoc

You could also create a directory with Asciidoc files and use the html output to append it to the file contents. It must have the same name as the Wren file.

  • Example Page:

class Page {
  static title {"Hello Chercan"}
  static content {Asciidoc.read()}
}

return Page

Themes

You can create your own themes. They are just Wren files that uses Wren tags <?wren ?>. You have all the Wren power in these templates.

Name them as <name>.wren.html. Configure the default theme in chercan/config.wren.

Example

<!DOCTYPE html>
<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="content-type">
  </head>
  <body>
    <h1>
      <?wren echo.call(page.title) ?>
      <small><?= "You can also use the shorthand echo tag" ?></small>
    </h1>
  </body>
</html>

Static

The static directory would contain any files (images, css, etc). They would be copied to the output directory.

πŸ“˜ LICENSE

MIT

🀩 Credits

Made with β™₯ by Ninjas.cl .