Add stackoverflow theme

This commit is contained in:
2018-05-08 15:23:46 +02:00
parent 63df11b783
commit 53aacbe1b0
8 changed files with 1402 additions and 67 deletions

View File

@@ -26,12 +26,9 @@
package kendall
import (
"fmt"
"io/ioutil"
"jsonresume/model"
"jsonresume/themes"
"path"
"strings"
"text/template"
)
@@ -46,10 +43,10 @@ var Theme = themes.Theme{
Name: "kendall",
Directory: packageDirectory,
Functions: template.FuncMap{
"iconClass": iconClass,
"formatDateWork": formatDateWork,
"formatDateEdu": formatDateEdu,
"formatDatePub": formatDatePub,
"iconClass": themes.IconClass,
"formatDateWork": themes.FormatDateWork,
"formatDateEdu": themes.FormatDateEdu,
"formatDatePub": themes.FormatDatePub,
"css": getCSS,
"printcss": getPrintCSS,
},
@@ -68,63 +65,3 @@ func getPrintCSS() string {
r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSSPrint))
return string(r)
}
func iconClass(network string) string {
network = strings.ToLower(network)
switch network {
// special cases
case "google-plus":
case "googleplus":
return "fa fa-google-plus"
case "flickr":
case "flicker":
return "fa fa-flickr"
case "dribbble":
case "dribble":
return "fa fa-dribbble"
case "codepen":
return "fa fa-codepen"
case "soundcloud":
return "fa fa-soundcloud"
case "reddit":
return "fa fa-reddit"
case "tumblr":
case "tumbler":
return "fa fa-tumblr"
case "stack-overflow":
case "stackoverflow":
return "fa fa-stack-overflow"
case "blog":
case "rss":
return "fa fa-rss"
case "gitlab":
return "fa fa-gitlab"
case "keybase":
return "fa fa-key"
default:
return "fa fa-" + network
}
return "fa fa-" + network
}
func formatDateWork(date model.ResumeDate) string {
if date.IsZero() {
return "Present"
}
return fmt.Sprintf("%s %d", date.Month().String(), date.Year())
}
func formatDateEdu(date model.ResumeDate) string {
if date.IsZero() {
return "Present"
}
return fmt.Sprintf("%d", date.Year())
}
func formatDatePub(date model.ResumeDate) string {
if date.IsZero() {
return "Present"
}
return fmt.Sprintf("%d %s %d", date.Day(), date.Month().String(), date.Year())
}