Skip to content

Commit

Permalink
chore(docs): reworks with docus
Browse files Browse the repository at this point in the history
  • Loading branch information
Stun3R committed Aug 22, 2023
1 parent 8fe5cce commit a103c55
Show file tree
Hide file tree
Showing 52 changed files with 7,682 additions and 9,062 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ bin/
test/
docs/
example/
scripts/
.eslintrc.js
.commitlint.config.js
.husky.config.js
Expand Down
14 changes: 9 additions & 5 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
module.exports = {
hooks: {
"before:git:release": "npm run docs:releases",
},
git: {
tagName: 'v${version}',
tagName: "v${version}",
commitMessage: "chore(release): ${version}",
},
github: {
release: true,
releaseName: 'v${version}',
releaseName: "v${version}",
},
plugins: {
'@release-it/conventional-changelog': {
preset: 'angular',
infile: 'CHANGELOG.md',
"@release-it/conventional-changelog": {
preset: "angular",
infile: "CHANGELOG.md",
},
},
};
4 changes: 4 additions & 0 deletions docs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
.output
.nuxt
8 changes: 8 additions & 0 deletions docs/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
root: true,
extends: '@nuxt/eslint-config',
rules: {
'vue/max-attributes-per-line': 'off',
'vue/multi-word-component-names': 'off'
}
}
1 change: 1 addition & 0 deletions docs/.gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ coverage
dist
sw.*
.env
.output
2 changes: 2 additions & 0 deletions docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
38 changes: 34 additions & 4 deletions docs/README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# strapi-sdk-docs
# Docus Starter

Starter template for [Docus](https://docus.dev).

## Clone

Clone the repository (using `nuxi`):

```bash
npx nuxi init -t themes/docus
```

## Setup

Expand All @@ -14,14 +24,34 @@ yarn install
yarn dev
```

## Edge Side Rendering

Can be deployed to Vercel Functions, Netlify Functions, AWS, and most Node-compatible environments.

Look at all the available presets [here](https://v3.nuxtjs.org/guide/deploy/presets).

```bash
yarn build
```

## Static Generation

This will create the `dist/` directory for publishing to static hosting:
Use the `generate` command to build your application.

The HTML files will be generated in the .output/public directory and ready to be deployed to any static compatible hosting.

```bash
yarn generate
```

To preview the static generated app, run `yarn start`
## Preview build

You might want to preview the result of your build locally, to do so, run the following command:

```bash
yarn preview
```

---

For detailed explanation on how things work, checkout [nuxt/content](https://content.nuxtjs.org) and [@nuxt/content theme docs](https://content.nuxtjs.org/themes-docs).
For a detailed explanation of how things work, check out [Docus](https://docus.dev).
52 changes: 52 additions & 0 deletions docs/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
export default defineAppConfig({
docus: {
title: "Strapi SDK",
description: "The SDK for seamless integration with your Strapi API.",
url: "https://strapi-sdk-js.netlify.app/",
image: "/preview.png",

socials: {
twitter: "Stun3R_",
github: "Stun3R/strapi-sdk-js",
},

github: {
dir: "docs/content",
branch: "develop",
repo: "strapi-sdk-js",
owner: "Stun3R",
edit: true,
},

aside: {
level: 0,
collapsed: false,
exclude: [],
},

main: {
padded: true,
fluid: true,
},

header: {
logo: true,
showLinkIcon: true,
exclude: [],
fluid: true,
},

footer: {
credits: false,
iconLinks: [
{
label: "Strapi",
href: "https://strapi.io",
icon: "simple-icons:strapi",
},
],
},

titleTemplate: "%s · Strapi SDK",
},
});
145 changes: 145 additions & 0 deletions docs/components/AppHeader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<script setup lang="ts">
const { config } = useDocus();
const { navigation } = useContent();
const { hasDocSearch } = useDocSearch();
const runtimeConfig = useRuntimeConfig();
const hasDialog = computed(
() => navigation.value?.length > 1 || navigation.value?.[0]?.children?.length
);
defineProps({
...variants,
});
</script>

<template>
<header :class="{ 'has-dialog': hasDialog }">
<Container :fluid="config?.header?.fluid">
<div class="section left">
<AppHeaderDialog v-if="hasDialog" />
<AppHeaderLogo />
<NuxtLink to="/releases" class="release left">{{
runtimeConfig.app.sdkVersion
}}</NuxtLink>
</div>

<div class="section center">
<AppHeaderLogo v-if="hasDialog" />
<AppHeaderNavigation />
</div>

<div class="section right">
<NuxtLink to="/releases" class="release right">{{
runtimeConfig.app.sdkVersion
}}</NuxtLink>

<AppDocSearch v-if="hasDocSearch" />
<AppSearch v-else :fuse="config.fuse" />
<ThemeSelect />
<div class="social-icons">
<AppSocialIcons />
</div>
</div>
</Container>
</header>
</template>

<style scoped lang="ts">
css({
':deep(.icon)': {
width: '{space.4}',
height: '{space.4}'
},
'.navbar-logo': {
'.left &': {
'.has-dialog &': {
display: 'none',
'@lg': {
display: 'block'
}
},
},
'.center &': {
display: 'block',
'@lg': {
display: 'none'
}
}
},
header: {
backdropFilter: '{elements.backdrop.filter}',
position: 'sticky',
top: 0,
zIndex: 10,
width: '100%',
borderBottom: '1px solid {elements.border.primary.static}',
backgroundColor: '{elements.backdrop.background}',
height: '{docus.header.height}',
'.release': {
fontWeight: '{fontWeight.medium}',
transition: 'color 150ms',
'&:hover': {
color: '{color.primary.500}'
},
'&.left': {
display: 'block',
'@sm': {
display: 'none'
}
},
'&.right': {
display: 'none',
'@sm': {
marginRight: '{space.2}',
display: 'block'
}
}
},
'.container': {
display: 'grid',
height: '100%',
gridTemplateColumns: 'repeat(12, minmax(0, 1fr))',
gap: '{space.2}'
},
'.section': {
display: 'flex',
alignItems: 'center',
flex: 'none',
'&.left': {
gridColumn: 'span 4 / span 4',
'@lg': {
marginLeft: 0
},
},
'&.center': {
gridColumn: 'span 4 / span 4',
justifyContent: 'center',
flex: '1',
zIndex: '1'
},
'&.right': {
display: 'flex',
gridColumn: 'span 4 / span 4',
justifyContent: 'flex-end',
alignItems: 'center',
flex: 'none',
marginRight: 'calc(0px - {space.4})',
'.social-icons': {
display: 'none',
'@md': {
display: 'flex',
alignItems: 'center',
}
}
}
}
}
})
</style>
8 changes: 8 additions & 0 deletions docs/components/Logo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script setup lang="ts">
const colorMode = useColorMode();
</script>

<template>
<img width="144" src="/logo-light.png" v-if="colorMode.value === 'light'" />
<img width="144" src="/logo-dark.png" v-if="colorMode.value === 'dark'" />
</template>
43 changes: 43 additions & 0 deletions docs/content/0.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Home
navigation: false
layout: page
main:
fluid: false
---

:ellipsis{right=0px width=75% blur=150px}

::block-hero
---
cta:
- Get started
- /getting-started/setup
secondary:
- Open on GitHub →
- https://github.com/stun3r/strapi-sdk-js
---

#title
Strapi SDK

#description
The SDK for seamless integration with your [Strapi](https://strapi.io) API.

#extra
::list
- Support Strapi v4
- RESTful methods
- Typescript support
- Simplified request responses
- Formatted error handling
::

#support
::terminal
---
content:
- npm i --save strapi-sdk-js
---
::
::
Loading

0 comments on commit a103c55

Please sign in to comment.