Skip to content

Commit 7110bb7

Browse files
committed
Remove extra lines from speaker file
Fixes #63 Signed-off-by: Matt Stratton <[email protected]>
1 parent a51ca98 commit 7110bb7

File tree

8 files changed

+59
-21
lines changed

8 files changed

+59
-21
lines changed

speaker/speaker.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ var qsCreateSpeaker = []*survey.Question{
3636
Name: "bio",
3737
Prompt: &survey.Editor{Message: "Enter the speaker's bio [Enter to launch editor]"},
3838
},
39+
{
40+
Name: "website",
41+
Prompt: &survey.Input{
42+
Message: "What is the speaker's website? [optional]",
43+
Help: "This should be the full URL to the speaker's website. Example: https://www.mattstratton.com",
44+
},
45+
Validate: func(val interface{}) error {
46+
if str, _ := val.(string); (str != "") && (helpers.ValidateField(str, "facebook") == false) {
47+
return errors.New("Please enter a valid URL.")
48+
}
49+
return nil
50+
},
51+
},
3952
{
4053
Name: "twitter",
4154
Prompt: &survey.Input{

speaker/templates.go

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,27 @@ package speaker
33
const speakerTmpl = `+++
44
Title = "{{ .Title }}"
55
type = "speaker"
6-
{{ with .Website }}website = "{{ . }}"{{ end }}
7-
{{ with .Twitter }}twitter = "{{ . }}"{{ end }}
8-
{{ with .Facebook }}facebook = "{{ . }}"{{ end }}
9-
{{ with .Linkedin }}linkedin = "{{ . }}"{{ end }}
10-
{{ with .Github }}github = "{{ . }}"{{ end }}
11-
{{ with .Gitlab }}gitlab = "{{ . }}"{{ end }}
12-
{{ with .ImagePath }}image = "{{ . }}"{{ end }}
6+
{{- with .Website }}
7+
website = "{{ . }}"
8+
{{- end }}
9+
{{- with .Twitter }}
10+
twitter = "{{ . }}"
11+
{{- end }}
12+
{{- with .Facebook }}
13+
facebook = "{{ . }}"
14+
{{- end }}
15+
{{- with .Linkedin }}
16+
linkedin = "{{ . }}"
17+
{{- end }}
18+
{{- with .Github }}
19+
github = "{{ . }}"
20+
{{- end }}
21+
{{- with .Gitlab }}
22+
gitlab = "{{ . }}"
23+
{{- end }}
24+
{{- with .ImagePath -}}
25+
image = "{{ . }}"
26+
{{- end }}
1327
+++
1428
{{ with .Bio }}{{.}}{{ end }}
1529
`

testdata/content/events/2017-ponyville/speakers/matt-stratton.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ twitter = "mattstratton"
66
facebook = "https://www.facebook.com/matt.stratton"
77
linkedin = "https://www.linkedin.com/in/mattstratton/"
88
github = "mattstratton"
9-
gitlab = "mattstratton"
10-
image = "matt-stratton.jpg"
9+
gitlab = "mattstratton"image = "matt-stratton.jpg"
1110
+++
1211

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+++
2+
Title = "Fancy Cat"
3+
type = "speaker"
4+
website = "http://www.mattstratton.com"
5+
twitter = "fancycat\n"github = "fancycat\n"
6+
+++
7+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
+++
2+
Title = "Henry Stratton"
3+
type = "speaker"
4+
twitter = "henryboy"
5+
6+
github = "henry"
7+
+++
8+
Henry loves guite
9+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
+++
2+
Title = "Joey Stratton"
3+
type = "speaker"
4+
twitter = "joeyjoeu"
5+
github = "joey"
6+
+++
7+
joaoiasdfj
8+

testdata/content/events/2018-canterlot/speakers/rainbow-dash.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
496 KB
Loading

0 commit comments

Comments
 (0)