webassets

package
v0.0.0-...-642df0c Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Req: go 1.16 or later (embed.FS is N/A on Go 1.15 or lower versions)

Index

Constants

View Source
const (
	VERSION string = "r.20240114.2007"

	LAST_MODIFIED_DATE_TIME string = "2024-01-08 23:58:07" // must be UTC time, (string) assets last modified ; UPDATE THIS AFTER EACH TIME THE ASSETS ARE MODIFIED !

	CACHED_EXP_TIME_SECONDS uint32 = 8 * 3600 // (int) cache time of assets ; 8h

	DEBUG bool = false
)
View Source
const (
	TEXT_CONTENT_HEADER string = "text/plain; charset=" + smart.CHARSET // keep separate, can be used also by HTTP Headers: Content-Type
	HTML_CONTENT_HEADER string = "text/html; charset=" + smart.CHARSET  // keep separate, can be used also by HTTP Headers: Content-Type

	HTML_META_FAVICON   string = `<link rel="icon" href="data:,">`
	HTML_META_VIEWPORT  string = `<meta name="viewport" content="width=device-width, initial-scale=1.0">`
	HTML_META_CHAREQUIV string = `<meta charset="` + smart.CHARSET + `"><meta http-equiv="Content-Type" content="` + HTML_CONTENT_HEADER + `">`

	TAG_CSS_START string = `<link rel="stylesheet" type="text/css" href="data:text/css,`
	TAG_CSS_END   string = `">`
	TAG_JS_START  string = `<script src="data:application/javascript,`
	TAG_JS_END    string = `"></script>`

	HTML_TPL_STATUS string = `<!DOCTYPE html>
<!-- TPL.SmartGo.STATUS -->
<html>
<head>
` + HTML_META_CHAREQUIV + `
` + HTML_META_FAVICON + `
<title>[###TITLE-TEXT|html###]</title>
` + HTML_META_VIEWPORT + `
<style>
* { font-family: 'IBM Plex Sans', 'Noto Sans', arial, sans-serif; font-smooth: always; }
hr { height:1px; border:none 0; border-top:1px solid #CCCCCC; }
div.message { line-height: 36px; text-align: left; font-size: 1.25rem; font-weight: bold; font-style: normal; padding-left: 16px; padding-right: 16px; padding-top: 12px; padding-bottom: 8px; margin-top: 8px; margin-bottom: 8px; max-width: calc(100% - 10px) !important; min-width: 100px; min-height: 40px; height: auto !important; border-radius: 5px; box-sizing: content-box !important; opacity: 1 !important; background-color: #C62828 !important; color: #FFFFFF !important; }
</style>
</head>
<body>
<h1 style="display:inline; font-size:4rem; color:#333333;">[###TITLE-TEXT|html###]</h1>
<br>
<br>
<hr>
<div class="message">[###MESSAGE-TEXT|html|nl2br###]</div>
<hr>
<small id="server-signature"><b>Smart.Framework.Go</b> :: WebApp</small>
<div align="right" title="` + smart.COPYRIGHT + `">[###FOOTER-HTML###]</div>
<br>
</body>
</html>
<!-- #end TPL -->
`

	HTML_TPL_DEF string = `<!DOCTYPE html>
<!-- TPL.SmartGo.DEF -->
<html>
<head>
` + HTML_META_CHAREQUIV + `
` + HTML_META_FAVICON + `
<title>[###TITLE|html###]</title>
` + HTML_META_VIEWPORT + `
[:::HEAD-CSS-JS:::]
[###HEAD-HTML###]
</head>
<body>
[###BODY-HTML###]
</body>
</html>
<!-- #end TPL -->
`

	HTML_TPL_FAVICON_DEF string = `<!DOCTYPE html>
<!-- TPL.SmartGo.FAV.DEF -->
<html>
<head>
` + HTML_META_CHAREQUIV + `
` + `<link rel="icon" href="[###FAVICON|html###]">` + `
<title>[###TITLE|html###]</title>
` + HTML_META_VIEWPORT + `
[:::HEAD-CSS-JS:::]
[###HEAD-HTML###]
</head>
<body>
[###BODY-HTML###]
</body>
</html>
<!-- #end TPL -->
`
)

Variables

This section is empty.

Functions

func HtmlStandaloneFaviconTemplate

func HtmlStandaloneFaviconTemplate(titleText string, headHtml string, bodyHtml string, favicon string) string

func HtmlStandaloneTemplate

func HtmlStandaloneTemplate(titleText string, headHtml string, bodyHtml string) string

func HtmlStatusPage

func HtmlStatusPage(titleText string, messageText string, displayAuthLogo bool) string

func ReadWebAsset

func ReadWebAsset(path string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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