Skip to content

Commit d664c42

Browse files
committed
docs: Add documentation
1 parent 094a089 commit d664c42

25 files changed

+20542
-0
lines changed

docs/.eslintrc.cjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@nuxt/eslint-config'],
4+
ignorePatterns: [
5+
'dist',
6+
'node_modules',
7+
'.output',
8+
'.nuxt'
9+
],
10+
rules: {
11+
'vue/max-attributes-per-line': 'off',
12+
'vue/multi-word-component-names': 'off'
13+
}
14+
}

docs/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
*.iml
3+
.idea
4+
*.log*
5+
.nuxt
6+
.vscode
7+
.DS_Store
8+
coverage
9+
dist
10+
sw.*
11+
.env
12+
.output

docs/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
strict-peer-dependencies=false

docs/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Docus Starter
2+
3+
Starter template for [Docus](https://docus.dev).
4+
5+
## Clone
6+
7+
Clone the repository (using `nuxi`):
8+
9+
```bash
10+
npx nuxi init -t themes/docus
11+
```
12+
13+
## Setup
14+
15+
Install dependencies:
16+
17+
```bash
18+
yarn install
19+
```
20+
21+
## Development
22+
23+
```bash
24+
yarn dev
25+
```
26+
27+
## Edge Side Rendering
28+
29+
Can be deployed to Vercel Functions, Netlify Functions, AWS, and most Node-compatible environments.
30+
31+
Look at all the available presets [here](https://v3.nuxtjs.org/guide/deploy/presets).
32+
33+
```bash
34+
yarn build
35+
```
36+
37+
## Static Generation
38+
39+
Use the `generate` command to build your application.
40+
41+
The HTML files will be generated in the .output/public directory and ready to be deployed to any static compatible hosting.
42+
43+
```bash
44+
yarn generate
45+
```
46+
47+
## Preview build
48+
49+
You might want to preview the result of your build locally, to do so, run the following command:
50+
51+
```bash
52+
yarn preview
53+
```
54+
55+
---
56+
57+
For a detailed explanation of how things work, check out [Docus](https://docus.dev).

docs/app.config.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// https://github.com/nuxt-themes/docus/blob/main/nuxt.schema.ts
2+
export default defineAppConfig({
3+
docus: {
4+
title: 'Nuxt Listmonk',
5+
description: 'Listmonk module for Nuxt.js',
6+
image: 'https://user-images.githubusercontent.com/904724/185365452-87b7ca7b-6030-4813-a2db-5e65c785bf88.png',
7+
socials: {
8+
twitter: 't7ndotdev',
9+
github: 'roncallyt/nuxt-listmonk',
10+
nuxt: {
11+
label: 'Nuxt',
12+
icon: 'simple-icons:nuxtdotjs',
13+
href: 'https://nuxt.com',
14+
},
15+
},
16+
github: {
17+
branch: 'main',
18+
repo: 'nuxt-listmonk',
19+
owner: 'roncallyt',
20+
edit: true,
21+
},
22+
aside: {
23+
level: 0,
24+
collapsed: false,
25+
exclude: [],
26+
},
27+
main: {
28+
padded: true,
29+
fluid: true,
30+
},
31+
header: {
32+
logo: true,
33+
showLinkIcon: true,
34+
exclude: ['search'],
35+
fluid: true,
36+
},
37+
},
38+
})

docs/components/content/Logo.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<svg
3+
height="63"
4+
viewBox="0 0 445 63"
5+
xmlns="http://www.w3.org/2000/svg"
6+
class="fill-current"
7+
>
8+
<path fill-rule="evenodd" clip-rule="evenodd" d="M31 63C48.1208 63 62 49.1208 62 32C62 14.8792 48.1208 1 31 1C13.8792 1 0 14.8792 0 32C0 49.1208 13.8792 63 31 63ZM49.9991 45.0057H33.651L36.3021 40.2738H47.0535L38.9531 26.3737L36.3021 30.9578L31.2946 39.6823C29.2216 43.1659 26.2483 45.0057 22.1632 45.0057H11.8536C11.3319 45.0057 10.8326 44.8218 10.3808 44.5621C9.92906 44.3025 9.46334 43.9765 9.20261 43.527C8.94187 43.0773 8.90782 42.5673 8.90805 42.0481C8.90827 41.5289 8.94147 41.0191 9.20261 40.5697L22.8996 16.9094C23.1606 16.4599 23.626 15.9863 24.0779 15.7268C24.5297 15.4673 25.029 15.431 25.5507 15.431C26.0723 15.431 26.5716 15.4673 27.0234 15.7268C27.4753 15.9863 27.7934 16.4599 28.0544 16.9094L33.651 26.3737L36.4493 21.4939C36.71 21.0443 37.0286 20.7183 37.4803 20.4587C37.932 20.1992 38.4314 20.0151 38.9531 20.0151C39.4748 20.0151 40.1215 20.1992 40.5732 20.4587C41.0249 20.7183 41.3435 21.0443 41.6041 21.4939L52.6501 40.5697C52.9112 41.0191 53.0917 41.5289 53.092 42.0481C53.0922 42.5673 52.9108 43.0773 52.6501 43.527C52.3894 43.9767 51.9237 44.3025 51.4719 44.5621C51.02 44.8218 50.5207 45.0057 49.9991 45.0057ZM14.7992 40.2738H22.0159C24.4443 40.2738 26.0137 39.5359 27.3903 37.2757L31 30.9578L25.5507 21.6417L14.7992 40.2738Z" fill="#0055D4"/>
9+
<path d="M116.808 12.1818V50H110.714L92.8949 24.2401H92.581V50H85.7301V12.1818H91.8608L109.662 37.9602H109.994V12.1818H116.808ZM142.056 38.071V21.6364H148.74V50H142.259V44.9588H141.963C141.323 46.5469 140.271 47.8456 138.806 48.8551C137.353 49.8646 135.562 50.3693 133.432 50.3693C131.573 50.3693 129.93 49.9569 128.502 49.1321C127.086 48.295 125.978 47.0824 125.178 45.4943C124.378 43.8939 123.978 41.9612 123.978 39.696V21.6364H130.662V38.6619C130.662 40.4593 131.155 41.8873 132.14 42.946C133.124 44.0047 134.417 44.5341 136.017 44.5341C137.002 44.5341 137.956 44.294 138.88 43.8139C139.803 43.3338 140.56 42.6198 141.151 41.6719C141.754 40.7116 142.056 39.5114 142.056 38.071ZM161.08 21.6364L166.805 32.1065L172.621 21.6364H179.694L171.144 35.8182L179.842 50H172.806L166.805 39.7884L160.859 50H153.768L162.41 35.8182L153.989 21.6364H161.08ZM199.028 21.6364V26.8068H182.722V21.6364H199.028ZM186.748 14.8409H193.433V41.4688C193.433 42.3674 193.568 43.0568 193.839 43.5369C194.122 44.0047 194.491 44.3248 194.947 44.4972C195.402 44.6695 195.907 44.7557 196.461 44.7557C196.879 44.7557 197.261 44.7249 197.606 44.6634C197.963 44.6018 198.234 44.5464 198.418 44.4972L199.545 49.723C199.188 49.8461 198.677 49.9815 198.012 50.1293C197.36 50.277 196.559 50.3632 195.612 50.3878C193.937 50.437 192.429 50.1847 191.087 49.6307C189.746 49.0644 188.681 48.1903 187.893 47.0085C187.117 45.8267 186.736 44.3494 186.748 42.5767V14.8409ZM217.812 50V12.1818H224.663V44.2571H241.319V50H217.812ZM246.97 50V21.6364H253.654V50H246.97ZM250.331 17.6108C249.272 17.6108 248.361 17.2599 247.598 16.5582C246.834 15.8442 246.453 14.9886 246.453 13.9915C246.453 12.982 246.834 12.1264 247.598 11.4247C248.361 10.7107 249.272 10.3537 250.331 10.3537C251.402 10.3537 252.313 10.7107 253.064 11.4247C253.827 12.1264 254.208 12.982 254.208 13.9915C254.208 14.9886 253.827 15.8442 253.064 16.5582C252.313 17.2599 251.402 17.6108 250.331 17.6108ZM282.946 29.1335L276.852 29.7983C276.68 29.1828 276.378 28.6042 275.947 28.0625C275.529 27.5208 274.963 27.0838 274.249 26.7514C273.535 26.419 272.661 26.2528 271.626 26.2528C270.235 26.2528 269.066 26.5544 268.118 27.1577C267.182 27.7609 266.721 28.5426 266.733 29.5028C266.721 30.3277 267.022 30.9986 267.638 31.5156C268.266 32.0327 269.3 32.4574 270.74 32.7898L275.578 33.8239C278.262 34.4025 280.256 35.3196 281.561 36.5753C282.878 37.831 283.543 39.4744 283.555 41.5057C283.543 43.2907 283.02 44.8665 281.986 46.233C280.964 47.5871 279.542 48.6458 277.72 49.4091C275.898 50.1723 273.805 50.554 271.442 50.554C267.97 50.554 265.176 49.8277 263.058 48.375C260.941 46.91 259.679 44.8726 259.273 42.2628L265.791 41.6349C266.087 42.9152 266.714 43.8816 267.675 44.5341C268.635 45.1866 269.884 45.5128 271.423 45.5128C273.011 45.5128 274.286 45.1866 275.246 44.5341C276.218 43.8816 276.705 43.0753 276.705 42.1151C276.705 41.3026 276.391 40.6316 275.763 40.1023C275.147 39.5729 274.187 39.1667 272.882 38.8835L268.044 37.8679C265.323 37.3016 263.311 36.3475 262.006 35.0057C260.701 33.6515 260.054 31.9403 260.067 29.8722C260.054 28.1241 260.528 26.6098 261.489 25.3295C262.461 24.0369 263.809 23.0398 265.533 22.3381C267.268 21.6241 269.269 21.267 271.534 21.267C274.858 21.267 277.474 21.9749 279.382 23.3906C281.303 24.8063 282.491 26.7206 282.946 29.1335ZM303.231 21.6364V26.8068H286.925V21.6364H303.231ZM290.951 14.8409H297.636V41.4688C297.636 42.3674 297.771 43.0568 298.042 43.5369C298.325 44.0047 298.694 44.3248 299.15 44.4972C299.605 44.6695 300.11 44.7557 300.664 44.7557C301.083 44.7557 301.464 44.7249 301.809 44.6634C302.166 44.6018 302.437 44.5464 302.621 44.4972L303.748 49.723C303.391 49.8461 302.88 49.9815 302.215 50.1293C301.563 50.277 300.763 50.3632 299.815 50.3878C298.14 50.437 296.632 50.1847 295.29 49.6307C293.949 49.0644 292.884 48.1903 292.096 47.0085C291.32 45.8267 290.939 44.3494 290.951 42.5767V14.8409ZM308.821 50V21.6364H315.211V26.456H315.543C316.134 24.831 317.113 23.563 318.479 22.652C319.846 21.7287 321.477 21.267 323.373 21.267C325.293 21.267 326.912 21.7348 328.229 22.6705C329.559 23.5937 330.494 24.8556 331.036 26.456H331.331C331.959 24.8802 333.018 23.6245 334.507 22.6889C336.009 21.741 337.788 21.267 339.844 21.267C342.454 21.267 344.584 22.0919 346.233 23.7415C347.883 25.3911 348.708 27.7978 348.708 30.9616V50H342.005V31.9957C342.005 30.2353 341.537 28.9489 340.601 28.1364C339.666 27.3116 338.521 26.8991 337.167 26.8991C335.554 26.8991 334.292 27.4039 333.381 28.4134C332.482 29.4105 332.033 30.7093 332.033 32.3097V50H325.478V31.7188C325.478 30.2538 325.034 29.0843 324.148 28.2102C323.274 27.3362 322.129 26.8991 320.713 26.8991C319.753 26.8991 318.879 27.1454 318.091 27.6378C317.303 28.1179 316.676 28.8011 316.208 29.6875C315.74 30.5616 315.506 31.5833 315.506 32.7528V50H308.821ZM367.862 50.554C365.092 50.554 362.691 49.9446 360.66 48.7259C358.629 47.5071 357.053 45.8021 355.933 43.6108C354.825 41.4195 354.271 38.8589 354.271 35.929C354.271 32.9991 354.825 30.4323 355.933 28.2287C357.053 26.0251 358.629 24.3139 360.66 23.0952C362.691 21.8764 365.092 21.267 367.862 21.267C370.631 21.267 373.032 21.8764 375.063 23.0952C377.094 24.3139 378.664 26.0251 379.772 28.2287C380.892 30.4323 381.452 32.9991 381.452 35.929C381.452 38.8589 380.892 41.4195 379.772 43.6108C378.664 45.8021 377.094 47.5071 375.063 48.7259C373.032 49.9446 370.631 50.554 367.862 50.554ZM367.898 45.1989C369.4 45.1989 370.656 44.7865 371.665 43.9616C372.675 43.1245 373.426 42.0043 373.918 40.6009C374.423 39.1974 374.675 37.634 374.675 35.9105C374.675 34.1747 374.423 32.6051 373.918 31.2017C373.426 29.786 372.675 28.6596 371.665 27.8224C370.656 26.9853 369.4 26.5668 367.898 26.5668C366.36 26.5668 365.079 26.9853 364.058 27.8224C363.048 28.6596 362.291 29.786 361.786 31.2017C361.294 32.6051 361.048 34.1747 361.048 35.9105C361.048 37.634 361.294 39.1974 361.786 40.6009C362.291 42.0043 363.048 43.1245 364.058 43.9616C365.079 44.7865 366.36 45.1989 367.898 45.1989ZM393.811 33.3807V50H387.126V21.6364H393.515V26.456H393.848C394.5 24.8679 395.54 23.6061 396.968 22.6705C398.409 21.7348 400.188 21.267 402.305 21.267C404.262 21.267 405.967 21.6856 407.42 22.5227C408.885 23.3598 410.018 24.5724 410.818 26.1605C411.63 27.7486 412.03 29.6752 412.018 31.9403V50H405.333V32.9744C405.333 31.0786 404.841 29.5952 403.856 28.5241C402.884 27.4531 401.536 26.9176 399.812 26.9176C398.643 26.9176 397.602 27.1761 396.691 27.6932C395.793 28.1979 395.085 28.9304 394.568 29.8906C394.063 30.8509 393.811 32.0142 393.811 33.3807ZM424.907 41.0994L424.889 33.0298H425.96L436.153 21.6364H443.964L431.426 35.5966H430.041L424.907 41.0994ZM418.814 50V12.1818H425.498V50H418.814ZM436.615 50L427.382 37.0923L431.887 32.3835L444.61 50H436.615Z" />
10+
</svg>
11+
</template>

docs/content/0.index.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Home
3+
navigation: false
4+
layout: page
5+
main:
6+
fluid: false
7+
---
8+
9+
:ellipsis{right=0px width=75% blur=150px}
10+
11+
::block-hero
12+
---
13+
cta:
14+
- Get started
15+
- /introduction/getting-started
16+
secondary:
17+
- Open on GitHub →
18+
- https://github.com/roncallyt/nuxt-listmonk
19+
---
20+
21+
#title
22+
Nuxt Listmonk
23+
24+
#description
25+
This module allows you to integrate with [Listmonk](https://listmonk.app).
26+
27+
#extra
28+
::list
29+
- Nuxt 3 ready
30+
- TypeScript support
31+
- Useful useSubscribe composable
32+
::
33+
34+
#support
35+
::terminal
36+
---
37+
content:
38+
- npx nuxi module add nuxt-listmonk
39+
---
40+
::
41+
::
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Getting Started
2+
3+
From your Markdown files to a deployed website in few minutes.
4+
5+
## Installation
6+
7+
1. Add nuxt-listmonk module to your nuxt.js project:
8+
9+
```bash [npx]
10+
npx nuxi module add nuxt-listmonk
11+
```
12+
13+
2. If necessary, add `nuxt-listmonk` to the `modules` key on `nuxt.config.ts` file:
14+
15+
```typescript
16+
export default defineNuxtConfig({
17+
modules: ['nuxt-listmonk'],
18+
});
19+
```
20+
21+
## Usage
22+
23+
1. Set up your environment variables:
24+
25+
```text
26+
NUXT_LISTMONK_HOST=""
27+
NUXT_LISTMONK_LIST_ID=""
28+
```
29+
30+
2. Add these options to the `listmonk` key on `nuxt.config.ts` file:
31+
32+
```typescript
33+
export default defineNuxtConfig({
34+
modules: ['nuxt-listmonk'],
35+
listmonk: {
36+
host: process.env.NUXT_LISTMONK_HOST,
37+
listId: process.env.NUXT_LISTMONK_LIST_ID,
38+
},
39+
});
40+
```
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
icon: ph:star-duotone
2+
navigation.redirect: /introduction/getting-started
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Composables
2+
3+
Discover the composables to use in your custom Vue components and pages.
4+
5+
## `useSubscribe()`
6+
7+
`useSubscribe()`{lang=ts} sends subscriber's data to the Listmonk host configured in `app.config.ts`
8+
9+
```vue
10+
<script setup lang="ts">
11+
const email = ref('')
12+
13+
async function submit() {
14+
const subscriber = {
15+
email: email.value,
16+
}
17+
18+
await useSubscribe(subscriber)
19+
}
20+
</script>
21+
22+
<template>
23+
<form @submit.prevent="submit">
24+
<div>
25+
<input v-model="email" type="email" name="email" placeholder="E-mail">
26+
</div>
27+
28+
<button type="submit">Send</button>
29+
</form>
30+
</template>
31+
```
32+
33+
::source-link
34+
---
35+
source: "composables/useSubscribe.ts"
36+
---
37+
::

0 commit comments

Comments
 (0)