1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
cardExample := hb.Div().
Class("card").
Style("width: 18rem;").
Child(
hb.Image().
Src("https://picsum.photos/300/200").
Class("card-img-top").
Alt("")).
Child(
hb.Div().
Class("card-body").
Children([]hb.TagInterface{
hb.Heading5().
HTML("Card heading").
Class("card-title"),
hb.Paragraph().
HTML("This is a wider card with supporting text below as a natural lead-in to additional content."),
hb.Paragraph().
HTML("This content is a little bit longer."),
hb.Paragraph().
HTML("It's a long established fact that a reader will be distracted by the readable content of a page when looking at its layout."),
hb.Hyperlink().
HTML("Go somewhere").Href("#").Class("btn btn-primary"),
}))
cardBody := hb.Div().
Class("card").
Style("width: 18rem;").
Child(
hb.Div().
Class("card-body").
Children([]hb.TagInterface{
hb.Paragraph().HTML("This is some text within a card body. "),
}))
cardTitleTextAndLinks := hb.Div().
Class("card").
Style("width: 18rem;").
Child(
hb.Div().
Class("card-body").
Children([]hb.TagInterface{
hb.Heading5().
HTML("Card title").
Class("card-title"),
hb.Heading6().
HTML("Card subtitle").
Class("card-subtitle mb-2 text-body-secondary"),
hb.Paragraph().
HTML("Some quick example text to build on the card title and make up the bulk of the card's content."),
hb.Hyperlink().
HTML("Card link").
Href("#").
Class("card-link"),
hb.Hyperlink().
HTML("Another link").
Href("#").
Class("card-link"),
}))
cardImage := hb.Div().
Class("card").
Style("width: 18rem;").
Child(
hb.Image().
Src("https://picsum.photos/300/200").
Class("card-img-top").
Alt("")).
Child(
hb.Div().
Class("card-body").
Children([]hb.TagInterface{
hb.Paragraph().
HTML("Some quick example text to build on the card title and make up the bulk of the card's content."),
}))
cardHeaderAndFooter := hb.Div().
Class("card").
Style("width: 18rem;").
Child(
hb.Div().
Class("card-header").
Children([]hb.TagInterface{
hb.Span().
HTML("Featured"),
}),
).
Child(
hb.Div().
Class("card-body").
Children([]hb.TagInterface{
hb.Heading5().
HTML("Special title treatment").Class("card-title"),
hb.Paragraph().
HTML("With supporting text below as a natural lead-in to additional content."),
hb.Hyperlink().
HTML("Go somewhere").
Href("#").
Class("btn btn-primary"),
}),
).
Child(
hb.Div().
Class("card-footer").
Children([]hb.TagInterface{
hb.Paragraph().
HTML("2 days ago"),
}),
) |