Comparing version 2.1.1 to 3.0.0
@@ -214,4 +214,4 @@ 'use strict'; | ||
// learn/#{organisation}/#{project}/#{category}/#{filename} | ||
var pathDetailsRegexString = '\n\t\t\t^\n\t\t\t.*?learn/\n\t\t\t(.+?)/ // organisation\n\t\t\t(.+?)/ // project\n\t\t\t(.+?)/ // category\n\t\t\t(.+?)\\. // basename\n\t\t\t(.+?) // extension\n\t\t\t$'.replace(/\/\/.+/g, '').replace(/\s/g, ''); | ||
// learn/#{organisation}-${repo}/#{project}/#{category}/#{filename} | ||
var pathDetailsRegexString = '\n\t\t\t^\n\t\t\t.*?learn/\n\t\t\t(.+?)-(.+?)/ // organisation - repo\n\t\t\t(.+?)/ // project\n\t\t\t(.+?)/ // category\n\t\t\t(.+?)\\. // basename\n\t\t\t(.+?) // extension\n\t\t\t$'.replace(/\/\/.+/g, '').replace(/\s/g, ''); | ||
var pathDetailsRegex = new RegExp(pathDetailsRegexString); | ||
@@ -226,9 +226,9 @@ var pathDetails = pathDetailsRegex.exec(a.relativePath); | ||
if (pathDetails != null) { | ||
var organisationDirectory = pathDetails[1]; | ||
var projectDirectory = pathDetails[2]; | ||
var categoryDirectory = pathDetails[3]; | ||
var basename = pathDetails[4]; | ||
var projectDirectory = pathDetails[3]; | ||
var categoryDirectory = pathDetails[4]; | ||
var basename = pathDetails[5]; | ||
var extension = pathDetails[6]; | ||
// const organisation = organisationDirectory.replace(/[-0-9]+/, '') | ||
var projectId = projectDirectory.replace(/[-0-9]+/, ''); | ||
// const organisation = organisationDirectory.replace(/^[-0-9]+/, '') | ||
var projectId = projectDirectory.replace(/^[-0-9]+/, ''); | ||
var categoryId = categoryDirectory.replace(/^[-0-9]+/, ''); | ||
@@ -240,5 +240,5 @@ | ||
var githubEditUrl = 'https://github.com/' + organisationDirectory + '/' + projectDirectory + '/edit/master/'; | ||
// const proseEditUrl = `http://prose.io/#${organisationDirectory}/${projectDirectory}/edit/master/` | ||
var editUrl = githubEditUrl + a.relativePath.replace('learn/' + organisationDirectory + '/' + projectDirectory + '/', ''); | ||
var githubEditUrl = config.projects[projectId].editUrl + categoryDirectory + '/' + basename + '.' + extension; | ||
// const proseEditUrl = githubEditUrl.replace('github.com', 'prose.io') | ||
var editUrl = githubEditUrl; | ||
@@ -245,0 +245,0 @@ // Indexes |
# History | ||
## v3.0.0 2017 March 22 | ||
- `src/learn/organisation/project` -> `src/learn/organisation-repo/project` | ||
## v2.1.1 2017 March 22 | ||
@@ -4,0 +7,0 @@ - Fix edit links not showing |
{ | ||
"name": "outpatient", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"description": "helpers for bevry websites", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/bevry/outpatient", |
@@ -202,7 +202,7 @@ 'use strict' | ||
// learn/#{organisation}/#{project}/#{category}/#{filename} | ||
// learn/#{organisation}-${repo}/#{project}/#{category}/#{filename} | ||
const pathDetailsRegexString = ` | ||
^ | ||
.*?learn/ | ||
(.+?)/ // organisation | ||
(.+?)-(.+?)/ // organisation - repo | ||
(.+?)/ // project | ||
@@ -222,9 +222,9 @@ (.+?)/ // category | ||
if (pathDetails != null) { | ||
const organisationDirectory = pathDetails[1] | ||
const projectDirectory = pathDetails[2] | ||
const categoryDirectory = pathDetails[3] | ||
const basename = pathDetails[4] | ||
const projectDirectory = pathDetails[3] | ||
const categoryDirectory = pathDetails[4] | ||
const basename = pathDetails[5] | ||
const extension = pathDetails[6] | ||
// const organisation = organisationDirectory.replace(/[-0-9]+/, '') | ||
const projectId = projectDirectory.replace(/[-0-9]+/, '') | ||
// const organisation = organisationDirectory.replace(/^[-0-9]+/, '') | ||
const projectId = projectDirectory.replace(/^[-0-9]+/, '') | ||
const categoryId = categoryDirectory.replace(/^[-0-9]+/, '') | ||
@@ -236,5 +236,5 @@ | ||
const githubEditUrl = `https://github.com/${organisationDirectory}/${projectDirectory}/edit/master/` | ||
// const proseEditUrl = `http://prose.io/#${organisationDirectory}/${projectDirectory}/edit/master/` | ||
const editUrl = githubEditUrl + a.relativePath.replace(`learn/${organisationDirectory}/${projectDirectory}/`, '') | ||
const githubEditUrl = config.projects[projectId].editUrl + categoryDirectory + '/' + basename + '.' + extension | ||
// const proseEditUrl = githubEditUrl.replace('github.com', 'prose.io') | ||
const editUrl = githubEditUrl | ||
@@ -241,0 +241,0 @@ // Indexes |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48730