Skip to content

Commit

Permalink
test amp boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Feb 20, 2025
1 parent db1104e commit 7fc5b0e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 3 additions & 2 deletions example/amp_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
<html >
<head><meta charset="utf-8"><title>Amp Yacht example</title>
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="/article.html">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style>
<noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<meta test="test">
<link rel="canonical" href="/index.html"></head>
</head>
<body><h1>Amp Yacht example</h1><ul><li><a href="output/mvp_page.html">output/mvp_page.html</a></li><li><a href="output/amp_page.html">
output/amp_page.html</a></li><li><a href="output/amp_page.html#development=1">output/amp_page.html#development=1</a></li><li><a href="output/most_basic.html">
output/most_basic.html</a></li><li><a href="output/index.html">output/index.html</a></li><li><a href="copy/test.yacht.html">
Expand Down
11 changes: 4 additions & 7 deletions example/write_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,15 @@ Future<void> main(List<String> args) async {
var head = index.head;
var children = htmlProvider
.createElementHtml('<head>$yachtAmpBoilerplate</head>', noValidate: true)
.children;
.childNodes;
print(children);
head.appendChild(htmlProvider.createTextNode('\n'));
for (var child in children) {
for (var child in List.of(children)) {
print(child);
head.appendChild(child);
head.appendChild(htmlProvider.createTextNode('\n'));
//head.appendChild(htmlProvider.createTextNode('\n'));
}
head.appendChild(htmlProvider.createTextNode('\n'));
head.appendChild(htmlProvider.createElementHtml('<meta test="test">'));
head.appendChild(htmlProvider.createTextNode('\n'));
index.head.appendChild(htmlProviderHtml5Lib
.createElementHtml('<link rel="canonical" href="/index.html">'));
appUlToBody();
result = htmlPrintDocument(index,
options: HtmlPrinterOptions(isWindows: Platform.isWindows));
Expand Down
8 changes: 8 additions & 0 deletions test/yacht_common_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,13 @@ void groupYacht(HtmlProvider htmlProvider) {
</html>
''');
});
test('amp boilerplate', () async {
// ignore: unused_local_variable
var head = htmlProvider.createElementHtml(
'<head>$yachtAmpBoilerplate</head>',
noValidate: true);
// ignore: avoid_print
print(head.outerHtml);
});
});
}

0 comments on commit 7fc5b0e

Please sign in to comment.