diff --git a/components/js/google/analytics.js b/components/js/google/analytics.js index 65c492d..c98eaca 100755 --- a/components/js/google/analytics.js +++ b/components/js/google/analytics.js @@ -1,18 +1,7 @@ -import Safe from 'react-safe'; - import Head from 'next/head'; +import Script from 'next/script'; export function GoogleAnalytics(props) { - const gtagJS = ` -window.dataLayer = window.dataLayer || []; -function gtag() { - dataLayer.push(arguments); -} -gtag('js', new Date()); - -gtag('config', '${props.trackingId}'); -`; - return ( <>
@@ -24,8 +13,21 @@ gtag('config', '${props.trackingId}'); } key="google-analytics" > -+ Complete API documentation for Django HTK modules and utilities. +
+ + {apiSections.map((section, sectionIdx) => ( +{item.signature}
+ {item.description}
+ +
+ {item.example}
+
+ + Django HTK is a comprehensive toolkit providing a set of apps, utilities, + middlewares, and more for Django applications. +
+ +Django HTK can be installed directly from GitHub:
+ +
+
+{`# Install using pip
+pip install git+https://github.com/hacktoolkit/django-htk.git`}
+
+
+ Or add it to your requirements.txt:
+
+{`# requirements.txt
+git+https://github.com/hacktoolkit/django-htk.git`}
+
+
+ Add HTK to your Django project's INSTALLED_APPS:
+
+{`# settings.py
+INSTALLED_APPS = [
+ # ... other apps
+ 'htk',
+ 'htk.apps.accounts',
+ 'htk.apps.cpq',
+ 'htk.apps.store',
+ # Add other HTK apps as needed
+]`}
+
+
+ Configure middleware (optional):
+ +
+
+{`# settings.py
+MIDDLEWARE = [
+ # ... other middleware
+ 'htk.middleware.classes.GlobalRequestMiddleware',
+ 'htk.middleware.classes.RequestTimerMiddleware',
+]`}
+
+
+ Here's a quick example of using HTK utilities:
+ +
+
+{`# Using HTK decorators
+from htk.decorators.classes import deprecated
+
+@deprecated('Use new_function instead')
+def old_function():
+ pass
+
+# Using HTK utilities
+from htk.utils import htk_setting
+from htk.utils.datetime_utils import unix_timestamp
+
+# Get a setting with fallback
+api_key = htk_setting('API_KEY', default='')
+
+# Get current unix timestamp
+timestamp = unix_timestamp()`}
+
+
+ Now that you have Django HTK installed, explore these resources:
+ +,
+ title: 'Well Documented',
+ description: 'Comprehensive documentation with examples and best practices.'
+ }
+ ];
+
+ return (
+ + A comprehensive toolkit of apps, utilities, and middlewares for Django +
+ View on GitHub
+
+ {feature.description}
+
+
+{`# Install from GitHub
+pip install git+https://github.com/hacktoolkit/django-htk.git
+
+# Or add to requirements.txt
+git+https://github.com/hacktoolkit/django-htk.git`}
+
+
+ ,
+ name: 'API',
+ description: 'RESTful API utilities and helpers for building robust APIs',
+ path: 'htk.api'
+ },
+ {
+ icon: + Django HTK provides a comprehensive set of modules and utilities + to accelerate Django application development. +
+ ++ These are the main application modules that provide complete + functionality for common use cases. +
+ +{module.description}
+{module.path}
+ + Helper functions and utilities for common programming tasks. +
+ +{util.description}
+{util.path}
+ Here's how to import and use HTK modules in your Django project:
+ +
+
+{`# Import specific utilities
+from htk.utils.datetime_utils import unix_timestamp
+from htk.decorators.classes import deprecated
+from htk.utils import htk_setting
+
+# Use in your code
+@deprecated('Use new_implementation')
+def old_function():
+ pass
+
+timestamp = unix_timestamp()
+api_key = htk_setting('API_KEY', default='default-key')`}
+
+
+