Update content variable support.
This commit is contained in:
parent
51487c66c9
commit
8b4bdf625f
@ -56,7 +56,7 @@ about:
|
||||
Here is my <a href="https://cdn.captainalm.com/download/keys/alfred@captainalm.com.asc">GPG Key</a> for my email address.
|
||||
</p>
|
||||
<p>
|
||||
My CV is available in the following formats: ( <a href="https://cdn.captainalm.com/download/cvs/AlfredManvilleCV-2025.docx">DOCX</a> | <a href="https://cdn.captainalm.com/download/cvs/AlfredManvilleCV-2025.pdf">PDF</a> )
|
||||
My CV is available in the following formats: ( <a href="https://cdn.captainalm.com/download/cvs/AlfredManvilleCV-#year#.docx">DOCX</a> | <a href="https://cdn.captainalm.com/download/cvs/AlfredManvilleCV-#year#.pdf">PDF</a> )
|
||||
</p>
|
||||
thumbnailLocation: "resources/assets/imageofyou_t.jpg"
|
||||
imageLocation: "resources/assets/imageofyou.jpg"
|
||||
|
@ -18,7 +18,8 @@ type AboutYaml struct {
|
||||
}
|
||||
|
||||
func (ay AboutYaml) GetContent() template.HTML {
|
||||
return template.HTML(strings.ReplaceAll(strings.ReplaceAll(ay.Content, "#age#", strconv.Itoa(ay.GetAge())), "#birth#", strconv.Itoa(ay.BirthYear)))
|
||||
r := strings.NewReplacer("#age#", strconv.Itoa(ay.GetAge()), "#birth#", strconv.Itoa(ay.BirthYear), "#year#", strconv.Itoa(time.Now().Year()))
|
||||
return template.HTML(r.Replace(ay.Content))
|
||||
}
|
||||
|
||||
func (ay AboutYaml) GetAge() int {
|
||||
|
Loading…
Reference in New Issue
Block a user