一键导入
stage-site-locally
// Stages the Dart site locally for PR validation. Includes formatting Dart code, syncing excerpts, building the site, checking for broken links, and serving the development site.
// Stages the Dart site locally for PR validation. Includes formatting Dart code, syncing excerpts, building the site, checking for broken links, and serving the development site.
Sync the changelog from the Dart SDK repo to update the changelog.yml entries in the site repository.
Publish a new article to the Dart blog from a Google Doc.
Proofreads Markdown files against Google guidelines.
Update the whats-new page with changes to the website since the previous release.
| name | stage-site-locally |
| description | Stages the Dart site locally for PR validation. Includes formatting Dart code, syncing excerpts, building the site, checking for broken links, and serving the development site. |
Before reviewing changes, pushing a PR, or testing the site locally, follow these steps to properly stage the repository.
Update the formatting of the site's Dart code and examples to stay compliant with standard formatting rules. This must be done before syncing excerpts so the generated code matches the source format:
dart run dash_site format-dart
Ensure that any changes made to code examples in the workspace are synced correctly into the corresponding Markdown files:
dart run dash_site refresh-excerpts
For the link checker to validate local URLs, the site must be built first. Run the build command:
dart run dash_site build
Verify that all internal pages, URLs, and markdown link references are intact.
First, check for broken Markdown link references:
dart run dash_site check-link-references
Second, check for broken cross-page links:
dart run dash_site check-links
If you detect any broken links, attempt to patch them or alert the user about the issues.
Finally, serve a local development environment to preview the changes in your browser:
dart run dash_site serve