Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update docus #5

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ coverage
*.iml
package-lock.json
templates/*
sw.js
sw.*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules
.DS_Store
coverage
dist
sw.*
10 changes: 0 additions & 10 deletions docs/.gitignore

This file was deleted.

56 changes: 31 additions & 25 deletions docs/content/en/index.md → docs/content/en/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
title: "Documentation"
description: "Track without being tracking on Nuxt with Ackee analytics"
category: "Home"
version: 3.0
fullscreen: false
menu: true
menuTitle: "Documentation"
badge: ""
draft: false
features:
- Add Ackee to your Nuxt app in seconds
- Ask for user consent easily
Expand All @@ -14,7 +20,7 @@ Track without being tracked on Nuxt with [Ackee analytics](https://ackee.electer

## Features

<list :items="features"></list>
<d-list :items="features"></d-list>

[Check Release Notes](https://github.com/nuxt-community/ackee-module/blob/main/CHANGELOG.md)

Expand All @@ -30,24 +36,24 @@ This module allows you to plug easily your Nuxt website to a domain on your Acke

Add `@nuxtjs/ackee` dependency to your project:

<code-group>
<code-block label="Yarn" active>
<d-code-group>
<d-code-block label="Yarn" active>

<!-- prettier-ignore -->
```bash
yarn add --dev @nuxtjs/ackee
```

</code-block>
<code-block label="NPM">
</d-code-block>
<d-code-block label="NPM">

<!-- prettier-ignore -->
```bash
npm install --save-dev @nuxtjs/ackee
```

</code-block>
</code-group>
</d-code-block>
</d-code-group>

Then add `@nuxtjs/ackee` to the `buildModule` section of `nuxt.config.js` and configure your Ackee `server` and `domainId`:

Expand All @@ -65,23 +71,23 @@ Then add `@nuxtjs/ackee` to the `buildModule` section of `nuxt.config.js` and co
}
```

<alert>
<d-alert>

Use the `modules` property instead of `buildModules` if you are using `nuxt < 2.9.0`

</alert>
</d-alert>

Voilà! Your Nuxt application is ready to report to your Ackee domain~

## Usage

This module injects `$ackee` into your application. It contains an [`ackee-tracker` instance](https://github.com/electerious/ackee-tracker#%EF%B8%8F-instance-api) (but not only, see [asking for consent](#asking-for-consent)). You can use it to create and update new records, actions, and more.

<alert>
<d-alert>

This module already takes care of creating a new record on every page navigation. That's why in most cases you don't need to get beyond the above setup!

</alert>
</d-alert>

### Sending Events

Expand All @@ -108,11 +114,11 @@ export default {
</script>
```

<alert>
<d-alert>

Ackee recommends to ask user for consent before sending events. For that purpose you can leverage this module's injected [`details.value`](#detailsvalue) property when using the `detailed` option, see [asking for consent](#asking-for-consent) below. More about events on [Ackee documentation](https://docs.ackee.electerious.com/#/docs/Events).

</alert>
</d-alert>

### Asking for Consent

Expand Down Expand Up @@ -157,8 +163,8 @@ From now on, a new object will be available at the key `details` in the injected

You can configure `@nuxtjs/ackee` with the `ackee` property in your `nuxt.config.js` or directly when registering the module in the `buildModules` array by using the array syntax.

<code-group>
<code-block label="ackee key" active>
<d-code-group>
<d-code-block label="ackee key" active>

<!-- prettier-ignore -->
```javascript[nuxt.config.js]
Expand All @@ -169,8 +175,8 @@ export default {
}
```

</code-block>
<code-block label="buildModules array">
</d-code-block>
<d-code-block label="buildModules array">

<!-- prettier-ignore -->
```javascript[nuxt.config.js]
Expand All @@ -183,8 +189,8 @@ export default {
}
```

</code-block>
</code-group>
</d-code-block>
</d-code-group>

### Properties

Expand Down Expand Up @@ -270,17 +276,17 @@ ackee: {
}
```

<alert type="warning">
<d-alert type="warning">

For this feature to work you need to set up an `Access-Control-Allow-Credentials` header on your Ackee installation, [more info](https://docs.ackee.electerious.com/#/docs/CORS%20headers#credentials).

</alert>
</d-alert>

<alert type="warning">
<d-alert type="warning">

This feature should be turned off when using a wildcard `Access-Control-Allow-Origin` header, [more info](https://docs.ackee.electerious.com/#/docs/Options#cors-headers).

</alert>
</d-alert>

#### storageKey

Expand Down Expand Up @@ -319,11 +325,11 @@ export default {

This module globally injects a `$ackee` object, meaning that you can access it anywhere using `this.$ackee`. For plugins, `asyncData`, `nuxtServerInit` and middlewares, you can access it from `context.$ackee`.

<alert type="warning">
<d-alert type="warning">

`details.*` methods and properties are only available when using `'opt-in'` or `'opt-out'` with the [detailed](#detailed) option.

</alert>
</d-alert>

### Methods

Expand Down
18 changes: 14 additions & 4 deletions docs/content/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
{
"title": "Nuxt Ackee",
"description": "Track without being tracking on Nuxt with Ackee analytics",
"url": "https://ackee.nuxtjs.org",
"layout": "readme",
"logo": {
"light": "/logo-light.svg",
"dark": "/logo-dark.svg"
},
"header": {
"logo": true,
"title": false
},
"twitter": "@nuxt_js",
"github": {
"repo": "nuxt-community/ackee-module",
"branch": "main"
"branch": "main",
"dir": "docs",
"releases": true
},
"twitter": "@nuxt_js",
"layout": "single",
"defaultBranch": "master"
"colors": {
"primary": "#65deb1"
},
"credits": true
}
5 changes: 0 additions & 5 deletions docs/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { withDocus } from 'docus'

export default withDocus({
docs: {
colors: {
primary: '#65deb1'
}
},
generate: {
fallback: true
},
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"generate": "nuxt generate"
},
"dependencies": {
"docus": "^0.0.9",
"nuxt": "^2.15.3"
"docus": "0.1.5",
"nuxt-edge": "latest"
},
"devDependencies": {
"vue-plausible": "^1.1.3"
"vue-plausible": "^1.1.4"
}
}
Loading