-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
171 lines (124 loc) · 5.08 KB
/
README.txt
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
teige
html image gallery written in ksh
==================================
Create and maintain an image gallery on your website.
teige [-h] [-v] [-bDFU] [-c config] [-e ID] [-r ID] file|url
Dependencies
============
teige needs ksh and ImageMagick to work as intended. It also
uses ftp to grab remote images with -U.
Options
=======
$ ksh teige -h
Anatomy of teige
================
teige exists on your website as a directory. In this directory
it keeps an index.html file and subdirectories for each posted
image with their image files and index.html.
ImageMagick currently does three things. Checks that the input
file is an image, resizes posted images to create a preview and
optionally blurs the preview if flag -b is supplied.
Every post has a unique ID which serves both as a url and a method
of editing and removing a post.
Information about each post is stored locally in $LOCAL, where
teige stores variables for each post from which it rebuilds the
gallery when used with -F or -e.
Initialization
==============
Before running the script for the first time (see Run section,)
you can edit it with your favorite editor. Notably this is where
you can change a path to where teige looks for its config.
USERVAR Path to a configuration file.
Default: $HOME/.teige.conf
But you do not need to edit anything inside the script for it to
work. Run teige for the first time without any arguments. This
will generate a configuration file.
Configuration
=============
Before going any further, open this file with your favorite editor
and fill in the required variables. The file itself is commented
and contains examples:
WROOT Full path to a website's root directory.
ie: /var/www/htdocs/www.website.cz or
/home/marek/public_html
WEB Relative path to teige's directory inside $WROOT.
User running teige must have write and read
permissions here.
Default: teige.
LOCAL Full path where teige stores offline data for each
post used for rebuilding. Default: $HOME/.teige
WEBSITE Url of your website. This is only printed after using
teige to get a quick link to the post in the form
$WEBSITE/$ID.
teige will create new posts in $WROOT/$WEB. The user running teige
needs write and read permissions on $WEB. The following variables
in the configuration file are used for the construction of the
gallery.
PROFILOVKA Path to a profile picture. Shows up on /index.html.
CSS Path to a css style sheet. teige comes with
a default style sheet gal.css. By default
it expects it in $WROOT/ (you have to put it
there yourself.)
NAME String. Title of your gallery.
MOTTO String. Subtitle of your gallery.
BIO String. A single paragraph description.
TAGS OPTIONAL string of html keywords.
These are used for $WEB/index.html
EDITOR Your prefered program for editing.
The configuration file serves both as a takeoff point for teige
and an easy way to modify one's profile picture, bio and subtitle
(MOTTO). Anytime you change any of these variables, run teige without
any arguments and it will update the the index of your gallery.
If everything went well, after running teige for the second time
(after modifying the $USERVAR) you should find its index file in
$WROOT/$WEB.
Run
===
run teige with:
ksh teige.ksh
The rest of this README suggests you run teige with ksh teige.ksh, or
place it inside your $PATH.
Options
=======
usage: teige [-h] [-v] [-bDF] [-c config] [-r ID] [-a] [file]
-h Display this help text.
-v Displays version information.
-c file Load different configuration file.
-b Blur preview of a posted image.
-D Display debugging messages.
-e ID Edit by ID.
-F Force rebuild of entire gallery.
-r ID Remove image by ID. This removes the post
from both the $WROOT/$WEB and $LOCAL
Usage
=====
If everything goes smooth, all you ever need to do is run
$ teige file (where file is an image file)
This checks that the file exists and if it does, proceeds to
ask the user for a TITLE, which is the h1 of the new post,
IMGALT, which is the alt= option of the img, and DESC, which
is a paragraph description of your post. These variables
along with date and information about the images are stored
locally in $LOCAL/$ID.var
Next it creates a resized copy to use for a preview image
and copies the original to $WROOT/$WEB/$ID.
If you find yourself editting the html part of teigei.ksh and
want to apply it to every previously posted image, use -F flag,
which rebuilds the entire gallery from $LOCAL/ where it stores
variables for each post. Images are NOT rebuilt again and not
stored locally. Their only copy exists in $WROOT/$WEB/$ID
When using -U, instead of a file, enter a URL of a remote image.
(this is subject to future foolproofing and currently exists
as a incomplete feature.)
The -b option blurs the preview of your post.
Both -e and -r interactively edit and remove a post by ID.
Have fun
Origin
======
teige is named after Karel Teige, a Czechoslovak surrealist
and a renowned collagist.
Autor
=====
teige was written in 2022 by Tomáš Rodr.
triapul.cz/teige
Published under GPL-v3