assets

package
v0.0.0-...-dae269f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package static implements serving of fully static resources

Index

Constants

View Source
const Public = "/⛰/"

Public holds the path to the public route

Variables

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

type Static

type Static struct {
	component.Base
}

func (*Static) HandleRoute

func (static *Static) HandleRoute(ctx context.Context, route string) (http.Handler, error)

func (*Static) Routes

func (*Static) Routes() component.Routes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL