Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10360656
defaultHead.tsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
defaultHead.tsx
View Options
import
{
tempstream
}
from
"tempstream"
;
import
type
{
Readable
}
from
"stream"
;
import
type
{
Context
}
from
"koa"
;
import
type
{
HTMLOptions
}
from
"@sealcode/sealgen"
;
import
{
htmlEscape
}
from
"escape-goat"
;
export
const
start_timestamp
=
Date
.
now
();
export
const
animation_script_head
=
/* HTML */
`<script type="text/javascript">
message = document.title + " • ";
window.title_animation_active = false;
window.animatePageTitle = function () {
if (window.title_animation_active) {
return;
}
window.title_animation_active = true;
function step() {
message = message.substr(1) + message.substr(0, 1);
document.title = message;
}
setInterval(step, 100);
};
</script>`
;
export
function
defaultHead
({
ctx
,
title
,
htmlOptions
,
metaImage
,
canonicalPath
,
css_clumps
=
[],
description
=
""
,
}
:
{
ctx
:
Context
;
title
:
string
|
Promise
<
string
|
Readable
>
;
htmlOptions
:
Partial
<
HTMLOptions
>
;
metaImage
?:
string
;
canonicalPath
?:
string
;
css_clumps
:
string
[];
description
:
string
;
})
:
JSX
.
Element
|
Readable
{
const
origin
=
ctx
.
URL
.
origin
;
return
tempstream
/* HTML */
`<title>
${
title
}
</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="
${
htmlEscape
(
description
)
}
" />
<link
rel="preload"
href="/dist/fonts/Poppins-400-1.woff2"
as="font"
type="font/woff2"
/>
<link
rel="preload"
href="/dist/fonts/Poppins-400-2.woff2"
as="font"
type="font/woff2"
/>
<script defer src="/dist/bundle.js?v=
${
start_timestamp
}
"></script>
${
metaImage
?
`<meta property="og:image" content="
${
metaImage
}
" />`
:
""
}
${
[
"default"
,
"page"
,
...(
ctx
.
url
.
includes
(
"/dowodzenie/"
)
?
[
"admin"
]
:
[]),
...
css_clumps
,
].
map
(
(
clump_name
)
=>
/* HTML*/
`<link
href="/dist/
${
clump_name
}
.entrypoint.css?v=
${
start_timestamp
}${
htmlOptions
.
autoRefreshCSS
?
`?
${
Math
.
random
()
}${
Math
.
random
()
}
`
:
""
}
"
rel="stylesheet"
type="text/css"
/>`
)
}
<link href="/dist/fonts/fonts.css" rel="stylesheet" type="text/css" />
${
canonicalPath
?
`<link rel="canonical" href="
${
origin
}${
canonicalPath
}
" />`
:
""
}
${
htmlOptions
.
morphing
?
`<meta name="turbo-refresh-method" content="morph" />`
:
""
}
${
htmlOptions
.
preserveScroll
?
`<meta name="turbo-refresh-scroll" content="preserve">`
:
""
}
`
;
}
File Metadata
Details
Attached
Mime Type
text/html
Expires
Sat, Nov 8, 08:13 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1032931
Default Alt Text
defaultHead.tsx (2 KB)
Attached To
Mode
rREWRITE Configurable rewriter
Attached
Detach File
Event Timeline
Log In to Comment