Repository navigation
Import code blocks and shared content into pages. - #12
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Import code blocks and shared content into pages
Adds two source-level include tags, so content doesn't have to be duplicated across pages.
<import-codeblock src="./playground.ts"/>TabPane), and in headers and footers.langoverrides it.srcresolves from the file the tag is in, must stay inside the content folder, and must match case exactly on every OS.<import-content src="./_shared.mdx"/>{{ }}work._convention: a Markdown/MDX file whose name, or a folder above it, starts with_is shared content. It is never published as a page; generated pages can't use such paths either.Dev server
Pages record the files they import, directly or through shared content. Editing an imported file re-renders those pages and refreshes any header or footer that imports it. Creating a missing file recovers its error page.
Studio docs
The 56 playground sources copied into component pages now use
<import-codeblock>. All copies matched their files exactly, the rendered output is identical, and 8,356 duplicated lines are removed.Docs
New Code blocks and Shared content guides. Also updated: the CLI guide (content folder rules), the ts-ssg README, and the incremental build notes.
Other
ts-ssgnow declares its existing@purestack/ts-minidomdependency, which adds one line toyarn.lock.Verification