Skip to content

Commit 18c9735

Browse files
authored
docs: migrate docs to nuxt/content (#404)
* docs: installed nuxt docs theme * docs: added docs files to content folder * docs: updated colors in tailwind.config.js * docs: updated colors and added global component * docs: added assets for global component * docs: update index.md * docs: fix link * docs: added features block * docs: updated styles for promote block * docs: fix hover * docs: moved docs files to docs/ * docs: moved docs directories, created own package.json for docs and removed vuepress
1 parent f54490b commit 18c9735

20 files changed

+4729
-2682
lines changed

docs/.gitignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
.vuepress/dist
1+
node_modules
2+
*.iml
3+
.idea
4+
*.log*
5+
.nuxt
6+
.vscode
7+
.DS_Store
8+
coverage
9+
dist

docs/.vuepress/config.js

-40
This file was deleted.

docs/.vuepress/public/styles.css renamed to docs/components/global/PromoteBlock.vue

+36-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
<template>
2+
<div>
3+
<a href="https://vueschool.io/lessons/the-axios-module?friend=nuxt" target="_blank" class="Promote">
4+
<img src="/async-data-with-nuxtjs-2x.png" alt="AsyncData Nuxt course by Vue School">
5+
<div class="Promote__Content">
6+
<h4 class="Promote__Content__Title">Learn how to use the Axios module with a short video lesson</h4>
7+
<p class="Promote__Content__Description">Get up to speed quickly with Vue School's free video lesson.</p>
8+
<p class="Promote__Content__Signature">Video courses made by VueSchool to support Nuxt.js developpement.</p>
9+
</div>
10+
</a>
11+
</div>
12+
</template>
13+
14+
<script>
15+
export default {
16+
name: 'PromoteBlock'
17+
}
18+
</script>
19+
20+
<style>
121
.Promote {
222
background-color: #edf2f7;
323
color: #2f495e;
@@ -7,11 +27,11 @@
727
margin-top: 1rem;
828
margin-bottom: 1rem;
929
border-radius: .25rem;
30+
text-decoration: none !important;
1031
}
1132
12-
1333
.Promote:hover {
14-
background-color: #e2e8f0 !important;
34+
background-color: #e2e8f0;
1535
text-decoration: none !important;
1636
}
1737
@@ -20,6 +40,7 @@
2040
height: auto;
2141
border-radius: .25rem;
2242
margin-bottom: .75rem;
43+
margin-top: 0;
2344
}
2445
2546
.Promote .Promote__Content {
@@ -60,7 +81,6 @@
6081
padding-left: 1rem;
6182
}
6283
63-
6484
.Promote .Promote__Content__Title {
6585
margin: 0;
6686
}
@@ -71,4 +91,16 @@
7191
}
7292
7393
}
74-
94+
.dark-mode .Promote {
95+
background: #2d3041;
96+
}
97+
.dark-mode .Promote .Promote__Content__Description {
98+
color: #fff;
99+
}
100+
.dark-mode .Promote .Promote__Content__Signature {
101+
color: #ebebeb;
102+
}
103+
.dark-mode .Promote:hover {
104+
background: #43485a;
105+
}
106+
</style>

docs/extend.md renamed to docs/content/en/extend.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Extending Axios
1+
---
2+
title: 'Extending Axios'
3+
description: ''
4+
position: 2
5+
category: 'Extending Axios'
6+
---
7+
28

39
If you need to customize axios by registering interceptors and changing global config, you have to create a nuxt plugin.
410

docs/helpers.md renamed to docs/content/en/helpers.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Helpers
1+
---
2+
title: 'Helpers'
3+
description: ''
4+
position: 3
5+
category: 'Helpers'
6+
---
7+
28

39
## Interceptors
410

docs/content/en/index.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: 'Introduction'
3+
description: ''
4+
position: 1
5+
category: 'Getting started'
6+
menuTitle: 'Intro'
7+
features:
8+
- Automatically set base URL for client & server side
9+
- Exposes `setToken` function to `$axios` so we can easily and globally set authentication tokens
10+
- Automatically enables `withCredentials` when requesting to base URL
11+
- Proxy request headers in SSR (Useful for auth)
12+
- Fetch Style requests
13+
- Integrated with Nuxt.js Progressbar while making requests
14+
- Integrated with Proxy Module
15+
- Auto retry requests with axios-retry
16+
---
17+
18+
## Features
19+
20+
<list :items="features"></list>
21+
22+
> Secure and Easy [Axios](https://github.com/axios/axios) integration with Nuxt.js.
23+
24+
## Links
25+
26+
* [GitHub](https://github.com/nuxt-community/axios-module)
27+
* [Release Notes](/releases)
28+
* [Migration Guide](migration)
29+
* [Examples](https://axios.nuxtjs.org/usage.html)
30+
31+
> 👉 To get started head to [Setup](/setup) section.
32+
33+
## Online courses
34+
35+
<promote-block>
36+
</promote-block>

docs/migration.md renamed to docs/content/en/migration.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Migration guides
1+
---
2+
title: 'Migration guides'
3+
description: ''
4+
position: 6
5+
category: 'Migration'
6+
---
7+
28

39
### From 4.x to 5.x
410

docs/options.md renamed to docs/content/en/options.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Options
1+
---
2+
title: 'Options'
3+
description: ''
4+
position: 4
5+
category: 'Getting started'
6+
---
7+
28

39
You can pass different options using module inline options:
410

docs/setup.md renamed to docs/content/en/setup.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
---
2+
title: 'Setup'
3+
description: ''
4+
position: 2
5+
category: 'Getting started'
6+
---
17

2-
# Setup
38

49
## Install
510

docs/usage.md renamed to docs/content/en/usage.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Usage
1+
---
2+
title: 'Usage'
3+
description: ''
4+
position: 3
5+
category: 'Getting started'
6+
---
7+
28

39
## Component
410

docs/content/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"title": "Axios Module",
3+
"github": "nuxt-community/axios-module"
4+
}

docs/nuxt.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import theme from '@nuxt/content-theme-docs'
2+
3+
export default theme({
4+
loading: { color: '#00CD81' },
5+
i18n: {
6+
locales: () => [{
7+
code: 'en',
8+
iso: 'en-US',
9+
file: 'en-US.js',
10+
name: 'English'
11+
}],
12+
defaultLocale: 'en'
13+
},
14+
content: {
15+
liveEdit: false
16+
},
17+
components: true
18+
})

docs/package.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
2+
"name": "docs",
3+
"version": "1.0.0",
24
"private": true,
35
"scripts": {
4-
"dev": "vuepress dev",
5-
"build": "vuepress build"
6+
"dev": "nuxt",
7+
"build": "nuxt build",
8+
"start": "nuxt start",
9+
"generate": "nuxt generate"
610
},
7-
"devDependencies": {
8-
"vuepress": "^1.5.2"
11+
"dependencies": {
12+
"@nuxt/content-theme-docs": "^0.4.0",
13+
"nuxt": "^2.14.1"
914
}
1015
}

docs/readme.md

-43
This file was deleted.
File renamed without changes.

docs/tailwind.config.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
theme: {
3+
extend: {
4+
colors: {
5+
primary: {
6+
50: '#F2F9F7',
7+
100: '#E6F3F0',
8+
200: '#C0E2D8',
9+
300: '#9AD0C1',
10+
400: '#4EAD93',
11+
500: '#028A64',
12+
600: '#027C5A',
13+
700: '#01533C',
14+
800: '#013E2D',
15+
900: '#01291E'
16+
}
17+
}
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)