Skip to content

Instantly share code, notes, and snippets.

@andrewshell
Last active August 29, 2015 14:19
Show Gist options
  • Save andrewshell/bdb986d0a8e53f497dcf to your computer and use it in GitHub Desktop.
Save andrewshell/bdb986d0a8e53f497dcf to your computer and use it in GitHub Desktop.
MyWord: Minimum Viable Homepage
{
"urlTwitterServer": "https://storage.geekity.com/",
"urlDefaultImage": "http://scripting.com/2015/03/21/gratefulDead.png",
"googleAnalyticsAccount": "UA-39531990-1",
"templates": {
"Default": "http://myword.geekity.com/templates/handlebars.html"
},
"startupCode": "bootstrapHomepage();"
}
var originalPublishButtonClick;
function homepageTemplate(data) {
var template = Handlebars.compile(
'<html><head><title>{{ rssTitle }}</title></head><body>' +
'<h1>{{ rssTitle }}</h1><h2>{{ rssDescription }}</h2>' +
'<ul>{{#each rssHistory}}<li><a href="{{ link }}">{{ title }}</a></li>{{/each}}</ul>' +
'</body></html>');
return template(data);
}
function publishButtonClickHook(flInteract, callback) {
originalPublishButtonClick(flInteract, callback);
console.log('publishHomepage');
var renderedtext = homepageTemplate(appPrefs);
twUploadFile ('index.html', renderedtext, "text/html", false, function (data) {});
}
function bootstrapHomepage() {
originalPublishButtonClick = publishButtonClick;
publishButtonClick = publishButtonClickHook;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment