Skip to content

Commit

Permalink
chore: more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsacoyote committed Apr 26, 2024
1 parent e41446c commit b2b7141
Show file tree
Hide file tree
Showing 16 changed files with 264 additions and 195 deletions.
15 changes: 1 addition & 14 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,7 @@ export default defineAppConfig({
title: '',
edit: 'https://github.com/matter-labs/zksync-docs/edit/staging/content',
feedback: 'https://github.com/matter-labs/zksync-docs/issues/new?labels=documentation',
links: [
{
icon: 'i-heroicons-chat-bubble-oval-left-ellipsis-16-solid',
label: 'Chat on Discord',
to: 'https://join.zksync.dev/',
target: '_blank',
},
{
icon: 'i-heroicons-user-group-20-solid',
label: 'Developer Forum',
to: 'https://github.com/zkSync-Community-Hub/zkync-developers/discussions',
target: '_blank',
},
],
links: [],
},
},
});
4 changes: 2 additions & 2 deletions content/tutorials/another-guide/10.index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Example Guide
description: Learn how to do something with this example guide.
title: Another Guide
description: Another guide to learn things.
---

## Avidi deceptam precesque struxisse
Expand Down
4 changes: 2 additions & 2 deletions content/tutorials/another-guide/30.last-step.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Step 2
description: The next step in the guide
title: Final Step
description: The last step to this guide.
---

## Pede si diva cruentat et non patri
Expand Down
2 changes: 1 addition & 1 deletion content/tutorials/another-guide/_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author:
avatar: https://avatars.githubusercontent.com/u/812331?v=4
github_repo: https://github.com/zkSync-Community-Hub
tags:
- account-abstraction
- web3
- vyper
summary: This is a short description of the guide that will show up on tweets or previews.
description:
Expand Down
2 changes: 1 addition & 1 deletion content/tutorials/best-tutorial/10.index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Best Tutorial
description: Learn how to do something with this example guide.
description: The best tutorial to learn from.
---

## Avidi deceptam precesque struxisse
Expand Down
4 changes: 2 additions & 2 deletions content/tutorials/best-tutorial/20.next.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Step 2
description: The next step in the guide
title: Finish
description: We finish up the guide here.
---

## Pede si diva cruentat et non patri
Expand Down
3 changes: 2 additions & 1 deletion content/tutorials/best-tutorial/_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ author:
avatar: https://avatars.githubusercontent.com/u/812331?v=4
github_repo: https://github.com/zkSync-Community-Hub
tags:
- account-abstraction
- hardhat
- viem
- solidity
summary: This is a short description of the guide that will show up on tweets or previews.
description:
Expand Down
4 changes: 2 additions & 2 deletions content/tutorials/cool-guide/10.index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Example Guide
description: Learn how to do something with this example guide.
title: Cool Guide
description: Learn from the coolest guide.
---

## Avidi deceptam precesque struxisse
Expand Down
2 changes: 1 addition & 1 deletion content/tutorials/cool-guide/20.next.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Step 2
title: Second Cool Step
description: The next step in the guide
---

Expand Down
2 changes: 1 addition & 1 deletion content/tutorials/cool-guide/_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author:
avatar: https://avatars.githubusercontent.com/u/812331?v=4
github_repo: https://github.com/zkSync-Community-Hub
tags:
- account-abstraction
- foundry
- solidity
summary: This is a short description of the guide that will show up on tweets or previews.
description:
Expand Down
4 changes: 2 additions & 2 deletions content/tutorials/simple-tutorial/10.index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Example Guide
description: Learn how to do something with this example guide.
title: Simple Tutorial
description: This one is a simple tutorial for beginners.
---

## Avidi deceptam precesque struxisse
Expand Down
2 changes: 1 addition & 1 deletion content/tutorials/simple-tutorial/_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author:
avatar: https://avatars.githubusercontent.com/u/812331?v=4
github_repo: https://github.com/zkSync-Community-Hub
tags:
- account-abstraction
- smart-contracts
- solidity
summary: This is a short description of the guide that will show up on tweets or previews.
description:
Expand Down
20 changes: 4 additions & 16 deletions layouts/docs.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
const navigation = inject<Ref<NavItem[]>>('navigation')
</script>
<script setup lang="ts"></script>

<template>
<UContainer>
<UPage>
<template #left>
<UAside>
<UNavigationTree :links="mapContentNavigation(navigation)" />
</UAside>
</template>

<slot />
</UPage>
</UContainer>
<div>
<slot />
</div>
</template>
87 changes: 66 additions & 21 deletions layouts/tutorials.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<script setup lang="ts">
const route = useRoute();
const { data: info } = await useAsyncData(`${route.path}-info`, () =>
queryContent(`/tutorials/${route.params.slug[0]}/_info`).findOne()
);
if (!route.path) {
throw new Error('Route path is not defined');
}
console.log('PATH', route);
const { data: info } = await useAsyncData(`${route.path}-info`, () => {
console.log('ROUTE', route.fullPath);
return queryContent(`${route.fullPath}/_info`).findOne();
});
const { data: navigation } = await useAsyncData(`${route.path}-sidenav`, () => {
const query = queryContent().where({
_path: { $contains: route.path },
Expand All @@ -14,24 +21,60 @@ const { data: navigation } = await useAsyncData(`${route.path}-sidenav`, () => {
return fetchContentNavigation(query);
});
const links = computed(() => {
const links = navigation.value[0].children[0].children.map((item) => ({
label: item.title,
to: item._path,
}));
return [
{
label: 'Tutorials',
icon: 'i-heroicons-arrow-left-circle',
to: '/tutorials',
},
{
label: info.value?.title || 'Guide',
collapsible: false,
children: links,
},
];
});
// const links = computed(() => {
// const pageLinks = navigation.value;
// return [
// {
// label: 'Tutorials',
// icon: 'i-heroicons-arrow-left-circle',
// to: '/tutorials',
// },
// {
// label: info.value?.title || 'Guide',
// collapsible: false,
// children: pageLinks[0].children[0].children.map((item) => ({
// label: item.title,
// to: item._path,
// })),
// },
// ];
// });
console.log('WHY INFO', info.value);
const links = [
{
label: 'Tutorials',
icon: 'i-heroicons-arrow-left-circle',
to: '/tutorials',
},
{
label: info.value?.title || 'Guide',
collapsible: false,
children: navigation.value[0].children[0].children.map((item) => ({
label: item.title,
to: item._path,
})),
},
];
const communityLinks = [
{
icon: 'i-heroicons-academic-cap-solid',
label: 'Contribute to the Cookbook',
to: 'https://github.com/zkSync-Community-Hub/cookbook',
},
{
icon: 'i-heroicons-chat-bubble-oval-left-ellipsis-16-solid',
label: 'Chat on Discord',
to: 'https://join.zksync.dev/',
target: '_blank',
},
{
icon: 'i-heroicons-user-group-20-solid',
label: 'Developer Forum',
to: 'https://github.com/zkSync-Community-Hub/zkync-developers/discussions',
target: '_blank',
},
];
</script>

<template>
Expand All @@ -40,6 +83,8 @@ const links = computed(() => {
<template #left>
<UAside>
<UDashboardSidebarLinks :links="links" />
<UDivider class="my-4" />
<UPageLinks :links="communityLinks" />
</UAside>
</template>

Expand Down
Loading

0 comments on commit b2b7141

Please sign in to comment.