Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
move the guides back into the main layout of the docs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliotFriend committed Dec 6, 2023
1 parent 60cbf2b commit 7e6a950
Show file tree
Hide file tree
Showing 60 changed files with 38 additions and 305 deletions.
2 changes: 1 addition & 1 deletion guides/README.mdx → docs/guides/README.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Guides
title: How-To Guides
description: here you will find really useful guides
hide_table_of_contents: true
sidebar_position: 0
Expand Down
4 changes: 4 additions & 0 deletions docs/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"position": 35,
"collapsible": false
}
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
Expand Up @@ -81,7 +81,7 @@ pub fn upgrade(e: Env, new_wasm_hash: BytesN<32>) {
The `update_current_contract_wasm` host function will also emit a `SYSTEM` contract [event] that contains the old and new wasm reference, allowing downstream users to be notified when a contract they use is updated. The event structure will have `topics = ["executable_update", old_executable: ContractExecutable, old_executable: ContractExecutable]` and `data = []`.

[here]: https://docs.rs/soroban-sdk/20.0.0-rc2/soroban_sdk/struct.Env.html#method.update_current_contract_wasm
[event]: ../../docs/soroban-internals/events#event-types
[event]: ../../soroban-internals/events.mdx#event-types

## Tests

Expand Down Expand Up @@ -286,4 +286,4 @@ Now that the contract was upgraded, you'll see a new version.
2
```

[`soroban-cli`]: ../../docs/getting-started/setup#install-the-soroban-cli
[`soroban-cli`]: ../../getting-started/setup.mdx#install-the-soroban-cli
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
Expand Up @@ -47,4 +47,4 @@ pub fn transfer(env: Env, from: Address, to: Address, amount: i128) {
}
```

[token interface]: ../../docs/tokens/token-interface
[token interface]: ../../tokens/token-interface.mdx
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.
2 changes: 1 addition & 1 deletion docs/soroban-internals/contract-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ TBD: expand this section.

## Upgrading contracts

See the [Upgrading Contracts](../../guides/conventions/upgrading-contracts) page for details on this.
See the [Upgrading Contracts](../guides/conventions/upgrading-contracts.mdx) page for details on this.
34 changes: 17 additions & 17 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ const config = {
},
plugins: [
"docusaurus-plugin-sass",
[
'@docusaurus/plugin-content-docs',
{
id: 'guides',
path: 'guides',
routeBasePath: 'guides',
sidebarPath: require.resolve('./sidebarsGuides.js'),
sidebarItemsGenerator: require('./src/sidebar-generator'),
editUrl: "https://github.com/stellar/soroban-docs/tree/main/",
showLastUpdateTime: true,
},
],
// [
// '@docusaurus/plugin-content-docs',
// {
// id: 'guides',
// path: 'guides',
// routeBasePath: 'guides',
// sidebarPath: require.resolve('./sidebarsGuides.js'),
// sidebarItemsGenerator: require('./src/sidebar-generator'),
// editUrl: "https://github.com/stellar/soroban-docs/tree/main/",
// showLastUpdateTime: true,
// },
// ],
[
'@docusaurus/plugin-content-docs',
{
Expand Down Expand Up @@ -121,11 +121,11 @@ const config = {
label: 'Dapps',
position: 'left'
},
{
to: '/guides',
label: 'Guides',
position: 'left'
},
// {
// to: '/guides',
// label: 'Guides',
// position: 'left'
// },
{
href: 'https://github.com/stellar/rs-soroban-sdk',
label: 'GitHub',
Expand Down
16 changes: 8 additions & 8 deletions src/sidebar-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ module.exports = async ({ defaultSidebarItemsGenerator, ...args }) => {

if (args.version.contentPath.endsWith('docs')) {
/**
* Adds a custom class name to the "Tutorials" index page, which we then
* use in the `/src/css/custom.scss` file to hide the `<ul>` element
* that is contained within the item. The result is a single "Tutorials"
* page that contains the list of all the docs underneath it, while
* those items are not displayed in the sidebar.
* Adds a custom class name to the "Tutorials" and "How-To Guides" index
* pages, which we then use in the `/src/css/custom.scss` file to hide
* the `<ul>` element that is contained within the item. The result is a
* single "Tutorials/Guides" page that contains the list of all the docs
* underneath it, while those items are not displayed in the sidebar.
*/
args.docs.map((doc) => {
if (doc.id === 'tutorials/README') {
if (doc.id === 'guides/README' || doc.id === 'tutorials/README') {
doc.frontMatter.sidebar_class_name = "sidebar-category-items-hidden"
}
})
Expand All @@ -25,9 +25,9 @@ module.exports = async ({ defaultSidebarItemsGenerator, ...args }) => {
* sidebar class name does (above). For now, make sure to manually add
* `hide_table_of_contents: true` to the front matter of each guide doc.
*/
args.docs.map((doc) =>
args.docs.map((doc) => {
doc.frontMatter.hide_table_of_contents = true
)
})
}

const sidebarItems = await defaultSidebarItemsGenerator({ ...args })
Expand Down
2 changes: 1 addition & 1 deletion src/theme/DocCardList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function DocCardListForCurrentSidebarCategory({className}) {
const category = useCurrentSidebarCategory();
return category.label === 'Tutorials'
? <FilterableDocCardList items={category.items} className={className} />
: category.label === 'Guides'
: category.label === 'How-To Guides'
? <GuidesDocList items={category.items} className={className} />
: <DocCardList items={category.items} className={className} />;
}
Expand Down
6 changes: 3 additions & 3 deletions src/theme/DocItem/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ export default function DocItemFooter() {
const canDisplayTagsRow = tags.length > 0;
const canDisplayEditMetaRow = !!(editUrl || lastUpdatedAt || lastUpdatedBy);
const canDisplayFooter = canDisplayTagsRow || canDisplayEditMetaRow;
const canDisplayDocCardsOnGuide = metadata.permalink.startsWith('/guides')
const canDisplayDocCardsOnGuide = metadata.permalink.startsWith('/docs/guides')
if (!canDisplayFooter) {
return null;
}
return (
<>
{canDisplayDocCardsOnGuide &&
<div className={clsx(metadata.permalink === '/guides/' ? 'margin-top--lg' : 'margin-top--xl')}>
{metadata.permalink !== '/guides/' && <h3>Guides in this category:</h3>}
<div className={clsx(metadata.permalink === '/docs/guides/' ? 'margin-top--lg' : 'margin-top--xl')}>
{metadata.permalink !== '/docs/guides/' && <h3>Guides in this category:</h3>}
<DocCardList />
</div>
}
Expand Down
23 changes: 0 additions & 23 deletions src/theme/DocPage/Layout/Main/index.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/theme/DocPage/Layout/Main/styles.module.css

This file was deleted.

28 changes: 0 additions & 28 deletions src/theme/DocPage/Layout/Sidebar/ExpandButton/index.js

This file was deleted.

27 changes: 0 additions & 27 deletions src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css

This file was deleted.

70 changes: 0 additions & 70 deletions src/theme/DocPage/Layout/Sidebar/index.js

This file was deleted.

32 changes: 0 additions & 32 deletions src/theme/DocPage/Layout/Sidebar/styles.module.css

This file was deleted.

29 changes: 0 additions & 29 deletions src/theme/DocPage/Layout/index.js

This file was deleted.

Loading

0 comments on commit 7e6a950

Please sign in to comment.