Strip protocol and trailing slashes from URLs
This commit is contained in:
parent
d5104af1a5
commit
a3a35372ed
4
index.js
4
index.js
|
@ -22,6 +22,10 @@ Handlebars.registerHelper('formatDate', dateString =>
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Handlebars.registerHelper('formatURL', url =>
|
||||||
|
url.replace(/^(https?:|)\/\//, '').replace(/\/$/, ''),
|
||||||
|
)
|
||||||
|
|
||||||
Handlebars.registerHelper('join', (arr, separator) =>
|
Handlebars.registerHelper('join', (arr, separator) =>
|
||||||
arr.join(typeof separator === 'string' ? separator : ', '),
|
arr.join(typeof separator === 'string' ? separator : ', '),
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
{{#url}}
|
{{#url}}
|
||||||
<div>
|
<div>
|
||||||
<h6>Website</h6>
|
<h6>Website</h6>
|
||||||
<a href="{{.}}">{{.}}</a>
|
<a href="{{.}}">{{formatURL .}}</a>
|
||||||
</div>
|
</div>
|
||||||
{{/url}}
|
{{/url}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<strong>{{.}}</strong>
|
<strong>{{.}}</strong>
|
||||||
{{/area}}
|
{{/area}}
|
||||||
{{#url}}
|
{{#url}}
|
||||||
<a href="{{.}}">{{.}}</a>
|
<a href="{{.}}">{{formatURL .}}</a>
|
||||||
{{/url}}
|
{{/url}}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
{{/entity}}
|
{{/entity}}
|
||||||
</span>
|
</span>
|
||||||
{{#url}}
|
{{#url}}
|
||||||
<a href="{{.}}">{{.}}</a>
|
<a href="{{.}}">{{formatURL .}}</a>
|
||||||
{{/url}}
|
{{/url}}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</span>
|
</span>
|
||||||
{{/publisher}}
|
{{/publisher}}
|
||||||
{{#url}}
|
{{#url}}
|
||||||
<a href="{{.}}">{{.}}</a>
|
<a href="{{.}}">{{formatURL .}}</a>
|
||||||
{{/url}}
|
{{/url}}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<strong>{{.}}</strong>
|
<strong>{{.}}</strong>
|
||||||
{{/position}}
|
{{/position}}
|
||||||
{{#url}}
|
{{#url}}
|
||||||
<a href="{{.}}">{{.}}</a>
|
<a href="{{.}}">{{formatURL .}}</a>
|
||||||
{{/url}}
|
{{/url}}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<strong>{{.}}</strong>
|
<strong>{{.}}</strong>
|
||||||
{{/position}}
|
{{/position}}
|
||||||
{{#url}}
|
{{#url}}
|
||||||
<a href="{{.}}">{{.}}</a>
|
<a href="{{.}}">{{formatURL .}}</a>
|
||||||
{{/url}}
|
{{/url}}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -246,7 +246,7 @@ blockquote > * + * {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h6>Website</h6>
|
<h6>Website</h6>
|
||||||
<a href="http://richardhendricks.example.com">http://richardhendricks.example.com</a>
|
<a href="http://richardhendricks.example.com">richardhendricks.example.com</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
@ -284,7 +284,7 @@ blockquote > * + * {
|
||||||
</div>
|
</div>
|
||||||
<div class="spaced-list">
|
<div class="spaced-list">
|
||||||
<strong>CEO/President</strong>
|
<strong>CEO/President</strong>
|
||||||
<a href="http://piedpiper.example.com">http://piedpiper.example.com</a>
|
<a href="http://piedpiper.example.com">piedpiper.example.com</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<p>Pied Piper is a multi-platform technology based on a proprietary universal compression algorithm that has consistently fielded high Weisman Scores™ that are not merely competitive, but approach the theoretical limit of lossless compression.</p>
|
<p>Pied Piper is a multi-platform technology based on a proprietary universal compression algorithm that has consistently fielded high Weisman Scores™ that are not merely competitive, but approach the theoretical limit of lossless compression.</p>
|
||||||
|
@ -311,7 +311,7 @@ blockquote > * + * {
|
||||||
</div>
|
</div>
|
||||||
<div class="spaced-list">
|
<div class="spaced-list">
|
||||||
<strong>Teacher</strong>
|
<strong>Teacher</strong>
|
||||||
<a href="http://coderdojo.example.com/">http://coderdojo.example.com/</a>
|
<a href="http://coderdojo.example.com/">coderdojo.example.com</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<p>Global movement of free coding clubs for young people.</p>
|
<p>Global movement of free coding clubs for young people.</p>
|
||||||
|
@ -336,7 +336,7 @@ blockquote > * + * {
|
||||||
</div>
|
</div>
|
||||||
<div class="spaced-list">
|
<div class="spaced-list">
|
||||||
<strong>Information Technology</strong>
|
<strong>Information Technology</strong>
|
||||||
<a href="https://www.ou.edu/">https://www.ou.edu/</a>
|
<a href="https://www.ou.edu/">www.ou.edu</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<p>Bachelor</p>
|
<p>Bachelor</p>
|
||||||
|
@ -410,7 +410,7 @@ blockquote > * + * {
|
||||||
<span>
|
<span>
|
||||||
Published by <strong>Hooli</strong>
|
Published by <strong>Hooli</strong>
|
||||||
</span>
|
</span>
|
||||||
<a href="http://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)">http://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)</a>
|
<a href="http://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)">en.wikipedia.org/wiki/Silicon_Valley_(TV_series)</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<p>Innovative middle-out compression algorithm that changes the way we store data.</p>
|
<p>Innovative middle-out compression algorithm that changes the way we store data.</p>
|
||||||
|
|
Loading…
Reference in New Issue