Skip to content

Commit 244eb0e

Browse files
authored
Merge pull request #651 from kalamuna/kstat_test
Update to kstat_test minimalist framework
2 parents 248c3e7 + 4ca0dd1 commit 244eb0e

File tree

116 files changed

+313
-7057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+313
-7057
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11
1+
18

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 6.0.0-alpha1: xxxx-xx-xx
4+
5+
- Complete rewrite without metalsmith, focusing on minimalism
6+
37
## 5.0.0-alpha1: 2022-06-12
48

59
- Move from node-sass to normal sass

README.md

Lines changed: 4 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -12,117 +12,13 @@ Static site application framework for prototyping and styleguiding.
1212

1313
## Install
1414

15-
$ npm install kalastatic --save
15+
npm install kalastatic --save
1616

1717
## Usage
1818

19-
### Convention
20-
21-
Construct your source files, using the template engine name in the file extension. The following example uses the [Pug](https://pugjs.org/) template engine, but others are available ([Twig](https://github.com/twigjs/twig.js), [Mustache](https://github.com/janl/mustache.js/), etc).
22-
23-
#### src/index.html.pug
24-
``` pug
25-
---
26-
pretty: true
27-
title: Hello World!
28-
---
29-
doctype html
30-
html(lang="en")
31-
head
32-
title= title
33-
body
34-
h1= title
35-
```
36-
37-
### Configuration
38-
39-
KalaStatic can be configured through a `kalastatic.yaml` file. The default options are as follows:
40-
41-
``` yml
42-
# The base directory of where the base KalaStatic lives.
43-
base: .
44-
45-
# What BrowserSync should consider the index page.
46-
bsIndex: 'index.html'
47-
48-
# What BrowserSync should consider the webroot when running KalaStatic.
49-
# Defaults to the KalaStatic destination directory.
50-
bsWebroot: ''
51-
52-
# Whether or not to open the browser when initially running Kalastatic.
53-
bsBrowser: false
54-
55-
# The directory (from base), where the source content files live.
56-
source: src
57-
58-
# Where the files will be built out to.
59-
destination: build
60-
61-
# Whether or not the build directory should be cleaned before building.
62-
cleanBuild: false
63-
64-
# The options to pass off to the Metalsmith plugins when building, keyed by plugin name.
65-
pluginOpts: {}
66-
67-
# KSS Styleguide Configuration
68-
kss:
69-
# Set the path to a custom KSS Builder
70-
builder: null
71-
title: "Styleguide"
72-
homepage: styles/homepage.md
73-
css: ../styles/main.css
74-
source:
75-
- src/components/
76-
- src/styles/
77-
```
78-
79-
### CLI
80-
81-
KalaStatic can be used as a command line interface. The following are some of its commands:
82-
83-
#### Build
84-
85-
Runs through the KalaStatic build tasks and outputs to the destination folder.
86-
87-
```
88-
node_modules/.bin/kalastatic build
89-
```
90-
91-
#### Start
92-
93-
Starts up a development server through [BrowserSync](https://www.browsersync.io/) in order to watch and serve KalaStatic. Changes you make to the source will automatically reflect in the browser.
94-
95-
```
96-
node_modules/.bin/kalastatic start
97-
```
98-
99-
#### Scripts
100-
101-
While you can run `kalastatic` as a CLI application, it is recommended to run the above commands through the use of [npm scripts](https://docs.npmjs.com/misc/scripts) in `package.json`:
102-
103-
```
104-
"scripts": {
105-
"test": "kalastatic build",
106-
"start": "kalastatic start"
107-
}
108-
```
109-
110-
Then you can simply run the following commands to interact with your project:
111-
112-
```
113-
npm test
114-
npm start
115-
```
116-
117-
### API
118-
119-
KalaStatic can be used a JavaScript API. Calling `KalaStatic()` will build, and return a Promise.
120-
121-
``` javascript
122-
var KalaStatic = require('kalastatic')
123-
KalaStatic('path/to/site').then(function() {
124-
// Site built
125-
})
19+
``` bash
20+
npm i kalastatic --global
21+
kalastatic path/to/prototype
12622
```
12723

12824
For more in depth documentation, visit https://kalamuna.github.io/kalastatic/

bin/kalastatic

Lines changed: 0 additions & 171 deletions
This file was deleted.

bin/kalastatic.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env node
2+
/**
3+
* @file bin/kalastatic
4+
*
5+
* This file will load up the kalastatic API, and run it against the current working directory.
6+
*/
7+
8+
import meow from 'meow';
9+
import { readFileSync } from 'fs';
10+
import { kstat } from "../src/kalastatic.js";
11+
12+
const cli = meow(`
13+
Usage
14+
$ kalastatic <directory>
15+
16+
Examples
17+
$ kalastatic path/to/prototype
18+
`, {
19+
importMeta: import.meta
20+
});
21+
22+
const directory = cli.input[0] ?? '.';
23+
24+
if (directory != '.') {
25+
process.chdir(directory);
26+
}
27+
28+
const pkg = readFileSync('package.json', 'utf8');
29+
const config = JSON.parse(pkg);
30+
kstat(config.kalastatic);

docs/.nojekyll

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)