Skip to content

Commit

Permalink
[Docs] - Updated docs website to use shared assets.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-carroll committed Jul 16, 2024
1 parent 2e955e4 commit b65e7f9
Show file tree
Hide file tree
Showing 30 changed files with 86 additions and 613 deletions.
88 changes: 84 additions & 4 deletions doc/website/bin/dart_rss_docs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import 'package:static_shock/static_shock.dart';
Future<void> main(List<String> arguments) async {
// Configure the static website generator.
final staticShock = StaticShock()
// Here, you can directly hook into the StaticShock pipeline. For example,
// you can copy an "images" directory from the source set to build set:
// Pick source files.
..pick(DirectoryPicker.parse("images"))
// All 3rd party behavior is added through plugins, even the behavior
// shipped with Static Shock.
..pickRemote(
layouts: _remoteLayouts,
components: _remoteComponents,
assets: _remoteAssets,
)
// Add all needed plugins.
..plugin(const MarkdownPlugin())
..plugin(const JinjaPlugin())
..plugin(const PrettyUrlsPlugin())
Expand All @@ -30,3 +33,80 @@ Future<void> main(List<String> arguments) async {
// Generate the static website.
await staticShock.generateSite();
}

final _remoteLayouts = <RemoteIncludeSource>{
// Main page layout.
RemoteInclude(
url:
"https://raw.githubusercontent.com/Flutter-Bounty-Hunters/fbh_branding/main/single-page-doc-sites/_includes/layouts/homepage.jinja?raw=true",
name: "homepage",
),
};

final _remoteComponents = <RemoteIncludeSource>{
// Contributors component (used by main page layout).
RemoteInclude(
url:
"https://raw.githubusercontent.com/Flutter-Bounty-Hunters/fbh_branding/main/single-page-doc-sites/_includes/components/contributors.jinja?raw=true",
name: "contributors",
),
};

final _remoteAssets = <RemoteFileSource>{
// Sass styles.
HttpFileGroup.fromUrlTemplate(
"https://raw.githubusercontent.com/Flutter-Bounty-Hunters/fbh_branding/main/single-page-doc-sites/styles/\$",
buildDirectory: "styles/",
files: {
"theme.scss",
"homepage.scss",
},
),

// Flutter and Dart logos.
RemoteFile(
url:
"https://raw.githubusercontent.com/Flutter-Bounty-Hunters/fbh_branding/main/single-page-doc-sites/images/google/dart-logo.svg?raw=true",
buildPath: FileRelativePath("images/branding/", "dart-logo", "svg"),
),
RemoteFile(
url:
"https://raw.githubusercontent.com/Flutter-Bounty-Hunters/fbh_branding/main/single-page-doc-sites/images/google/flutter-logo.svg?raw=true",
buildPath: FileRelativePath("images/branding/", "flutter-logo", "svg"),
),

// Dart Favicons.
HttpFileGroup.fromUrlTemplate(
"https://github.com/Flutter-Bounty-Hunters/fbh_branding/blob/main/single-page-doc-sites/images/google/dart-favicon/\$?raw=true",
buildDirectory: "images/favicon/dart/",
files: {
"android-chrome-192x192.png",
"android-chrome-512x512.png",
"apple-touch-icon.png",
"browserconfig.xml",
"favicon-16x16.png",
"favicon-32x32.png",
"favicon.ico",
"mstile-150x150.png",
"site.webmanifest",
},
),

// Flutter Favicons.
HttpFileGroup.fromUrlTemplate(
"https://github.com/Flutter-Bounty-Hunters/fbh_branding/blob/main/single-page-doc-sites/images/google/flutter-favicon/\$?raw=true",
buildDirectory: "images/favicon/flutter/",
files: {
"android-chrome-192x192.png",
"android-chrome-512x512.png",
"apple-touch-icon.png",
"browserconfig.xml",
"favicon-16x16.png",
"favicon-32x32.png",
"favicon.ico",
"mstile-150x150.png",
"safari-pinned-tab.svg",
"site.webmanifest",
},
),
};
2 changes: 1 addition & 1 deletion doc/website/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:
sdk: ^3.0.0

dependencies:
static_shock: any
static_shock: ^0.0.9

dev_dependencies:
lints: ^2.0.0
Expand Down
1 change: 1 addition & 0 deletions doc/website/source/_data.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
homepage_url: https://flutter-bounty-hunters.github.io/dart-rss/
show_logo: false

# Configuration for the package that this website documents.
package:
Expand Down
21 changes: 0 additions & 21 deletions doc/website/source/_includes/components/contributors.jinja

This file was deleted.

131 changes: 0 additions & 131 deletions doc/website/source/_includes/layouts/homepage.jinja

This file was deleted.

30 changes: 0 additions & 30 deletions doc/website/source/images/branding/dart-logo.svg

This file was deleted.

1 change: 0 additions & 1 deletion doc/website/source/images/branding/flutter-logo.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 0 additions & 9 deletions doc/website/source/images/favicon/dart/browserconfig.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file removed doc/website/source/images/favicon/dart/favicon.ico
Binary file not shown.
Binary file not shown.
19 changes: 0 additions & 19 deletions doc/website/source/images/favicon/dart/site.webmanifest

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 0 additions & 9 deletions doc/website/source/images/favicon/flutter/browserconfig.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 0 additions & 19 deletions doc/website/source/images/favicon/flutter/safari-pinned-tab.svg

This file was deleted.

19 changes: 0 additions & 19 deletions doc/website/source/images/favicon/flutter/site.webmanifest

This file was deleted.

Binary file removed doc/website/source/images/flutter-golden-example.png
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit b65e7f9

Please sign in to comment.