# spirit-site-data

> A template data generator for the spirit static file generator

Latest version **1.0.2** (published 2014-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install spirit-site-data
pnpm add spirit-site-data
yarn add spirit-site-data
bun add spirit-site-data
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2014-07-24 |
| First published | 2014-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexander James Ray |
| Maintainers | alexray |
| Keywords | data, spirit |

## Links

- npm: https://www.npmjs.com/package/spirit-site-data
- Repository: http://github.com/alex-ray/spirit-site-data
- Homepage: https://github.com/alex-ray/spirit-site-data
- Issues: https://github.com/alex-ray/spirit-site-data/issues
- npm.io page: https://npm.io/package/spirit-site-data

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2014-07-24
- 1.0.1 — 2014-07-20
- 1.0.0 — 2014-07-19
- 0.0.1 — 2014-07-17

## README

## Spirit Site Data

### Summary
A simple template data generator for the [ Spirit Core ]( http://github.com/alex-ray/spirit-core) static file generator.

### Syntax
Install the [ Spirit Core ]( http://github.com/alex-ray/spirit-core ) through [npm](http://npmjs.org).
```
npm install spirit-core.
```
```javascript

var config = {
  site : {
    data : {
      title : "A spirit blog.",
      description : "Something awesome."
    }
  }
} ;

var SpiritCore     = require( 'spirit-core' ) ;
var spirit         = new SpiritCore( ".", config ) ;
var spiritData     = spirit.getData( ) ;
var spiritSiteData = spiritData.site ;

console.log( spiritData.site ) ;

/* RETURNS =>
  {
    title : "A spirit blog",
    description : "Something awesome."
  }
*/

```

### Properties

`spiritData.site`
The data object containing all template data

### Configuration
There are three ways to pass data into the site property

1. Through the [ Spirit Core ]( http://github.com/alex-ray/spirit-core ) configuration files site property.
```javascript
  // In "_config.json"
  {
    site : {
      // put data here
    }
  }
```

2. Programmatically to the [ Spirit Core ]( http://github.com/alex-ray/spirit-core)  constructor .
```javascript
  var config = {
    site : {
      // put data here
    }
  }
  var SpiritCore = require( 'spirit-core' ) ;
  var spirit = new SpiritCore( '/root/path', config )
```

3. By specifying a src path in the site config
```javascript
  var config = {
    site : {
      src : 'siteData.json'
    }
  } ;
  var SpiritCore = require( 'spirit-core' ) ;
  var spirit = new SpiritCore( 'root/path', config ) ;

  /* in "siteData.json"
    {
      // put data here
    }
  */
```
4. By including a `site.json` file in the source directory
```
  /* in "_site.json"
    {
      // put data here
    }
  */
```

Handmade in San Francisco California by [ Alex Ray ]( http://twitter.com/_alexray )

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