mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-26 03:23:55 +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);
|
||||
};
|
||||
|
||||
exports.onRouteChange = function(state) {
|
||||
if (typeof window !== "undefined" && window.ga) {
|
||||
window.ga('send', 'pageview', {
|
||||
page: state.pathname
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
siteTitle = "Graphene"
|
||||
ga = "UA-12613282-7"
|
||||
|
||||
[docs.quickstart]
|
||||
name = "Quickstart"
|
||||
|
|
12
docs/html.js
12
docs/html.js
|
@ -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>
|
||||
);
|
||||
|
|
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