aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 172ab9af415e289f3ace54eaa656122255eeaf66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Small utilities and source files for generating my static website.

## Getting started

### Building the static website

The generation is handled by the shell script `bin/ssg`. It uses functions
from `bin/func` as abstraction layers to process source files.

The generation of the *rss* file is handled in `bin/rssg`. Same as the above
for the shell functions.

Building the static website is as simple as typing:

```
make website

# building small parts is possible
./bin/ssg
./bin/rssg
```

### Previewing

Run a local webserver, e.g.: `python3 -m http.server out/`. Preview the results
on your favorite web browser.

`make && python3 -m http.server out/`

### Uploading the output directory

The content of the `out/` directory is uploaded to a remote directory, thanks
to *rsync* over *ssh*.

`make deploy`

## Media

### Storing medias

Any media files, such as images or video can be stored in a separate `media`
branch . Any files or directory at its root will be copied to the `out/`
directory in the `trunk` branch when generating the static website.

### Compressing images

Files in *jpg format* can be compressed with one of the following command:

- `convert "${in}" -interlace Plane -sampling-factor 4:2:0 -quality 75% "${out}"`
- `convert "${in}" -interlace Plane -gaussian-blur .05 -quality 85% "${out}"`

Additionaly, the option `-strip` can be used for removing metadata. Moreover,
the `-quality`, `-gaussian-blur` and `-sampling-factor` can be swapped between
the example above. Once again, it is a manual process and difficult -time
consumming ?- to automate it with good results.

### Dithering images

It is preferred to use the `png` format with dithered images. Moreover, using
a maximum width of 600 pixeles makes sense, since the dithered will lose
informations anyway. Some of the following commands can be used, with different
results or colored output. Moreover, changing the order of the parameters
changes the final output!

- `convert "${in}" -resize 600x -ordered-dither 3x3 -colorspace gray "${out}"`
- `convert "${in}" -resize 600x -ordered-dither 3x3 -colors 16 "${out}"`

The use of `-colors 16` is encouraged for colored pictures.
remember that computers suck.