-
Notifications
You must be signed in to change notification settings - Fork 118
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
documentation improvements (typos, links, images) #731
base: main
Are you sure you want to change the base?
Changes from 5 commits
56dadfa
cc275ea
0874035
785522f
b4564d5
f10a019
05b7ded
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,36 +8,30 @@ import { docsConfig } from '@docs-config'; | |
|
||
# SEO | ||
|
||
To simplify Nextra SEO / Open Graph configuration, Aptos Nextra projects use the | ||
`docs.config.js` file for many core Open Graph functionalities. | ||
To simplify Nextra SEO / Open Graph configuration, Aptos Nextra projects use the `docs.config.js` file for many core Open Graph functionalities. | ||
|
||
### Dynamic Open Graph Images | ||
|
||
The Aptos Docs template takes advantage of [Next.js' dynamic opengraph images](https://vercel.com/docs/functions/og-image-generation) | ||
using the edge runtime to ensure low-latency SEO cards and no cold-starts. | ||
The Aptos Docs template takes advantage of [Next.js' dynamic opengraph images](https://vercel.com/docs/functions/og-image-generation) using the edge runtime to ensure low-latency SEO cards and no cold-starts. | ||
|
||
<br /> | ||
|
||
export function DynamicImage({ title }) { | ||
const imageUrl = `${docsConfig.origin}/api/og.png?title=${encodeURIComponent(title)}`; | ||
|
||
return ( | ||
<img src={imageUrl} alt="Dynamic Image" /> | ||
); | ||
} | ||
|
||
<DynamicImage title="Dynamic Image" /> | ||
<img | ||
src="https://assets-global.website-files.com/606f63778ec431ec1b930f1f/63dbd502218a274f2a602968_aptos.png" | ||
alt="Example Open Graph Image" | ||
style="width: 100%; max-width: 800px; height: auto; border: 1px solid #eaeaea; border-radius: 8px; margin: 20px 0" | ||
/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is supposed to be a dynamic image example, so it doesn't make much sense here to change to an img There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right about this being a dynamic image example. I made these changes because the dynamic image generation wasn't working due to server issues (the server needs to be running with @vercel/og package and proper Edge Runtime setup for OG image generation to work). I'll create a separate issue to track and fix the server setup required for dynamic image generation. For now, I'll revert these changes to keep the original dynamic image example in the documentation. |
||
|
||
The Open Graph Images are generated dynamically at runtime from `React` components, and served as a png image. | ||
This is how we are able to include things like the title of the page in the SEO card. | ||
|
||
For more details, checkout `/pages/api/og.png.tsx`. | ||
For more details, checkout the file `/pages/api/og.png.tsx`. | ||
|
||
<FileTree> | ||
<FileTree.Folder name="pages" defaultOpen> | ||
<FileTree.File name="_meta.ts" /> | ||
<FileTree.Folder name="api"> | ||
<FileTree.Folder name="og.png.tsx" active /> | ||
<FileTree.Folder name="api" defaultOpen> | ||
<FileTree.File name="og.png.tsx" active /> | ||
</FileTree.Folder> | ||
<FileTree.Folder name="en" /> | ||
<FileTree.File name="_app.tsx" /> | ||
|
@@ -48,14 +42,14 @@ For more details, checkout `/pages/api/og.png.tsx`. | |
</FileTree> | ||
|
||
> Note: You may be wondering why we use `og.png.tsx` instead of `og.tsx` as the filename. | ||
We use `og.png.tsx` because after testing it extensively, we learned that | ||
Twitter renders opengraph images if their URLs end with the file extension. | ||
> We use `og.png.tsx` because after testing it extensively, we learned that | ||
> Twitter renders opengraph images if their URLs end with the file extension. | ||
|
||
### Testing | ||
|
||
You can always check the opengraph image by navigating to `/api/og.png`. | ||
You can always check the opengraph image by navigating to `/api/og.png` in your browser. | ||
|
||
(e.g., [`http://localhost:3000/api/og.png`](http://localhost:3000/api/og.png)) | ||
For example: [`http://localhost:3000/api/og.png`](http://localhost:3000/api/og.png) | ||
|
||
### Favicon | ||
|
||
|
@@ -72,31 +66,31 @@ You can always check the opengraph image by navigating to `/api/og.png`. | |
</FileTree> | ||
|
||
For other assets located in `public/favicon`, you may want to customize the | ||
website icon. You can do so easily by doing the following: | ||
|
||
website icon. You can do so easily by following these steps: | ||
|
||
<Steps> | ||
|
||
##### Generate Favicon | ||
### Generate Favicon | ||
|
||
Navigate to [https://favicon.io/favicon-converter/](https://favicon.io/favicon-converter/). | ||
Upload an `svg` file with the logo you'd like to generate your favicon for. | ||
|
||
##### Copy assets into `public/favicon` | ||
### Copy assets into `public/favicon` | ||
|
||
After generating the assets, favicon.ico should return a zip file containing | ||
After generating the assets, favicon.io will return a zip file containing: | ||
|
||
- `android-chrome-192x192.png` | ||
- `favicon.ico` | ||
- ...so on and so forth | ||
- And other favicon assets | ||
|
||
Copy all of these and replace the existing files in `public/favicon` | ||
Copy all of these files and replace the existing files in `public/favicon` | ||
|
||
##### Deploy | ||
### Deploy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be 4
|
||
|
||
Deploy your changes to see the new favicon in action. | ||
|
||
</Steps> | ||
|
||
### Customizing Open Graph | ||
|
||
To customize the Open Graph configuration, see `theme.config.tsx`. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ title: "Node Networks and Sync" | |
|
||
Validator nodes and fullnodes form a hierarchical structure with validator nodes at the root and fullnodes everywhere else. The Aptos blockchain distinguishes two types of fullnodes: validator fullnodes and public fullnodes. Validator fullnodes connect directly to validator nodes and offer scalability alongside DDoS mitigation. Public fullnodes connect to validator fullnodes (or other public fullnodes) to gain low-latency access to the Aptos network. | ||
|
||
![v-fn-network.svg](/docs/v-fn-network.svg) | ||
![v-fn-network.svg](/apps/nextra/public/docs/v-fn-network.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This image is currently working? I think it should stay how it is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, the image with the original path isn't working - it shows as a broken image. The new path I added points to the correct location of the file in the project structure (/apps/nextra/public/docs/v-fn-network.svg), which makes the image display properly. Would you like me to show you the difference between how it looks with both paths? |
||
|
||
## Node types | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, these seem to work right now, any reason to change from markdown to HTML?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MDX format is specifically designed to combine the simplicity of Markdown with the power of HTML where needed. In this case, using HTML tags in MDX is a valid and more suitable solution for creating interactive badges
Screenshot before changes:
Screenshot after changes:
The HTML version provides: