Unverified Commit 2ee297b0 authored by Dan Field's avatar Dan Field Committed by GitHub

Fix source-links (#34831)

parent 6dbd3f69
...@@ -133,7 +133,7 @@ Future<void> main(List<String> arguments) async { ...@@ -133,7 +133,7 @@ Future<void> main(List<String> arguments) async {
} }
dartdocBaseArgs.addAll(<String>['--link-to-source-excludes', '../../bin/cache', dartdocBaseArgs.addAll(<String>['--link-to-source-excludes', '../../bin/cache',
'--link-to-source-root', '../..', '--link-to-source-root', '../..',
'--link-to-source-uri-template', 'https://github.com/flutter/flutter/blob/${gitRevision()}/%f%#L%l%']); '--link-to-source-uri-template', 'https://github.com/flutter/flutter/blob/master/%f%#L%l%']);
// Generate the documentation. // Generate the documentation.
// We don't need to exclude flutter_tools in this list because it's not in the // We don't need to exclude flutter_tools in this list because it's not in the
// recursive dependencies of the package defined at dev/docs/pubspec.yaml // recursive dependencies of the package defined at dev/docs/pubspec.yaml
...@@ -276,10 +276,16 @@ void createFooter(String footerPath, String version) { ...@@ -276,10 +276,16 @@ void createFooter(String footerPath, String version) {
File('${footerPath}footer.html').writeAsStringSync('<script src="footer.js"></script>'); File('${footerPath}footer.html').writeAsStringSync('<script src="footer.js"></script>');
File('$kPublishRoot/api/footer.js') File('$kPublishRoot/api/footer.js')
..createSync(recursive: true) ..createSync(recursive: true)
..writeAsStringSync('''var span = document.querySelector('footer>span'); ..writeAsStringSync('''(function() {
if (span) { var span = document.querySelector('footer>span');
span.innerText = 'Flutter $version $timestamp ${gitRevision()} $gitBranchOut'; if (span) {
} span.innerText = 'Flutter $version $timestamp ${gitRevision()} $gitBranchOut';
}
var sourceLink = document.querySelector('a.source-link');
if (sourceLink) {
sourceLink.href = sourceLink.href.replace('/master/', '/${gitRevision()}/');
}
})();
'''); ''');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment