Last active
August 29, 2015 14:19
-
-
Save andrewshell/bdb986d0a8e53f497dcf to your computer and use it in GitHub Desktop.
MyWord: Minimum Viable Homepage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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();" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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