assets

package
v0.0.0-...-b197db6 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 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.d3b2edc7.js"></script><script type="module" src="/⛰/User.67ac1e81.js"></script><script type="module" src="/⛰/Default.f6deb600.js"></script><script src="/⛰/Default.93529533.js" nomodule defer></script><script type="module" src="/⛰/Admin.ca068b4d.js"></script><script src="/⛰/Admin.c909fe00.js" nomodule defer></script>`,
	Styles:  `<link rel="stylesheet" href="/⛰/Default.ed052f6d.css"><link rel="stylesheet" href="/⛰/User.1664d889.css"><link rel="stylesheet" href="/⛰/Admin.9235a6f6.css"><link rel="stylesheet" href="/⛰/User.72760bc7.css"><link rel="stylesheet" href="/⛰/Admin.d1020143.css">`,
}

AssetsAdmin contains assets for the 'Admin' entrypoint.

View Source
var AssetsAdminProvision = Assets{
	Scripts: `<script nomodule defer src="/⛰/User.d3b2edc7.js"></script><script nomodule defer src="/⛰/Admin.c909fe00.js"></script><script type="module" src="/⛰/User.67ac1e81.js"></script><script type="module" src="/⛰/Admin.ca068b4d.js"></script><script type="module" src="/⛰/Default.f6deb600.js"></script><script src="/⛰/Default.93529533.js" nomodule defer></script><script type="module" src="/⛰/AdminProvision.994883f5.js"></script><script src="/⛰/AdminProvision.5f2c7fe4.js" nomodule defer></script>`,
	Styles:  `<link rel="stylesheet" href="/⛰/Default.ed052f6d.css"><link rel="stylesheet" href="/⛰/Admin.d1020143.css"><link rel="stylesheet" href="/⛰/User.72760bc7.css"><link rel="stylesheet" href="/⛰/User.1664d889.css"><link rel="stylesheet" href="/⛰/Admin.9235a6f6.css"><link rel="stylesheet" href="/⛰/AdminProvision.8569d237.css">`,
}

AssetsAdminProvision contains assets for the 'AdminProvision' entrypoint.

View Source
var AssetsAdminRebuild = Assets{
	Scripts: `<script nomodule defer src="/⛰/User.d3b2edc7.js"></script><script nomodule defer src="/⛰/Admin.c909fe00.js"></script><script type="module" src="/⛰/User.67ac1e81.js"></script><script type="module" src="/⛰/Admin.ca068b4d.js"></script><script type="module" src="/⛰/Default.f6deb600.js"></script><script src="/⛰/Default.93529533.js" nomodule defer></script><script type="module" src="/⛰/AdminRebuild.5b253105.js"></script><script src="/⛰/AdminRebuild.bd32e5c4.js" nomodule defer></script>`,
	Styles:  `<link rel="stylesheet" href="/⛰/Default.ed052f6d.css"><link rel="stylesheet" href="/⛰/Admin.d1020143.css"><link rel="stylesheet" href="/⛰/User.72760bc7.css"><link rel="stylesheet" href="/⛰/User.1664d889.css"><link rel="stylesheet" href="/⛰/Admin.9235a6f6.css"><link rel="stylesheet" href="/⛰/AdminRebuild.e554824e.css">`,
}

AssetsAdminRebuild contains assets for the 'AdminRebuild' entrypoint.

View Source
var AssetsDefault = Assets{
	Scripts: `<script type="module" src="/⛰/Default.f6deb600.js"></script><script src="/⛰/Default.93529533.js" nomodule defer></script><script type="module" src="/⛰/Default.68829c56.js"></script><script src="/⛰/Default.5dd67eb3.js" nomodule defer></script>`,
	Styles:  `<link rel="stylesheet" href="/⛰/Default.ed052f6d.css"><link rel="stylesheet" href="/⛰/Default.749670b3.css">`,
}

AssetsDefault contains assets for the 'Default' entrypoint.

View Source
var AssetsUser = Assets{
	Scripts: `<script type="module" src="/⛰/Default.f6deb600.js"></script><script src="/⛰/Default.93529533.js" nomodule defer></script><script type="module" src="/⛰/User.67ac1e81.js"></script><script src="/⛰/User.d3b2edc7.js" nomodule defer></script>`,
	Styles:  `<link rel="stylesheet" href="/⛰/Default.ed052f6d.css"><link rel="stylesheet" href="/⛰/User.72760bc7.css"><link rel="stylesheet" href="/⛰/User.1664d889.css">`,
}

AssetsUser contains assets for the 'User' entrypoint.

View Source
var Disclaimer string
View Source
var PureCSSFieldTemplate = template.Must(template.New("").Parse(`
<div class="pure-control-group">
<label for="{{.Name}}">{{.Label}}</label>
{{ if (eq .Type "textarea" )}}
<textarea name="{{.Name}}" id="{{.Name}}" placeholder="{{.Placeholder}}"{{if .Autocomplete }} autocomplete="{{.Autocomplete}}" {{end}}>{{.Value}}</textarea>
{{ else }}
<input type="{{.Type}}" value="{{.Value}}" name="{{.Name}}" id="{{.Name}}" placeholder="{{.Placeholder}}"{{if .Autocomplete }} autocomplete="{{.Autocomplete}}" {{end}}>
{{ end }}
</div>`))

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