Skip to content

Commit 2dd7558

Browse files
authored
Refactor docs to live on their own (#6454)
1 parent 86e7cd4 commit 2dd7558

File tree

607 files changed

+1772
-5137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

607 files changed

+1772
-5137
lines changed

.firebaserc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": {
3-
"default": "flutter-dev-230821",
3+
"default": "flutter-docs-prod",
44
"flutter-dev": "flutter-dev-230821",
55
"flutter-io": "sweltering-fire-2088",
66
"staging-1": "flutter-io-staging-1",

.github/ISSUE_TEMPLATE/1_page_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ body:
99
id: page-url
1010
attributes:
1111
label: Page URL
12-
placeholder: "Example: https://flutter.dev/docs"
12+
placeholder: "Example: https://docs.flutter.dev"
1313
validations:
1414
required: true
1515
- type: input

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ on:
1212

1313
env:
1414
NODE_ENV: production
15-
NODE_VERSION: 15
15+
NODE_VERSION: 17
1616

1717
jobs:
1818

1919
test:
2020
runs-on: ubuntu-latest
21+
if: github.repository == 'flutter/website'
2122
strategy:
2223
fail-fast: false
2324
matrix:
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: HTML link references validate
1+
name: Validate link references in built HTML
22

33
on:
44
push:
@@ -8,27 +8,18 @@ on:
88
branches:
99
- main
1010

11-
env:
12-
NODE_ENV: production
13-
NODE_VERSION: 15
14-
1511
jobs:
1612
check_link_references:
1713
runs-on: ubuntu-latest
1814
steps:
1915
- uses: actions/checkout@v2
2016
with:
2117
submodules: "recursive"
22-
- name: Install Node
23-
uses: actions/setup-node@v2
24-
with:
25-
node-version: ${{ env.NODE_VERSION }}
2618
- name: Build
2719
run: make build
2820
env:
2921
DISABLE_TESTS: 1
3022
- uses: actions/setup-python@v2
3123
with:
3224
python-version: "3.x"
33-
- run: pip install PyYAML
3425
- run: python tool/check_link_references.py

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ node_modules
1919
example.g
2020
pubspec.lock
2121
tmp/
22+
_config_stage.yml

Dockerfile

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM ruby:${RUBY_VERSION}-buster as dev
44

55
ENV TZ=US/Pacific
66

7-
ARG NODE_VERSION=15
7+
ARG NODE_VERSION=17
88
ENV NODE_VERSION=$NODE_VERSION
99

1010
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x -o node_setup.sh && \
@@ -56,7 +56,7 @@ RUN if test -n "$FLUTTER_BRANCH" -a "$FLUTTER_BRANCH" != "stable" ; then \
5656
fi
5757

5858
# Set up Flutter
59-
RUN flutter doctor --suppress-analytics --quiet
59+
RUN flutter doctor
6060
RUN flutter --version
6161
RUN dart pub get
6262

@@ -65,9 +65,6 @@ EXPOSE 4002
6565

6666

6767
# -- Test target
68-
# NOTE that instead of have a script that tests all targets,
69-
# we could build a new docker container for each test and
70-
# start clean
7168
FROM dev as test
7269
ARG DISABLE_TESTS
7370
ENV DISABLE_TESTS=$DISABLE_TESTS
@@ -90,16 +87,12 @@ RUN cd flutter && \
9087
git fetch origin stable && \
9188
git checkout stable && \
9289
git pull
93-
9490
RUN flutter doctor
95-
96-
# NOTE this is a bit sneaky and we could be more clear about it
97-
# by having an actual production template for robots.txt rather
98-
# than changing the contents of the file at build/test time.
99-
# This is similarly seen in tool/check-links.sh
10091
RUN echo "User-agent: *" > src/robots.txt && echo "Allow: /" >> src/robots.txt
10192

102-
RUN bundle exec jekyll build --config _config.yml
93+
ARG BUILD_CONFIGS=_config.yml
94+
ENV BUILD_CONFIGS=$BUILD_CONFIGS
95+
RUN bundle exec jekyll build --config $BUILD_CONFIGS
10396

10497

10598
# -- Deploy target
@@ -109,14 +102,14 @@ ARG FIREBASE_TOKEN
109102
ENV FIREBASE_TOKEN=$FIREBASE_TOKEN
110103
ARG FIREBASE_ALIAS=default
111104
ENV FIREBASE_ALIAS=${FIREBASE_ALIAS:-default}
112-
ARG COMMIT=$(git rev-parse --short HEAD)
113-
ENV COMMIT=$COMMIT
105+
ARG BUILD_COMMIT=$(git rev-parse --short HEAD)
106+
ENV BUILD_COMMIT=$COMMIT
114107

115108
RUN firebase use $FIREBASE_ALIAS
116-
RUN firebase deploy -m $COMMIT \
109+
RUN firebase deploy -m $BUILD_COMMIT \
117110
--only hosting \
118111
--non-interactive \
119112
--token $FIREBASE_TOKEN \
120113
--project $FIREBASE_ALIAS \
121114
--debug \
122-
--json
115+
--json

Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ all: gen-env up down debug shell setup serve switch-channel test-channel \
1010
.DEFAULT_GOAL := up
1111
.PHONY: all
1212

13+
FIREBASE_ALIAS ?= default
14+
1315

1416
# =================== Development Commands ==================
1517

@@ -68,7 +70,7 @@ serve:
6870

6971
# Test hosting locally with FB emulator
7072
emulate:
71-
firebase emulators:start --only hosting
73+
firebase emulators:start --only hosting --project ${FIREBASE_ALIAS}
7274

7375

7476
# =================== Testing locally from host ==================
@@ -133,7 +135,7 @@ check-links:
133135

134136
FLUTTER_BRANCH ?= stable
135137
TEST_TARGET_CHANNEL ?= stable
136-
FIREBASE_ALIAS ?= default
138+
BUILD_CONFIGS ?= _config.yml
137139
BUILD_COMMIT := $(shell git rev-parse --short HEAD)
138140
BUILD_TAG = fltbuild
139141
BUILD_NAME = tmpbuild
@@ -164,12 +166,13 @@ debug-test:
164166
# those will be run on the Github action.
165167
# Usage: `DISABLE_TESTS=1 make build-image`
166168
build-image:
167-
docker build --no-cache --rm --target builder \
169+
docker build --rm --target builder \
168170
--build-arg FIREBASE_ALIAS=${FIREBASE_ALIAS} \
169171
--build-arg FIREBASE_TOKEN=${FIREBASE_TOKEN} \
170172
--build-arg FLUTTER_BRANCH=${FLUTTER_BRANCH} \
171173
--build-arg DISABLE_TESTS=${DISABLE_TESTS} \
172-
--build-arg COMMIT=${BUILD_COMMIT} \
174+
--build-arg BUILD_COMMIT=${BUILD_COMMIT} \
175+
--build-arg BUILD_CONFIGS=${BUILD_CONFIGS} \
173176
--build-arg RUBY_VERSION=${RUBY_VERSION} \
174177
--build-arg NODE_VERSION=${NODE_VERSION} -t ${BUILD_TAG}:${BUILD_COMMIT} .
175178

@@ -205,13 +208,16 @@ else
205208
--json
206209
endif
207210

208-
STAGE_NAME ?= stage
211+
209212
# All in one command to stage your build to a Firebase
210213
# channel on your currently selected project
211214
# Usage: `make stage STAGE_NAME=foo`
215+
STAGE_NAME ?= docs
212216
stage:
213-
make build
214-
firebase hosting:channel:deploy ${STAGE_NAME}
217+
make build BUILD_CONFIGS=_config.yml,_config_stage.yml
218+
firebase hosting:channel:deploy ${STAGE_NAME} \
219+
--project ${FIREBASE_ALIAS} \
220+
--token ${FIREBASE_TOKEN}
215221

216222

217223

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Flutter logo]](https://flutter.dev)
1+
[![Flutter logo]](https://docs.flutter.dev)
22
# [Flutter][] website
33

44
[![Build Status][]][Repo on GitHub Actions]
@@ -298,7 +298,7 @@ Also check out the site-shared [wiki](https://github.com/dart-lang/site-shared/w
298298
[DartPad]: https://dartpad.dev
299299
[`firebase use` command]: https://firebase.googleblog.com/2016/07/deploy-to-multiple-environments-with.html
300300
[forking]: https://docs.github.com/en/get-started/quickstart/fork-a-repo
301-
[Flutter install]: https://flutter.dev/docs/get-started/install
301+
[Flutter install]: https://docs.flutter.dev/get-started/install
302302
[Flutter logo]: https://github.com/dart-lang/site-shared/blob/master/src/_assets/image/flutter/icon/64.png?raw=1
303303
[Firebase]: https://firebase.google.com/
304304
[Google Developer Documentation Style Guidelines]: https://developers.google.com/style

_config.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
title: Flutter
2-
3-
url: https://flutter.dev
4-
2+
url: https://docs.flutter.dev
3+
main-url: https://flutter.dev
54
email: flutter-dev@googlegroups.com
65

76
google_analytics_id: UA-67589403-1
87
google_site_verification: HFqxhSbf9YA_0rBglNLzDiWnrHiK_w4cqDh2YD2GEY4
98
google_tag_manager_id: GTM-ND4LWWZ
109
default_share_image: /assets/images/flutter-logo-sharing.png
11-
1210

13-
branch: main
1411

1512
github_username: flutter
13+
branch: main
1614
repo:
1715
organization: https://github.com/flutter
18-
1916
this: https://github.com/flutter/website
20-
2117
flutter: https://github.com/flutter/flutter
2218
samples: https://github.com/flutter/samples
2319
plugins: https://github.com/flutter/plugins
@@ -92,27 +88,27 @@ defaults:
9288
show_banner: true
9389
show_footer: true
9490
- scope:
95-
path: 'docs'
91+
path: ''
9692
values:
9793
toc: true
9894
- scope:
99-
path: 'docs/cookbook'
95+
path: 'cookbook'
10096
values:
10197
show_breadcrumbs: true
10298
- scope:
103-
path: 'docs/development'
99+
path: 'development'
104100
values:
105101
show_breadcrumbs: true
106102
- scope:
107-
path: 'docs/development/ui/widgets'
103+
path: 'development/ui/widgets'
108104
values:
109105
toc: false
110106
- scope:
111-
path: 'docs/get-started'
107+
path: 'get-started'
112108
values:
113109
show_breadcrumbs: true
114110
- scope:
115-
path: 'docs/get-started/flutter-for'
111+
path: 'get-started/flutter-for'
116112
values:
117113
show_breadcrumbs: false
118114

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ services:
1111
environment:
1212
- NODE_ENV=development
1313
- JEKYLL_ENV=development
14+
- DISABLE_TESTS=$DISABLE_TESTS
15+
- FIREBASE_ALIAS=$FIREBASE_ALIAS
16+
- FIREBASE_TOKEN=$FIREBASE_TOKEN
1417
ports:
1518
- "4002:4002"
1619
- "35729:35729"
20+
- "5500:5500"
1721
volumes:
1822
- ./:/app
1923
- site_bundle:/usr/local/bundle

0 commit comments

Comments
 (0)