Documentation ¶
Overview ¶
Package static implements serving of fully static resources
Index ¶
Constants ¶
const Public = "/⛰/"
Public holds the path to the public route
Variables ¶
var AssetsAdmin = Assets{
Scripts: `<script nomodule defer src="/⛰/User.869c9a74.js"></script><script type="module" src="/⛰/User.23a71b44.js"></script><script type="module" src="/⛰/Default.38d394c2.js"></script><script src="/⛰/Default.38d394c2.js" nomodule defer></script><script type="module" src="/⛰/Admin.c0a122d2.js"></script><script src="/⛰/Admin.b992cf94.js" nomodule defer></script>`,
Styles: `<link rel="stylesheet" href="/⛰/Default.a1620182.css"><link rel="stylesheet" href="/⛰/User.09b09c46.css"><link rel="stylesheet" href="/⛰/Admin.9d294a13.css"><link rel="stylesheet" href="/⛰/User.68febbf8.css"><link rel="stylesheet" href="/⛰/Admin.db3e959a.css">`,
}
AssetsAdmin contains assets for the 'Admin' entrypoint.
var AssetsAdminProvision = Assets{
Scripts: `<script nomodule defer src="/⛰/User.869c9a74.js"></script><script nomodule defer src="/⛰/Admin.b992cf94.js"></script><script type="module" src="/⛰/User.23a71b44.js"></script><script type="module" src="/⛰/Admin.c0a122d2.js"></script><script type="module" src="/⛰/Default.38d394c2.js"></script><script src="/⛰/Default.38d394c2.js" nomodule defer></script><script type="module" src="/⛰/AdminProvision.7dff6f1a.js"></script><script src="/⛰/AdminProvision.3981a5f2.js" nomodule defer></script>`,
Styles: `<link rel="stylesheet" href="/⛰/Default.a1620182.css"><link rel="stylesheet" href="/⛰/Admin.db3e959a.css"><link rel="stylesheet" href="/⛰/User.68febbf8.css"><link rel="stylesheet" href="/⛰/User.09b09c46.css"><link rel="stylesheet" href="/⛰/Admin.9d294a13.css"><link rel="stylesheet" href="/⛰/AdminProvision.38d394c2.css">`,
}
AssetsAdminProvision contains assets for the 'AdminProvision' entrypoint.
var AssetsAdminRebuild = Assets{
Scripts: `<script nomodule defer src="/⛰/User.869c9a74.js"></script><script nomodule defer src="/⛰/Admin.b992cf94.js"></script><script type="module" src="/⛰/User.23a71b44.js"></script><script type="module" src="/⛰/Admin.c0a122d2.js"></script><script type="module" src="/⛰/Default.38d394c2.js"></script><script src="/⛰/Default.38d394c2.js" nomodule defer></script><script type="module" src="/⛰/AdminRebuild.ddc01020.js"></script><script src="/⛰/AdminRebuild.e4ce4c16.js" nomodule defer></script>`,
Styles: `<link rel="stylesheet" href="/⛰/Default.a1620182.css"><link rel="stylesheet" href="/⛰/Admin.db3e959a.css"><link rel="stylesheet" href="/⛰/User.68febbf8.css"><link rel="stylesheet" href="/⛰/User.09b09c46.css"><link rel="stylesheet" href="/⛰/Admin.9d294a13.css"><link rel="stylesheet" href="/⛰/AdminRebuild.38d394c2.css">`,
}
AssetsAdminRebuild contains assets for the 'AdminRebuild' entrypoint.
var AssetsDefault = Assets{
Scripts: `<script type="module" src="/⛰/Default.38d394c2.js"></script><script src="/⛰/Default.38d394c2.js" nomodule defer></script><script type="module" src="/⛰/Default.38d394c2.js"></script><script src="/⛰/Default.38d394c2.js" nomodule defer></script>`,
Styles: `<link rel="stylesheet" href="/⛰/Default.a1620182.css"><link rel="stylesheet" href="/⛰/Default.d8ae99b3.css">`,
}
AssetsDefault contains assets for the 'Default' entrypoint.
var AssetsUser = Assets{
Scripts: `<script type="module" src="/⛰/Default.38d394c2.js"></script><script src="/⛰/Default.38d394c2.js" nomodule defer></script><script type="module" src="/⛰/User.23a71b44.js"></script><script src="/⛰/User.869c9a74.js" nomodule defer></script>`,
Styles: `<link rel="stylesheet" href="/⛰/Default.a1620182.css"><link rel="stylesheet" href="/⛰/User.68febbf8.css"><link rel="stylesheet" href="/⛰/User.09b09c46.css">`,
}
AssetsUser contains assets for the 'User' entrypoint.
var Disclaimer string
Functions ¶
This section is empty.
Types ¶
type Assets ¶
type Assets struct { Scripts template.HTML // <script> tags inserted by the asset Styles template.HTML // <link> tags inserted by the asset }
Assets represents a group of assets to be included inside a template.
Assets are generated using the 'build.mjs' script. The script is called using 'go:generate', which stores variables in the form of 'Assets{{Name}}' inside this package.
The build script roughly works as follows: - Delete any previously generated distribution directory. - Bundle the entrypoint sources under 'src/entry/{{Name}}/index.{ts,css}' together with the base './src/base/index.{ts,css}' - Store the output inside the 'dist' directory - Generate new constants of the form Assets{{Name}}
Each asset group should be registered as a parameter to the 'go:generate' line.