-
Notifications
You must be signed in to change notification settings - Fork 267
feature: content reuse #584
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8623b52
content reuse example
sbvegan 2519afc
Update notes/content-reuse.md
cpengilly 8103423
Apply suggestions from code review
sbvegan e66ac5d
Merge branch 'main' into content-reuse
sbvegan 60cce75
content reuse
sbvegan 01d37ca
Update notes/content-reuse.md
cpengilly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`op-proposer` is the service that submits the output roots to the L1. This is to enable trustless execution of L2-to-L1 messaging and creates the view into the L2 state from the L1's perspective. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as OpProposerDescriptionShort } from './OpProposerDescriptionShort.md' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Content Reuse | ||
|
||
Content reuse is when you reuse the same piece of content in various places. It means that technical writers don't have to re-write text many times, and it means that the original piece of copy should be easy to locate so that it can be used as often as needed. When changes are made to that original piece of text, it will then be automatically changed wherever else that piece of text is used, which saves a lot of time. | ||
|
||
## Content Directory | ||
|
||
The content directory contains markdown files that can be imported across the nextra website. | ||
|
||
## How to Write Reusable Content | ||
|
||
Create a `.md` file in the `/content` directory. | ||
|
||
### How to Use a Single Reusable Content Components | ||
|
||
1. Import it at the top of `.mdx` file: | ||
|
||
``` | ||
import DescriptionShort from '@/content/DescriptionShort.md' | ||
``` | ||
|
||
1. Use it within the file | ||
|
||
``` | ||
Text before | ||
|
||
<OpProposerDescriptionShort /> | ||
|
||
Text after | ||
``` | ||
|
||
### How to Use a Multiple Reusable Content Components | ||
|
||
1. You can create a `index.js` file in the `content` directories and export | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
the components like this: | ||
|
||
``` | ||
export { default as ComponentA } from './ComponentA.md' | ||
export { default as ComponentB } from './ComponentB.md' | ||
``` | ||
|
||
1. Import it at the top of `.mdx` file: | ||
|
||
``` | ||
import {ComponentA, ComponentB} from '@/content/index.js' | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.