Skip to content

Commit 7624b4d

Browse files
committed
Added markdown files, main doc dynamic routing page, and typography
1 parent 9dd9d6c commit 7624b4d

File tree

9 files changed

+107
-7
lines changed

9 files changed

+107
-7
lines changed

components/DocsContents.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Section Header
66
</h3>
77

8-
<nuxt-link to="#" class="flex items-center pb-3 pr-5 text-gray-600 hover:text-gray-700">
8+
<nuxt-link to="doc-example" class="flex items-center pb-3 pr-5 text-gray-600 hover:text-gray-700">
99
Link 1
1010
</nuxt-link>
1111

components/MainHeader.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
2-
<div class="fixed flex flex-shrink-0 h-16 w-full max-w-6xl bg-white border-b-2 border-gray-100">
2+
<div class="fixed z-10 flex flex-shrink-0 h-16 w-full max-w-6xl bg-white border-b-2 border-gray-100">
33
<!-- TODO Add mobile friendly header -->
4-
<button class="md:hidden p-6" @click="showMobileMenu">
4+
<button class="md:hidden items-center px-6" @click="showMobileMenu">
55
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
66
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
77
</svg>
@@ -17,9 +17,9 @@
1717
</div>
1818

1919
<!-- icons -->
20-
<div>
20+
<a href="/">
2121
<GlobeIcon class="mr-1 h-5 w-5 text-gray-700 hover:text-gray-800" />
22-
</div>
22+
</a>
2323

2424

2525
</div>

content/documentation/doc-example.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: 'Doc Example 1'
3+
description: 'Documentation Example one'
4+
image: ''
5+
video: ''
6+
---
7+
8+
## Header 2
9+
10+
### Header 3
11+
12+
[Google](https://google.com)
13+
14+
![this is an image](/images/cleavr_logo.png)
15+
16+
1. This
17+
2. is
18+
3. an
19+
4. ordered
20+
5. list
21+
22+
- this
23+
- is
24+
- an
25+
- unordered
26+
- list

layouts/default.vue

+21-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,22 @@
1313
<MainHeader @showMobileMenu="showMobileMenu = true" v-show="!showMobileMenu" />
1414
<div class="h-screen flex">
1515
<DesktopSidebar class="hidden md:flex" />
16-
<Nuxt />
16+
<Nuxt class="mt-24 px-6" />
1717
</div>
1818
</div>
1919
</template>
2020

2121
<script>
2222
export default {
23+
transition: {
24+
name: 'page',
25+
mode: 'out-in'
26+
},
27+
watch: {
28+
'$route' () {
29+
this.showMobileMenu = false
30+
}
31+
},
2332
data () {
2433
return {
2534
showMobileMenu: false
@@ -29,5 +38,16 @@ export default {
2938
</script>
3039

3140
<style>
41+
.prose code {
42+
color: orange;
43+
}
44+
.prose a {
45+
color: #2563EB;
46+
text-decoration: none;
47+
}
3248
49+
.prose a:hover {
50+
color: #3B82F6;
51+
text-decoration: none;
52+
}
3353
</style>

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"dependencies": {
1212
"@nuxt/content": "^1.11.1",
1313
"core-js": "^3.6.5",
14-
"nuxt": "^2.14.6"
14+
"nuxt": "^2.14.6",
15+
"@tailwindcss/typography": "^0.2.0"
1516
},
1617
"devDependencies": {
1718
"@nuxtjs/tailwindcss": "^3.1.0"

pages/_doc.vue

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<div>
3+
<h1 class="text-3xl font-semibold text-gray-9000 pb-8">
4+
{{ doc.title }}
5+
</h1>
6+
<NuxtContent :document="doc" class="prose" />
7+
</div>
8+
</template>
9+
10+
<script>
11+
12+
export default {
13+
transition: {
14+
name: 'page',
15+
mode: 'out-in'
16+
},
17+
async asyncData( { $content, params } ) {
18+
const doc = await $content('documentation', params.doc ).fetch()
19+
return { doc }
20+
}
21+
22+
}
23+
</script>

static/images/cleavr_logo.png

29.1 KB
Loading

tailwind.config.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
purge: [],
3+
darkMode: false,
4+
theme: {
5+
typography: {
6+
default: {
7+
css: {
8+
'code::before': {
9+
content: '""',
10+
},
11+
'code::after': {
12+
content: '""',
13+
},
14+
},
15+
},
16+
},
17+
extend: {},
18+
},
19+
variants: {
20+
extend: {},
21+
},
22+
plugins: [
23+
require(`@tailwindcss/typography`)
24+
]
25+
}

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,11 @@
13081308
mustache "^2.3.0"
13091309
stack-trace "0.0.10"
13101310

1311+
"@tailwindcss/typography@^0.2.0":
1312+
version "0.2.0"
1313+
resolved "https://registry.yarnpkg.com/@tailwindcss/typography/-/typography-0.2.0.tgz#b597c83502e3c3c6641a8aaabda223cd494ab349"
1314+
integrity sha512-aPgMH+CjQiScLZculoDNOQUrrK2ktkbl3D6uCLYp1jgYRlNDrMONu9nMu8LfwAeetYNpVNeIGx7WzHSu0kvECg==
1315+
13111316
"@types/anymatch@*":
13121317
version "1.3.1"
13131318
resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a"

0 commit comments

Comments
 (0)