Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 04a38f2

Browse files
committed
docs: update newsletter
1 parent fceda2f commit 04a38f2

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

docs/guide/getting-started.md

+17-16
Original file line numberDiff line numberDiff line change
@@ -436,29 +436,30 @@ module.exports = {
436436
}
437437
```
438438

439-
Again, a out-of-box component `<Newsletter>`. you can import it from `'@vuepress/plugin-blog/lib/client/components'`.
439+
`vuepress-plugin-mailchimp` has already registered a global component `SimpleNewsletter`. Here's a simple usage:
440+
```vue
441+
// layouts/Post.vue
442+
<template>
443+
<div>
444+
<Content />
445+
<SimpleNewsletter />
446+
</div>
447+
</template>
448+
```
440449

450+
In your theme, You'll probably offer users options whether to enable or not. You can use `this.$service.email.enabled` to access it:
441451
```vue
442452
// layouts/Post.vue
443453
<template>
444-
<div>
445-
<Content />
446-
<Newsletter />
447-
<Comment />
448-
</div>
454+
<div>
455+
<Content />
456+
<SimpleNewsletter v-if="$service.email.enabled"/>
457+
</div>
449458
</template>
459+
```
450460

451-
<script>
452-
import { Comment, Newsletter } from '@vuepress/plugin-blog/lib/client/components'
461+
Please head [UI-customization](https://vuepress-plugin-mailchimp.billyyyyy3320.com/#ui-customization) if you don't like the default UI.
453462

454-
export default {
455-
components: {
456-
Comment,
457-
Newsletter
458-
},
459-
}
460-
</script>
461-
```
462463
## Writing a blog theme
463464

464465
If everything is ok, you can start to write a blog theme. Actually, there are only 2 necessary layout components to

0 commit comments

Comments
 (0)