mirror of https://github.com/anoshenko/rui.git
Added GoogleFonts field to AppParams
This commit is contained in:
parent
2855aa62cb
commit
25ef319960
|
|
@ -1,6 +1,7 @@
|
||||||
# v0.21.0
|
# v0.21.0
|
||||||
|
|
||||||
* Removed "style-disabled" property and GetDisabledStyle function
|
* Removed "style-disabled" property and GetDisabledStyle function
|
||||||
|
* Added GoogleFonts field to AppParams
|
||||||
|
|
||||||
# v0.20.0
|
# v0.20.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,11 @@ type AppParams struct {
|
||||||
// The countdown begins after the OnPause event arrives.
|
// The countdown begins after the OnPause event arrives.
|
||||||
// If the value of this property is less than or equal to 0 then the socket is not closed.
|
// If the value of this property is less than or equal to 0 then the socket is not closed.
|
||||||
SocketAutoClose int
|
SocketAutoClose int
|
||||||
|
|
||||||
|
// GoogleFonts - url of Google fonts included in the application. For example, adding two fonts: "Open Sans" and "Roboto"
|
||||||
|
//
|
||||||
|
// GoogleFonts : "https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap"
|
||||||
|
GoogleFonts string
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStartPage(buffer *strings.Builder, params AppParams) {
|
func getStartPage(buffer *strings.Builder, params AppParams) {
|
||||||
|
|
@ -83,7 +88,18 @@ func getStartPage(buffer *strings.Builder, params AppParams) {
|
||||||
|
|
||||||
buffer.WriteString(`
|
buffer.WriteString(`
|
||||||
<base target="_blank" rel="noopener">
|
<base target="_blank" rel="noopener">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">`)
|
||||||
|
|
||||||
|
if params.GoogleFonts != "" {
|
||||||
|
buffer.WriteString(`
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="`)
|
||||||
|
buffer.WriteString(params.GoogleFonts)
|
||||||
|
buffer.WriteString(`" rel="stylesheet">`)
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer.WriteString(`
|
||||||
<style>`)
|
<style>`)
|
||||||
buffer.WriteString(appStyles)
|
buffer.WriteString(appStyles)
|
||||||
buffer.WriteString(`</style>
|
buffer.WriteString(`</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue