Skip to content

Commit 8392d66

Browse files
committed
feat: Docs: Remove dead links and amp up the guide
This project is still linked in many static site lists as one of the most popular PHP based generators and stared by many people. It's old and has it's quirks (see https://stitcher.io/blog/a-simple-approach-to-static-generation), but it's actually working. So a little upgrade to the docs - removing dead links, add sidenotes, explain some files - is probably okay. Furthermore, in view of the continuing popularity of the project despite the lack of updates, I believe it makes sense to explain the development status transparently and concisely: The project is in maintenance mode. That's it.
1 parent 37dfa0c commit 8392d66

File tree

5 files changed

+110
-62
lines changed

5 files changed

+110
-62
lines changed

README.md

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
[![Build Status](https://scrutinizer-ci.com/g/brendt/stitcher/badges/build.png?b=master)](https://scrutinizer-ci.com/g/brendt/stitcher/build-status/master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/brendt/stitcher/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/brendt/stitcher/?branch=master)
2-
31
# Stitcher
42

5-
High performance, static websites for PHP developers.
3+
[![Maintenance mode](https://img.shields.io/badge/maintenance_mode-%F0%9F%9A%A7-grey.svg?labelColor=orange)](https://github.com/agendav/agendav/#maintenance-mode)
64

7-
```bash
8-
composer create-project pageon/stitcher
9-
```
5+
**High performance, static websites for PHP developers.**
6+
7+
![Screenshot](src/img/screenshot.png)
8+
9+
Stitcher sites utilize a simple concept that allows PHP developers to quickly publish a structured website or blog.
10+
**Data entries** are mapped onto **templates** and “stitched” together via a **config file**.
11+
12+
Data entries can be provided in many ways:
13+
JSON or YAML files, MarkDown files, images, SASS or CSS, JavaScript, folders and more.
1014

11-
### Why Stitcher?
15+
Templates may use Twig or Smarty to output a desired HTML markup.
1216

13-
Stitcher differs from many other static site generator in two areas. First of all: **performance is key**. Stitcher is built from its core for high performance websites. All tools available to you put performance on the first place. Secondly, it doesn't try to add extra syntax to existing formats. Stitcher provides a robust set of tools **for developers** to build with, and not a lot of hacks so everything fits in one file.
17+
And the config file: well, it's a small YAML.
18+
19+
## Why Stitcher?
20+
21+
Stitcher differs from many other static site generators in two areas.
22+
First of all: **performance is key**. Stitcher is built from its core for high performance websites.
23+
All tools available to you put performance on the first place.
24+
Secondly, it doesn't try to add extra syntax to existing formats. Stitcher provides a robust set of tools
25+
**for developers** to build with, and not a lot of hacks so everything fits in one file.
1426

1527
Also important to note, included with Stitcher:
1628

@@ -22,8 +34,22 @@ Also important to note, included with Stitcher:
2234
- Built-in SASS support
2335
- JavaScript and CSS minification
2436
- Built-in SEO and meta tag optimizations
37+
- CLI to run common actions
38+
39+
## Setup
2540

26-
A quick look at Stitcher:
41+
```bash
42+
composer create-project pageon/stitcher
43+
```
44+
45+
For development purposes you may run the internal PHP server and point it to the `/dev` directory.
46+
You should see an introduction guide and example blog files.
47+
48+
## Quick Guide
49+
50+
A quick look at Stitcher.
51+
52+
The site config defines template and data source files for different routes. This is a minimal blog setup:
2753

2854
```yaml
2955
# site.yml
@@ -43,6 +69,9 @@ A quick look at Stitcher:
4369
field: id
4470
```
4571
72+
Each blog post could come from different content sources, which are listed in data files.
73+
Metadata is stored here as well.
74+
4675
```yaml
4776
# data/blog.yml
4877

@@ -61,6 +90,18 @@ foo_bar:
6190
image: foo_bar.jpg
6291
```
6392
93+
One blog post, in this example it's just a MarkDown file.
94+
95+
```markdown
96+
# data/blog/hello.md
97+
98+
# Hello World
99+
100+
This is a **MarkDown** file. That's it.
101+
```
102+
103+
And finally, a template to render a single post:
104+
64105
```html
65106
<!-- blog.post.html -->
66107

@@ -79,21 +120,17 @@ foo_bar:
79120
{% endblock %}
80121
```
81122

123+
The [full documentation](src/data/guide.md) is shown when you run the project in a server.
82124

83-
You can read more about it on [the Stitcher website](http://stitcher.pageon.be).
84-
85-
### Upcoming features
125+
## Examples
86126

87-
Stitcher is in alpha development, so new features are still being made. Here's a list of what's to come before a stable v1 release:
127+
This project is used, with some rather strong modifications, on [stitcher.io](https://stitcher.io),
128+
the source code for this blog is available at [github.com/brendt/stitcher.io](https://github.com/brendt/stitcher.io).
88129

89-
- Plugin support
90-
- Theme support
130+
## Development
91131

92-
Also, we're already thinking about the farther future:
132+
The core library is maintained in [github.com/pageon/stitcher-core](https://github.com/pageon/stitcher-core).
93133

94-
- Localisation
95-
- URL generation
96-
- CLI Configuration and setup
97-
- site:deploy command
98-
- Frontend Filters
99-
- Form support with Lumen/Slim
134+
⌛ This project was created mainly for personal usage. It's in maintenance mode only.
135+
The development [faded out](https://stitcher.io/blog/a-simple-approach-to-static-generation) a while ago
136+
and the core will be replaced with a solution based on another framework eventually.

src/data/guide.md

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
1+
# Guide
2+
3+
## Building a site with Stitcher
4+
5+
Stitcher sites utilize a simple concept that allows PHP developers to quickly publish a structured website or blog.
6+
**Data entries** are mapped onto **templates** and “stitched” together via a **config file**.
7+
8+
The goal is simple: create blazing fast websites. Stitcher will parse all your templates into static HTML pages,
9+
will parse and minify CSS and JavaScript, will optimize images using ``srcset`` and provides useful developer tools
10+
to aid you in setting things up smoothly.
11+
112
## Installation
213

3-
```sh
4-
composer create-project brendt/stitcher-site
14+
When you read this guide you probably have set up the project already. If not, run
15+
16+
```bash
17+
composer create-project pageon/stitcher
518
```
619

7-
## Building a site with Stitcher
20+
For development purposes you may run the internal PHP server and point it to the `/dev` directory.
21+
22+
```bash
23+
php -S localhost:80 -t dev/
24+
```
825

9-
Stitcher sites can be built by anyone with basic HTML knowledge: **data entries** are mapped onto **templates** which are accessible via **a URL**.
10-
These two components (entries and templates) are mapped - *stitched* - together via a **config file**. Data entries can be provided in many ways:
11-
JSON or YAML files, MarkDown files, images, SASS or CSS, JavaScript, folders and more.
26+
See »Host setup« to find out how to set up different hosts for development and production.
1227

13-
The goal is simple: create blazing fast websites. Stitcher will parse all your templates into static HTML pages, will parse and minify CSS and JavaScript,
14-
will optimize images using ``srcset`` and provides useful developer tools to aid you in setting things up smoothly.
28+
## File setup
1529

1630
### site.yml
1731

@@ -48,15 +62,15 @@ The ``site.yml`` file, located in the ``src/site`` directory is used to stitch t
4862
```
4963
5064
The ``template`` key is required and provides a path to the required template for this page.
51-
The ``data`` key isn't required. It takes a collection of variable names (these will be accessible in the template as variables).
52-
Each variable will need to be loaded. You can either provide a path to a data file (loaded from ``src/data`` by default),
53-
or you can provide a collection with a `src` and `id` key. This approach will generate detail pages from a collection of data entries.
65+
The ``data`` key isn't required. It takes a collection of variable names (these will be accessible in the template as variables).
66+
Each variable will need to be loaded. You can either provide a path to a data file (loaded from ``src/data`` by default),
67+
or you can provide a collection with a `src` and `id` key. This approach will generate detail pages from a collection of data entries.
5468

5569
### Data entries
5670

5771
Data entries can be provided in many formats: JSON, YAML, MarkDown, image, folder, ... Examples can be found after running the `site:install` command.
58-
A data file can either contain data of a single entry, or contain a collection of multiple entries. In the second case, when using JSON or YAML files,
59-
An extra root key `entries` is required.
72+
A data file can either contain data of a single entry, or contain a collection of multiple entries. In the second case, when using JSON or YAML files,
73+
An extra root key `entries` is required.
6074

6175
```yaml
6276
entries:
@@ -79,8 +93,7 @@ See the `src/data` folder files for a more thorough reference.
7993

8094
### Templates
8195

82-
At this moment, Stitcher only supports Smarty as a template engine. Support for more engines will be added in the future.
83-
In a template, all functionality of the engine is available, and all variables provided in `site.yml` are available.
96+
In a template, all functionality of the engine is available, and all variables provided in `site.yml` are available.
8497

8598
```html
8699
{extends 'index.tpl'}
@@ -98,7 +111,12 @@ At this moment, Stitcher only supports Smarty as a template engine. Support for
98111
{/block}
99112
```
100113

101-
### Helpers
114+
### Config
115+
116+
The `config.yml` file provides some configuration options, to set directory paths, image rendering config, meta config and minification options.
117+
See the config file for more information.
118+
119+
## Helpers
102120

103121
Stitcher provides some helper functions in aid of creating fast websites.
104122

@@ -128,30 +146,23 @@ Stitcher provides some helper functions in aid of creating fast websites.
128146
</html>
129147
```
130148

131-
### Config
149+
## Commands
132150

133-
The `config.yml` file provides some configuration options, to set directory paths, image rendering config, meta config and minification options.
134-
See the config file for more information.
151+
Stitcher offers a command line script to run some static site actions.
135152

136-
### Commands
153+
Run `./stitcher` to see the list of available commands and options. Some of them are:
137154

138155
- `site:install`: Copy a base install example.
139156
- `site:generate [url]`: Generate the whole site, or a specific URL from `sites.yml`.
140157
- `site:clean [--force]`: Remove all the generated files.
141158
- `router:list`: List all available URLs from `sites.yml`.
142159
- `router:dispatch url`: Debug a specified URL.
143160

144-
### Developer controller
145-
146-
The developer controller can be used to generate a single URL on-the-fly. Thus enabling a developer to make changes to data entries, configs or templates; and see these changes in real-time, without the need of manually generating the website again.
161+
## Host setup
147162

148-
It's obvious that this approach takes a bit more rendering time, so web pages will be slower.
163+
Stitcher requires at least one virtual host, two if you'd want to use the development mode.
149164

150-
### Host setup
151-
152-
Stitcher requires at least one virtual host, two if you'd want to use the developers controller.
153-
154-
**production**
165+
**Production**
155166

156167
```xml
157168
<VirtualHost *:80>
@@ -167,7 +178,7 @@ Stitcher requires at least one virtual host, two if you'd want to use the develo
167178
</VirtualHost>
168179
```
169180

170-
**development**
181+
**Development**
171182

172183
```xml
173184
<VirtualHost *:80>
@@ -183,9 +194,8 @@ Stitcher requires at least one virtual host, two if you'd want to use the develo
183194
</VirtualHost>
184195
```
185196

186-
Don't forget to add a local host in ``/ets/hosts``.
197+
The development mode can be used to generate a single URL on-the-fly.
187198

188-
```
189-
127.0.0.1 stitcher.local
190-
127.0.0.1 dev.stitcher.local
191-
```
199+
Thus enabling developers to make changes to data entries, configs or templates
200+
and see these changes in real-time, without the need of manually generating the website again.
201+
It's obvious that this approach takes a bit more rendering time, so web pages will be slower.

src/img/screenshot.png

28.7 KB
Loading

src/template/home.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
Welcome to Stitcher
1313
</h2>
1414
<h3>
15-
a tool to create <em>blazing</em> fast websites.
15+
<em>High performance, static websites for PHP developers.</em>
1616
</h3>
1717

1818
<div class="vwrapper">
19-
<a class="button" href="http://stitcher.pageon.be/guide/setting-up" target="_blank">Getting started</a>
19+
<a class="button" href="/guide" target="_blank">Getting started</a>
2020
<em class="button-link">or</em>
21-
<a class="button" href="http://stitcher.pageon.be/guide" target="_blank">Read the full guide</a>
21+
<a class="button" href="/examples" target="_blank">Example blog</a>
2222
</div>
2323
</div>
2424
{/block}

src/template/index.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<head>
33
{block 'head'}
4-
<title>Stitcher 1.0</title>
4+
<title>Stitcher</title>
55
{meta}
66
{css src="main.scss" inline=true}
77
{/block}
@@ -12,7 +12,8 @@
1212
<header>
1313
<nav class="wrapper">
1414
<a href="/" class="stitcher">Stitcher</a>
15-
<a href="http://stitcher.pageon.be/guide/setting-up" target="_blank">Guide</a>
15+
<a href="/guide">Guide</a>
16+
<a href="/examples">Example blog</a>
1617
</nav>
1718
</header>
1819
{/block}

0 commit comments

Comments
 (0)