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

[web] setup content structure #973 #975

Merged
merged 1 commit into from
Jan 6, 2024
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
5 changes: 5 additions & 0 deletions agdb_web/content/cs/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# agdb dokumentace

Stránky jsou v přípravě.

[Dokumentace v angličtině](/en/docs)
1 change: 1 addition & 0 deletions agdb_web/content/cs/blog/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# agdb blog
5 changes: 5 additions & 0 deletions agdb_web/content/cs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# agdb dokumentace

Stránky jsou v přípravě.

[Dokumentace v angličtině](/en/docs)
3 changes: 3 additions & 0 deletions agdb_web/content/cs/enterprise/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# agdb enterprise

Stránky jsou v přípravě.
1 change: 1 addition & 0 deletions agdb_web/content/en/api/1.typescript/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# typescript api
1 change: 1 addition & 0 deletions agdb_web/content/en/api/2.python/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# python api
1 change: 1 addition & 0 deletions agdb_web/content/en/api/3.rust/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# rust api
1 change: 1 addition & 0 deletions agdb_web/content/en/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# agdb api
1 change: 1 addition & 0 deletions agdb_web/content/en/blog/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# agdb blog
1 change: 1 addition & 0 deletions agdb_web/content/en/docs/1.guides/1.key-concepts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Key Concepts
1 change: 1 addition & 0 deletions agdb_web/content/en/docs/1.guides/2.usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Usage
18 changes: 18 additions & 0 deletions agdb_web/content/en/docs/1.guides/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "agdb guides"
description: "Guides for agdb, Agnesoft Graph Database"
navigation:
title: "Guides"
---

# agdb guides

[Key Concepts](/docs/guides/key-concepts)

[Usage](/docs/guides/usage)

lol

```Rust
let foo;
```
6 changes: 6 additions & 0 deletions agdb_web/content/en/docs/2.examples/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
navigation:
title: "Examples"
---

# agdb examples
6 changes: 6 additions & 0 deletions agdb_web/content/en/docs/3.references/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
navigation:
title: "References"
---

# agdb references
12 changes: 12 additions & 0 deletions agdb_web/content/en/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "agdb documentation"
description: "Documentation of agdb, Agnesoft Graph Database"
---

# agdb documentation

[Guides](/docs/guides)

[Examples](/docs/examples)

[References](/docs/references)
1 change: 1 addition & 0 deletions agdb_web/content/en/enterprise/1.support/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# support
1 change: 1 addition & 0 deletions agdb_web/content/en/enterprise/2.sponsors/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# sponsors
1 change: 1 addition & 0 deletions agdb_web/content/en/enterprise/3.cloud/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# agdb cloud
4 changes: 2 additions & 2 deletions agdb_web/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import i18nConfig from "./i18n.config";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devServer: {
port: 4000,
port: 5001,
},
devtools: { enabled: true },
modules: [
"@nuxt/content",
["@nuxt/content", { documentDriven: true }],
"@nuxt/test-utils/module",
["@nuxtjs/i18n", i18nConfig],
],
Expand Down
8 changes: 0 additions & 8 deletions agdb_web/pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ const path =
</script>
<template>
<main>
<img
alt="agdb logo"
class="logo"
src="@/static/logo.svg"
width="125"
height="125"
/>
<h1>agdb</h1>
<ContentDoc :path="path" />
</main>
</template>
120 changes: 114 additions & 6 deletions agdb_web/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,123 @@
<script lang="ts" setup>
const { t } = useI18n();
const { t, locale } = useI18n();
const localePath = useLocalePath();

const docsQuery = queryContent(locale.value, "docs");
const apiQuery = queryContent(locale.value, "api");
const enterpriseQuery = queryContent(locale.value, "enterprise");
const blogQuery = queryContent(locale.value, "blog");
</script>

<template>
<NuxtLink :to="localePath('/')">{{ t("menu.home") }}</NuxtLink>
<NuxtLink :to="localePath(t('urls.about'))">{{ t("menu.about") }}</NuxtLink>
<NuxtLink :to="localePath(t('urls.contact'))">{{
t("menu.contact")
}}</NuxtLink>
<header>
<h3><NuxtLink :to="localePath('/docs')">Docs:</NuxtLink></h3>
<nav>
<ContentNavigation v-slot="{ navigation }" :query="docsQuery">
<ul>
<template
v-for="link of navigation.at(0)?.children?.at(0)
?.children"
:key="link._path"
>
<li v-if="link.children?.length">
<NuxtLink
v-if="link.children?.length"
:to="link._path"
>{{ link.navTitle || link.title }}</NuxtLink
>
</li>
</template>
</ul>
</ContentNavigation>
</nav>

<h3><NuxtLink :to="localePath('/api')">Api</NuxtLink></h3>
<nav>
<ContentNavigation v-slot="{ navigation }" :query="apiQuery">
<ul>
<template
v-for="link of navigation.at(0)?.children?.at(0)
?.children"
:key="link._path"
>
<li v-if="link.children?.length">
<NuxtLink
v-if="link.children?.length"
:to="link._path"
>{{ link.navTitle || link.title }}</NuxtLink
>
</li>
</template>
</ul>
</ContentNavigation>
</nav>

<h3><NuxtLink :to="localePath('/enterprise')">Enterprise</NuxtLink></h3>
<nav>
<ContentNavigation v-slot="{ navigation }" :query="enterpriseQuery">
<ul>
<template
v-for="link of navigation.at(0)?.children?.at(0)
?.children"
:key="link._path"
>
<li v-if="link.children?.length">
<NuxtLink
v-if="link.children?.length"
:to="link._path"
>{{ link.navTitle || link.title }}</NuxtLink
>
</li>
</template>
</ul>
</ContentNavigation>
</nav>

<h3><NuxtLink :to="localePath('/blog')">Blog</NuxtLink></h3>
<nav>
<ContentNavigation v-slot="{ navigation }" :query="blogQuery">
<ul>
<template
v-for="link of navigation.at(0)?.children?.at(0)
?.children"
:key="link._path"
>
<li v-if="link.children?.length">
<NuxtLink
v-if="link.children?.length"
:to="link._path"
>{{ link.navTitle || link.title }}</NuxtLink
>
</li>
</template>
</ul>
</ContentNavigation>
</nav>

<h3>Other:</h3>
<ul>
<li>
<NuxtLink :to="localePath('/')">{{ t("menu.home") }}</NuxtLink>
</li>
<li>
<NuxtLink :to="localePath(t('urls.about'))">{{
t("menu.about")
}}</NuxtLink>
</li>
<li>
<NuxtLink :to="localePath(t('urls.contact'))">{{
t("menu.contact")
}}</NuxtLink>
</li>
</ul>
</header>
<img
alt="agdb logo"
class="logo"
src="@/static/logo.svg"
width="125"
height="125"
/>
<h1>agdb</h1>
</template>

Expand Down
4 changes: 2 additions & 2 deletions agdb_web/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineConfig({
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:4000",
baseURL: "http://localhost:5001",

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
Expand Down Expand Up @@ -85,7 +85,7 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
webServer: {
command: "npm run dev",
url: "http://localhost:4000",
url: "http://localhost:5001",
reuseExistingServer: !process.env.CI,
},
});
4 changes: 2 additions & 2 deletions agdb_web/tests/pages/[...slug].test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import i18nConfig from "@/i18n.config";
import slug from "@/pages/[...slug].vue";

describe("[...slug]", () => {
it("renders the correct message", () => {
it("renders content", () => {
const i18n = createI18n(i18nConfig);
const wrapper = shallowMount(slug, {
route: "/about",
global: {
plugins: [i18n, useRouter()],
},
});
expect(wrapper.text()).toContain("agdb");
expect(wrapper.getComponent("content-doc-stub")).toBeTruthy();
});
});