Skip to content

Commit

Permalink
Alright, don't force Strip Protocol. Good refresher though
Browse files Browse the repository at this point in the history
  • Loading branch information
aegershman committed May 6, 2022
1 parent c9422e2 commit 8fc80a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ fs.readdirSync(partialsDir)
Handlebars.registerPartial(path.basename(filename, extname), template),
)

Handlebars.registerHelper('STRIP_PROTOCOL', urlStr => {
const result = urlStr.replace(/(^\w+:|^)\/\//, '');
return result;
})
// Handlebars.registerHelper('STRIP_PROTOCOL', urlStr => {
// const result = urlStr.replace(/(^\w+:|^)\/\//, '');
// return result;
// })

Handlebars.registerHelper('MONTH_YEAR', dateString =>
// https://dockyard.com/blog/2020/02/14/you-probably-don-t-need-moment-js-anymore
Expand Down
3 changes: 2 additions & 1 deletion partials/basics.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
{{#if url}}
<span class='divider'>|</span>
<span class='url'>
<a href='{{url}}'>{{STRIP_PROTOCOL url}}</a>
{{!-- <a href='{{url}}'>{{STRIP_PROTOCOL url}}</a> --}}
<a href='{{url}}'>{{url}}</a>
</span>
{{/if}}
{{#location}}
Expand Down

0 comments on commit 8fc80a0

Please sign in to comment.