site www

2025-12-11 0 605

The documentation site for the Dart programming language,
built with Eleventy and hosted on Firebase.

We welcome contributions of all kinds!
To set up the site locally, follow the
below guidelines on Building the site.
To learn more about contributing to this repository,
check out the Contributing guidelines.

Getting started

Start by looking for an issue
that catches your interest, or create an issue with your proposed change.
Consider adding a comment to let everyone know that you\’re working on it, and
feel free to ask any questions you have on the same issue.

To update this site, fork the repo, make your changes,
and generate a pull request.
For small, contained changes (such as style and typo fixes),
you probably don\’t need to build this site.
Often you can make changes using the GitHub UI.
We can stage the changes automatically in your pull request.

Important

If you are cloning this repository locally,
follow the below instruction on cloning with its submodule.

If your change involves code samples, adds/removes pages, or affects navigation,
do consider building and testing your work before submitting.

If you want or need to build the site, follow the steps below.

Build the site

For changes beyond simple text and CSS tweaks,
we recommend running the site locally to
enable an edit-refresh cycle.

Get the prerequisites

Install the following tools to build and develop the site:

Dart

The latest stable release of Dart is required to build the site
and run its tooling. This can be the Dart included in the Flutter SDK.
If you don\’t have Dart or need to update, follow the
instructions at Get the Dart SDK.

If you already have Dart installed, verify it\’s on your path
and already the latest stable version:

dart --version

Node.js

The latest stable LTS release of Node.js is required to build the site.
If you don\’t have Node.js or need to update, download your
computer\’s corresponding version and follow the instructions
from the Node.js download archive.
If you prefer, you can use a version manager such as nvm,
and run nvm install from the repository\’s root directory.

If you already have Node installed, verify it\’s available on your path
and already the latest stable version (currently 22.15 or later):

node --version

If your version is out of date,
follow the update instructions for how you originally installed it.

Clone this repo and its submodules

Note

This repository has git submodules, which affects how you clone it.
The GitHub documentation has general help on
forking and cloning repos.

If you\’re not a member of the Dart organization,
we recommend you create a fork of this repo under your own account,
and then submit a PR from that fork.

Once you have a fork (or you\’re a Dart org member),
choose one of the following submodule-cloning techniques:

  1. Clone the repo and its submodule at the same time
    using the --recurse-submodules option:

    git clone --recurse-submodules https://git*hu*b.co*m/dart-lang/site-www.git
    
  2. If you\’ve already cloned the repo without its submodule,
    then run this command from the root of the repository:

    git submodule update --init --recursive
    

Note

At any time during development
you can use the git submodule command to refresh submodules:

git pull && git submodule update --init --recursive

Set up your local environment and serve changes

Before you continue setting up the site infrastructure,
verify the correct versions of Dart and Node.js are set up and available by
following the instructions in Get the prerequisites.

  1. Optional: After cloning the repo and its submodules,
    create a branch for your changes:

    git checkout -b <BRANCH_NAME>
    
  2. From the root directory of the repository,
    fetch the site\’s Dart dependencies.

    dart pub get
    
  3. Install pnpm using your preferred installation method.
    pnpm is an alternative, efficient package manager for npm packages.
    If you already have pnpm, verify you have the latest stable version.
    We recommend using corepack to install and manage pnpm versions,
    since it is bundled with most installations of Node.

    If you haven\’t used corepack before, you\’ll need to
    first enable it with corepack enable.
    Then, to install the correct pnpm version, from the
    root directory of the repository, run corepack install:

    corepack enable
    corepack install
    
  4. Once you have pnpm installed and setup,
    fetch the site\’s npm dependencies using pnpm install.
    We highly recommend you use pnpm, but you can also use npm.

    pnpm install
    
  5. From the root directory, run the dash_site tool to
    validate your setup and learn about the available commands.

    ./dash_site --help
    
  6. From the root directory, serve the site locally.

    ./dash_site serve
    

    This command generates and serves the site on a
    local port that\’s printed to your terminal.

  7. View your changes in the browser by navigating to http://loc*alh*os*t:4000.

    Note the port might be different if 4000 is taken.

    If you want to check the raw, generated HTML output and structure,
    view the _site directory in a file explorer or an IDE.

  8. Make your changes to the local repo.

    The site should automatically rebuild on most changes, but if
    something doesn\’t update, exit the process and rerun the command.
    Improvements to this functionality are planned.
    Please open a new issue to track the issue if this occurs.

  9. Commit your changes to the branch and submit your PR.

    If your change is large, or you\’d like to test it,
    consider validating your changes.

Tip

To find additional commands that you can run,
run ./dash_site --help from the repository\’s root directory.

Validate your changes

Check documentation and example code

If you\’ve made changes to the code in the /examples or /tool directories,
commit your work, then run the following command to
verify it is up to date and matches the site standards.

./dash_site check-all

If this script reports any errors or warnings,
then address those issues and rerun the command.
If you have any issues, leave a comment on your issue or pull request,
and we\’ll try our best to help you.
You can also chat with us on the #hackers-devrel channel
on the Flutter contributors Discord!

Refresh code excerpts

A build that fails with the error
Error: Some code excerpts needed to be updated!
means that one or more code excerpts in the site Markdown files
aren\’t identical to the code regions declared
in the corresponding .dart files.

To resolve this error,
from the root of the site-www directory,
run ./dash_site refresh-excerpts.

To learn more about creating, editing, and using code excerpts,
check out the excerpt updater package documentation.

[Optional] Deploy to a staging site

A site maintainer can automatically stage submitted pull requests.
If you\’d like to first stage the site yourself,
you can build a full version and upload it to Firebase.

  1. If you don\’t already have a Firebase project,

    • Navigate to the Firebase Console
      and create your own Firebase project (for example, dart-dev-staging).

    • Head back to your local terminal and verify that you\’re logged in.

      npm exec -- firebase-tools login
      
    • Ensure that your project exists and activate that project:

      npm exec -- firebase-tools projects:list
      npm exec -- firebase-tools use <your-project>
      
  2. From the root directory of the repository, build the site:

    ./dash_site build
    

    This builds the site and copies it to your local _site directory.
    If that directory previously existed, it will be replaced.

  3. Deploy to your activated Firebase project\’s default hosting site:

    npm exec -- firebase-tools deploy --only hosting
    
  4. Navigate to your PR on GitHub and include the link of the staged version.
    Do consider adding a reference to the commit you staged,
    so that reviewers know if any further changes have been made.

下载源码

通过命令行克隆项目:

git clone https://github.com/dart-lang/site-www.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 建站资源 site www https://www.zuozi.net/34906.html

常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务