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

Commit dcae6a6

Browse files
authored
Merge pull request #645 from chriscoffee/tkt-00611
[refs #611] Add ability to use custom_url in program page
2 parents 0fae8be + fced731 commit dcae6a6

File tree

7 files changed

+57
-45
lines changed

7 files changed

+57
-45
lines changed

.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 for `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

exampleSite/data/events/2017-ponyville.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ program:
269269
date: 2017-07-16
270270
start_time: "15:15"
271271
end_time: "16:00"
272+
custom_url: "http://www.cnn.com"
272273
- title: "Open Space #3"
273274
type: open-space
274275
date: 2017-07-16

layouts/program/single.html

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,23 @@ <h5 class="mb-0">
105105
</div>
106106
<div class="col-lg-8 col-md-6 program-element {{ printf "program-%s" .type }}" {{ if .background_color }}style="background-color: {{ .background_color }}"{{end}}>
107107
{{- if eq .type "custom" -}}
108-
{{ .title }}<br/>
108+
{{- if .custom_url -}}
109+
<a href="{{ .custom_url | safeURL }}">{{ .title }}<br/></a>
110+
{{- else -}}
111+
{{ .title }}<br/>
112+
{{- end -}}
109113
{{- if .comments -}}
110114
<span class="program-page-desc">{{ .comments | markdownify }}<br/></span>
111115
{{- end -}}
112116
{{- 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>
117+
{{- if .custom_url -}}
118+
<a href="{{ .custom_url | safeURL }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}</a><br/>
119+
{{- else -}}
120+
<a href="{{ (printf "events/%s/program/%s" $e.name .title) | absURL }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}</a><br/>
121+
{{- end -}}
119122
{{- if eq ($.Scratch.Get "icons") "TRUE" -}}
120-
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
121-
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
123+
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}&nbsp;<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
124+
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}&nbsp;<a href="{{ . }}"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
122125
{{- end -}}
123126
<br/>
124127
<br/>
@@ -136,35 +139,35 @@ <h5 class="mb-0">
136139
{{- if ge $ignites_len 1 -}}
137140
<ul class="list-unstyled">
138141
{{- range where $e.ignites "date" ($.Scratch.Get "date") -}}
139-
{{- if ($.Scratch.Get .title) -}}
140142
<li>
141-
<a href="/events/{{ $e.name}}/program/{{ .title }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }}
142-
-
143-
{{ $.Scratch.Get .title }}</a>&nbsp;
144-
{{- if eq ($.Scratch.Get "icons") "TRUE" -}}
145-
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
146-
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}<a href="{{ . }}"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
147-
{{- end -}}
148-
</li>
143+
{{- if and ($.Scratch.Get .title) (.custom_url) -}}
144+
<a href="{{ .custom_url | safeURL }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}</a>
145+
{{- else if ($.Scratch.Get .title) -}}
146+
<a href="/events/{{ $e.name }}/program/{{ .title }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }} - {{ $.Scratch.Get .title }}</a>
149147
{{- else -}}
150-
<li>
151-
{{.title}}
148+
{{ .title }}
149+
{{- end -}}
150+
{{- if eq ($.Scratch.Get "icons") "TRUE" -}}
151+
{{- with ($.Scratch.Get (printf "%s-video_link" .title)) -}}&nbsp;<a href="{{ . }}"><i class="fa fa-video-camera" aria-hidden="true"></i></a>&nbsp;{{- end -}}
152+
{{- with ($.Scratch.Get (printf "%s-slides_link" .title)) -}}&nbsp;<a href="{{ . }}"><i class="fa fa-file-text-o" aria-hidden="true"></i></a>&nbsp;{{- end -}}
153+
{{- end -}}
152154
</li>
153-
{{- end -}}
154-
{{- end -}}
155-
</ul>
156-
{{- end -}}
155+
{{- end -}}<!-- rang ignites-->
156+
</ul>
157+
{{- end -}} <!-- if ge $ignites_len 1 -->
157158
{{- end -}}
158159
{{- end -}}
159160
<!-- end ignite stuff here -->
160161
<!-- do open-space stuff here -->
161162
{{- else if (eq .type "open-space") -}}
162-
<a href="{{ "open-space-format/" | absURL }}">
163-
{{ .title }}
164-
</a><br/>
163+
{{- if .custom_url -}}
164+
<a href="{{ .custom_url | safeURL }}">{{ .title }}</a><br/>
165+
{{- else -}}
166+
<a href="{{ "open-space-format/" | absURL }}">{{ .title }}</a><br/>
167+
{{- end -}}
165168
{{- else -}}
166169
{{ .title }}
167-
{{- end -}}
170+
{{- end -}}
168171
</div>
169172
</div>
170173
{{- if eq (div ($.Scratch.Get "program_len") 2) ($.Scratch.Get "program_counter") -}}
@@ -188,4 +191,4 @@ <h5 class="mb-0">
188191
</div>
189192
{{- end -}}
190193

191-
{{ end }}
194+
{{ end }}

static/css/site.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/css/site.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)