Skip to content

Commit 5b36369

Browse files
[Docs] - Add docs website. (#29)
1 parent 42d7307 commit 5b36369

39 files changed

+1594
-0
lines changed

.github/workflows/build_docs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and deploy documentation website
2+
on:
3+
push:
4+
branches:
5+
main
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: ./doc/website
14+
steps:
15+
# Checkout the repository
16+
- uses: actions/checkout@v3
17+
18+
# Setup a Dart environment
19+
- uses: dart-lang/setup-dart@v1
20+
21+
# Download all the packages that the app uses
22+
- run: dart pub get
23+
24+
# Build the static site
25+
- run: dart run bin/flutter_test_robots_docs.dart
26+
env:
27+
GHUB_DOC_WEBSITE_TOKEN: ${{ vars.GHUB_DOC_WEBSITE_TOKEN }}
28+
29+
# Zip and upload the static site.
30+
- name: Upload artifact
31+
uses: actions/upload-pages-artifact@v1
32+
with:
33+
path: ./doc/website/build
34+
35+
deploy:
36+
name: Deploy
37+
needs: build
38+
runs-on: ubuntu-latest
39+
40+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
41+
permissions:
42+
pages: write # to deploy to Pages
43+
id-token: write # to verify the deployment originates from an appropriate source
44+
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v2

analysis_options.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml
22

33
# Additional information about this file can be found at
44
# https://dart.dev/guides/language/analysis-options
5+
6+
analyzer:
7+
exclude:
8+
- doc/**

doc/website/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Build output
2+
/build
3+
4+
# https://dart.dev/guides/libraries/private-files
5+
# Created by `dart pub`
6+
.dart_tool/
7+
8+
# Android Studio and IntelliJ IDEA
9+
.idea
10+
11+
.DS_Store

doc/website/analysis_options.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file configures the static analysis results for your project (errors,
2+
# warnings, and lints).
3+
#
4+
# This enables the 'recommended' set of lints from `package:lints`.
5+
# This set helps identify many issues that may lead to problems when running
6+
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7+
# style and format.
8+
#
9+
# If you want a smaller set of lints you can change this to specify
10+
# 'package:lints/core.yaml'. These are just the most critical lints
11+
# (the recommended set includes the core lints).
12+
# The core lints are also what is used by pub.dev for scoring packages.
13+
14+
include: package:lints/recommended.yaml
15+
16+
# Uncomment the following section to specify additional rules.
17+
18+
# linter:
19+
# rules:
20+
# - camel_case_types
21+
22+
# analyzer:
23+
# exclude:
24+
# - path/to/excluded/files/**
25+
26+
# For more information about the core and recommended set of lints, see
27+
# https://dart.dev/go/core-lints
28+
29+
# For additional information about configuring this file, see
30+
# https://dart.dev/guides/language/analysis-options
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import 'dart:io';
2+
3+
import 'package:static_shock/static_shock.dart';
4+
5+
Future<void> main(List<String> arguments) async {
6+
// Configure the static website generator.
7+
final staticShock = StaticShock()
8+
// Here, you can directly hook into the StaticShock pipeline. For example,
9+
// you can copy an "images" directory from the source set to build set:
10+
..pick(DirectoryPicker.parse("images"))
11+
// All 3rd party behavior is added through plugins, even the behavior
12+
// shipped with Static Shock.
13+
..plugin(const MarkdownPlugin())
14+
..plugin(const JinjaPlugin())
15+
..plugin(const PrettyUrlsPlugin())
16+
..plugin(const RedirectsPlugin())
17+
..plugin(const SassPlugin())
18+
..plugin(DraftingPlugin(
19+
showDrafts: arguments.contains("preview"),
20+
))
21+
..plugin(const PubPackagePlugin({
22+
"flutter_test_robots",
23+
}))
24+
..plugin(
25+
GitHubContributorsPlugin(
26+
authToken: Platform.environment["github_doc_website_token"],
27+
),
28+
);
29+
30+
// Generate the static website.
31+
await staticShock.generateSite();
32+
}

0 commit comments

Comments
 (0)