-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,74 @@ | ||
# Astro Cookie Consent | ||
<div align="center"> | ||
<h1>vanilla-cookieconent + Astro Integration</h1> | ||
</div> | ||
|
||
Astro wrapper for [vanilla-cookieconsent](https://github.com/orestbida/cookieconsent) | ||
> Use [vanilla-cookieconsent](https://github.com/orestbida/cookieconsent) natively in Astro 🍪 | ||
## Installation | ||
|
||
### Installation using the Astro CLI | ||
|
||
Using the Astro CLI is the [recommended way](https://docs.astro.build/en/guides/integrations-guide/#automatic-integration-setup) to setup integrations in Astro. | ||
|
||
```console | ||
# npm | ||
npx astro add @jop-software/astro-cookieconsent | ||
|
||
# pnpm | ||
pnpm astro add @jop-software/astro-cookieconsent | ||
``` | ||
|
||
### Manual Installation | ||
|
||
When the automatic setup from Astro is not an option for you, feel free to install the package manually. | ||
|
||
```console | ||
# npm | ||
npm install @jop-software/astro-cookieconsent | ||
|
||
# pnpm | ||
pnpm add @jop-software/astro-cookieconsent | ||
``` | ||
|
||
Make sure that either your package manager installs peer dependencies or to manually install the [`vanilla-cookieconsent`](https://www.npmjs.com/package/vanilla-cookieconsent) package. | ||
|
||
## Usage | ||
|
||
```javascript | ||
// astro.config.mjs | ||
|
||
import cookieconsent from "@jop-software/astro-cookieconsent"; | ||
|
||
export default defineConfig({ | ||
// ... | ||
integrations: [ | ||
// ... | ||
cookieconsent({ | ||
// ... | ||
gui_options: { | ||
consent_modal: { | ||
layout: 'cloud', // box/cloud/bar | ||
position: 'bottom center', // bottom/middle/top + left/right/center | ||
transition: 'slide', // zoom/slide | ||
swap_buttons: false // enable to invert buttons | ||
}, | ||
settings_modal: { | ||
layout: 'box', // box/bar | ||
// position: 'left', // left/right | ||
transition: 'slide' // zoom/slide | ||
} | ||
} | ||
// ... | ||
}), | ||
], | ||
}); | ||
``` | ||
|
||
When you call the integration, you can use the same configuration as you can in the [vanilla-cookieconsent](https://github.com/orestbida/cookieconsent) package. | ||
Check their [Readme](https://github.com/orestbida/cookieconsent/blob/master/Readme.md) for more information and documentation. | ||
|
||
## Professional support | ||
|
||
Professional support is available. Please contact [[email protected]](mailto:[email protected]) for more information. | ||
|
||
<div align=center>© 2023, <a href="https://jop-software.de">jop-software Inh. Johannes Przymusinski</a></div> |