Removed app cache. Added google analytics.

This commit is contained in:
Syrus Akbary 2015-11-30 02:15:55 -08:00
parent dbea576673
commit 221889cb7b
4 changed files with 20 additions and 8 deletions

View File

@ -9,3 +9,11 @@ exports.loadContext = function(callback) {
}
return callback(context);
};
exports.onRouteChange = function(state) {
if (typeof window !== "undefined" && window.ga) {
window.ga('send', 'pageview', {
page: state.pathname
});
}
}

View File

@ -1,4 +1,5 @@
siteTitle = "Graphene"
ga = "UA-12613282-7"
[docs.quickstart]
name = "Quickstart"

View File

@ -5,7 +5,7 @@ export default class Html extends React.Component {
render() {
var title = this.props.title || DocumentTitle.rewind();
return (
<html lang={this.props.lang} manifest="/graphene.appcache">
<html lang={this.props.lang}>
<head>
<meta charSet="utf-8"/>
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
@ -18,6 +18,16 @@ export default class Html extends React.Component {
<body>
<div id="react-mount" dangerouslySetInnerHTML={{__html: this.props.body}} />
<script src="/bundle.js"/>
{this.props.config.ga?<script dangerouslySetInnerHTML={{__html: `
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '${this.props.config.ga}', 'auto');
ga('send', 'pageview');
`}}
/>:null}
</body>
</html>
);

View File

@ -1,7 +0,0 @@
CACHE MANIFEST
# 2015-11-27 v1.0.0
/playground/lib/pypyjs.vm.js
/playground/lib/pypyjs.vm.js.zmem
NETWORK:
*