Skip to content
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

CI: Site Variable Scanner #1461

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 16 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ jobs:
- name: Check for broken internal links
run: dart run flutter_site check-links

site-variable-scanner:
name: Check if text can be replaced with site variables
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
submodules: recursive
- uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30
with:
sdk: stable
- name: Fetch Dart packages
run: dart pub get
- name: Check if text can be replaced with site variables
run: dart run flutter_site check-site-variable

firebase-validate:
name: Validate Firebase configuration
runs-on: ubuntu-latest
Expand All @@ -119,7 +134,7 @@ jobs:

deploy:
name: Deploy to production
needs: [test, excerpts, linkcheck, firebase-validate]
needs: [test, excerpts, linkcheck, site-variable-scanner, firebase-validate]
runs-on: ubuntu-latest
if: |
github.event_name == 'push' &&
Expand Down
2 changes: 1 addition & 1 deletion site-shared
Submodule site-shared updated 139 files
76 changes: 38 additions & 38 deletions src/_data/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,51 @@ default_share_image: /assets/images/cn/flutter-cn-logo.png
github_username: cfug
branch: main
repo:
organization: https://github.com/flutter
this: https://github.com/cfug/flutter.cn
flutter: https://github.com/flutter/flutter
samples: https://github.com/flutter/samples
packages: https://github.com/flutter/packages
gallery-archive: https://github.com/flutter/gallery
engine: https://github.com/flutter/engine
uxr: https://github.com/flutter/uxr
wonderous: https://github.com/gskinnerTeam/flutter-wonderous-app
organization: https://github.com/flutter/
this: https://github.com/cfug/flutter.cn/
flutter: https://github.com/flutter/flutter/
samples: https://github.com/flutter/samples/
packages: https://github.com/flutter/packages/
gallery-archive: https://github.com/flutter/gallery/
engine: https://github.com/flutter/engine/
uxr: https://github.com/flutter/uxr/
wonderous: https://github.com/gskinnerTeam/flutter-wonderous-app/
dart:
api: https://api.dart.cn
api: https://api.dart.cn/
sdk:
channel: stable
sdk:
channel: stable # When changing this value also update it in src/_assets/js/archive.js
social:
twitter: https://twitter.com/FlutterDev
youtube: https://www.youtube.com/@flutterdev
dart-site: https://dart.cn
news: https://news.dartlang.org
api: https://api.flutter-io.cn
main-api: https://main-api.flutter-io.cn
pub: https://pub-web.flutter-io.cn
pub-api: https://pub-web.flutter-io.cn/documentation
pub-pkg: https://pub-web.flutter-io.cn/packages
flutter-medium: https://medium.com/flutter
medium: https://medium.com
dartpad: https://dartpad.cn
gallery-archive: https://gallery.flutter.cn
material: https://m3.material-io.cn
material2: https://m2.material.io
so: https://stackoverflow.com
github: https://github.com
flutter-assets: https://flutter.github.io/assets-for-api-docs/assets
android-dev: https://developer.android.google.cn
apple-dev: https://developer.apple.com
google-blog: https://developers.googleblog.com
developers: https://developers.google.cn
codelabs: https://codelabs.developers.google.com
codelabs-cn: https://codelabs.flutter-io.cn # docs.flutter.cn
flutter-files-cn: https://files.flutter-io.cn # docs.flutter.cn
groups: https://groups.google.com
firebase: https://firebase.google.cn
twitter: https://twitter.com/FlutterDev/
youtube: https://www.youtube.com/@flutterdev/
dart-site: https://dart.cn/
news: https://news.dartlang.org/
api: https://api.flutter-io.cn/
main-api: https://main-api.flutter-io.cn/
pub: https://pub-web.flutter-io.cn/
pub-api: https://pub-web.flutter-io.cn/documentation/
pub-pkg: https://pub-web.flutter-io.cn/packages/
flutter-medium: https://medium.com/flutter/
medium: https://medium.com/
dartpad: https://dartpad.cn/
gallery-archive: https://gallery.flutter.cn/
material: https://m3.material-io.cn/
material2: https://m2.material.io/
so: https://stackoverflow.com/
github: https://github.com/
flutter-assets: https://flutter.github.io/assets-for-api-docs/assets/
android-dev: https://developer.android.google.cn/
apple-dev: https://developer.apple.com/
google-blog: https://developers.googleblog.com/
developers: https://developers.google.cn/
codelabs: https://codelabs.developers.google.com/
codelabs-cn: https://codelabs.flutter-io.cn/ # docs.flutter.cn
flutter-files-cn: https://files.flutter-io.cn/ # docs.flutter.cn
groups: https://groups.google.com/
firebase: https://firebase.google.cn/
wonderous: https://wonderous.app/
youtube-site: https://youtube.com
youtube-site: https://youtube.com/

yt:
set: 'frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ consult the [CocoaPods getting started guide][].
If watching a video helps you learn,
this video covers adding Flutter to an iOS app:

<iframe class="full-width" src="{{yt-embed}}/IIcrfrTshTs" title="Learn about how to add Flutter to an existing iOS app" {{yt-set}}></iframe>
<iframe class="full-width" src="{{site.yt.embed}}/IIcrfrTshTs" title="Learn about how to add Flutter to an existing iOS app" {{site.yt.set}}></iframe>

[Watch this video on YouTube]({{yt-watch}}/IIcrfrTshTs).
[Watch this video on YouTube]({{site.yt.watch}}/IIcrfrTshTs).

#### Requirements {:#method-a-reqs}

Expand Down Expand Up @@ -139,4 +139,4 @@ into your iOS app, complete the following procedure.
[build-modes]: /testing/build-modes
[CocoaPods getting started guide]: https://guides.cocoapods.org/using/using-cocoapods.html
[Podfile target]: https://guides.cocoapods.org/syntax/podfile.html#target
[Flutter Podfile sample]: https://github.com/flutter/samples/blob/main/add_to_app/plugin/ios_using_plugin/Podfile
[Flutter Podfile sample]: {{site.repo.samples}}blob/main/add_to_app/plugin/ios_using_plugin/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Use this method in the following use cases:

#### Limitations {:#method-b-limits}

{% render docs/add-to-app/ios-project/limits-common-deps.md %}
{% include docs/add-to-app/ios-project/limits-common-deps.md %}

#### Example project structure {:#method-b-structure}

{% render docs/add-to-app/ios-project/embed-framework-directory-tree.md %}
{% include docs/add-to-app/ios-project/embed-framework-directory-tree.md %}

#### Procedures

Expand All @@ -32,6 +32,6 @@ into your existing app in Xcode depends on the type of framework.
* Link and embed dynamic frameworks.
* Link static frameworks. [Never embed them][static-framework].

{% render docs/add-to-app/ios-project/link-and-embed.md %}
{% include docs/add-to-app/ios-project/link-and-embed.md %}

[static-framework]: https://developer.apple.com/library/archive/technotes/tn2435/_index.html
[static-framework]: {{site.apple-dev}}library/archive/technotes/tn2435/_index.html
6 changes: 3 additions & 3 deletions src/_includes/docs/add-to-app/ios-project/embed-split.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Use this method in the following use cases:

#### Limitations {:#method-c-limits}

{% render docs/add-to-app/ios-project/limits-common-deps.md %}
{% include docs/add-to-app/ios-project/limits-common-deps.md %}

This method only works with the `beta` or `stable` [release channels][].

[release channels]: /release/upgrade#switching-flutter-channels

#### Example project structure {:#method-c-structure}

{% render docs/add-to-app/ios-project/embed-framework-directory-tree.md %}
{% include docs/add-to-app/ios-project/embed-framework-directory-tree.md %}

#### Add Flutter engine to your Podfile

Expand All @@ -45,4 +45,4 @@ and `Release` when you're ready to ship.

#### Link and embed app and plugin frameworks

{% render docs/add-to-app/ios-project/link-and-embed.md %}
{% include docs/add-to-app/ios-project/link-and-embed.md %}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ The next section explains how to [produce that framework][ios-framework].
To prevent the error that occurs when common dependencies exist,
use `flutter build ios-framework` with the `--no-plugins` flag.

[common]: https://github.com/flutter/flutter/issues/130220
[ios-framework]: https://github.com/flutter/flutter/issues/114692
[common]: {{site.repo.flutter}}issues/130220
[ios-framework]: {{site.repo.flutter}}issues/114692
4 changes: 2 additions & 2 deletions src/_includes/docs/add-to-app/ios-project/link-and-embed.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,5 @@ To embed your dynamic frameworks, complete the following procedure.
1. Select **Product** <span aria-label="and then">></span>
**Build** or press <kbd>Cmd</kbd> + <kbd>B</kbd>.

[static or dynamic frameworks]: https://stackoverflow.com/questions/32591878/ios-is-it-a-static-or-a-dynamic-framework
[static-framework]: https://developer.apple.com/library/archive/technotes/tn2435/_index.html
[static or dynamic frameworks]: {{site.so}}questions/32591878/ios-is-it-a-static-or-a-dynamic-framework
[static-framework]: {{site.apple-dev}}library/archive/technotes/tn2435/_index.html
2 changes: 1 addition & 1 deletion src/_includes/docs/admonitions/tip-hashCode-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ hexadecimal digits of its [`hashCode`][].
This hash serves as a unique identifier for that render object.
:::

[`hashCode`]: {{site.api}}/flutter/rendering/TextSelectionPoint/hashCode.html
[`hashCode`]: {{site.api}}flutter/rendering/TextSelectionPoint/hashCode.html
4 changes: 2 additions & 2 deletions src/_includes/docs/community/china/pub-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

1. Configure a proxy.
To configure a proxy, check out the
[Dart documentation on proxies]({{site.dart-site}}/tools/pub/troubleshoot#pub-get-fails-from-behind-a-corporate-firewall).
[Dart documentation on proxies]({{site.dart-site}}tools/pub/troubleshoot#pub-get-fails-from-behind-a-corporate-firewall).

配置代理。
要配置代理,请查阅 [Dart 关于代理的文档]({{site.dart-site}}/tools/pub/troubleshoot#pub-get-fails-from-behind-a-corporate-firewall)。
要配置代理,请查阅 [Dart 关于代理的文档]({{site.dart-site}}tools/pub/troubleshoot#pub-get-fails-from-behind-a-corporate-firewall)。

{% comment %}
From <https://github.com/flutter/website/issues/2556#issuecomment-481566476>
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/docs/dart-tool-win.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ from the command line, or see the [dart tool][] page.

:::

[dart tool]: {{site.dart-site}}/tools/dart-tool
[dart tool]: {{site.dart-site}}tools/dart-tool
2 changes: 1 addition & 1 deletion src/_includes/docs/dart-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ from the command line, or see the [dart tool][] page.

:::

[dart tool]: {{site.dart-site}}/tools/dart-tool
[dart tool]: {{site.dart-site}}tools/dart-tool
4 changes: 2 additions & 2 deletions src/_includes/docs/dartpad-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This codelab uses embedded DartPads to display examples and exercises.
If you see empty boxes instead of DartPads, check out
[Troubleshooting DartPad]({{site.dart-site}}/tools/dartpad/troubleshoot).
[Troubleshooting DartPad]({{site.dart-site}}tools/dartpad/troubleshoot).

本页面使用一个嵌入式版本的 DartPad 来显示示例和进行练习。
如果你看到的是空白内容,而不是 DartPad 内容,
请前往 [DartPad 故障排除页]({{site.dart-site}}/tools/dartpad/troubleshoot)。
请前往 [DartPad 故障排除页]({{site.dart-site}}tools/dartpad/troubleshoot)。

:::
2 changes: 1 addition & 1 deletion src/_includes/docs/debug/debug-flow-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ check out [`flutter_gdb`][].
:::

[GNU Project Debugger]: https://www.sourceware.org/gdb/
[`flutter_gdb`]: {{site.repo.engine}}/blob/main/sky/tools/flutter_gdb
[`flutter_gdb`]: {{site.repo.engine}}blob/main/sky/tools/flutter_gdb

#### Build the Android version of the Flutter app in the Terminal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Flutter 需要完整安装 Android Studio 才能支持其 Android 平台的依

### 安装 Android Studio

1. Download and install [Android Studio]({{site.android-dev}}/studio/install#chrome-os).
1. Download and install [Android Studio]({{site.android-dev}}studio/install#chrome-os).

下载并安装 [Android Studio]({{site.android-dev}}/studio/install#chrome-os)。
下载并安装 [Android Studio]({{site.android-dev}}studio/install#chrome-os)。

1. Start Android Studio, and go through the 'Android Studio Setup Wizard'.
This installs the latest Android SDK, platform tools and build tooling
Expand Down Expand Up @@ -81,10 +81,10 @@ you need an Android device running Android 5.0 (API level 21) or higher.

1. Enable **Developer options** and **USB debugging** on your device.
Detailed instructions are available in the
[Android documentation]({{site.android-dev}}/studio/debug/dev-options).
[Android documentation]({{site.android-dev}}studio/debug/dev-options).

在你的设备上启动**开发者选项**以及 **USB 调试**工具。
详细步骤请查看 [Android 文档]({{site.android-dev}}/studio/debug/dev-options)。
详细步骤请查看 [Android 文档]({{site.android-dev}}studio/debug/dev-options)。

1. Using a USB cable, plug your phone into your computer.
On your Chromebook, you might see a notification for
Expand Down
28 changes: 14 additions & 14 deletions src/_includes/docs/install/deprecated/android-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Flutter 依赖 Android Studio 的全量安装来为其提供 Android 平台的

{% render docs/help-link.md, location:'android-studio', section:'#android-setup' %}

1. Download and install [Android Studio]({{site.android-dev}}/studio).
1. Download and install [Android Studio]({{site.android-dev}}studio).

下载并安装 [Android Studio]({{site.android-dev}}/studio)。
下载并安装 [Android Studio]({{site.android-dev}}studio)。

1. Start Android Studio, and go through the 'Android Studio Setup Wizard'.
This installs the latest Android SDK, Android SDK Command-line Tools,
Expand Down Expand Up @@ -56,22 +56,22 @@ you need an Android device running Android 5.0 (API level 21) or higher.

1. Enable **Developer options** and **USB debugging** on your device.
Detailed instructions are available in the
[Android documentation]({{site.android-dev}}/studio/debug/dev-options).
[Android documentation]({{site.android-dev}}studio/debug/dev-options).

在设备上打开 **Developer options** 和 **USB debugging** 选项,
你可以在 [Android documentation]({{site.android-dev}}/studio/debug/dev-options) 上查看更详细的方法介绍。
你可以在 [Android documentation]({{site.android-dev}}studio/debug/dev-options) 上查看更详细的方法介绍。

1. [Optional] To leverage wireless debugging, enable **Wireless debugging**
on your device. Detailed instructions are available in the
[Android documentation]({{site.android-dev}}/studio/run/device#wireless).
[Android documentation]({{site.android-dev}}studio/run/device#wireless).

[可选] 要使用无线调试,启用设备上的 **Wireless debugging**。
详细的操作步骤在 [Android 文档]({{site.android-dev}}/studio/run/device#wireless) 里有。
详细的操作步骤在 [Android 文档]({{site.android-dev}}studio/run/device#wireless) 里有。

1. Windows-only: Install the [Google USB
Driver]({{site.android-dev}}/studio/run/win-usb).
Driver]({{site.android-dev}}studio/run/win-usb).

如果是在 Windows 平台上使用,需要安装 [Google USB Driver]({{site.android-dev}}/studio/run/win-usb)
如果是在 Windows 平台上使用,需要安装 [Google USB Driver]({{site.android-dev}}studio/run/win-usb)

1. Using a USB cable, plug your phone into your computer. If prompted on your
device, authorize your computer to access your device.
Expand Down Expand Up @@ -103,11 +103,11 @@ follow these steps:
根据以下步骤来将 Flutter 应用运行或测试于你的 Android 模拟器上:

1. Enable
[VM acceleration]({{site.android-dev}}/studio/run/emulator-acceleration#accel-vm)
[VM acceleration]({{site.android-dev}}studio/run/emulator-acceleration#accel-vm)
on your machine.

激活机器上的
[VM acceleration]({{site.android-dev}}/studio/run/emulator-acceleration) 选项。
[VM acceleration]({{site.android-dev}}studio/run/emulator-acceleration) 选项。

1. Start **Android Studio**, click the **Device Manager**
icon, and select **Create Device** under **Virtual** tab...
Expand Down Expand Up @@ -145,20 +145,20 @@ follow these steps:

1. Under Emulated Performance, select **Hardware - GLES 2.0** to enable
[hardware
acceleration]({{site.android-dev}}/studio/run/emulator-acceleration).
acceleration]({{site.android-dev}}studio/run/emulator-acceleration).

在 Emulated Performance 下选择 **Hardware - GLES 2.0** 选项来开启
[硬件加速]({{site.android-dev}}/studio/run/emulator-acceleration)。
[硬件加速]({{site.android-dev}}studio/run/emulator-acceleration)。

1. Verify the AVD configuration is correct, and select **Finish**.

确保 AVD 选项配置正确,并选择 **Finish** 选项。

For details on the above steps, see [Managing
AVDs]({{site.android-dev}}/studio/run/managing-avds).
AVDs]({{site.android-dev}}studio/run/managing-avds).

想要查看上述步骤的更多详细信息,
请查看 [Managing AVDs]({{site.android-dev}}/studio/run/managing-avds) 页面。
请查看 [Managing AVDs]({{site.android-dev}}studio/run/managing-avds) 页面。

1. In Android Virtual Device Manager, click **Run** in the toolbar.
The emulator starts up and displays the default canvas for your
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ Now, run flutter doctor to accept the android-licenses:
$ flutter doctor --android-licenses
```

[Android SDK tools]: {{site.android-dev}}/studio/#downloads
[Android SDK tools]: {{site.android-dev}}studio/#downloads
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ you need the following in addition to the Flutter SDK:
[CocoaPods][] 如果你需要使用插件

[CocoaPods]: https://cocoapods.org/
[Xcode]: {{site.apple-dev}}/xcode/
[Xcode]: {{site.apple-dev}}xcode/
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

{{site.alert.end}}

[Announcing Flutter for Windows]: {{site.flutter-medium}}/announcing-flutter-for-windows-6979d0d01fed
[Announcing Flutter for Windows]: {{site.flutter-medium}}announcing-flutter-for-windows-6979d0d01fed

### Additional Windows requirements

Expand Down
Loading
Loading