feat: update server setup examples about & index.html

This commit is contained in:
Ayo 2023-10-10 23:42:11 +02:00
parent f420c9fe2b
commit 0646b44712
3 changed files with 7 additions and 3 deletions

View file

@ -96,7 +96,6 @@ function doSetUp(html: string) {
value = value.replace(/\s/g, ""); value = value.replace(/\s/g, "");
html = html.replace(key, setupMap[value]); html = html.replace(key, setupMap[value]);
} }
console.log("---------");
return html; return html;
} }

View file

@ -6,10 +6,15 @@
<title>top about</title> <title>top about</title>
<script server:setup> <script server:setup>
let greeting = "hello"; let greeting = "hello";
const homeLabel = getHomeLabel();
function getHomeLabel() {
return "Home" + "!!! " + new Date().toLocaleDateString();
}
</script> </script>
</head> </head>
<body> <body>
<a href="/">Home</a> <a href="/">{{homeLabel}}</a>
<h1>{{greeting}}!!! Top Level About</h1> <h1>{{greeting}}!!! Top Level About</h1>
</body> </body>
</html> </html>

View file

@ -15,7 +15,7 @@
</script> </script>
</head> </head>
<body> <body>
<a href="/about">{{ count }}</a> <a href="/about">{{ count + 123 }}</a>
{{greeting}} hey {{greeting}} hey
<div> <div>
<hello-world name="{{name }}"></hello-world> <hello-world name="{{name }}"></hello-world>