5.3 KiB
5.3 KiB
Website Metadata Structure
This document specifies the JSON structures for the metadata files used to define the website's header, footer, navbar, and the list of pages. These metadata files are stored on IPFS and retrieved by the browser-hosted website.
Header Metadata
The header metadata is a simple JSON structure. Based on the provided image, it includes a logo and potentially links.
{
"logo": {
"alt_text": "OurWorld Logo",
"ipfs_hash": "Qm..." // IPFS hash of the logo image
},
"links": [
{
"text": "ThreeFold.io",
"url": "https://threefold.io",
"external": true
},
{
"text": "Mycelium Network",
"url": "https://mycelium.network",
"external": true
},
{
"text": "AI Box",
"url": "https://aibox.com", // Example URL
"external": true
}
]
}
logo
: An object containing details about the website logo.alt_text
: Alternative text for the logo image.ipfs_hash
: The IPFS hash (CID) of the logo image file.
links
: An array of link objects to be displayed in the header.text
: The display text for the link.url
: The URL the link points to.external
: A boolean indicating if the link opens in a new tab.
Footer Metadata
The footer metadata is a JSON structure defining the content and links in the website's footer.
{
"text": "© 2024 OurWorld. All rights reserved.",
"links": [
{
"text": "Privacy Policy",
"page_path": "legal/privacy_policy" // Reference to a page in the pages list
},
{
"text": "Terms of Service",
"page_path": "legal/terms_of_service" // Reference to a page in the pages list
}
],
"social_links": [
{
"platform": "twitter",
"url": "https://twitter.com/ourworld"
},
{
"platform": "github",
"url": "https://github.com/ourworld"
}
]
}
text
: Copyright or other textual information in the footer.links
: An array of internal links, referencing pages defined in the pages list.text
: The display text for the link.page_path
: The unique path of the page as defined in the pages list metadata (collection/filename
).
social_links
: An array of links to social media profiles.platform
: The name of the social media platform (e.g., "twitter", "github").url
: The URL of the social media profile.
Navbar Metadata
The navbar metadata is a JSON structure defining the website's navigation menu.
{
"menu_items": [
{
"text": "Introduction",
"page_path": "introduction/introduction" // Reference to a page in the pages list
},
{
"text": "Our Story",
"page_path": "about/our_story" // Reference to a page in the pages list
},
{
"text": "Team",
"page_path": "about/team" // Reference to a page in the pages list
},
{
"text": "Collections",
"submenu": [
{
"text": "Collection One",
"page_path": "collections/collection_one_overview" // Reference to a page
},
{
"text": "Collection Two",
"page_path": "collections/collection_two_overview" // Reference to a page
}
]
}
]
}
menu_items
: An array of menu items. Each item can be a direct link to a page or contain a submenu.text
: The display text for the menu item.page_path
: (Optional) The unique path of the page if it's a direct link.submenu
: (Optional) An array of nested menu items.
Pages List Metadata
The pages list metadata is a JSON array listing all available markdown pages and the key required to retrieve and decrypt their content.
[
{
"path": "introduction/introduction",
"collection": "introduction",
"filename": "introduction.md",
"key": "... Qm..." // blake_hash encrypted_ipfs_hash
},
{
"path": "about/our_story",
"collection": "about",
"filename": "our_story.md",
"key": "... Qm..."
},
{
"path": "about/team",
"collection": "about",
"filename": "team.md",
"key": "... Qm..."
},
{
"path": "collections/collection_one_overview",
"collection": "collections",
"filename": "collection_one_overview.md",
"key": "... Qm..."
},
{
"path": "collections/collection_two_overview",
"collection": "collections",
"filename": "collection_two_overview.md",
"key": "... Qm..."
},
{
"path": "legal/privacy_policy",
"collection": "legal",
"filename": "privacy_policy.md",
"key": "... Qm..."
},
{
"path": "legal/terms_of_service",
"collection": "legal",
"filename": "terms_of_service.md",
"key": "... Qm..."
}
]
- Each object in the array represents a single markdown page.
path
: The unique path used to reference the page (e.g., in navbar or footer links). This is a combination ofcollection/filename
without the.md
extension.collection
: The name of the collection (folder) the markdown file belongs to.filename
: The name of the markdown file (including the.md
extension).key
: A string combining the Blake hash of the original content and the IPFS hash (CID) of the encrypted content, separated by a space. The Blake hash serves as the encryption key.
All names (collection
, filename
) are in lowercase and snake_case.