-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Merge marketing site into sites/www
#13373
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
36 commits
Select commit
Hold shift + click to select a range
9b4960f
Initial import of flutter/website-cms into repository
parlough fe8f17a
Add sites/www to pub workspace
parlough c3cbb85
Add support for the site from the dash_site tool
parlough 7bb243a
Set up building, serving, and cleaning in dash_site tool
parlough 03672b6
Fix image asset loading and transformation issues
parlough 531a113
Set up and separate GitHub actions workflows
parlough 0fd5cb7
Use combined stage and deploy setup
parlough 092f5cf
Adjust root AGENTS.md file
parlough 65b8b47
Update workflow display name
parlough 9de68e2
Enable serving both sites at the same time
parlough f0a3460
Avoid losing the firebase deploy output
parlough e7cc2a3
Update deploy and stage to rely on separate triggers
parlough c1ef951
Move stage and deploy logic to Dart for easier maintainence
parlough 307a190
Fix and simplify _SITE substitution
parlough bf82133
Hook up different Firebase emulator ports per site
parlough 3552dee
Clean up wording of PR comments
parlough e76efef
Adjust workflow group name for marketing site
parlough ccc5fae
Rename dart test workflows
parlough 8be0955
Fix conditional running of dart test workflow
parlough ea0c449
Update dash_site test-dart command to run site-specific tests
parlough ad98f4f
Remove strange tracking state
parlough 152adca
Clean up comments on stage-preview command
parlough ab04803
Merge branch 'main' into feat/merge-website-cms
parlough 5fc6c00
Keep deploy image the same for now
parlough 23e14d5
Merge branch 'main' into feat/merge-website-cms
parlough 9c9faad
Port updated banner from live site
parlough e46d53d
Merge branch 'main' into feat/merge-website-cms
parlough 4ece991
Merge branch 'main' into feat/merge-website-cms
parlough 73aaa20
Update sites README file
parlough 3ccff11
Merge branch 'main' into feat/merge-website-cms
parlough d666d88
Set default reviewer for sites/www directory
parlough 45b99c4
Merge branch 'main' into feat/merge-website-cms
parlough 90cbb3a
Apply suggestions from Gemini code review
parlough 0561f1b
Merge branch 'main' into feat/merge-website-cms
parlough 6465308
Fix additional review comments
parlough 23222df
Update sites/www to use stable SDK constraint
parlough File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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,70 @@ | ||
| name: Marketing site | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'sites/www/**' | ||
| - 'tool/dash_site/**' | ||
| - 'tool/config/linkcheck-skip-list.txt' | ||
| - 'pubspec.yaml' | ||
| - 'pubspec.lock' | ||
| - 'analysis_options.yaml' | ||
| - '.github/workflows/www.yml' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'sites/www/**' | ||
| - 'tool/dash_site/**' | ||
| - 'tool/config/linkcheck-skip-list.txt' | ||
| - 'pubspec.yaml' | ||
| - 'pubspec.lock' | ||
| - 'analysis_options.yaml' | ||
| - '.github/workflows/www.yml' | ||
| schedule: | ||
| - cron: '0 0 * * 0' | ||
|
|
||
| permissions: read-all | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| linkcheck: | ||
| name: Build and check links | ||
| runs-on: ubuntu-latest | ||
| if: github.repository == 'flutter/website' | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
| - uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260 | ||
| with: | ||
| sdk: beta | ||
| - name: Fetch Dart dependencies | ||
| run: dart pub get | ||
| - name: Install firebase-tools | ||
| run: curl -sL https://firebase.tools | bash | ||
| - name: Build site | ||
| run: dart run dash_site --site=www build | ||
| - name: Check for broken Markdown link references | ||
| run: dart run dash_site --site=www check-link-references | ||
| - name: Check for broken internal links | ||
| run: dart run dash_site --site=www check-links | ||
|
|
||
| firebase-validate: | ||
| name: Validate Firebase configuration | ||
| runs-on: ubuntu-latest | ||
| if: github.repository == 'flutter/website' | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
| - uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260 | ||
| with: | ||
| sdk: beta | ||
| - name: Fetch Dart dependencies | ||
| run: dart pub get | ||
| - name: Validate the firebase.json file | ||
| run: dart run dash_site --site=www verify-firebase-json |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,13 @@ | ||
| # @sfshaza2 is assigned as the default reviewer and triager, | ||
| # @sfshaza2 is the default reviewer and triager for the repository, | ||
| # with @flutter/website-reviewers available to approve as well as a fallback. | ||
| * @flutter/website-reviewers @sfshaza2 | ||
|
|
||
| # @abdallahshaban557 is the default reviewer for the marketing site, | ||
| # with @flutter/website-reviewers available to approve as well as a fallback. | ||
| /sites/www/ @flutter/website-reviewers @abdallahshaban557 | ||
|
|
||
| ## Notes | ||
| ## -------------------------------------------------- | ||
| ## Default reviewer will triage to others. | ||
| ## Someone in this group requires an LGTM to push a PR: @flutter/website-reviewers | ||
| ## All PRs require an LGTM from a `@flutter/website-reviewers` member to land. | ||
| ## Include the following reviewers on any iOS or macOS or flavors changes: @jmagman |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,4 +10,5 @@ workspace: | |
| - packages/analysis_defaults | ||
| - packages/excerpter | ||
| - sites/docs | ||
| - sites/www | ||
| - tool/dash_site | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| --- | ||
| trigger: always_on | ||
| --- | ||
|
|
||
| # Jaspr Project Rules | ||
|
|
||
| ## Core Principles | ||
| - **Framework**: Use [Jaspr](https://github.com/schultek/jaspr) for all web UI components. Do not use standard Flutter widgets (Container, Column, Row, etc.). | ||
| - **Elements**: Use HTML-like components provided by Jaspr (`div`, `section`, `h1`, `p`, `img`, `a`, `button`, `span`, etc.). | ||
|
|
||
| ## Components | ||
| - **Stateless vs Stateful**: | ||
| - Use `StatelessComponent` for purely presentational components that do not manage local state. | ||
| - Use `StatefulComponent` only when internal state management (e.g., animations, form input handling) is required. | ||
| - **Client-Side Rendering**: Annotate components with `@client` if they require browser-specific APIs or interactivity that cannot be server-side rendered (SSR). | ||
|
|
||
| ## Project Structure | ||
| - **Components**: Place reusable UI components in `lib/components/`. | ||
| - **Pages**: Place route-level components in `lib/pages/`. | ||
|
|
||
| ## Common Patterns | ||
| - **Lists**: Prefer Dart collection-for and collection-if elements over`.map().toList()` to render lists of children. | ||
| - **Conditionals**: Prefer Dart `if` inside the children list over ternary operators for conditional rendering. | ||
|
|
||
| ## Best Practices | ||
|
|
||
| When writing Jaspr components, adhere to these modern syntax rules: | ||
|
|
||
| ### Component Signature | ||
| Always use the `Component build(BuildContext context)` signature (not `Iterable<Component>` with `yield`). | ||
|
|
||
| ```dart | ||
| // ✅ Correct | ||
| @override | ||
| Component build(BuildContext context) { | ||
| return div([...]); | ||
| } | ||
|
|
||
| // ❌ Avoid | ||
| @override | ||
| Iterable<Component> build(BuildContext context) sync* { | ||
| yield div([...]); | ||
| } | ||
| ``` | ||
|
|
||
| ### Text Components | ||
| Use the dot-shorthand `.text()` for adding text nodes, which is cleaner than wrapping strings in `text()`. | ||
|
|
||
| ```dart | ||
| // ✅ Correct | ||
| div([ | ||
| .text('Hello World'), | ||
| ]) | ||
|
|
||
| // ❌ Avoid, Deprecated | ||
| div([ | ||
| text('Hello World'), | ||
| ]) | ||
| ``` | ||
|
|
||
| ### Links and Navigation | ||
|
|
||
| Prefer standard `a` tags over `Link` components when you need full control over attributes or are migrating strict HTML. | ||
|
|
||
| ```dart | ||
| // ✅ Correct | ||
| a( | ||
| href: '/path', | ||
| classes: 'my-link', | ||
| events: {'click': (e) => ...}, // Easy to attach events | ||
| [.text('Go')] | ||
| ) | ||
| ``` | ||
|
|
||
| ### Positional Arguments for Children | ||
|
|
||
| `div`, `span`, and other container components typically take children as a positional `List<Component>`. | ||
|
|
||
| ```dart | ||
| // ✅ Correct | ||
| div(classes: 'wrapper', [ | ||
| child1, | ||
| child2 | ||
| ]) | ||
|
|
||
| // ❌ Avoid | ||
| div(classes: 'wrapper', children: [ ... ]) | ||
| ``` | ||
|
|
||
| - Use `main_([...])` for rendering a `<main>` element. | ||
| - Use `Component.element(tag: 'xx', children: [...])` for an element that does not have a direct component. | ||
|
|
||
| ### Using Browser APIs and handling Global/Window Events | ||
|
|
||
| Use `import 'package:universal_web/web.dart' as web;` for accessing standard browser APIs (e.g. `window` or `window.document`) when implementing browser-specific logic (location checking, scroll locking). | ||
|
|
||
| Use `web.EventStreamProviders` to listen to window-level events in `initState` and cancel stream subscriptions in `dispose`. | ||
|
|
||
| ```dart | ||
| StreamSubscription? _resizeSubscription; | ||
|
|
||
| @override | ||
| void initState() { | ||
| super.initState(); | ||
| if (kIsWeb) { | ||
| _resizeSubscription = web.EventStreamProviders.resizeEvent | ||
| .forTarget(web.window) | ||
| .listen((_) => setState(() {})); | ||
| } | ||
| } | ||
|
|
||
| @override | ||
| void dispose() { | ||
| _resizeSubscription?.cancel(); | ||
| super.dispose(); | ||
| } | ||
| ``` | ||
Oops, something went wrong.
Oops, something went wrong.
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.