umberto 2.1.1 → 2.1.4
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 +1 -1
- package/scripts/helper/find-main-category-page.js +10 -0
- package/scripts/utils/findmaincategorypage.js +20 -0
- package/src/api-builder/api-builder.js +2 -1
- package/src/helpers/get-docsearch-config.js +1 -1
- package/src/hexo/filter/project-locals.js +1 -0
- package/src/tasks/get-project-config.js +5 -0
- package/themes/umberto/layout/_api-docs/api-base.pug +0 -3
- package/themes/umberto/layout/_api-docs/class.pug +6 -1
- package/themes/umberto/layout/_api-docs/interface.pug +5 -0
- package/themes/umberto/layout/_api-docs/mixin.pug +5 -0
- package/themes/umberto/layout/_api-docs/module.pug +5 -0
- package/themes/umberto/layout/_api-docs/namespace.pug +5 -0
- package/themes/umberto/layout/_api-docs/typedef.pug +5 -0
- package/themes/umberto/layout/_mixin/nav-tree-level.pug +4 -0
- package/themes/umberto/layout/_partial/report-issue-widget.pug +1 -0
- package/themes/umberto/layout/api.pug +5 -3
- package/themes/umberto/layout/page.pug +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2017-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
const findMainCategoryPage = require( '../utils/findmaincategorypage.js' );
|
|
9
|
+
|
|
10
|
+
hexo.extend.helper.register( 'findMainCategoryPage', findMainCategoryPage );
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2017-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The function returns a `page` object that represents the main landing page for given category.
|
|
10
|
+
*
|
|
11
|
+
* @param {String} category
|
|
12
|
+
* @param {Object} allPages
|
|
13
|
+
* @param {Array} allPages.data
|
|
14
|
+
* @returns {*}
|
|
15
|
+
*/
|
|
16
|
+
module.exports = function findMainCategoryPage( category, allPages ) {
|
|
17
|
+
return allPages.data
|
|
18
|
+
.filter( page => page.category === category )
|
|
19
|
+
.find( page => page.shortName === 'index' );
|
|
20
|
+
};
|
|
@@ -439,7 +439,8 @@ module.exports = class ApiBuilder {
|
|
|
439
439
|
groups: this._groups,
|
|
440
440
|
slug: this._projectSlug,
|
|
441
441
|
customRanking: this._projectConfig.docsearch ? this._projectConfig.docsearch.customRanking : []
|
|
442
|
-
} )
|
|
442
|
+
} ),
|
|
443
|
+
projectVersion: this._projectConfig.version
|
|
443
444
|
};
|
|
444
445
|
const view = new HtmlFile(
|
|
445
446
|
this._tmplCol.renderTemplate(
|
|
@@ -189,7 +189,7 @@ function getTransformDataFns( groups, slug ) {
|
|
|
189
189
|
'tags.forEach( function( tag ) {',
|
|
190
190
|
'hitsGrouped[ tag ] = hits',
|
|
191
191
|
'.filter( function( h ) {',
|
|
192
|
-
|
|
192
|
+
`return h.tags.includes( '${ slug }' ) && h.tags.includes( tag );`,
|
|
193
193
|
'} )',
|
|
194
194
|
'.slice( 0, 10 )',
|
|
195
195
|
'.map( function( item, idx ) {',
|
|
@@ -271,6 +271,11 @@ function validateCategories( category, uniqueIds ) {
|
|
|
271
271
|
|
|
272
272
|
uniqueIds.add( category.id );
|
|
273
273
|
|
|
274
|
+
// The "navigationIncludeIndex" option is supported only for top-level categories.
|
|
275
|
+
if ( typeof category.navigationIncludeIndex !== 'undefined' ) {
|
|
276
|
+
throw new Error( `The "navigationIncludeIndex" option is supported only for top-level categories. Found in "${ category.id }".` );
|
|
277
|
+
}
|
|
278
|
+
|
|
274
279
|
// Check nested categories only if the value is an array.
|
|
275
280
|
if ( !isArray( category.categories ) ) {
|
|
276
281
|
return;
|
|
@@ -2,4 +2,9 @@ extends api-base
|
|
|
2
2
|
include ./_mixin/_api-title
|
|
3
3
|
|
|
4
4
|
block prepend content
|
|
5
|
-
+apiTitle( { iconPath: 'assets/' + umbertoVersion + '/img/cog.svg', kind: 'Class' } )
|
|
5
|
+
+apiTitle( { iconPath: 'assets/' + umbertoVersion + '/img/cog.svg', kind: 'Class' } )
|
|
6
|
+
|
|
7
|
+
//- Make sure to add the report issue widget at the end of the page.
|
|
8
|
+
block append content
|
|
9
|
+
if page.reportIssueWidget
|
|
10
|
+
include ../_partial/report-issue-widget
|
|
@@ -3,3 +3,8 @@ include ./_mixin/_api-title
|
|
|
3
3
|
|
|
4
4
|
block prepend content
|
|
5
5
|
+apiTitle( { iconPath: 'assets/' + umbertoVersion + '/img/arrows.svg', kind: 'Interface' } )
|
|
6
|
+
|
|
7
|
+
//- Make sure to add the report issue widget at the end of the page.
|
|
8
|
+
block append content
|
|
9
|
+
if page.reportIssueWidget
|
|
10
|
+
include ../_partial/report-issue-widget
|
|
@@ -3,3 +3,8 @@ include ./_mixin/_api-title
|
|
|
3
3
|
|
|
4
4
|
block prepend content
|
|
5
5
|
+apiTitle( { iconPath: 'assets/' + umbertoVersion + '/img/cog.svg', kind: 'Mixin' } )
|
|
6
|
+
|
|
7
|
+
//- Make sure to add the report issue widget at the end of the page.
|
|
8
|
+
block append content
|
|
9
|
+
if page.reportIssueWidget
|
|
10
|
+
include ../_partial/report-issue-widget
|
|
@@ -3,3 +3,8 @@ include ./_mixin/_api-title
|
|
|
3
3
|
|
|
4
4
|
block prepend content
|
|
5
5
|
+apiTitle( { iconPath: 'assets/' + umbertoVersion + '/img/box-red.svg', kind: 'Module' } )
|
|
6
|
+
|
|
7
|
+
//- Make sure to add the report issue widget at the end of the page.
|
|
8
|
+
block append content
|
|
9
|
+
if page.reportIssueWidget
|
|
10
|
+
include ../_partial/report-issue-widget
|
|
@@ -3,3 +3,8 @@ include ./_mixin/_api-title
|
|
|
3
3
|
|
|
4
4
|
block prepend content
|
|
5
5
|
+apiTitle( { iconPath: 'assets/' + umbertoVersion + '/img/box-brown.svg', kind: 'Namespace' } )
|
|
6
|
+
|
|
7
|
+
//- Make sure to add the report issue widget at the end of the page.
|
|
8
|
+
block append content
|
|
9
|
+
if page.reportIssueWidget
|
|
10
|
+
include ../_partial/report-issue-widget
|
|
@@ -11,11 +11,15 @@ mixin navTreeLevel( data, isRoot )
|
|
|
11
11
|
- const shouldPrintSubTree = dataArr.filter( item => item.title || item.hasDescendentLeaf ).length || projectLocals.navigationShowEmptyCategories
|
|
12
12
|
|
|
13
13
|
if isRoot
|
|
14
|
+
if data.navigationIncludeIndex
|
|
15
|
+
+navTreeItem( findMainCategoryPage( data.id, site.pages ) )
|
|
16
|
+
|
|
14
17
|
each item in dataArr
|
|
15
18
|
if item.name
|
|
16
19
|
+navTreeLevel( item, false )
|
|
17
20
|
else
|
|
18
21
|
+navTreeItem( item )
|
|
22
|
+
|
|
19
23
|
//- We don't want to display empty categories (#523).
|
|
20
24
|
else if shouldPrintSubTree
|
|
21
25
|
li
|
|
@@ -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
|
|
@@ -9,9 +9,11 @@ block content
|
|
|
9
9
|
|
|
10
10
|
!= split.content
|
|
11
11
|
|
|
12
|
-
if page.reportIssueWidget
|
|
13
|
-
include _partial/report-issue-widget
|
|
14
|
-
|
|
15
12
|
block navtree
|
|
16
13
|
if projectLocals && projectLocals.apiTree
|
|
17
14
|
!= projectLocals.apiTree
|
|
15
|
+
|
|
16
|
+
//- Make sure to add the report issue widget at the end of the page.
|
|
17
|
+
block append content
|
|
18
|
+
if page.reportIssueWidget
|
|
19
|
+
include _partial/report-issue-widget
|