Skip to content

kaihendry/wordsister

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My sister needed a simple Web page to add Wedding information upon. The options sucked, so I wrote this.

Features

Very low SLOC. Suck less inspired.

HTML isn't hard, though it's easier to edit with Markdown with a preview.

Editing a page on the Web is accomplished by appending /edit to the URL.

You can also edit the *.mdwn directly on the filesystem. Just run make in the top level directory when done.

First HTML comment becomes the page title.

There is a simple text area to edit the style.css and an ability to upload files.

Authorising editing

First to /edit gets a random secret cookie id for authorising edits on the wiki. To give or restore edit rights, share the cookie like so:

echo http://$vhost/edit/?wordsister=$(ls cookies/)

Optional: Edit the site remotely via git

cat <<HERE > .git/hooks/post-receive
#!/bin/sh
export GIT_WORK_TREE=$(dirname $(pwd))
if ! git diff --quiet
then
	echo WORDSISTER on $GIT_WORK_TREE: Local changes detected. Will NOT be running make!
	echo WORDSISTER: Commit them on the remote host and git pull to do a merge.
	exit 1
fi
git checkout -f master
cd ..
make
HERE
chmod +x .git/hooks/post-receive
git config receive.denyCurrentBranch ignore

On your local machine, you should be able to git clone $vhost:/srv/www/$vhost, make edits and git push back to the remote.

How to upgrade Word sister to latest upstream

git pull https://github.com/kaihendry/wordsister