1 Apache + Grutatxt: The Simplest Possible Website
2 ================================================
4 By http://gweb.org (Geoffrey Plitt)
6 I envisioned an entire website consisting of nothing but human-readable
7 text files that are converted to HTML by the web server when necessary,
8 with the least amount of extra junk in there. Here's how I did it.
10 .htaccess (root folder):
11 ------------------------
13 DirectoryIndex index.html index.text
14 Action handle_text /cgi-bin/handle_text.cgi
15 AddHandler handle_text .text
17 This allows you to mix html and "text" content, which is converted to HTML
20 /cgi-bin/handle_text.cgi:
21 -------------------------
23 echo "Content-type: text/html"
25 base=`basename $PATH_TRANSLATED`
26 if [ "$QUERY_STRING" = "" ]; then
28 cat $PATH_TRANSLATED | grutatxt -nb
29 echo "<br><br><small><i>"
30 echo "Generated with <a href='"
31 echo "http://www.triptico.com/software/grutatxt.html"
32 echo "'>Grutatxt</a>. View <a href='$base?SOURCE'>page source</a>"
33 echo "</i></small></BODY></HTML>"
35 echo "<html><body><small>"
36 # The confusing sed stuff just displays ampersands and brackets.
37 cat $PATH_TRANSLATED | sed 's/&/\&/g;s/</\</g;s/>/\>/g' |
41 echo "</small></body></html>"
44 /index.text (any folder)
45 -----------------------
46 I'm an auto-grutatxt'ed HTML page
49 And here is a body paragraph!