Skip to content

Commit

Permalink
update: folder structure and minor changes to code (#1158)
Browse files Browse the repository at this point in the history
Co-authored-by: dharamveergit <dharamveersingh.em@gmail.com>
  • Loading branch information
HoomanDgtl and dharamveergit authored Sep 12, 2024
1 parent e2fba9f commit 1e608db
Show file tree
Hide file tree
Showing 189 changed files with 90 additions and 28 deletions.
17 changes: 13 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ We appreciate your interest in contributing to Axelar! This document `CONTRIBUTI

### Table of Contents

- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [How to Contribute](#how-to-contribute)
- [Code of Conduct](#code-of-conduct)
- [Contributing to Axelar](#contributing-to-axelar)
- [Table of Contents](#table-of-contents)
- [Getting Started](#getting-started)
- [How to Contribute](#how-to-contribute)
- [Code of Conduct](#code-of-conduct)
- [Our Standards:](#our-standards)
- [Our Responsibilities:](#our-responsibilities)
- [Project Structure](#project-structure)

### Getting Started

Expand Down Expand Up @@ -75,3 +79,8 @@ Unacceptable behavior includes:
As project maintainers, we clarify the standards of acceptable behavior and take appropriate corrective action in response to unacceptable behavior.

We also reserve the right to remove or reject any contributions that do not align with this Code of Conduct or to temporarily or permanently ban any contributor who exhibits inappropriate, threatening, offensive, or harmful behavior.

### Project Structure

- **`src/content/`**: All documentation content in Markdown format.
- **`src/layouts/navigation.ts`**: Defines the navigation structure for the documentation site.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Axelar Docs

- [Axelar Docs](#axelar-docs)
- [Updating Navigation](#updating-navigation)
- [How to Contribute to the Docs](#how-to-contribute-to-the-docs)
- [Here's what you need to know to contribute to the Axelar documentation:](#heres-what-you-need-to-know-to-contribute-to-the-axelar-documentation)
- [Short links](#short-links)
- [ITS](#its)

The official documentation website for [Axelar](https://github.com/axelarnetwork).

The project uses [Astro](https://astro.build) and deploys via [Vercel](https://vercel.com). To develop it locally, clone this repository and run the following command to start the local dev server:
Expand All @@ -15,6 +22,14 @@ And visit `localhost:3000` to preview your changes.

Site navigation is generated in TypeScript based on the section the user is currently browsing in. The navigation layout is managed in [`src/layouts/navigation.ts`](https://github.com/axelarnetwork/axelar-docs/blob/main/src/layouts/navigation.ts), with pages represented as a `title` and `href` in one of the `children` arrays. The site supports up to 3 levels of nested navigation, with the top level acting as navigation header. Each subsequent level is visually tabbed beneath its parent.

## How to Contribute to the Docs

### Here's what you need to know to contribute to the Axelar documentation:

- Content Folder: Contributions are made by adding files to this [folder](/src/content/docs/). This folder structure defines the organization and links within the documentation.
- Creating a New Page: To add a new page, create a new Markdown file (.md or .mdx) inside the /docs/ folder. Use a descriptive filename that reflects the topic of your page (e.g., /src/content/docs/learn/security.mdx).
- Updating Navigation: Once you've created a new page, you need to update the navigation bar to include it. Edit the file [src/layouts/navigation.ts](#updating-navigation). This file controls the navigation links throughout the Axelar docs website. Locate the appropriate section and add an entry for your new page, ensuring consistency with the existing navigation style.

## Short links

These links redirect to pages in the documentation whose slugs may otherwise be hard to remember.
Expand Down
11 changes: 11 additions & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineCollection, z } from "astro:content";

const docs = defineCollection({
schema: z.object({
title: z.string().optional(),
}),
});

export const collections = {
docs,
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add a new EVM chain

import { Callout } from '../../components/callout'
import { Callout } from '../../../components/callout'



Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ChainList from '../../../components/chainlist';
import ChainList from '../../../../components/chainlist';

# Chain names: Mainnet

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import EVMChains from "../../../components/evm/chains";
import EVMAssets from "../../../components/evm/assets";
import EVMChains from "../../../../components/evm/chains";
import EVMAssets from "../../../../components/evm/assets";

# Contract addresses: Mainnet

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ChainList from '../../../components/chainlist';
import ChainList from '../../../../components/chainlist';

# Chain names: Testnet

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import EVMChains from "../../../components/evm/chains";
import EVMAssets from "../../../components/evm/assets";
import EVMChains from "../../../../components/evm/chains";
import EVMAssets from "../../../../components/evm/assets";

# Chain names: Testnet (Lisbon)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Section from "../../../../layouts/Section.astro";
import { Callout } from "../../../../../src/components/callout";
import Section from "../../../../../layouts/Section.astro";
import { Callout } from "../../../../../../src/components/callout";
const title = "Interchain Tokens and the Interchain Token Service";
Expand Down Expand Up @@ -121,7 +121,7 @@ const cards = [
cards.map((card) => (
<a class="card" href={card.url}>
<div>
<Fragment set:html={card.icon} /> {card.title}
<Fragment set:html={card?.icon} /> {card.title}
</div>
<div>{card.description}</div>
<span>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Callout } from "../../../src/components/callout";
import { Callout } from "../../../../src/components/callout";

# Onboard your IBC-compatible chain

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Add a custom network to Keplr

import Button from "../../components/keplr/addKeplrWallet";
import AddKeplr from "../../components/keplr";
import Form from "../../components/textarea";
import Button from "../../../components/keplr/addKeplrWallet";
import AddKeplr from "../../../components/keplr";
import Form from "../../../components/textarea";

## Don't have the Keplr Browser extension? Add it here:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set up MetaMask

import AddToWeb3 from '../../components/web3'
import AddToWeb3 from '../../../components/web3'

1. Connect MetaMask to other EVM chains
2. Get testnet tokens for other EVM chains to pay for gas
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Centrifuge

import { Callout } from "../../../components/callout"
import { Callout } from "../../../../components/callout"

Set up your Centrifuge Mainnet or Testnet node.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
16 changes: 8 additions & 8 deletions src/layouts/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export const getNavigation = (section) => {
children: [
{
title: "No Code",
href: "/dev/send-tokens/interchain-tokens/quick-start/no-code/"
href: "/dev/send-tokens/interchain-tokens/quick-start/no-code/",
},
{
title: "Programmatic",
href: "/dev/send-tokens/interchain-tokens/quick-start/programmatic/"
}
]
href: "/dev/send-tokens/interchain-tokens/quick-start/programmatic/",
},
],
},
{
title: "Token Manager",
Expand Down Expand Up @@ -302,9 +302,9 @@ export const getNavigation = (section) => {
{
title: "Configure companion processes",
href: "/dev/amplifier/chains/soroban",
}
},
],
}
},
],
},
{
Expand Down Expand Up @@ -567,7 +567,7 @@ export const getNavigation = (section) => {
children: [
{
title: "v1.0",
href: "/resources/mainnet/upgrades/v1.0/",
href: "/resources/mainnet/upgrades/v10/",
},
{
title: "v0.35",
Expand Down Expand Up @@ -632,7 +632,7 @@ export const getNavigation = (section) => {
children: [
{
title: "v1.0",
href: "/resources/testnet/upgrades/v1.0/",
href: "/resources/testnet/upgrades/v10/",
},
{
title: "v0.35",
Expand Down
26 changes: 26 additions & 0 deletions src/pages/[...slug].astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
import { getCollection } from 'astro:content';
import Section from '../layouts/Section.astro';
export async function getStaticPaths() {
const docs = await getCollection('docs');
return docs?.map((doc) => ({
params: { slug: doc.slug },
props: { doc },
}));
}
const { doc } = Astro.props;
const {Content} = await doc.render()
---

<Content />

0 comments on commit 1e608db

Please sign in to comment.