From 6bfd12756d422a88ef20945ca41df376e9f721a1 Mon Sep 17 00:00:00 2001 From: Arnaud Ysmal Date: Wed, 9 May 2018 23:30:40 +0200 Subject: [PATCH] No more duplicated themes --- cli/resume.go | 8 +- model/json.go | 79 +-- themes/kendall/kendall.go | 17 +- themes/kendall/resume.template | 51 +- themes/kendallfr/kendallfr.go | 68 --- themes/kendallfr/print.css | 91 --- themes/kendallfr/resume.template | 299 --------- themes/kendallfr/style.css | 276 --------- themes/stackoverflow/resume.template | 90 +-- themes/stackoverflow/stackoverflow.go | 17 +- themes/stackoverflowfr/resume.template | 440 -------------- themes/stackoverflowfr/stackoverflow.go | 63 -- themes/stackoverflowfr/style.css | 771 ------------------------ themes/theme.go | 157 ++++- themes/themefr.go | 82 --- 15 files changed, 286 insertions(+), 2223 deletions(-) delete mode 100644 themes/kendallfr/kendallfr.go delete mode 100644 themes/kendallfr/print.css delete mode 100644 themes/kendallfr/resume.template delete mode 100644 themes/kendallfr/style.css delete mode 100644 themes/stackoverflowfr/resume.template delete mode 100644 themes/stackoverflowfr/stackoverflow.go delete mode 100755 themes/stackoverflowfr/style.css delete mode 100644 themes/themefr.go diff --git a/cli/resume.go b/cli/resume.go index 656b697..e214e88 100644 --- a/cli/resume.go +++ b/cli/resume.go @@ -34,9 +34,7 @@ import ( "jsonresume/model" "jsonresume/themes" _ "jsonresume/themes/kendall" - _ "jsonresume/themes/kendallfr" _ "jsonresume/themes/stackoverflow" - _ "jsonresume/themes/stackoverflowfr" ) func main() { @@ -45,6 +43,7 @@ func main() { var theme string var err error var outf string + var lang string var f *os.File flag.StringVar(&resume, "resume", "resume.json", "JSON of resume") @@ -53,6 +52,8 @@ func main() { flag.StringVar(&theme, "t", "", "Theme of resume") flag.StringVar(&outf, "out", "-", "Output file") flag.StringVar(&outf, "o", "-", "Output file") + flag.StringVar(&lang, "lang", "", "Force lang") + flag.StringVar(&lang, "l", "", "Force lang") flag.Parse() if outf == "-" { @@ -65,6 +66,9 @@ func main() { if r, err = model.Parse(resume); err != nil { log.Fatal(err) } + if lang != "" { + r.Language = lang + } if t, exists := themes.Themes[theme]; exists { if err = t.Render(r, f); err != nil { diff --git a/model/json.go b/model/json.go index 0f21cd5..1661b0d 100644 --- a/model/json.go +++ b/model/json.go @@ -51,6 +51,7 @@ func (ct *ResumeDate) UnmarshalJSON(b []byte) (err error) { // Resume represent Curriculum Vitae type Resume struct { Title string `json:"title"` + Language string `json:"lang"` Basic Basic `json:"basics"` Work []Work `json:"work"` Volunteer []Volunteer `json:"volunteer"` @@ -66,19 +67,19 @@ type Resume struct { // Basic is the basic information for a resume type Basic struct { - Name string `json:"name"` - Label string `json:"label"` - Image string `json:"image"` - Email string `json:"email"` - Phone string `json:"phone"` - URL string `json:"url"` - Summary string `json:"summary"` - ResumeLocation Location `json:"location"` - Profiles []SocialProfile `json:"profiles"` + Name string `json:"name"` + Label string `json:"label"` + Image string `json:"image"` + Email string `json:"email"` + Phone string `json:"phone"` + URL string `json:"url"` + Summary string `json:"summary"` + Location UserLocation `json:"location"` + Profiles []SocialProfile `json:"profiles"` } // Location is the location details of a resume owner. -type Location struct { +type UserLocation struct { Address string `json:"address"` PostalCode string `json:"postalCode"` City string `json:"city"` @@ -93,35 +94,35 @@ type SocialProfile struct { URL string `json:"url"` } -type JobHighlight struct { +type Highlight struct { Title string `json:"title"` Items []string `json:"items"` } // Work is the work details of the resume owner. type Work struct { - Name string `json:"name"` - WorkLocation string `json:"location"` - Description string `json:"description"` - Position string `json:"position"` - URL string `json:"url"` - StartDate ResumeDate `json:"startDate"` - EndDate ResumeDate `json:"endDate"` - Summary string `json:"summary"` - Highlights []JobHighlight `json:"highlights"` - Keywords []string `json:"keywords"` + Name string `json:"name"` + Location string `json:"location"` + Description string `json:"description"` + Position string `json:"position"` + URL string `json:"url"` + StartDate ResumeDate `json:"startDate"` + EndDate ResumeDate `json:"endDate"` + Summary string `json:"summary"` + Highlights []Highlight `json:"highlights"` + Keywords []string `json:"keywords"` } // Volunteer is the volunteer details of the resume owner. type Volunteer struct { - Organization string `json:"organization"` - Position string `json:"position"` - URL string `json:"url"` - StartDate ResumeDate `json:"startDate"` - EndDate ResumeDate `json:"endDate"` - Summary string `json:"summary"` - Highlights []string `json:"highlights"` - Keywords []string `json:"keywords"` + Organization string `json:"organization"` + Position string `json:"position"` + URL string `json:"url"` + StartDate ResumeDate `json:"startDate"` + EndDate ResumeDate `json:"endDate"` + Summary string `json:"summary"` + Highlights []Highlight `json:"highlights"` + Keywords []string `json:"keywords"` } // Education is the education details of the resume owner. @@ -179,16 +180,16 @@ type Reference struct { // Volunteer is the volunteer details of the resume owner. type Project struct { - Name string `json:"name"` - Description string `json:"description"` - Highlights []string `json:"highlights"` - Keywords []string `json:"keywords"` - StartDate ResumeDate `json:"startDate"` - EndDate ResumeDate `json:"endDate"` - URL string `json:"url"` - Roles []string `json:"roles"` - Entity string `json:"entity"` - Type string `json:"type"` + Name string `json:"name"` + Description string `json:"description"` + Highlights []Highlight `json:"highlights"` + Keywords []string `json:"keywords"` + StartDate ResumeDate `json:"startDate"` + EndDate ResumeDate `json:"endDate"` + URL string `json:"url"` + Roles []string `json:"roles"` + Entity string `json:"entity"` + Type string `json:"type"` } func Parse(f string) (*Resume, error) { diff --git a/themes/kendall/kendall.go b/themes/kendall/kendall.go index ba5b8a5..77459c0 100644 --- a/themes/kendall/kendall.go +++ b/themes/kendall/kendall.go @@ -26,7 +26,6 @@ package kendall import ( - "io/ioutil" "jsonresume/themes" "path" "text/template" @@ -43,25 +42,23 @@ var Theme = themes.Theme{ Name: "kendall", Directory: packageDirectory, Functions: template.FuncMap{ - "iconClass": themes.IconClass, - "formatDateWork": themes.FormatDateWork, - "formatDateEdu": themes.FormatDateEdu, - "formatDatePub": themes.FormatDatePub, - "css": getCSS, - "printcss": getPrintCSS, + "css": getCSS, + "printcss": getPrintCSS, }, - Template: fileTemplate, } func init() { + t, _ := Asset(path.Join(packageDirectory, fileTemplate)) + Theme.Template = string(t) (&Theme).Register() } + func getCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSS)) + r, _ := Asset(path.Join(packageDirectory, fileCSS)) return string(r) } func getPrintCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSSPrint)) + r, _ := Asset(path.Join(packageDirectory, fileCSSPrint)) return string(r) } diff --git a/themes/kendall/resume.template b/themes/kendall/resume.template index 5e1b272..1be4a9b 100644 --- a/themes/kendall/resume.template +++ b/themes/kendall/resume.template @@ -1,10 +1,10 @@ - + - Resume of {{.Basic.Name}} + {{.Lang.TitlePrefix}} {{.Basic.Name}} @@ -32,14 +32,14 @@ {{if .Basic.Summary -}}
-

About

+

{{.Lang.About}}

{{.Basic.Summary}}

{{- end}} {{if .Work -}}
-

Work Experience

+

{{.Lang.WorkExperience}}

{{range .Work -}}
@@ -50,7 +50,7 @@ {{.URL}}
{{- end}} -
{{formatDateWork .StartDate}} – {{formatDateWork .EndDate}}
+
{{formatDateMY .StartDate}} – {{formatDateMY .EndDate}}
@@ -83,11 +83,11 @@ {{if .Awards -}}
-

Awards

+

{{.Lang.Awards}}

    {{range .Awards -}}
  • -
    {{formatDatePub .Date}}
    +
    {{formatDateDMY .Date}}

    {{.Awarder}}

    {{.Title}}

    @@ -101,7 +101,7 @@ {{if .Volunteer -}}
    -

    Volunteer

    +

    {{.Lang.Volunteer}}

    {{range .Volunteer -}}
    @@ -112,7 +112,7 @@ {{.URL}}
    {{- end}} -
    {{formatDateWork .StartDate}} – {{formatDateWork .EndDate}}
    +
    {{formatDateMY .StartDate}} – {{formatDateMY .EndDate}}
    @@ -124,7 +124,14 @@
      {{range .Highlights -}} -
    • {{.}}
    • +
    • + {{.Title}} + {{if .Items -}} +
        + {{range .Items}}
      • {{.}}
      • {{end}} +
      + {{- end}} +
    • {{- end}}
    {{- end}} @@ -139,12 +146,12 @@
    -

    Contact

    - {{if .Basic.ResumeLocation.City -}} +

    {{.Lang.Contact}}

    + {{if .Basic.Location.City -}}
    - {{if .Basic.ResumeLocation.Address}}
    {{.Basic.ResumeLocation.Address}}
    {{- end}} -
    {{.Basic.ResumeLocation.City}}{{if .Basic.ResumeLocation.Region}}, {{.Basic.ResumeLocation.Region}}{{- end}}{{if .Basic.ResumeLocation.PostalCode}} {{.Basic.ResumeLocation.PostalCode}}{{- end}}{{if .Basic.ResumeLocation.CountryCode}} {{.Basic.ResumeLocation.CountryCode}}{{- end}}
    + {{if .Basic.Location.Address}}
    {{.Basic.Location.Address}}
    {{- end}} +
    {{.Basic.Location.City}}{{if .Basic.Location.Region}}, {{.Basic.Location.Region}}{{- end}}{{if .Basic.Location.PostalCode}} {{.Basic.Location.PostalCode}}{{- end}}{{if .Basic.Location.CountryCode}} {{.Basic.Location.CountryCode}}{{- end}}
    {{- end}} {{if .Basic.Phone -}} @@ -176,11 +183,11 @@ {{if .Education -}}
    -

    Education

    +

    {{.Lang.Education}}

      {{range .Education -}}
    • -
      {{formatDateEdu .StartDate}} {{formatDateEdu .EndDate}}
      +
      {{formatDateY .StartDate}} {{formatDateY .EndDate}}

      {{.Institution}}

      {{if .StudyType}}

      {{.StudyType}}

      {{end}} @@ -207,7 +214,7 @@ {{if .Skills -}}
      -

      Skills

      +

      {{.Lang.Skills}}

      {{range .Skills -}}
      @@ -226,7 +233,7 @@ {{if .Publications -}}
      -

      Publications

      +

      {{.Lang.Publications}}

      {{range .Publications -}}
      @@ -236,7 +243,7 @@ {{if .Publisher -}}
      {{.Publisher}}
      {{- end}} -
      {{formatDatePub .ReleaseDate}}
      +
      {{formatDateDMY .ReleaseDate}}
      {{if .URL -}}
      {{.URL}} @@ -253,7 +260,7 @@ {{if .Languages -}}
      -

      Languages

      +

      {{.Lang.Languages}}

        {{range .Languages -}}
      • {{.Language}}{{.Fluency}}
      • @@ -264,7 +271,7 @@ {{if .Interests -}}
        -

        Interests

        +

        {{.Lang.Interests}}

        {{range .Interests -}}
        @@ -281,7 +288,7 @@ {{- end}} {{if .References -}}
        -

        References

        +

        {{.Lang.References}}

        {{range .References -}}
        {{.Reference}}
        diff --git a/themes/kendallfr/kendallfr.go b/themes/kendallfr/kendallfr.go deleted file mode 100644 index bd015d6..0000000 --- a/themes/kendallfr/kendallfr.go +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2018 Arnaud Ysmal. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -package kendallfr - -import ( - "io/ioutil" - "jsonresume/themes" - "path" - "text/template" -) - -const ( - packageDirectory = "themes/kendallfr" - fileCSS = "style.css" - fileCSSPrint = "print.css" - fileTemplate = "resume.template" -) - -var Theme = themes.Theme{ - Name: "kendallfr", - Directory: packageDirectory, - Functions: template.FuncMap{ - "iconClass": themes.IconClass, - "formatDateWork": themes.FormatDateWorkFR, - "formatDateEdu": themes.FormatDateEduFR, - "formatDatePub": themes.FormatDatePubFR, - "css": getCSS, - "printcss": getPrintCSS, - }, - Template: fileTemplate, -} - -func getCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSS)) - return string(r) -} - -func getPrintCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSSPrint)) - return string(r) -} - -func init() { - (&Theme).Register() -} diff --git a/themes/kendallfr/print.css b/themes/kendallfr/print.css deleted file mode 100644 index a13418f..0000000 --- a/themes/kendallfr/print.css +++ /dev/null @@ -1,91 +0,0 @@ -body { - font-size: .95em; - -webkit-print-color-adjust: exact; -} - -a[href]:after { - content: none !important; -} - -#photo{ - display: none; -} - -.box { - margin-bottom: -10px; -} - -blockquote, -#education, -#awards, -.contact-item, -.publication, -.skills, -.interests { - page-break-inside: avoid; -} - -.col-sm-5{ - width: 40%; - padding: 0 15px; -} - -.col-sm-7{ - width: 60%; - padding: 0 15px; -} - -.skills .col-sm-offset-1, -.interests .col-sm-offset-1{ - margin-top: -10px; - margin-bottom: 5px; -} - -#education { - margin: 0; - margin-bottom: -20px; -} -#awards:before, -#education:before { - background: none; -} - -#awards .description, -#education .description, -.job .details { - border: 1px solid #eee; -} -.publication, -.publication .panel-heading, -.publication .name{ - margin: 0; - padding: 0 5px; - border: none; -} -.publication .panel-body { - padding: 0 10px; - margin: 0; -} - -.badge { - margin: 0; -} - -.list-group-item{ - border: none; - margin: 0; - padding: 5px 15px; -} -.list-group-item:after{ - content: ''; - position: absolute; - top: 8px; - right: 0; - left: -1px; - height: 0; - width: 0; - border: solid transparent; - border-right-color: #999; - border-width: 4px; - pointer-events: none; - } diff --git a/themes/kendallfr/resume.template b/themes/kendallfr/resume.template deleted file mode 100644 index eb5777f..0000000 --- a/themes/kendallfr/resume.template +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - - CV de {{.Basic.Name}} - - - - - - -
        -
        -
        -
        - - {{if .Basic.Image -}} -
        - avatar -
        - {{- end}} -
        -

        {{.Basic.Name}}
        {{if .Basic.Label}}{{.Basic.Label}}{{- end}}

        -
        -
        -
        -
        -
        -
        - {{if .Basic.Summary -}} - -
        -

        À propos

        -

        {{.Basic.Summary}}

        -
        - {{- end}} - {{if .Work -}} - -
        -

        Expérience Professionnelle

        - {{range .Work -}} -
        -
        -
        -
        {{.Name}}
        - {{if .URL -}} - - {{- end}} -
        {{formatDateWork .StartDate}} – {{formatDateWork .EndDate}}
        -
        -
        -
        -
        -
        {{.Position}}
        -
        - {{.Summary -}} - {{if .Highlights -}} -
        -
          - {{range .Highlights -}} -
        • - {{.Title}} - {{if .Items -}} -
            - {{range .Items}}
          • {{.}}
          • {{end}} -
          - {{- end}} -
        • - {{- end}} -
        - {{- end}} -
        -
        -
        -
        - {{- end}} -
        - {{- end}} - {{if .Awards -}} - -
        -

        Récompenses

        -
          - {{range .Awards -}} -
        • -
          {{formatDatePub .Date}}
          -
          -

          {{.Awarder}}

          -

          {{.Title}}

          -

          {{.Summary}}

          -
          -
        • - {{- end}} -
        -
        - {{- end}} - {{if .Volunteer -}} - -
        -

        Bénévolat

        - {{range .Volunteer -}} -
        -
        -
        -
        {{.Organization}}
        - {{if .URL -}} - - {{- end}} -
        {{formatDateWork .StartDate}} – {{formatDateWork .EndDate}}
        -
        -
        -
        -
        -
        {{.Position}}
        -
        - {{.Summary -}} - {{if .Highlights -}} -
        -
          - {{range .Highlights -}} -
        • {{.}}
        • - {{- end}} -
        - {{- end}} -
        -
        -
        -
        - {{- end}} -
        - {{- end}} -
        -
        - -
        -

        Contact

        - {{if .Basic.ResumeLocation.City -}} -
        -
        - {{if .Basic.ResumeLocation.Address}}
        {{.Basic.ResumeLocation.Address}}
        {{- end}} -
        {{.Basic.ResumeLocation.City}}{{if .Basic.ResumeLocation.Region}}, {{.Basic.ResumeLocation.Region}}{{- end}}{{if .Basic.ResumeLocation.PostalCode}} {{.Basic.ResumeLocation.PostalCode}}{{- end}}{{if .Basic.ResumeLocation.CountryCode}} {{.Basic.ResumeLocation.CountryCode}}{{- end}}
        -
        - {{- end}} - {{if .Basic.Phone -}} -
        -
        -
        {{.Basic.Phone}}
        -
        - {{- end}} - {{if .Basic.Email -}} - - {{- end}} - {{if .Basic.URL -}} - - {{- end}} - {{range .Basic.Profiles -}} - - {{- end}} -
        - {{if .Education -}} - -
        -

        Formation

        -
          - {{range .Education -}} -
        • -
          {{formatDateEdu .StartDate}} {{formatDateEdu .EndDate}}
          -
          -

          {{.Institution}}

          - {{if .StudyType}}

          {{.StudyType}}

          {{end}} -

          {{.Area}}

          - {{if .GPA -}} -

          - GPA: {{.GPA}} -

          - {{- end}} - {{if .Courses -}} -
          Courses
          -
            - {{range .Courses -}} -
          • {{.}}
          • - {{- end}} -
          - {{- end}} -
          -
        • - {{- end}} -
        -
        - {{- end}} - {{if .Skills -}} - -
        -

        Compétences

        - {{range .Skills -}} -
        -
        - {{.Name}} - {{if .Level}}{{.Level}}{{- end}} -
        -
        - {{range .Keywords -}} - {{.}} - {{- end}} -
        -
        - {{- end}} -
        - {{- end}} - {{if .Publications -}} - -
        -

        Publications

        - {{range .Publications -}} -
        -
        -
        {{.Name}}
        -
        -
        - {{if .Publisher -}} -
        {{.Publisher}}
        - {{- end}} -
        {{formatDatePub .ReleaseDate}}
        - {{if .URL -}} - - {{- end}} - {{if .Summary -}} -

        {{.Summary}}

        - {{- end}} -
        -
        - {{- end}} -
        - {{- end}} - {{if .Languages -}} - -
        -

        Langues

        -
          - {{range .Languages -}} -
        • {{.Language}}{{.Fluency}}
        • - {{- end}} -
        -
        - {{- end}} - {{if .Interests -}} - -
        -

        Intérêts

        - {{range .Interests -}} -
        -
        - {{.Name -}} -
        -
        - {{range .Keywords -}} - {{.}} - {{- end}} -
        -
        - {{- end}} -
        - {{- end}} - {{if .References -}} -
        -

        Références

        - {{range .References -}} -
        -
        {{.Reference}}
        -
        {{.Name}}
        -

        - {{- end}} -
        - {{- end}} -
        -
        -
        - - - diff --git a/themes/kendallfr/style.css b/themes/kendallfr/style.css deleted file mode 100644 index 45c3513..0000000 --- a/themes/kendallfr/style.css +++ /dev/null @@ -1,276 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800); -@charset "utf-8"; -@-webkit-viewport { width: device-width; } -@-moz-viewport { width: device-width; } -@-ms-viewport { width: device-width; } -@-o-viewport { width: device-width; } -@viewport { width: device-width; } - -body{ - font-family: 'Open Sans', Arial, Tahoma; - font-weight: 400; - color: #363636; - background: #334960; -} -blockquote { - font-size: 1em; -} - -.container{ - margin-top: 80px; - margin-bottom: 15px; - background: #fff; -} - -#photo-header{ - margin-top: -75px; -} -#photo{ - width: 160px; - height: 160px; - border-radius: 50%; - overflow: hidden; - padding: 5px; - background: #334960; - display: inline-block; -} -#photo img{ - width: 150px; - height: 150px; - border-radius: 50%; -} -#text-header h1{ - margin: 0; - padding: 0; - font-size: 1.5em; - font-weight: 700; - text-transform: uppercase; - letter-spacing: -1px; -} -#text-header h1::first-line{ - font-size: 1.5em; - font-weight: 800; - line-height: 1.5em; -} -#text-header h1 span{ - color: #334960; - opacity: 0.7; -} -#text-header h1 sup{ - opacity: 0.5; -} -#text-header:after{ - width: 100%; - height: 3px; - border-bottom: 1px solid #ddd; - margin-top: 15px; - content: ''; - display: block; -} - -.box{ - padding-bottom: 10px; - margin-bottom: 25px; -} -.box h2{ - color: #227c74; - font-size: 1.5em; - font-weight: 700; - text-transform: uppercase; -} - -#awards, -#education{ - margin-top: 20px; - margin-bottom: 0; - position: relative; - padding: 1em 0; - list-style: none; -} -#awards:before, -#education:before { - width: 5px; - height: 100%; - position: absolute; - left: 35px; - top: 0; - content: ' '; - display: block; - background: #32475c; - background: -moz-linear-gradient(top, #ffffff 0%, #32475c 7%, #32475c 89%, #ffffff 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(7%,#32475c), color-stop(89%,#32475c), color-stop(100%,#ffffff)); - background: -webkit-linear-gradient(top, #ffffff 0%,#32475c 7%,#32475c 89%,#ffffff 100%); - background: -o-linear-gradient(top, #ffffff 0%,#32475c 7%,#32475c 89%,#ffffff 100%); - background: -ms-linear-gradient(top, #ffffff 0%,#32475c 7%,#32475c 89%,#ffffff 100%); - background: linear-gradient(to bottom, #ffffff 0%,#32475c 7%,#32475c 89%,#ffffff 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ); -} -#awards li, -#education li{ - width: 100%; - z-index: 2; - position: relative; - float: left; -} -#awards .year, -#education .year{ - width: 14%; - background: #fff; - padding: 10px; - font-weight: 700; - display: inline-block; -} -#awards .description, -#education .description{ - width: 83%; - display: inline-block; - background: #eee; - margin-bottom: 10px; - position: relative; - padding: 10px; - border-bottom: 1px solid #ccc; - border-right: 1px solid #ccc; -} -#awards .description:after, -#education .description:after { - content: ''; - position: absolute; - top: 15px; - right: 0; - left: -16px; - height: 0; - width: 0; - border: solid transparent; - border-right-color: #eee; - border-width: 8px; - pointer-events: none; -} -#awards .description h3, -#education .description h3{ - font-size: 1.2em; - margin: 0; - padding: 0; - font-weight: 700; -} -#awards .description p, -#education .description p{ - margin-top: 5px; - padding: 0; -} - -.job{ - margin-bottom: 15px; -} -.job .details { - margin-left: 3%; - width: 95%; - padding: 10px; - margin-bottom: 10px; - background: #eee; - border-bottom: 1px solid #ccc; - border-right: 1px solid #ccc; -} -.job .where{ - font-size: 1.2em; - font-weight: bold; -} -.job .year{ - opacity: 0.7; -} -.job .profession{ - font-size: 1.2em; - font-weight: bold; -} -.job .description{ - line-height: 1.5em; -} -.job .highlights{ - padding: 5px 0; - font-weight: bold; -} -.job .job-details { - padding-left: 5%; - width: 100%; -} -.publication { - margin-bottom: 0; -} -.publication .name{ - font-size: 1em; - font-weight: bold; -} -.publication .year{ - opacity: 0.7; -} -.publication p{ - margin: 0; - padding-top: 10px; -} - -.contact-item{ - width: 100%; - float: left; -} -.contact-item .icon{ - padding: 10px; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; - color: #32475c; - background: #eee; -} -.contact-item:last-child .icon{ - border-bottom: none; -} -.contact-item .title{ - width: 80%; - width: calc(100% - 55px); - font-weight: 700; - opacity: 0.9; -} -.contact-item .title.only{ - margin-top: 10px; -} -.contact-item .description{ - width: 80%; - width: calc(100% - 55px); - color: #334960; -} - -.item-interests, -.item-skills{ - height: 30px; - color: #334960; - padding: 5px 10px; - margin-bottom: 5px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - font-size: 1.1em; - font-weight: 600; -} -.interest, -.skill{ - color: #fff; - display: inline-block; - margin-right: 5px; - margin-bottom: 5px; - padding: 5px 10px; - background: #32475c; - position: relative; - font-size: .85em; -} -.skill-level { - background-color: #227c74; - border-radius: 4px; - color: #fff; - padding: 1px 8px; - font-size: .75em; - position: absolute; - margin: 1px 10px; -} - -#language-skills .skill{ - margin: 10px 0; - padding-bottom: 10px; - border-bottom: 1px solid #eee; -} diff --git a/themes/stackoverflow/resume.template b/themes/stackoverflow/resume.template index a2ca59a..b2318b3 100644 --- a/themes/stackoverflow/resume.template +++ b/themes/stackoverflow/resume.template @@ -1,5 +1,5 @@ - + @@ -27,22 +27,22 @@
        {{- end}} - {{if .Basic.ResumeLocation.City}} + {{if .Basic.Location.City}} - {{if .Basic.ResumeLocation.Address}} - {{.Basic.ResumeLocation.Address}}, + {{if .Basic.Location.Address}} + {{.Basic.Location.Address}}, {{- end}} - {{if .Basic.ResumeLocation.PostalCode}} - {{.Basic.ResumeLocation.PostalCode}}, + {{if .Basic.Location.PostalCode}} + {{.Basic.Location.PostalCode}}, {{- end}} - {{if .Basic.ResumeLocation.City}} - {{.Basic.ResumeLocation.City}}, + {{if .Basic.Location.City}} + {{.Basic.Location.City}}, {{- end}} - {{if .Basic.ResumeLocation.Region}} - {{.Basic.ResumeLocation.Region}} + {{if .Basic.Location.Region}} + {{.Basic.Location.Region}} {{- end}} - {{if .Basic.ResumeLocation.CountryCode}} - {{.Basic.ResumeLocation.CountryCode}} + {{if .Basic.Location.CountryCode}} + {{.Basic.Location.CountryCode}} {{- end}} {{- end}} @@ -99,7 +99,7 @@ {{if .Skills}}
        -

        Skills

        +

        {{.Lang.Skills}}

        {{range .Skills}} @@ -119,7 +119,7 @@ {{if .Work}}
        -

        Work Experience ({{len .Work}})

        +

        {{.Lang.WorkExperience}} ({{len .Work}})

        {{range $index, $w := .Work}} @@ -135,15 +135,15 @@ {{if $w.Position}}
        {{$w.Position}}
        {{end}}
        {{$w.Name}}
        - {{formatDateWork $w.StartDate}} - - {{formatDateWork $w.EndDate}} + {{formatDateMY $w.StartDate}} + - {{formatDateMY $w.EndDate}}
        {{- end}} - {{if $w.WorkLocation -}} + {{if $w.Location -}} - {{if $w.WorkLocation}}{{$w.WorkLocation}},{{end}} + {{if $w.Location}}{{$w.Location}},{{end}} {{- end}} {{if $w.URL}} {{$w.URL}}{{end}} @@ -175,7 +175,7 @@ {{if .Projects -}}
        -

        Projects ({{len .Projects}})

        +

        {{.Lang.Projects}} ({{len .Projects}})

        {{range $index, $p := .Projects}} @@ -191,8 +191,8 @@ {{if $p.Name}}
        {{$p.Name}}
        {{end}} {{if $p.StartDate -}}
        - {{formatDateWork $p.StartDate}} - - {{formatDateWork $p.EndDate}} + {{formatDateMY $p.StartDate}} + - {{formatDateMY $p.EndDate}}
        {{- end}} @@ -209,7 +209,17 @@ {{- end}}
        {{if $p.Description}}

        {{$p.Description}}

        {{end}} - {{if $p.Highlights}}
          {{range $p.Highlights}}
        • {{.}}
        • {{end}}
        {{end}} + {{if $p.Highlights}}
          + {{range $p.Highlights -}} +
        • {{.Title}} + {{if .Items -}} +
            + {{range .Items}}
          • {{.}}
          • {{end}} +
          + {{- end}} +
        • + {{- end}} +
        {{end}}
        {{- end}} @@ -219,7 +229,7 @@ {{if .Volunteer -}}
        -

        Volunteer

        +

        {{.Lang.Volunteer}}

        {{range $index, $v := .Volunteer}} @@ -237,8 +247,8 @@
        {{$v.Organization}}
        - {{formatDateWork $v.StartDate}} - - {{formatDateWork $v.EndDate}} + {{formatDateMY $v.StartDate}} + - {{formatDateMY $v.EndDate}}
        {{- end}} @@ -255,7 +265,15 @@ {{if $v.Summary}}

        {{$v.Summary}}

        {{end}} {{if $v.Highlights}}
          - {{range $v.Highlights}}
        • {{.}}
        • {{end}} + {{range $v.Highlights -}} +
        • {{.Title}} + {{if .Items -}} +
            + {{range .Items}}
          • {{.}}
          • {{end}} +
          + {{- end}} +
        • + {{- end}}
        {{- end}}
        @@ -267,7 +285,7 @@ {{if .Education -}}
        -

        Education ({{len .Education}})

        +

        {{.Lang.Education}} ({{len .Education}})

        @@ -286,8 +304,8 @@ {{if $e.Institution}}
        {{$e.Institution}}
        {{end}}
        - {{if $e.StartDate}}{{formatDateEdu $e.StartDate}}{{end}} - - {{formatDateEdu $e.EndDate}} + {{if $e.StartDate}}{{formatDateY $e.StartDate}}{{end}} + - {{formatDateY $e.EndDate}}
        {{if $e.Courses -}} @@ -310,7 +328,7 @@ {{if .Awards -}}
        -

        Awards

        +

        {{.Lang.Awards}}

        {{range $index, $a := .Awards}} @@ -326,7 +344,7 @@ {{if $a.Title}}
        {{$a.Title}}
        {{end}} {{if $a.Awarder}}
        {{$a.Awarder}}
        {{end}}
      - {{if $a.Date}}
      {{formatDatePub $a.Date}}
      {{end}} + {{if $a.Date}}
      {{formatDateDMY $a.Date}}
      {{end}}
      {{if $a.Summary}}

      {{$a.Summary}}

      {{end}} @@ -339,7 +357,7 @@ {{if .Publications -}}
      -

      Publications

      +

      {{.Lang.Publications}}

      {{range $index, $p := .Publications}} @@ -366,7 +384,7 @@ {{- end}} {{if $p.Publisher}} in {{$p.Publisher}}{{end}}
      - {{if $p.ReleaseDate}} {{formatDatePub $p.ReleaseDate}} {{end}} + {{if $p.ReleaseDate}} {{formatDateDMY $p.ReleaseDate}} {{end}}
      @@ -380,7 +398,7 @@ {{if .Languages -}}
      -

      Languages

      +

      {{.Lang.Languages}}

      {{range .Languages}} @@ -402,7 +420,7 @@ {{if .Interests -}}
      -

      Interests

      +

      {{.Lang.Interests}}

      {{range .Interests}} @@ -423,7 +441,7 @@ {{if .References -}}
      -

      References

      +

      {{.Lang.References}}

      {{range .References}} diff --git a/themes/stackoverflow/stackoverflow.go b/themes/stackoverflow/stackoverflow.go index cd90b8f..5b86e3c 100644 --- a/themes/stackoverflow/stackoverflow.go +++ b/themes/stackoverflow/stackoverflow.go @@ -23,10 +23,9 @@ * SUCH DAMAGE. */ -package kendall +package stackoverflow import ( - "io/ioutil" "jsonresume/themes" "path" "strings" @@ -43,20 +42,18 @@ var Theme = themes.Theme{ Name: "stackoverflow", Directory: packageDirectory, Functions: template.FuncMap{ - "iconClass": themes.IconClass, - "formatDateWork": themes.FormatDateWork, - "formatDateEdu": themes.FormatDateEdu, - "formatDatePub": themes.FormatDatePub, - "css": getCSS, - "tolower": strings.ToLower, + "css": getCSS, + "tolower": strings.ToLower, }, - Template: fileTemplate, } func init() { + t, _ := Asset(path.Join(packageDirectory, fileTemplate)) + Theme.Template = string(t) (&Theme).Register() } + func getCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSS)) + r, _ := Asset(path.Join(packageDirectory, fileCSS)) return string(r) } diff --git a/themes/stackoverflowfr/resume.template b/themes/stackoverflowfr/resume.template deleted file mode 100644 index f365b3c..0000000 --- a/themes/stackoverflowfr/resume.template +++ /dev/null @@ -1,440 +0,0 @@ - - - - - - CV de {{.Basic.Name}} - - - - - - -
      - - - {{if .Basic.Summary}} -
      -
      -
      {{.Basic.Summary}}
      -
      -
      - {{- end}} - {{if .Skills}} -
      -
      -

      Compétences

      -
      -
      - {{range .Skills}} -
      - {{if .Name}}

      {{.Name}}

      {{end}} - {{if .Level}}
      {{.Level}}
      {{end}} - {{if .Keywords -}} -
        - {{range .Keywords}}
      • {{.}}
      • {{end}} -
      - {{- end}} -
      - {{- end}} -
      -
      - {{- end}} - {{if .Work}} -
      -
      -

      Expérience Professionnelle ({{len .Work}})

      -
      -
      - {{range $index, $w := .Work}} -
      - {{if $w.Name -}} - {{if eq $index 0 -}} - - {{else -}} - - {{- end}} - -
      - {{if $w.Position}}
      {{$w.Position}}
      {{end}} -
      {{$w.Name}}
      -
      - {{formatDateWork $w.StartDate}} - - {{formatDateWork $w.EndDate}} -
      -
      - {{- end}} - {{if $w.WorkLocation -}} - - - {{if $w.WorkLocation}}{{$w.WorkLocation}},{{end}} - - {{- end}} - {{if $w.URL}} {{$w.URL}}{{end}} - {{if $w.Keywords -}} -
        - {{range $w.Keywords}}
      • {{.}}
      • {{end}} -
      - {{- end}} -
      - {{if $w.Summary}}

      {{$w.Summary}}

      {{end}} - {{if $w.Highlights -}} -
        - {{range $w.Highlights -}} -
      • {{.Title}} - {{if .Items -}} -
          - {{range .Items}}
        • {{.}}
        • {{end}} -
        - {{- end}} -
      • - {{- end}} -
      {{end}} -
      -
      - {{- end}} -
      -
      - {{- end}} - {{if .Projects -}} -
      -
      -

      Projets ({{len .Projects}})

      -
      -
      - {{range $index, $p := .Projects}} -
      - {{if eq $index 0 -}} - - {{else -}} - - {{- end}} - - {{if $p.Name -}} -
      - {{if $p.Name}}
      {{$p.Name}}
      {{end}} - {{if $p.StartDate -}} -
      - {{formatDateWork $p.StartDate}} - - {{formatDateWork $p.EndDate}} -
      - {{- end}} -
      - {{- end}} - {{if $p.URL}} - - {{$p.URL}} - - {{- end}} - {{if $p.Keywords -}} -
        - {{range $p.Keywords}}
      • {{.}}
      • {{end}} -
      - {{- end}} -
      - {{if $p.Description}}

      {{$p.Description}}

      {{end}} - {{if $p.Highlights}}
        {{range $p.Highlights}}
      • {{.}}
      • {{end}}
      {{end}} -
      -
      - {{- end}} -
      -
      - {{- end}} - {{if .Volunteer -}} -
      -
      -

      Bénévolat

      -
      -
      - {{range $index, $v := .Volunteer}} -
      - {{if $v.Organization -}} - {{if eq $index 0 -}} - - {{else -}} - - {{- end}} - -
      -
      - {{if $v.Position}}
      {{$v.Position}}
      {{end}} -
      {{$v.Organization}}
      -
      -
      - {{formatDateWork $v.StartDate}} - - {{formatDateWork $v.EndDate}} -
      -
      - {{- end}} - {{if $v.URL -}} - - {{- end}} - {{if $v.Keywords}}
        - {{range $v.Keywords}}
      • {{.}}
      • {{end}} -
      {{end}} -
      -

      - {{if $v.Summary}}

      {{$v.Summary}}

      {{end}} - {{if $v.Highlights}} -
        - {{range $v.Highlights}}
      • {{.}}
      • {{end}} -
      - {{- end}} -
      -
      - {{- end}} -
      -
      - {{- end}} - {{if .Education -}} -
      -
      -

      Formation ({{len .Education}})

      -
      - -
      - {{range $index, $e := .Education}} -
      - {{if eq $index 0 -}} - - {{else -}} - - {{- end}} - -
      -
      - {{if $e.StudyType}}
      {{$e.StudyType}}
      {{end}} - {{if $e.Area}}
      {{$e.Area}}
      {{end}} - {{if $e.Institution}}
      {{$e.Institution}}
      {{end}} -
      -
      - {{if $e.StartDate}}{{formatDateEdu $e.StartDate}}{{end}} - - {{formatDateEdu $e.EndDate}} -
      -
      - {{if $e.Courses -}} -
        - {{range $e.Courses}}
      • {{.}}
      • {{end}} -
      - {{- end}} -
      - {{if $e.GPA -}} -
      - Grade: {{$e.GPA}} -
      - {{- end}} -
      -
      - {{- end}} -
      -
      - {{- end}} - {{if .Awards -}} -
      -
      -

      Récompenses

      -
      -
      - {{range $index, $a := .Awards}} -
      - {{if eq $index 0 -}} - - {{else -}} - - {{- end}} - -
      -
      - {{if $a.Title}}
      {{$a.Title}}
      {{end}} - {{if $a.Awarder}}
      {{$a.Awarder}}
      {{end}} -
      - {{if $a.Date}}
      {{formatDatePub $a.Date}}
      {{end}} -
      -
      - {{if $a.Summary}}

      {{$a.Summary}}

      {{end}} -
      -
      - {{- end}} -
      -
      - {{- end}} - {{if .Publications -}} -
      -
      -

      Publications

      -
      -
      - {{range $index, $p := .Publications}} -
      - {{if eq $index 0 -}} - - {{else -}} - - {{- end}} - - -
      -
      - {{if $p.Name -}} - - {{if $p.URL -}} - - {{$p.Name}} - - {{else -}} - {{$p.Name}} - {{- end}} - - {{- end}} - {{if $p.Publisher}} in {{$p.Publisher}}{{end}} -
      - {{if $p.ReleaseDate}} {{formatDatePub $p.ReleaseDate}} {{end}} -
      - -
      - {{if $p.Summary}}

      {{$p.Summary}}

      {{end}} -
      -
      - {{- end}} -
      -
      - {{- end}} - {{if .Languages -}} -
      -
      -

      Langues

      -
      -
      - {{range .Languages}} -
      - {{if .Language}}

      {{.Language}}

      {{end}} -
      - {{if .Fluency -}} -
      - {{.Fluency}} -
      -
      - {{- end}} -
      -
      - {{- end}} -
      -
      - {{- end}} - {{if .Interests -}} -
      -
      -

      Intérêts

      -
      -
      - {{range .Interests}} -
      - {{if .Name}}

      {{.Name}}

      {{end}} - {{if .Keywords -}} -
        - {{range .Keywords}} -
      • {{.}}
      • - {{- end}} -
      - {{- end}} -
      - {{- end}} -
      -
      - {{- end}} - {{if .References -}} -
      -
      -

      Références

      -
      -
      - {{range .References}} -
      - {{if .Reference}}
      “ {{.Reference}} ”
      {{end}} - {{if .Name}}
      {{.Name}}
      {{end}} -
      - {{- end}} -
      -
      - {{- end}} -
      - - diff --git a/themes/stackoverflowfr/stackoverflow.go b/themes/stackoverflowfr/stackoverflow.go deleted file mode 100644 index a6245be..0000000 --- a/themes/stackoverflowfr/stackoverflow.go +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2018 Arnaud Ysmal. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -package kendall - -import ( - "io/ioutil" - "jsonresume/themes" - "path" - "strings" - "text/template" -) - -const ( - packageDirectory = "themes/stackoverflowfr" - fileCSS = "style.css" - fileTemplate = "resume.template" -) - -var Theme = themes.Theme{ - Name: "stackoverflowfr", - Directory: packageDirectory, - Functions: template.FuncMap{ - "iconClass": themes.IconClass, - "formatDateWork": themes.FormatDateWorkFR, - "formatDateEdu": themes.FormatDateEduFR, - "formatDatePub": themes.FormatDatePubFR, - "css": getCSS, - "tolower": strings.ToLower, - }, - Template: fileTemplate, -} - -func init() { - (&Theme).Register() -} - -func getCSS() string { - r, _ := ioutil.ReadFile(path.Join(packageDirectory, fileCSS)) - return string(r) -} diff --git a/themes/stackoverflowfr/style.css b/themes/stackoverflowfr/style.css deleted file mode 100755 index e89e828..0000000 --- a/themes/stackoverflowfr/style.css +++ /dev/null @@ -1,771 +0,0 @@ -/******************************************** -* reset from -* http://meyerweb.com/eric/tools/css/reset/ -*******************************************/ - -html, -body, -div, -span, -applet, -object, -iframe, -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote, -pre, -a, -abbr, -acronym, -address, -big, -cite, -code, -del, -dfn, -em, -img, -ins, -kbd, -q, -s, -samp, -small, -strike, -strong, -sub, -sup, -tt, -var, -b, -u, -i, -center, -dl, -dt, -dd, -ol, -ul, -li, -fieldset, -form, -label, -legend, -table, -caption, -tbody, -tfoot, -thead, -tr, -th, -td, -article, -aside, -canvas, -details, -embed, -figure, -figcaption, -footer, -header, -hgroup, -menu, -nav, -output, -ruby, -section, -summary, -time, -mark, -audio, -video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - vertical-align: baseline; -} - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -menu, -nav, -section { - display: block; -} - -body { - line-height: 1; -} - -ol, -ul { - list-style: none; -} - -blockquote, -q { - quotes: none; -} - -blockquote:before, -blockquote:after, -q:before, -q:after { - content: none; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - - -/**************** -* COMMONS -****************/ - -body, -html { - font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; - font-size: 13px; - color: #40484f; - font-weight: 400; - letter-spacing: 0; - line-height: 1.46153846; - text-align: left; - -webkit-text-size-adjust: 100%; -} - -p { - display: block; - margin-bottom: 1.3em; -} - -a { - color: #0095ff; - text-decoration: none; -} - -a:hover { - color: #0c65a5; - text-decoration: underline; -} - -ul { - margin-top: 1rem; -} - -li { - list-style-type: square; - list-style-position: outside; - margin-left: 1.3em; -} - -.highlights>li>p { - margin-bottom: 0.5em; -} - -h1 { - font-size: 2rem; -} - -h2 { - font-size: 1.67rem; -} - -h3 { - font-size: 1.27rem; -} - -em { - color: #757575; -} - -blockquote { - margin-bottom: 1em; -} - -strong { - font-weight: 700; -} - - -/* main container */ - -#resume { - padding: 1rem; - margin-top: 2rem; -} - - -/* every section wrapper */ - -.section { - margin-bottom: 1rem; -} - -section .location { - margin-right: .5em; - color: #606d76; - font-weight: 700; -} - -#contact { - margin-top: .5rem; -} - -#profiles .item { - padding: 0; -} - -#header>#profiles, -#header>#contact, -#skills, -#languages, -#interests { - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - -webkit-flex-flow: row wrap; - flex-flow: row wrap; - -webkit-justify-content: flex-start; - justify-content: flex-start; -} - -#header>div { - line-height: 1.5; -} - -#header>div>div { - margin-right: 1.2em; -} - -#header h1.name { - font-size: 2.8rem; - font-weight: 100; - line-height: 100%; -} - -#header h2.label { - color: #202931; - font-size: 1.47rem; - font-weight: 300; -} - -#header .picture { - width: 11em; - float: right; - border-radius: 4px; -} - -.main-summary { - background: #f1f8ff; - padding: 1.2em 1em; - margin-top: 1rem; -} - -.main-summary p { - margin: .15em 0 0; -} - -h2.section-title { - display: inline-block; - background: #fff; - padding: 0 1em 0.3em 0; - color: #ff6d1f; - text-transform: uppercase; - font-weight: 600; - border: none; - font-size: .9rem; -} - -.section>header { - position: relative; -} - -.fa { - margin-right: 0.25em; -} - -.section>header::after { - position: absolute; - left: 0; - top: .7em; - height: 1px; - background: #ccc; - content: ""; - width: 100%; - z-index: -100; - display: block; -} - -.section.main-summary>section { - margin: 0; -} - -.section>section>header { - font-size: 1.38rem; - position: relative; - margin-top: .7em; -} - -.section>section>header:first-of-type { - margin: 0; -} - -.section>section>header .space-left { - position: absolute; - left: -1.56rem; - top: 5px; - color: #aaa; - line-height: 1; - opacity: 0; -} - -.position, -.company, -.organization, -.institution, -.date, -.area, -.studyType, -.title, -.awarder { - display: inline; -} - -.position, -.studyType, -.area, -.title, -.language, -.name { - font-weight: 600; -} - -.company::before, -.institution::before, -.organization::before, -.awarder::before { - content: "at " -} - -.company, -.institution, -.organization, -.awarder { - color: #606d76; - font-weight: 400; -} - -.section header .date { - font-size: 1rem; - display: inline-table; - padding: .1em 0; - font-weight: 600; -} - -ul.keywords, -ul.courses { - margin-top: .5em; -} - -ul.keywords li, -ul.courses li { - display: inline-block; - margin: 2px 2px 2px 0; - padding: 4px 5px 5px; - font-size: .9rem; - line-height: 1; - text-transform: lowercase; - color: #3e6d8e; - background-color: #dfeaf1; - border: 0 solid #dfeaf1; - white-space: nowrap; -} - -ul.keywords li:hover, -ul.courses li:hover { - background: #dfeaf0; -} - -.item { - padding: .5em 0; -} - -.gpa { - padding-bottom: .5em; -} - -.fa.social { - font-size: 1.1em; -} - - -/* Social Media Brand Colors */ - -.google-plus { - color: #dd4b39; -} - -.tumblr { - color: #32506d; -} - -.foursquare { - color: #0072b1; -} - -.facebook { - color: #3b5998; -} - -.linkedin { - color: #007bb6; -} - -.pinterest { - color: #cb2027; -} - -.dribbble { - color: #ea4c89; -} - -.instagram { - color: #517fa4; -} - -.twitter { - color: #00aced; -} - -.soundcloud { - color: #ff3a00; -} - -.wordpress { - color: #21759b; -} - -.youtube { - color: #bb0000; -} - -.github { - color: #171515; -} - -.stack-overflow { - color: #828386; - position: relative; -} - -.flickr { - color: #ff0084; -} - -.reddit { - color: #ff4500; -} - -.hacker-news { - color: #ff6600; -} - -.stack-overflow::after { - position: absolute; - left: 0; - content: '\f16c'; - color: #f68a1f; - overflow: hidden; - height: 100%; -} - -.telegram { - color: #2291c3; -} - -#languages .item, -#skills .item, -#interests .item { - width: 15em; - padding: 0 .5em .5em 0; - border-bottom: none; -} - -#skills .item { - width: 16em; -} - -#skills .item .keywords { - width: 15em; -} - - -/* Skill chart */ - -.level { - margin-bottom: .5em; -} - -.level .bar { - border: 1px solid #ddd; - display: block; - width: 10em; - height: 5px; - position: relative; -} - -.level .bar::after { - position: absolute; - content: " "; - top: 0; - left: 0; - background: black; - height: 5px; -} - -.level.beginner .bar::after { - background: #EB5F51; - width: 2.5em; -} - -.level.intermediate .bar::after { - background: #ffdf1f; - width: 5em; -} - -.level.advanced .bar::after, -.level.fluent .bar::after { - background: #5CB85C; - width: 7.5em; -} - -.level.master .bar::after, -.level.native.speaker .bar::after { - background: #59C596; - width: 10em; -} - -#references .item { - padding-left: .5em; - border-left: 5px solid #ff6d1f; -} - -.toggle-item { - visibility: hidden; -} - -/****************** -* HELPER CLASSES -******************/ - -.clear::after { - content: ""; - display: table; - clear: both; -} - -.display { - display: block; - opacity: 1 !important; -} - -.margin1 { - margin-bottom: .5rem; -} - - -/**************** -* TABLET -****************/ - -@media screen and (min-width: 602px) { - #resume { - width: 80%; - margin: 0 auto; - } -} - - -/**************** -* LAPTOP -****************/ - -@media screen and (min-width: 1025px) { - li { - margin-left: 1.5em; - } - #resume { - width: 820px; - margin: 2rem auto; - } - .section>section>header .space-left { - opacity: 1; - cursor: pointer; - } - .section>section { - margin-left: 1.67rem; - } - .toggle-item { - transform: translate(-9999px); - } - .toggle-item+label { - display: block; - } - .toggle-item:checked+label:after { - content: "\f0d7"; - } - .toggle-item+label:after { - float: left; - cursor: pointer; - margin-left: -20px; - color: #aaa; - font-size: 16px; - font-weight: 900; - font-family: "Font Awesome 5 Free"; - content: "\f0da"; - } - .toggle-item~.item { - height: 0; - opacity: 0; - } - .toggle-item:checked~.item { - height: auto; - opacity: 1; - transition: all .5s linear; - } - .company::before, - .institution::before, - .organization::before, - .awarder::before { - content: "| "; - } - .header-left { - float: left; - width: 70%; - word-break: normal; - } - .section header .date { - float: right; - padding: .2em; - } - .display { - display: none; - } - .display:not(.none) { - display: block; - } -} - -@media print { - #resume { - margin: 0; - padding: 0; - -ms-word-wrap: break-word; - word-wrap: break-word; - line-height: 1.3; - /*font-family: Arial, Georgia, "Lucida Grande", sans-serif;*/ - } - @page { - margin: 1cm 1.4cm; - } - .item-count { - display: none; - } - .company::before, - .institution::before, - .organization::before, - .awarder::before { - content: "at "; - } - .main-summary { - padding: 2rem 0; - } - .section { - margin: .8rem 0; - padding: 0; - } - .section header { - padding-bottom: .15rem; - } - .section .location { - padding-bottom: .15rem; - } - .stack-overflow::after { - content: ""; - } - .fa.social { - color: #828386; - } - ul { - margin-top: .4em; - } - ul, - li { - padding: 0; - } - ul.keywords li, - ul.courses li { - margin: 0; - padding: 0; - font-size: .8rem; - text-transform: lowercase; - } - ul.keywords li::after, - ul.courses li::after { - padding: 0 0 0 .1rem; - content: " |"; - } - ul.keywords::before, - ul.courses::before { - font-size: .8rem; - font-weight: 600; - } - ul.keywords::before { - content: "Skills acquired: "; - } - #skills .keywords::before { - content: ''; - } - .section p { - margin: 0; - padding: 0; - } - ul.courses::before { - content: "Major courses: "; - } - ul.keywords li:last-of-type::after, - ul.courses li:last-of-type::after { - content: ""; - } - .level em { - font-style: normal; - padding: .1em 0; - } - .level .bar { - display: none; - } - #profiles .item { - padding: 0; - } - .item.display { - display: block; - opacity: 1 !important; - } -} diff --git a/themes/theme.go b/themes/theme.go index e19e173..372c2b9 100644 --- a/themes/theme.go +++ b/themes/theme.go @@ -29,11 +29,27 @@ import ( "fmt" "io" "jsonresume/model" - "path" "strings" "text/template" + "time" ) +type LangString struct { + TitlePrefix string + About string + Contact string + WorkExperience string + Awards string + Volunteer string + Education string + Skills string + Publications string + Languages string + Interests string + References string + Projects string +} + type Theme struct { Name string Directory string @@ -42,14 +58,53 @@ type Theme struct { } var Themes map[string]*Theme +var Langs = map[string]LangString{ + "en": LangString{ + TitlePrefix: "Resume of", + About: "About", + Contact: "Contact", + WorkExperience: "Work Experience", + Awards: "Awards", + Volunteer: "Volunteer", + Education: "Education", + Skills: "Skills", + Publications: "Publications", + Languages: "Languages", + Interests: "Interests", + References: "References", + Projects: "Projects", + }, +} +var CommonFuncs = map[string]template.FuncMap{ + "en": template.FuncMap{ + "iconClass": iconClass, + "formatDateY": formatDateY, + "formatDateMY": formatDateMY, + "formatDateDMY": formatDateDMY, + }, +} func init() { Themes = make(map[string]*Theme) + setupFrenchTranslation() +} + +type TemplateData struct { + *model.Resume + Lang LangString } func (t *Theme) Render(r *model.Resume, w io.Writer) error { - tmpl := template.Must(template.New(t.Template).Funcs(t.Functions).ParseFiles(path.Join(t.Directory, t.Template))) - return tmpl.Execute(w, r) + if r.Language == "" { + r.Language = "en" + } + l, exists := Langs[r.Language] + if !exists { + return fmt.Errorf("Unsupported language %s", r.Language) + } + f, _ := CommonFuncs[r.Language] + tmpl := template.Must(template.New(t.Name).Funcs(f).Funcs(t.Functions).Parse(t.Template)) + return tmpl.Execute(w, &TemplateData{r, l}) } func (t *Theme) Register() error { @@ -60,8 +115,7 @@ func (t *Theme) Register() error { return nil } -// Common functions -func IconClass(network string) string { +func iconClass(network string) string { network = strings.ToLower(network) switch network { case "google-plus": @@ -99,23 +153,98 @@ func IconClass(network string) string { 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 { +func formatDateY(date model.ResumeDate) string { if date.IsZero() { return "Present" } return fmt.Sprintf("%d", date.Year()) } -func FormatDatePub(date model.ResumeDate) string { +func formatDateMY(date model.ResumeDate) string { + if date.IsZero() { + return "Present" + } + return fmt.Sprintf("%s %d", date.Month().String(), date.Year()) +} + +func formatDateDMY(date model.ResumeDate) string { if date.IsZero() { return "Present" } return fmt.Sprintf("%d %s %d", date.Day(), date.Month().String(), date.Year()) } + +func setupFrenchTranslation() { + Langs["fr"] = LangString{ + TitlePrefix: "CV de", + About: "À propos", + Contact: "Contact", + WorkExperience: "Expérience Professionnelle", + Awards: "Récompenses", + Volunteer: "Bénévolat", + Education: "Formation", + Skills: "Compétences", + Publications: "Publications", + Languages: "Langues", + Interests: "Intérêts", + References: "Références", + Projects: "Projets", + } + CommonFuncs["fr"] = template.FuncMap{ + "iconClass": iconClass, + "formatDateY": formatDateYFR, + "formatDateMY": formatDateMYFR, + "formatDateDMY": formatDateDMYFR, + } +} + +func getMonthFR(date model.ResumeDate) string { + switch date.Month() { + case time.January: + return "Janvier" + case time.February: + return "Février" + case time.March: + return "Mars" + case time.April: + return "Avril" + case time.May: + return "Mai" + case time.June: + return "Juin" + case time.July: + return "Juillet" + case time.August: + return "Août" + case time.September: + return "Septembre" + case time.October: + return "Octobre" + case time.November: + return "Novembre" + case time.December: + return "Décembre" + } + return "" +} + +func formatDateYFR(date model.ResumeDate) string { + if date.IsZero() { + return "Présent" + } + return fmt.Sprintf("%d", date.Year()) +} + +func formatDateMYFR(date model.ResumeDate) string { + if date.IsZero() { + return "Présent" + } + return fmt.Sprintf("%s %d", getMonthFR(date), date.Year()) +} + +func formatDateDMYFR(date model.ResumeDate) string { + if date.IsZero() { + return "Présent" + } + return fmt.Sprintf("%d %s %d", date.Day(), getMonthFR(date), date.Year()) +} diff --git a/themes/themefr.go b/themes/themefr.go deleted file mode 100644 index 94cc4f4..0000000 --- a/themes/themefr.go +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2018 Arnaud Ysmal. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -package themes - -import ( - "fmt" - "jsonresume/model" -) - -func getMonthFR(date model.ResumeDate) string { - switch date.Month() { - case 1: - return "Janvier" - case 2: - return "Février" - case 3: - return "Mars" - case 4: - return "Avril" - case 5: - return "Mai" - case 6: - return "Juin" - case 7: - return "Juillet" - case 8: - return "Août" - case 9: - return "Septembre" - case 10: - return "Octobre" - case 11: - return "Novembre" - case 12: - return "Décembre" - } - return "" -} - -func FormatDateWorkFR(date model.ResumeDate) string { - if date.IsZero() { - return "Présent" - } - return fmt.Sprintf("%s %d", getMonthFR(date), date.Year()) -} - -func FormatDateEduFR(date model.ResumeDate) string { - if date.IsZero() { - return "Présent" - } - return fmt.Sprintf("%d", date.Year()) -} - -func FormatDatePubFR(date model.ResumeDate) string { - if date.IsZero() { - return "Présent" - } - return fmt.Sprintf("%d %s %d", date.Day(), getMonthFR(date), date.Year()) -}