Skip to content

Commit

Permalink
v0.2.0 (#2)
Browse files Browse the repository at this point in the history
v0.2.0: Markdown support, TravisCI, test coverage and code refactor.
  • Loading branch information
pirobtumen authored Oct 21, 2019
1 parent 8e78f36 commit 332ee00
Show file tree
Hide file tree
Showing 31 changed files with 467 additions and 336 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: node_js
node_js:
- "12.12"
cache:
directories:
- node_modules
branches:
only:
- master
before_install:
- npm update
install:
- npm ci
script:
- npm run test
- npm run coveralls
- npm run build
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0] - 21-10-2019

### Added

- Markdown support.
- Build command supports output folder option and args validation.
- Travis CI integration.
- Test coverage.

## [0.1.0] - 20-10-2019

### Added

- Uses generic file types only.
Template system.
- Template system.
- Snippet system.
- Progressive builds.
- CSS minification.
- Blog post, recent posts and archive.
- Blog post, recent posts and archive.
73 changes: 46 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
[![TravisCI](https://travis-ci.com/pirobtumen/filler.svg?branch=master)](https://travis-ci.com/pirobtumen/filler)
[![Coverage Status](https://coveralls.io/repos/github/pirobtumen/filler/badge.svg?branch=master)](https://coveralls.io/github/pirobtumen/filler?branch=master)

# Filler

1. Description
2. Features & Roadmap
3. Installation
4. Commands
5. Folder structure
6. Template system
7. Snippet system
8. Blog system
9. Contribute
10. License
Static web sites made easy.

**Table of content**

- [Filler](#filler)
- [Objective](#objective)
- [Features and Roadmap](#features-and-roadmap)
- [Installation](#installation)
- [Commands](#commands)
- [Folder structure](#folder-structure)
- [Template system](#template-system)
- [Snippet system](#snippet-system)
- [Blog system](#blog-system)
- [Contribute](#contribute)
- [License](#license)

## Static web sites made easy.
## Objective

Filler is a tool to create a static website using templates, reusing code and saving time. Its main purpose is to be as simple as possible to use.

## Features & Roadmap
## Features and Roadmap

- [x] Uses generic file types only. [v0.1.0]
- [x] Template system. [v0.1.0]
- [x] Snippet system. [v0.1.0]
- [x] Progressive builds (it only builds files that have changed, but you can `--force` it). [v0.1.0]
- [x] CSS minification. [v0.1.0]
- [x] Blog post, recent posts and archive. [v0.1.0]
- [ ] Markdown support.
- [x] Markdown support.
- [ ] Improve logging system.
- [ ] Improve error system.
- [ ] Serve project: build in memory and watch for file changes.
- [ ] Support saving into cloud storage (AWS S3, Google Cloud Storage...).
- [ ] Example templates.
- [ ] "init" command.
- [ ] Multilingual sites.
- [ ] Webpack support.
- [ ] React support.
- [ ] Serve project (build in memory and watch for file changes).
- [ ] Server Side Rendering.
- [ ] SEO features.
- [ ] Any proposal? Contribute!

## Installation
# Installation

Install node [[Download link](https://nodejs.org/en/download/)] [Tested version 12.12]
Install node [[Download link](https://nodejs.org/en/download/)][tested version 12.12]

Install filler:

```
git clone https://github.com/pirobtumen/filler.git
cd filler
Expand All @@ -47,11 +62,12 @@ node filler --help
## Commands

- build \<folder\> [OPTIONS]

- folder: project folder path. E.g.: "~/Projects/myweb".
- --force: force build all files.
- --mode [dev, prod]: build mode. Replace specifi snippets.
- --recentPosts [number]: number of recent posts rendered.

- --output: output folder path. Default: ./dist
- --force: force build all files. Default: false
- --mode [dev, prod]: build mode. Replace specific snippets. Default: dev
- --recentPosts [number]: number of recent posts rendered. Default: 5

## Folder structure

Expand All @@ -74,13 +90,14 @@ Create the following file structure:
- /styles
- styles.css
```

Build command for development:

`node filler ~/Projects/myweb`

Build command for production (injects analytics):

`node filler ~/Projects/myweb`
`node filler ~/Projects/myweb --mode prod`

The output folder will contain:

Expand All @@ -98,7 +115,7 @@ The output folder will contain:

## Template system

The files inside the public folder can use any template created inside the `/templates` folder. The idea is to set the property `@template <template filename>` inside a comment in the top part of the file. Let's see an example:
The files inside the public folder can use any template created inside the `/templates` folder. The idea is to set the property `@template <template filename>` inside a comment in the top part of the file. Let's see an example:

```
File: ./public/index.html
Expand All @@ -108,6 +125,7 @@ File: ./public/index.html
I'm the main web page!!
```

```
File: ./templates/main.html
<div>
Expand All @@ -127,6 +145,7 @@ I'm the main web page!!
## Snippet system

Currently there are only two supported snippets:

- /snippets/scripts.html: replaced in every mode.
- /snippets/analytics.html: replaced only in `prod` mod.

Expand Down Expand Up @@ -156,7 +175,7 @@ I'm the main web page!!

## Blog system

The files inside the `/post` folder can use any template created inside the `/templates` folder. The idea is to set the parameter `@template <template filename>` inside a comment in the top part of the file. It will also have some extra properties: `@title`, `@description`, `@author` and `@date (dd-mm-yyyyy)`. These properties are used to build the `{{blog:recent-post}}` and `{{blog:archive}}`.
The files inside the `/post` folder can use any template created inside the `/templates` folder. The idea is to set the parameter `@template <template filename>` inside a comment in the top part of the file. It will also have some extra properties: `@title`, `@description`, `@author` and `@date (dd-mm-yyyyy)`. These properties are used to build the `{{blog:recent-post}}` and `{{blog:archive}}`.

```
File: ./post/my-first-post.html
Expand All @@ -171,9 +190,9 @@ File: ./post/my-first-post.html
My firs blog post content
```

If you want to use `{{blog:recent-posts}}` or `{{blog:archive}}`, you need to create the `/template/recentPost.html` or `template/archivePost.html` template in order to render them. For example:
If you want to use `{{blog:recent-posts}}` or `{{blog:archive}}`, you need to create the `/template/recentPost.html` or `template/archivePost.html` template in order to render them. For example:

Then you can insert the markups `{{blog:recent-posts}}` or `{{blog:archive}}` where you want, for example in the main page:
Then you can insert the markups `{{blog:recent-posts}}` or `{{blog:archive}}` where you want, for example in the main page:

```
Result: ./dist/index.html
Expand All @@ -186,13 +205,13 @@ I'm the main web page!!

You can control the number of recent post displayed with the `build --recentPosts <number>` argument.

## Contribute
# Contribute

Feel free to:

- Submit bugs/features.
- Open a Pull Request with some fix/feature.

## License
# License

Filler is distributed under BSD 3-Clause license. Check the LICENSE.md file.
11 changes: 6 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module.exports = {
"roots": [
"<rootDir>/test"
],
"transform": {
"^.+\\.ts$": "ts-jest"
collectCoverage: true,
verbose: true,
collectCoverageFrom: ['src/**/*.ts'],
transform: {
"^.+\\.tsx?$": "ts-jest",
},
testRegex: "(./tests/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
}
Loading

0 comments on commit 332ee00

Please sign in to comment.