Skip to content

Commit 82c4c69

Browse files
committed
Adding source Url pattern to the embed configs
1 parent 33209c8 commit 82c4c69

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

build/createFiddleFiles.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,14 @@ module.exports = function(options) {
6767
var contents, stream, $,
6868
basePath = path.dirname(file.path),
6969
relativePath = basePath.split("HTMLSamples").pop().replace(/\\/g, "/"),
70+
originalPath = "HTMLSamples" + file.history[0].split("HTMLSamples").pop().replace(/\\/g, "/"),
7071
htmlFile, jsFile, cssFile,
7172
html = [], js = "", css = "",
7273
resultStr = file.lang === "ja" ? options.strings.resultJA : options.strings.resultEN,
7374
embed = {
74-
"embed": [{
75+
//use original file path for source link
76+
"srcUrlPattern" : path.posix.join("/${owner}/${repo}-src/blob/", options.version, originalPath),
77+
"embed": [{
7578
"label": "JS",
7679
"path": path.posix.join(options.version, relativePath, "fiddle/demo.js")
7780
},{

0 commit comments

Comments
 (0)