Skip to content

Commit fb6a8c7

Browse files
authored
Add rudimentary freshness tool (#5959)
Added for determining freshness. Nothing happens in CI, this is just for running locally. Used like: ``` ./dash_site freshness ``` with output like: ``` ====== Files with missing lastVerified dates ====== ❓ missing-date web/libraries.md ❓ missing-date web/wasm.md ====== Files with stale lastVerified dates ====== 🟥 2021-05-13 resources/google-apis.md 🟧 2022-11-21 resources/coming-from/js-to-dart.md 🟧 2022-12-13 resources/coming-from/swift-to-dart.md 🟨 2023-02-23 guides/environment-declarations.md ``` You can optionally change the cutoff to include a file as stale with the `--cutoff` option which accepts an integer amount of days. It currently defaults to 270 days. The staleness is determined by the `lastVerified` option in each page's YAML frontmatter. `lastVerified` indicates when the page was last verified as up to date as of: ```yaml --- title: Document title lastVerified: 2024-04-21 --- ``` If a file shouldn't be checked for freshness, you can specify `skipFreshness: true` in the frontmatter: ```yaml --- title: Document title skipFreshness: true --- ```
1 parent a9e443d commit fb6a8c7

25 files changed

+282
-1
lines changed

src/content/404.html

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
description: "dart.dev's 404 page."
55
sitemap: false
66
permalink: /404.html
7+
skipFreshness: true
78
---
89

910
<div class="text-center">

src/content/brand.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Dart brand guidelines
33
description: >-
44
The guidelines governing the usage of the Dart trademarks and assets.
5+
skipFreshness: true
56
---
67

78
The "Dart" name and logo are trademarks owned by Google.

src/content/community/code-of-conduct.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Code of conduct
33
description: Be excellent to each other.
44
toc: false
5+
skipFreshness: true
56
---
67

78
We expect Dart community members to act professionally and respectfully, and

src/content/guides/environment-declarations.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Configuring apps with compilation environment declarations
33
description: >-
44
Learn about using compilation environment declarations
55
to customize application behavior.
6+
lastVerified: 2023-02-23
67
---
78

89
You can specify compilation environment declarations

src/content/guides/language/evolution.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Dart language evolution
33
short-title: Language evolution
44
description: Notable changes and additions to the Dart programming language.
5+
lastVerified: 2024-05-14
56
---
67

78
This page lists notable changes and additions to the

src/content/guides/language/language-tour.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ js: [{url: '/assets/js/language-tour-redirector.js'}]
66
sitemap: false
77
canonical: https://dart.dev/language
88
noindex: true
9+
skipFreshness: true
910
---
1011

1112
:::warning

src/content/guides/libraries/library-tour.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ js: [{url: '/assets/js/library-tour-redirector.js'}]
66
sitemap: false
77
canonical: https://dart.dev/libraries
88
noindex: true
9+
skipFreshness: true
910
---
1011

1112
:::warning

src/content/language/concurrency.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Concurrency in Dart
33
description: >-
44
Use isolates to enable parallel code execution on multiple processor cores.
55
short-title: Concurrency
6+
lastVerified: 2023-12-14
67
prevpage:
78
url: /language/modifier-reference
89
title: Class modifiers reference

src/content/language/isolates.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Isolates
33
description: Information on writing isolates in Dart.
44
short-title: Isolates
5+
lastVerified: 2024-01-04
56
prevpage:
67
url: /language/async
78
title: Asynchronous support

src/content/map.html

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Document index
33
description: Human-readable sitemap of all pages on dart.dev.
44
toc: false
5+
skipFreshness: true
56
---
67

78
{% assign pages = collections.all | sort: 'data.title' %}

src/content/resources/breaking-changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Breaking changes and deprecations
33
description: A list of breaking changes by release in Dart.
4+
lastVerified: 2024-05-14
45
---
56

67
{% assign versioned = '<span class="tag-label language-versioned-tag">Language versioned</span>' %}

src/content/resources/coming-from/js-to-dart.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Learning Dart as a JavaScript developer
33
description: Leverage your JavaScript knowledge when learning Dart.
44
body_class: highlight-languages
5+
lastVerified: 2022-11-21
56
---
67

78
This guide aims to leverage your JavaScript programming knowledge

src/content/resources/coming-from/swift-to-dart.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Learning Dart as a Swift developer
33
description: Leverage your Swift knowledge when learning Dart.
44
body_class: highlight-languages
5+
lastVerified: 2022-12-13
56
---
67

78
This guide aims to leverage your Swift programming

src/content/resources/google-apis.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Using Google APIs
33
short-title: Google APIs
44
description: Your Dart apps can use Firebase and Google client APIs.
5+
lastVerified: 2021-05-13
56
---
67

78
This page points to resources to help you use

src/content/robots.liquid

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: none
33
permalink: robots.txt
4+
skipFreshness: true
45
---
56

67
{%- if isProduction == true -%}

src/content/search-all.html

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Search dart.dev, api.dart.dev, the old www.dartlang.org site,
55
flutter.dev, and more.
66
toc: false
7+
skipFreshness: true
78
---
89

910
<p>

src/content/search.html

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
short-title: Search
44
description: Search for documentation on dart.dev.
55
toc: false
6+
skipFreshness: true
67
---
78

89
Want results from additional Dart-related sites, like api.dart.dev and flutter.dev?

src/content/security.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Security
33
description: >-
44
An overview of the Dart team's philosophy and processes for security.
5+
skipFreshness: true
56
---
67

78
The Dart team takes the security of Dart and the applications

src/content/sitemap.liquid

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: none
33
sitemap: false
44
permalink: sitemap.xml
5+
skipFreshness: true
56
---
67
<?xml version="1.0" encoding="UTF-8"?>
78
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

src/content/terms.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Terms of use
33
description: The terms of use for dart.dev.
44
toc: false
5+
skipFreshness: true
56
---
67

78
The Dart website (the "Website") is hosted by Google.

src/content/tools/diagnostic-messages.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Diagnostic messages
33
description: Details for diagnostics produced by the Dart analyzer.
44
body_class: highlight-diagnostics
5+
skipFreshness: true
56
---
67
{%- comment %}
78
WARNING: Do NOT EDIT this file directly. It is autogenerated by the script in

src/content/tools/linter-rules/individual-rules.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ eleventyComputed:
1010
permalink: "/tools/linter-rules/{{lint.name}}.html"
1111
title: "{{ lint.name }}"
1212
description: "Learn more about the {{ lint.name }} linter rule."
13+
skipFreshness: true
1314
---
1415

1516
{{lint.description}}

tool/dart_site/lib/dart_site.dart

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'src/commands/check_link_references.dart';
1111
import 'src/commands/check_links.dart';
1212
import 'src/commands/check_site_variable.dart';
1313
import 'src/commands/format_dart.dart';
14+
import 'src/commands/freshness.dart';
1415
import 'src/commands/generate_effective_dart_toc.dart';
1516
import 'src/commands/refresh_excerpts.dart';
1617
import 'src/commands/serve.dart';
@@ -32,6 +33,7 @@ final class DartSiteCommandRunner extends CommandRunner<int> {
3233
addCommand(VerifyFirebaseJsonCommand());
3334
addCommand(RefreshExcerptsCommand());
3435
addCommand(FormatDartCommand());
36+
addCommand(FreshnessCommand());
3537
addCommand(GenerateEffectiveDartToc());
3638
addCommand(AnalyzeDartCommand());
3739
addCommand(TestDartCommand());

0 commit comments

Comments
 (0)