This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-16
lines changed
Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Original file line number Diff line number Diff 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
464465If everything is ok, you can start to write a blog theme. Actually, there are only 2 necessary layout components to
You can’t perform that action at this time.
0 commit comments