Serving Static Content

Batch scripts can convert static content into federated wiki compatible json and serve it with apache.

Apache

We'll springboard our site off of the javascript at fed.wiki.org. This simplifies our work but makes that site the Origin Server which has minor liabilities that are easily reversed at any time.

Configure apache to serve a virtual domain from the pages directory.

Add an index.html to redirect to a url that will load federated wiki's client.js and point to welcome-vistiors.json.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="REFRESH" content="0;url=http://fed.wiki.org/ wiki.c2.com/welcome-visitors"> </head> </html>

Add a .htaccess file that allows CORS access to your content. Include a 404 document that will be similarly allowed but eventually ignored.

Header add Access-Control-Allow-Origin "*" ErrorDocument 404 /findpage.json

Add a favicon.png, curl it from some convenient farm. Try random.png at sandbox. Refresh until you get one you like.

curl http://sandbox.fed.wiki.org/favicon.png >favicon.png

Question: Can .htaccess perform the one redirect making all html superflous?

Batch Scripts

We find it convenient to write script functions to generate useful story items from script datatypes. Add to this a function to emit a page with both story and journal, where the journal has a create action.

Batch scripts can use a version of create that includes the completed story. This admits that the page has been created in one atomic action.

Items should have unique random ids. Incremental handling of moves depends on unique ids. Data can be lost when ids within a single page aren't unique.

Online tools can check generated json should federated wiki find fault. Escape double-quotes, newlines and backslashes within strings. Use comma as a separator, not a terminator between json elements. Write exotic characters in UTF-8.

Consider generating content as a revision of the previous release. Save the released json in an archive directory. Read this, replace the story and add a subsequent create action leaving one or more previous creates in place. Write to pages replacing previous work in progress.

Run batch scripts from cron or other appropriate triggers. Consider updating only pages where inputs have changed.

Considerations

The products of Local Editing will be, as always, associated with the origin, not the static site.

The origin will get to 404 every page browsed this way. It could track browsing from the server side, or, by delivering an unconventional client side.

The origin will endure a 404 for every page browsed this way. Should fed.wiki.org become popular as a springboard it would face performance issues. Client code could check the neighborhood sitemaps to short-circuit requests destine to 404.