Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit f91af77

Browse files
Christopher Millsmattstratton
authored andcommitted
[refs #611] Add custom_url to program
Add ability to add a custom_url type for all types of talk on the program page. Adding custom_url: "https://valid.url.co.uk" will result in the link on the schedule being opened in another window. I also took it upon myself to change the indenting in the single.html file but this can be reverted.
1 parent 0fae8be commit f91af77

4 files changed

Lines changed: 76 additions & 91 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ bower_components
44
release/
55
dist
66
.DS_Store
7+
.idea/

REFERENCE.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,22 +176,24 @@ program:
176176
date: 2017-06-16
177177
start_time: "08:00"
178178
end_time: "09:00"
179+
custom_url: "https://example.com/registration"
179180
- title: "Opening Welcome"
180181
type: custom
181182
date: 2017-06-16
182183
start_time: "09:15"
183184
end_time: "09:00"
184185
```
185186

186-
| Field Name | Required | Description | Example |
187-
|--------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
188-
| `title` | Yes | The name of the program element. If it is a talk, ignite, or workshop, use the name of the talk/ignite/workshop file, minus the `.md` extension. | "Opening Welcome" or "apple-jack" |
189-
| `type` | Yes | The type for the program element. Valid choices are `custom`, `talk`, `ignite`, `workshop`, or `open-space`. This defines the color of the program element. `talk`, `ignite`, and `workshop` types will create a link to the program item named in `title`. | talk |
190-
| `date` | Yes | The date of the program element, in YYYY-MM-DD format. | 2017-06-16 |
191-
| `start_time` | Yes | The start time of the program element. | "08:00" |
192-
| `end_time` | Yes | The end time of the program element. | "13:40" |
193-
| `comments` | No | Additional comments/notes about the program types `talk`, `workshop` and `custom` (for example, location of an evening event). Markdown is supported. | "This will be at the [Pony Club](http://www.mattstratton.com),1005 Ponyville Drive,Ponyville, IL,60612" |
194-
| `background_color` | No | Allows the ability to override the color of the program element. Only the background color can be changed; please test to make sure the color works with the displayed text colors. Color is expressed in RGB HEX value. Must be in quotes. | "#FFFA99" |
187+
| Field Name | Required | Description | Example |
188+
|--------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
189+
| `title` | Yes | The name of the program element. If it is a talk, ignite, or workshop, use the name of the talk/ignite/workshop file, minus the `.md` extension. | "Opening Welcome" or "apple-jack" |
190+
| `type` | Yes | The type for the program element. Valid choices are `custom`, `talk`, `ignite`, `workshop`, or `open-space`. This defines the color of the program element. `talk`, `ignite`, and `workshop` types will create a link to the program item named in `title`. | talk |
191+
| `date` | Yes | The date of the program element, in YYYY-MM-DD format. | 2017-06-16 |
192+
| `start_time` | Yes | The start time of the program element. | "08:00" |
193+
| `end_time` | Yes | The end time of the program element. | "13:40" |
194+
| `comments` | No | Additional comments/notes about the program types `talk`, `workshop` and `custom` (for example, location of an evening event). Markdown is supported. | "This will be at the [Pony Club](http://www.mattstratton.com),1005 Ponyville Drive,Ponyville, IL,60612" |
195+
| `background_color` | No | Allows the ability to override the color of the program element. Only the background color can be changed; please test to make sure the color works with the displayed text colors. Color is expressed in RGB HEX value. Must be in quotes. | "#FFFA99" |
196+
| `custom_url` | No | Replaces the URL for various program types to link to external URL or a URL of your choosing. Valid choices are `custom`, `talk`, `ignite`, `workshop`, or `open-space` | "https://example.com" |
195197

196198
##### Program Element Colors
197199

@@ -214,12 +216,14 @@ ignites:
214216
date: 2017-06-16
215217
- title: "DevOps With Delight"
216218
date: 2017-06-16
219+
custom_url: "https://example.com/ignites
217220
```
218221

219-
| Field Name | Required | Description | Example |
220-
|------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
221-
| `title` | Yes | The title of the ignite. If it is named after the filename (without the `.md` extension` of a talk, it will generate a link to the talk page. | "matt-stratton" or "DevOps With Delight" |
222-
| `date` | Yes | The date of the ignite, in YYYY-MM-DD format. | 2017-06-16 |
222+
| Field Name | Required | Description | Example |
223+
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
224+
| `title` | Yes | The title of the ignite. If it is named after the filename (without the `.md` extension` of a talk, it will generate a link to the talk page. | "matt-stratton" or "DevOps With Delight" |
225+
| `date` | Yes | The date of the ignite, in YYYY-MM-DD format. | 2017-06-16 |
226+
| `custom_url` | No | Allows linking to URL off-site for various reasons. | "https://example.com/schedule" |
223227

224228
## Pages and Frontmatter
225229

layouts/program/single.html

Lines changed: 54 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -43,49 +43,29 @@ <h2>Program</h2>
4343
{{- $.Scratch.Set "speaker_len" (.Params.speakers | len) -}}
4444
{{- $.Scratch.Set "speaker_count" 0 -}}
4545
{{- end -}}
46-
{{- end -}}
47-
{{- range .Params.speakers -}}
48-
{{- $.Scratch.Set "speaker_count" (add ($.Scratch.Get "speaker_count") 1) -}}
49-
{{- $.Scratch.Set "speakername" . -}}
50-
{{- range where $.Site.Pages "Type" "speaker" -}}
51-
{{- if eq (index (split (.Permalink | relURL) "/") 2) $e.name -}}
52-
{{- if eq .File.BaseFileName ($.Scratch.Get "speakername") -}}
53-
{{- $.Scratch.Add (printf "%s-speaker" ($.Scratch.Get "base_file_name")) .Title -}}
54-
{{- if ne ($.Scratch.Get "speaker_count") ($.Scratch.Get "speaker_len") -}}
55-
{{- $.Scratch.Add (printf "%s-speaker" ($.Scratch.Get "base_file_name")) ", " -}}
46+
<!-- end if eq $talk_slug $e.name -->
5647
{{- end -}}
57-
{{- end -}}
58-
{{- end -}}
59-
<!-- end if eq $speaker_slug $e.name -->
60-
{{- end -}}
61-
<!-- end range where $.Site.Pages "Type" "speaker" -->
62-
{{- end -}}
63-
<!-- end ranging over speakers -->
64-
{{- end -}}
65-
<!-- end if eq $talk_slug $e.name -->
66-
{{- end -}}
67-
<!-- end range where $.Site.Pages "Type" "speaker" -->
48+
<!-- end range where $.Site.Pages "Type" "speaker" -->
6849
<!-- Get the dates for the program -->
6950
{{- with $e -}}
7051
{{- range .program -}}
7152
{{- $.Scratch.SetInMap "dates" .date .date -}}
7253
{{- end -}}
7354
{{- end -}}
74-
<!-- new experimental program end -->
75-
<div class="row">
76-
<div class="col">
77-
<div id="accordion" role="tablist" aria-multiselectable="true">
78-
{{- range ($.Scratch.GetSortedMapValues "dates") -}}
79-
{{- $.Scratch.Set "date" . -}}
80-
{{- with $e -}}
81-
{{- if .program -}}
82-
<div class="card">
83-
<div class="card-header" role="tab" id="{{printf "headingOne-%s" ($.Scratch.Get "date") }}">
84-
<h5 class="mb-0">
85-
{{- dateFormat "January 2, 2006" ($.Scratch.Get "date") -}}
86-
</a>
87-
</h5>
88-
</div>
55+
<!-- new experimental program end -->
56+
<div class="row">
57+
<div class="col">
58+
<div id="accordion" role="tablist" aria-multiselectable="true">
59+
{{- range ($.Scratch.GetSortedMapValues "dates") -}}
60+
{{- $.Scratch.Set "date" . -}}
61+
{{- with $e -}}
62+
{{- if .program -}}
63+
<div class="card">
64+
<div class="card-header" role="tab" id="{{printf "headingOne-%s" ($.Scratch.Get "date") }}">
65+
<h5 class="mb-0">
66+
{{- dateFormat "January 2, 2006" ($.Scratch.Get "date") -}}
67+
</h5>
68+
</div>
8969

9070
<div id="{{printf "#collapse-%s" ($.Scratch.Get "date") }}" class="collapse show" role="tabpanel" aria-labelledby="{{printf "headingOne-%s" ($.Scratch.Get "date") }}">
9171
<div class="card-block">
@@ -105,17 +85,19 @@ <h5 class="mb-0">
10585
</div>
10686
<div class="col-lg-8 col-md-6 program-element {{ printf "program-%s" .type }}" {{ if .background_color }}style="background-color: {{ .background_color }}"{{end}}>
10787
{{- if eq .type "custom" -}}
88+
{{- if .custom_url -}}
89+
<a href="{{ .custom_url | safeURL }}">{{ .title }}<br/></a>
90+
{{- else -}}
10891
{{ .title }}<br/>
10992
{{- if .comments -}}
11093
<span class="program-page-desc">{{ .comments | markdownify }}<br/></span>
11194
{{- end -}}
11295
{{- else if or (eq .type "talk") (eq .type "workshop") -}}
113-
<a href="{{ (printf "events/%s/program/%s" $e.name .title) | absURL }}">
114-
{{ $.Scratch.Get (printf "%s-speaker" .title) }}
115-
-
116-
{{ $.Scratch.Get .title }}
117-
118-
</a>
96+
{{- if .custom_url -}}
97+
<a href="{{ .custom_url | safeURL }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}</a><br/>
98+
{{- else -}}
99+
<a href="{{ (printf "events/%s/program/%s" $e.name .title) | absURL }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}</a><br/>
100+
{{- end -}}
119101
{{- if eq ($.Scratch.Get "icons") "TRUE" -}}
120102
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
121103
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
@@ -136,56 +118,51 @@ <h5 class="mb-0">
136118
{{- if ge $ignites_len 1 -}}
137119
<ul class="list-unstyled">
138120
{{- range where $e.ignites "date" ($.Scratch.Get "date") -}}
139-
{{- if ($.Scratch.Get .title) -}}
140121
<li>
141-
<a href="/events/{{ $e.name}}/program/{{ .title }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }}
142-
-
143-
{{ $.Scratch.Get .title }}</a>&nbsp;
122+
{{- if and ($.Scratch.Get .title) (.custom_url) -}}
123+
<a href="{{ .custom_url | safeURL }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}</a>
124+
{{- else if ($.Scratch.Get .title) -}}
125+
<a href="/events/{{ $e.name }}/program/{{ .title }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}</a>
144126
{{- if eq ($.Scratch.Get "icons") "TRUE" -}}
145127
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
146128
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
147129
{{- end -}}
148130
</li>
149131
{{- else -}}
150-
<li>
151-
{{.title}}
132+
{{ .title }}
133+
{{- end -}}
152134
</li>
153135
{{- end -}}
154-
{{- end -}}
155-
</ul>
136+
</ul>
137+
{{- end -}}
156138
{{- end -}}
157139
{{- end -}}
140+
<!-- end ignite stuff here -->
141+
<!-- do open-space stuff here -->
142+
{{- else if (eq .type "open-space") -}}
143+
{{- if .custom_url -}}
144+
<a href="{{ .custom_url | safeURL }}" target="_blank" rel="noopener">{{ .title }}</a><br/>
145+
{{- else -}}
146+
<a href="{{ "open-space-format/" | absURL }}">{{ .title }}</a><br/>
147+
{{- end -}}
158148
{{- end -}}
159-
<!-- end ignite stuff here -->
160-
<!-- do open-space stuff here -->
161-
{{- else if (eq .type "open-space") -}}
162-
<a href="{{ "open-space-format/" | absURL }}">
163-
{{ .title }}
164-
</a><br/>
165-
{{- else -}}
166-
{{ .title }}
149+
</div>
150+
</div>
151+
{{- if eq (div ($.Scratch.Get "program_len") 2) ($.Scratch.Get "program_counter") -}}
152+
</div>
153+
<div class="col-lg-6">
167154
{{- end -}}
168-
</div>
155+
{{- end -}}
169156
</div>
170-
{{- if eq (div ($.Scratch.Get "program_len") 2) ($.Scratch.Get "program_counter") -}}
171157
</div>
172-
<div class="col-lg-6">
173-
{{- end -}}
174-
{{- end -}}
175-
{{- end -}}
176-
{{- end -}}
177-
</div>
178-
</div>
179-
</div>
158+
</div>
159+
</div>
160+
{{- end -}}
161+
{{- end -}}
162+
{{- end -}}
180163
</div>
181164
</div>
165+
</div>
166+
<!--end row-->
167+
{{- end -}}
182168
{{- end -}}
183-
</div>
184-
</div>
185-
</div>
186-
<!--end row-->
187-
</div>
188-
</div>
189-
{{- end -}}
190-
191-
{{ end }}

static/scss/custom.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,6 @@ h3.program-page {
607607
font-size: .85em;
608608
}
609609

610-
611610
.program-element {
612611
overflow: hidden;
613612
height: 1%
@@ -628,6 +627,10 @@ h3.program-page {
628627
.program-custom {
629628
background-color: lighten( $devopsdays-gray, 15% );
630629
color: #000;
630+
631+
>a {
632+
color: #000;
633+
}
631634
}
632635

633636
.program-talk {

0 commit comments

Comments
 (0)