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

feat: global components #164

Merged
merged 16 commits into from
Jun 25, 2020
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- master
- dev

jobs:
ci:
Expand Down
5 changes: 0 additions & 5 deletions commitlint.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</template>

<script>
import ClickAway from '../directives/click-away'
import ClickAway from '~/directives/click-away'

export default {
name: 'Dropdown',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<div
class="alert border-l-4 p-4 mb-4"
:class="`alert-${type}`"
>
<div class="alert border-l-4 p-4 mb-4" :class="`alert-${type}`">
<div class="flex">
<div class="flex-shrink-0 self-start pt-1">
<IconInfo v-if="type === 'info'" class="alert-icon" />
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions docs/content/en/writing.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,20 @@ However, you cannot render
</my-component>
```

#### Global components

Since **v2.0.0** and Nuxt **v2.13.0**, you can now put your components in `components/global/` directory so you don't have to import them in your pages.

```bash
components/
global/
Hello.vue
content/
home.md
```

Then in `content/home.md`, you can use `<hello></hello>` component without having to worry about importing it in your page.

### Table of contents

A `toc` array property will be injected into your document, listing all the `h2` and `h3` with their titles and ids, so you can link to them.
Expand Down
File renamed without changes.
11 changes: 1 addition & 10 deletions docs/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export default {
'@/plugins/categories',
'@/plugins/i18n.client',
'@/plugins/vue-scrollactive',
'@/plugins/components',
'@/plugins/menu.client'
],
components: true,
/*
** Give routes to static generation
*/
Expand Down Expand Up @@ -76,15 +76,6 @@ export default {
'@nuxt/content'
],
/*
** Components auto import
** See https://github.com/nuxt/components
*/
components: {
dirs: [
{ path: '@/components', pattern: '*.vue' }
]
},
/*
** Modules configuration
*/
colorMode: {
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
},
"dependencies": {
"@nuxt/content": "^1.3.2",
"@nuxt/content": "nuxt/content#dev",
"@nuxtjs/pwa": "^3.0.0-beta.20",
"lodash.groupby": "^4.6.0",
"nuxt-edge": "^2.13.0-26541346.39dd866b",
"nuxt": "^2.13.1",
"nuxt-i18n": "^6.12.2",
"prism-themes": "^1.4.0",
"tailwindcss": "^1.4.6",
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/_slug.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ export default {
}
}

.nuxt-content h4 {
@apply text-xl font-semibold mb-2 pb-1 border-b -mt-16 pt-20;
}

@screen lg {
.nuxt-content h2 a,
.nuxt-content h3 a {
Expand Down
19 changes: 0 additions & 19 deletions docs/plugins/components.js

This file was deleted.

Loading