umberto 2.1.0 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umberto",
3
- "version": "2.1.0",
3
+ "version": "2.1.3",
4
4
  "description": "CKSource Documentation builder",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -437,8 +437,10 @@ module.exports = class ApiBuilder {
437
437
  getLinkToSource: githubUrlUtils.getFullGithubLink.bind( this ),
438
438
  docSearchConfig: getDocSearchConfig( this._docSearch, {
439
439
  groups: this._groups,
440
+ slug: this._projectSlug,
440
441
  customRanking: this._projectConfig.docsearch ? this._projectConfig.docsearch.customRanking : []
441
- } )
442
+ } ),
443
+ projectVersion: this._projectConfig.version
442
444
  };
443
445
  const view = new HtmlFile(
444
446
  this._tmplCol.renderTemplate(
@@ -10,6 +10,7 @@ const { cloneDeep } = require( 'lodash' );
10
10
 
11
11
  module.exports = ( searchConfig, {
12
12
  groups = [],
13
+ slug = '',
13
14
  customRanking = []
14
15
  } = {} ) => {
15
16
  if ( !searchConfig ) {
@@ -53,7 +54,7 @@ module.exports = ( searchConfig, {
53
54
  ].join( '\n' )
54
55
  };
55
56
 
56
- const transformDataFunctions = getTransformDataFns( groups );
57
+ const transformDataFunctions = getTransformDataFns( groups, slug );
57
58
 
58
59
  if ( transformDataFunctions ) {
59
60
  for ( const tag of Object.keys( transformDataFunctions ) ) {
@@ -86,7 +87,7 @@ module.exports = ( searchConfig, {
86
87
  return docSearchConfig;
87
88
  };
88
89
 
89
- function getTransformDataFns( groups ) {
90
+ function getTransformDataFns( groups, slug ) {
90
91
  if ( !Array.isArray( groups ) || groups.length === 0 ) {
91
92
  return null;
92
93
  }
@@ -114,7 +115,7 @@ function getTransformDataFns( groups ) {
114
115
 
115
116
  `hitsGrouped[ '${ g.slug }' ] = hits`,
116
117
  '.filter( function( h ) {',
117
- `return h.tags.includes( '${ g.slug }' );`,
118
+ `return h.tags.includes( '${ slug }' ) && h.tags.includes( '${ g.slug }' );`,
118
119
  '} )',
119
120
  '.slice( 0, 7 )',
120
121
  '.map( function( item, idx ) {',
@@ -127,7 +128,7 @@ function getTransformDataFns( groups ) {
127
128
  `if ( tag !== '${ g.slug }' ) {`,
128
129
  'hitsGrouped[ tag ] = hits',
129
130
  '.filter( function( h ) {',
130
- 'return h.tags.includes( tag );',
131
+ `return h.tags.includes( '${ slug }' ) && h.tags.includes( tag );`,
131
132
  '} )',
132
133
  '.slice( 0, 10 )',
133
134
  '.map( function( item, idx ) {',
@@ -188,7 +189,7 @@ function getTransformDataFns( groups ) {
188
189
  'tags.forEach( function( tag ) {',
189
190
  'hitsGrouped[ tag ] = hits',
190
191
  '.filter( function( h ) {',
191
- 'return h.tags.includes( tag );',
192
+ `return h.tags.includes( '${ slug }' ) && h.tags.includes( tag );`,
192
193
  '} )',
193
194
  '.slice( 0, 10 )',
194
195
  '.map( function( item, idx ) {',
@@ -63,11 +63,13 @@ module.exports = ( ctx, {
63
63
  disableSearch: config.docsearch === false,
64
64
  docSearchConfig: getDocSearchConfig( docSearch, {
65
65
  groups: config.groups,
66
+ slug: config.slug,
66
67
  customRanking: config.docsearch ? config.docsearch.customRanking : []
67
68
  } ),
68
69
  repoUrl: config.repoUrl,
69
70
  og: config.og,
70
71
  projectSlug: config.slug,
72
+ projectVersion: config.version,
71
73
  navigationShowEmptyCategories
72
74
  };
73
75
  }
@@ -156,6 +156,7 @@ module.exports = class SdkBuilder {
156
156
  projectSlug,
157
157
  docSearchConfig: getDocSearchConfig( this._docSearch, {
158
158
  groups: this.projectConfig.groups,
159
+ slug: this.projectConfig.slug,
159
160
  customRanking: this.projectConfig.docsearch ? this.projectConfig.docsearch.customRanking : []
160
161
  } )
161
162
  };
@@ -2,6 +2,7 @@
2
2
  - const shortPageUrl = page.path.split( '/' ).slice( 2 ).join( '/' )
3
3
  - const githubUrl = new URL( page.reportIssueWidget );
4
4
  - githubUrl.searchParams.set( 'title', 'Docs issue report from "' + shortPageUrl + '"' );
5
+ - githubUrl.searchParams.set( 'project-version', projectLocals.projectVersion );
5
6
 
6
7
  div.info-box.notice.notice__feedback
7
8
  p