Skip to content

Commit 802ec8c

Browse files
author
Janaka-Steph
committed
Fix show me the code
1 parent e7af140 commit 802ec8c

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

antora-playbook.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ asciidoc:
2121
#author: Stéphane Roche <[email protected]>
2222
description: 'Non-official Bitcoin Programming with BitcoinJS, Bitcoin Core and LND extensive guide'
2323
keywords: 'bitcoin, bitcoin core, lnd, lightning network, programming'
24-
codebaseurl: 'https://github.com/bitcoin-studio/Bitcoin-Programming-with-BitcoinJS/blob/master/code/'
24+
# handlebar replace helper will replace '{page-origin-branch}'
25+
codebaseurl: 'https://github.com/bitcoin-studio/Bitcoin-Programming-with-BitcoinJS/blob/{page-origin-branch}/code/'
2526
runtime:
2627
fetch: true

ui/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
13
1+
12

ui/src/helpers/replace.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict'
2+
3+
module.exports = (str, from, to) => str.replace(from, to)

ui/src/partials/toolbar.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
{{#if page.attributes.codeurl}}
1010
<div class="quicklink quicklink__code">
11-
<a href="{{page.attributes.codeurl}}" target="_blank">
11+
<a href="{{replace page.attributes.codeurl '{page-origin-branch}' page.origin.branch}}" target="_blank">
1212
<i class="fas fa-code"></i>
1313
</a>
1414
</div>
1515
{{/if}}
1616

1717
{{#if page.attributes.codeurl2}}
1818
<div class="quicklink quicklink__code">
19-
<a href="{{page.attributes.codeurl2}}" target="_blank">
19+
<a href="{{replace page.attributes.codeurl2 '{page-origin-branch}' page.origin.branch}}" target="_blank">
2020
<i class="fas fa-code"></i>
2121
</a>
2222
</div>

0 commit comments

Comments
 (0)