# lhassa

> Lhassa is a NodeJS / ExpressJS schema-less database-less site engine, inspired by Jekyll

Latest version **0.1.5** (published 2016-05-28) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install lhassa
pnpm add lhassa
yarn add lhassa
bun add lhassa
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2016-05-28 |
| First published | 2016-05-27 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| Author | P. TELLIER-ROBERT |
| Maintainers | ptellier |
| Keywords | NodeJS, ExpressJS |

## Links

- npm: https://www.npmjs.com/package/lhassa
- Repository: https://github.com/ptellier/lhassa
- Homepage: https://github.com/ptellier/lhassa#readme
- Issues: https://github.com/ptellier/lhassa/issues
- npm.io page: https://npm.io/package/lhassa

## Dependencies (3)

- [ejs](https://npm.io/package/ejs.md) ^2.4.2
- [marked](https://npm.io/package/marked.md) ^0.3.5
- [express](https://npm.io/package/express.md) ^4.13.4

## Recent versions

- 0.1.5 (latest) — 2016-05-28
- 0.1.4 — 2016-05-28
- 0.1.3 — 2016-05-28
- 0.1.2 — 2016-05-27
- 0.1.1 — 2016-05-27

## README

#1. LhassaJS

##1.1. What is it ?

Lhassa is a small and simple static site framework written in NodeJS, based upon 
ExpressJS framework, EJS template engine and Markdown.


##1.2. Why ?

Because I need such a simple framework for some clients of mine, and I feel comfortable
writing simple front-end applications using such a tool.

AND... I actually HATE using bloated things...


##1.3. How do I use it ?

In your project :

```
npm install --save lhassa
```

then in your main project file (app.js, server.js, index.js or whatever...) :

```
appdir = __dirname; // define application directory
lhassa = require('lhassa'); // require Lhassa from local packages
app = lhassa(__appdir); // instanciate Lhassa application (it's an ExpressJS app)
app.listen(3000); // listen on port 3000
```

As lhassa(...) returns an ExpressJS application, you can use it as a sub-application...


##1.4. Is there any API ?

Lhassa is meant to be simple, easy and clean, no API is provided at the moment, because it
doesn't need any !


##1.5. Lhassa assumes some files exist...


```
src/ - layouts, pages and posts

src/includes/*.ejs - things you do not want to repeat, do not forget : 'DRY is mandatory for great code !'

src/errors/404.ejs - your 'error 404' page
src/errors/500.ejs - your 'OMG something went totally wrong and my site is broken !' page

src/pages/*.ejs - all your static pages
src/posts/*.md - all your posts written in markdown


pub/ - public static files, compiled assets, etc...


site.json - your site / subapp configuration
```


#2. site.json

Here is a basic site.json example :

```
{
  "lang" : "fr"
  "title" : "my awesome site"
  "pages" : {
  	"/" : { "src" : "index", "title" : "Hello World !" }
  },
  "posts" : [ "hello.md", "bad_news.md", "hi_there.md" ]
}
```

lang (String) : fr|en|... - html lang="" property

title (String) : default title tag property

pages (Object) : url -> object pairs, each url is associated with a source file (in src/pages/) and a title. You can add properties.

posts (Array) : ordered array of posts from past to present (newest is last in the array, oldest is first)

---
_Source: https://npm.io/package/lhassa · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
