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

Documentation website template #33

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ zeroapi.egg-info
coverage.*

# code generation test directory
test_codegen
test_codegen

# Documentation
node_modules
docs/.vitepress/cache
docs/.vitepress/dist
120 changes: 120 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
export default {
title: 'Zero',
description: 'Zero Documentation',
// base : '/zero/',
lastUpdated: true,
lang: 'en-US',
cleanUrls: true,

markdown: {
theme: 'material-theme-palenight',
lineNumbers: true,
anchors: {
slugify(str) {
return encodeURIComponent(str)
}
}
},

// Google Analytics
// head: [
// [ 'script', { async: '' , src: "https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX" } ],
// [ 'script', {} , "window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-XXXXXXXXXX');" ],
// ],
alpondith marked this conversation as resolved.
Show resolved Hide resolved

themeConfig: {
siteTitle: 'Zero',
logo : '/logo.png',

// DocSearch by Algolia
// algolia: {
// appId: 'XXXXXXXXXXXX',
// apiKey: 'XXXXXXXXXXXXXXXXXXXX',
// indexName: 'XXXXX'
// },
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any simple search? Other than algolia?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever the documentation site will be ready then you will have to apply here. They will email you all credentials. And this is free.

However, there is another alternative to this. But it will take some time to play with the alternative. I will inform you if I find the proper solution. Alternative plugin


editLink: {
pattern: 'https://github.com/Ananto30/zero/tree/main/docs/:path',
text: 'Edit this page on GitHub'
},

// Navigation Section
nav: [
{ text: 'Home', link: '/' },
{ text: 'Documentation', link: 'getting_started/overview.md' },
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/Ananto30/zero' },
],

// Sidebar Section
sidebar: [

{
text: 'Getting Started',
collapsed: false,
items: [
{ text: 'Overview',link: 'getting_started/overview.md' },
{ text: 'About',link: 'getting_started/about.md' },
{ text: 'Benchmark',link: 'getting_started/benchmark.md' },
{ text: 'Install',link: 'getting_started/install.md' },
{ text: 'Uninstall',link: 'getting_started/uninstall.md' },
],
},

{
text: 'Concepts',
collapsed: true,
items: [
{ text: 'Architecture',link: 'concept/architecture.md' },
{ text: 'Lifecycle',link: 'concept/lifecycle.md' },
],
},

{
text: 'The Basics',
collapsed: true,
items: [
{ text: 'Routing',link: 'basic/routing.md' },
{ text: 'Request',link: 'basic/request.md' },
{ text: 'Response',link: 'basic/response.md' },
{ text: 'Middleware',link: 'basic/middleware.md' },
],
},

{
text: 'Advanced',
collapsed: true,
items: [
{ text: 'Code Generation',link: 'advanced/code_generation.md' },
],
},
alpondith marked this conversation as resolved.
Show resolved Hide resolved

{
text: 'Testing',
collapsed: true,
items: [
{ text: 'Getting Started',link: 'testing/getting_started.md' },
{ text: 'Http Testing',link: 'testing/http_testing.md' },
],
},

{
text: 'Prologue',
collapsed: true,
items: [
{ text: 'Release Note',link: 'prologue/release_note.md' },
{ text: 'Upgrade Guide',link: 'prologue/upgrade_guide.md' },
{ text: 'Contribution Guide',link: 'prologue/contribution_guide.md' },
],
},

],

// Footer Section
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2023 zero'
},
},
}
40 changes: 40 additions & 0 deletions docs/.vitepress/theme/components/AsideSponsors.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<script setup>
import { useData } from "vitepress";
import sponsorsJson from "@theme/data/sponsor.json";

const { frontmatter } = useData();

const sponsors = sponsorsJson.platinum;

</script>

<template>
<div v-if="frontmatter.sponsors !== false">
<a v-for="sponsor in sponsors" :key="sponsor.name" :href="sponsor.link" target="_blank">
<img class="img" :src="sponsor.image" :alt="sponsor.name" />
</a>

<a class="b-sponsor" href="https://www.buymeacoffee.com/ananto30" target="_blank">
<p>Become Sponsor</p>
</a>
</div>
</template>

<style>
.img {
margin-top: 4px;
margin-bottom: px;
}

.b-sponsor {
font-size: 16px;
padding: 10px;
font-weight: normal;
text-align: center;
}

.b-sponsor:hover {
text-decoration: underline;
color: blueviolet;
}
</style>
18 changes: 18 additions & 0 deletions docs/.vitepress/theme/components/BuyMeACoffee.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script setup lang="ts">
import { useData } from "vitepress";
const { frontmatter } = useData();
</script>

<template>
<div v-if="frontmatter.sponsors !== false">
<a href="https://www.buymeacoffee.com/ananto30" target="_blank">
<img class="img" src="/advertisement/bmc.jpg" alt="buy me a coffee" />
</a>
</div>
</template>

<style>
.img {
border: 1px solid #ddd;
}
</style>
83 changes: 83 additions & 0 deletions docs/.vitepress/theme/components/Sponsors.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<script setup>

import sponsorsJson from "@theme/data/sponsor.json";

const platinumSponsors = sponsorsJson.platinum;
const goldSponsors = sponsorsJson.average;

</script>

<template>
<h1 class="title">Platinum Sponsors</h1>
<div class="sponsors">
<a class="sponsor" v-for="sponsor in platinumSponsors" :key="sponsor.name" :href="sponsor.link" target="_blank">
<img :src="sponsor.image" :alt="sponsor.name" />
</a>
</div>
<h1 class="title">Gold Sponsors</h1>
<div class="sponsors">
<a class="sponsor" v-for="sponsor in goldSponsors" :key="sponsor.name" :href="sponsor.link" target="_blank">
<img :src="sponsor.image" :alt="sponsor.name" />
</a>
</div>
</template>

<style scoped>
.title {
font-size: 3rem;
font-weight: bold;
margin-top: 120px;
margin-bottom: 60px;
text-align: center;
}

.sponsors {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
margin: 0 auto;
max-width: 100%;
}

.sponsor {
background-color: #f1f1f1;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100px;
border-radius: 10px;
}

.sponsor img {
max-width: 100%;
height: auto;
padding: 20px;
}

@media (min-width: 400px) {
.sponsor {
width: calc(50% - 20px);
height: 100px;
margin: 10px;
}
}

@media (min-width: 768px) {
.sponsor {
width: calc(33.33% - 20px);
height: 100px;
}
}

@media (min-width: 992px) {
.sponsor {
width: calc(25% - 20px);
height: 120px;
}
.sponsors {
max-width: 1160px;
}
}
</style>
33 changes: 33 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

/* options : https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css */


/* import fonr */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,500;0,600;0,700;1,500;1,600;1,700&display=swap');


:root {

--vp-font-family-base: 'Verdana';
/* --vp-font-family-base: 'Verdana'; */
/* --vp-font-family-base: 'Monaco' ; */


--vp-c-brand: #8e43b6;
--vp-c-brand-light: #712b94;

--vp-c-green: #660099;
--vp-c-green-light: #7f4b98;
--vp-c-green-lighter: #8f7e98;
--vp-c-green-dark: #500077;
--vp-c-green-darker: #1d002c;

/* Typography */
/* --vp-font-family-base: 'Quicksand', sans-serif; */

/* Code Snippet font */
--vp-font-family-mono: 'Roboto Mono' , monospace;

}

70 changes: 70 additions & 0 deletions docs/.vitepress/theme/data/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"platinum":
[
{
"name": "Sponsor 1",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor 1",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor 3",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor 4",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
}
],

"average":
[
{
"name": "Sponsor1",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor2",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor3",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor4",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor5",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor6",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor7",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor8",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
}
]

}
12 changes: 12 additions & 0 deletions docs/.vitepress/theme/data/sponsor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"platinum":
[

],

"average":
[

]

}
Loading