mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-18 12:30:37 +03:00
Removed app cache. Added google analytics.
This commit is contained in:
parent
dbea576673
commit
221889cb7b
|
@ -9,3 +9,11 @@ exports.loadContext = function(callback) {
|
||||||
}
|
}
|
||||||
return callback(context);
|
return callback(context);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.onRouteChange = function(state) {
|
||||||
|
if (typeof window !== "undefined" && window.ga) {
|
||||||
|
window.ga('send', 'pageview', {
|
||||||
|
page: state.pathname
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
siteTitle = "Graphene"
|
siteTitle = "Graphene"
|
||||||
|
ga = "UA-12613282-7"
|
||||||
|
|
||||||
[docs.quickstart]
|
[docs.quickstart]
|
||||||
name = "Quickstart"
|
name = "Quickstart"
|
||||||
|
|
12
docs/html.js
12
docs/html.js
|
@ -5,7 +5,7 @@ export default class Html extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
var title = this.props.title || DocumentTitle.rewind();
|
var title = this.props.title || DocumentTitle.rewind();
|
||||||
return (
|
return (
|
||||||
<html lang={this.props.lang} manifest="/graphene.appcache">
|
<html lang={this.props.lang}>
|
||||||
<head>
|
<head>
|
||||||
<meta charSet="utf-8"/>
|
<meta charSet="utf-8"/>
|
||||||
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
|
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
|
||||||
|
@ -18,6 +18,16 @@ export default class Html extends React.Component {
|
||||||
<body>
|
<body>
|
||||||
<div id="react-mount" dangerouslySetInnerHTML={{__html: this.props.body}} />
|
<div id="react-mount" dangerouslySetInnerHTML={{__html: this.props.body}} />
|
||||||
<script src="/bundle.js"/>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|
7
docs/static/graphene.appcache
vendored
7
docs/static/graphene.appcache
vendored
|
@ -1,7 +0,0 @@
|
||||||
CACHE MANIFEST
|
|
||||||
# 2015-11-27 v1.0.0
|
|
||||||
/playground/lib/pypyjs.vm.js
|
|
||||||
/playground/lib/pypyjs.vm.js.zmem
|
|
||||||
|
|
||||||
NETWORK:
|
|
||||||
*
|
|
Loading…
Reference in New Issue
Block a user