✅ COMPLETED: 1. Dockerfile uses port 80 (astro preview) 2. BaseLayout imports globals.css 3. globals.css with Tailwind v4 @theme syntax 4. index.astro has Header, Footer, FixedContact 5. All image references fixed to existing files 6. Hero uses hdpe_pipe_main.jpg 7. Product cards use hdpe001.jpg 8. pt-20 on main for fixed header ✅ TESTED LOCALLY: - Build: 15 pages in 1.27s - Docker build successful - Port 80 working - Images load - CSS works Ready for Easypanel deployment.
53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
/**
|
|
* @import {Comment, Parents} from 'hast'
|
|
* @import {State} from '../index.js'
|
|
*/
|
|
|
|
import {stringifyEntities} from 'stringify-entities'
|
|
|
|
const htmlCommentRegex = /^>|^->|<!--|-->|--!>|<!-$/g
|
|
|
|
// Declare arrays as variables so it can be cached by `stringifyEntities`
|
|
const bogusCommentEntitySubset = ['>']
|
|
const commentEntitySubset = ['<', '>']
|
|
|
|
/**
|
|
* Serialize a comment.
|
|
*
|
|
* @param {Comment} node
|
|
* Node to handle.
|
|
* @param {number | undefined} _1
|
|
* Index of `node` in `parent.
|
|
* @param {Parents | undefined} _2
|
|
* Parent of `node`.
|
|
* @param {State} state
|
|
* Info passed around about the current state.
|
|
* @returns {string}
|
|
* Serialized node.
|
|
*/
|
|
export function comment(node, _1, _2, state) {
|
|
// See: <https://html.spec.whatwg.org/multipage/syntax.html#comments>
|
|
return state.settings.bogusComments
|
|
? '<?' +
|
|
stringifyEntities(
|
|
node.value,
|
|
Object.assign({}, state.settings.characterReferences, {
|
|
subset: bogusCommentEntitySubset
|
|
})
|
|
) +
|
|
'>'
|
|
: '<!--' + node.value.replace(htmlCommentRegex, encode) + '-->'
|
|
|
|
/**
|
|
* @param {string} $0
|
|
*/
|
|
function encode($0) {
|
|
return stringifyEntities(
|
|
$0,
|
|
Object.assign({}, state.settings.characterReferences, {
|
|
subset: commentEntitySubset
|
|
})
|
|
)
|
|
}
|
|
}
|