umberto 6.1.0 → 6.1.2
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/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/scripts/filter/before-post-render/has-own-favicons.js +12 -0
- package/scripts/utils/has-own-favicons.js +48 -0
- package/src/data-converter/converters/typedoc/typedocconverter.js +4 -1
- package/themes/umberto/layout/gloria/_api-docs/_mixin/_type.pug +11 -4
- package/themes/umberto/layout/gloria/_partial/head.pug +7 -4
- package/themes/umberto/layout/umberto/_partial/head.pug +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [6.1.2](https://github.com/cksource/umberto/compare/v6.1.1...v6.1.2) (2025-04-23)
|
|
5
|
+
|
|
6
|
+
### Bug fixes
|
|
7
|
+
|
|
8
|
+
* Umberto attempts to load the theme's favicons in case a project does not define its own, rather than generating links to non-existent resources. Closes [#1256](https://github.com/cksource/umberto/issues/1256). ([commit](https://github.com/cksource/umberto/commit/a6de17b195a67e78010773f420e54fa16b154378))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## [6.1.1](https://github.com/cksource/umberto/compare/v6.1.0...v6.1.1) (2025-04-17)
|
|
12
|
+
|
|
13
|
+
### Bug fixes
|
|
14
|
+
|
|
15
|
+
* Displaying arguments names in callbacks before the types in API docs. ([commit](https://github.com/cksource/umberto/commit/2974f7f34b4549907d233b35bd3b0756d0d1177e))
|
|
16
|
+
|
|
17
|
+
|
|
4
18
|
## [6.1.0](https://github.com/cksource/umberto/compare/v6.0.0...v6.1.0) (2025-04-15)
|
|
5
19
|
|
|
6
20
|
### Features
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
const hasOwnFavicons = require( '../../utils/has-own-favicons' );
|
|
9
|
+
|
|
10
|
+
hexo.extend.filter.register( 'before_post_render', data => {
|
|
11
|
+
return hasOwnFavicons( data, hexo );
|
|
12
|
+
} );
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
const upath = require( 'upath' );
|
|
9
|
+
const fs = require( 'fs' );
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Checks if the project has its own favicons. If so, they will be used when rendering meta tags (`<link rel="icon">`).
|
|
13
|
+
*
|
|
14
|
+
* Otherwise, the default favicons will be used.
|
|
15
|
+
*
|
|
16
|
+
* @param {object} page
|
|
17
|
+
* @param {string} page.projectName
|
|
18
|
+
* @param {boolean} page.hasOwnAssets
|
|
19
|
+
* @param {object} hexo
|
|
20
|
+
* @param {Object.<string, ProjectGlobalConfig>} hexo.projectGlobals
|
|
21
|
+
* @returns {*}
|
|
22
|
+
*/
|
|
23
|
+
module.exports = function hasOwnFavicons( page, hexo ) {
|
|
24
|
+
const projectConfig = hexo.projectGlobals[ page.projectName ];
|
|
25
|
+
|
|
26
|
+
let hasOwnAssets = false;
|
|
27
|
+
|
|
28
|
+
if ( projectConfig ) {
|
|
29
|
+
const { config } = hexo.projectGlobals[ page.projectName ];
|
|
30
|
+
|
|
31
|
+
if ( config ) {
|
|
32
|
+
hasOwnAssets = fs.existsSync(
|
|
33
|
+
upath.join( config.projectRootPath, 'docs', 'assets', 'img', 'favicons', '96x96.png' )
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
page.hasOwnAssets = hasOwnAssets;
|
|
39
|
+
|
|
40
|
+
return page;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @typedef {object} ProjectGlobalConfig
|
|
45
|
+
* @property {string} projectRootPath
|
|
46
|
+
* @property {object} config
|
|
47
|
+
* @property {string} config.projectRootPath
|
|
48
|
+
*/
|
|
@@ -694,7 +694,10 @@ class TypeConverter {
|
|
|
694
694
|
const isClass = signature.kindString === 'Constructor signature';
|
|
695
695
|
|
|
696
696
|
const params = ( signature.parameters || [] )
|
|
697
|
-
.map( singleType =>
|
|
697
|
+
.map( singleType => ( {
|
|
698
|
+
name: singleType.name,
|
|
699
|
+
type: this.convert( singleType.type )
|
|
700
|
+
} ) )
|
|
698
701
|
.filter( Boolean );
|
|
699
702
|
|
|
700
703
|
const returns = signature.type ? this.convert( signature.type ) : null;
|
|
@@ -125,10 +125,17 @@ mixin renderInlineFunction( callback )
|
|
|
125
125
|
|
|
126
126
|
//- (2) Arguments parsing. They are seperated by coma (`, `).
|
|
127
127
|
each paramObject, paramIndex in callback.params
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
if ( 'name' in paramObject && 'type' in paramObject )
|
|
129
|
+
//- (3.a) Process a single argument when it is an object.
|
|
130
|
+
| #{ paramObject.name }:
|
|
131
|
+
+renderType( paramObject.type )
|
|
132
|
+
if paramIndex < callback.params.length - 1
|
|
133
|
+
| !{ ', ' }
|
|
134
|
+
else
|
|
135
|
+
//- (3.b) Process a single argument.
|
|
136
|
+
+renderType( paramObject )
|
|
137
|
+
if paramIndex < callback.params.length - 1
|
|
138
|
+
| !{ ', ' }
|
|
132
139
|
|
|
133
140
|
//- (4) Close the parenthesis. Define the returned type.
|
|
134
141
|
//- It prints ` ) => ` or `) => ` depending on required arguments by the callback.
|
|
@@ -43,10 +43,13 @@ if page.BASE_PATH && page.BASE_PATH !== '.' && !page.BASE_PATH.includes( 'latest
|
|
|
43
43
|
link( rel = 'canonical' href = page.canonicalUrlBeginning + page.path.replace( page.BASE_PATH, projectLocals.latestBasePath ) )
|
|
44
44
|
|
|
45
45
|
if page.BASE_PATH
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
link( rel="
|
|
46
|
+
//- When a project does not define its own assets, let's use the default ones (from a theme).
|
|
47
|
+
//- See: #1256.
|
|
48
|
+
- const basePath = !page.hasOwnAssets ? '' : page.BASE_PATH;
|
|
49
|
+
link( rel="icon" type="image/png" href=relative_url( page.path, pathJoin( basePath, 'assets/img/favicons/16x16.png' ) ) sizes="16x16" )
|
|
50
|
+
link( rel="icon" type="image/png" href=relative_url( page.path, pathJoin( basePath, 'assets/img/favicons/32x32.png' ) ) sizes="32x32" )
|
|
51
|
+
link( rel="icon" type="image/png" href=relative_url( page.path, pathJoin( basePath, 'assets/img/favicons/96x96.png' ) ) sizes="96x96" )
|
|
52
|
+
link( rel="apple-touch-icon" type="image/png" href=relative_url( page.path, pathJoin( basePath, 'assets/img/favicons/200x200.png' ) ) )
|
|
50
53
|
|
|
51
54
|
if ( docSearchConfig && docSearchConfig.isEnabled && !disableSearch && (!projectLocals || !projectLocals.disableSearch) )
|
|
52
55
|
link( rel = 'stylesheet', href = docSearchConfig.css )
|
|
@@ -43,10 +43,13 @@ if page.BASE_PATH && page.BASE_PATH !== '.' && !page.BASE_PATH.includes( 'latest
|
|
|
43
43
|
link( rel = 'canonical' href = page.canonicalUrlBeginning + page.path.replace( page.BASE_PATH, projectLocals.latestBasePath ) )
|
|
44
44
|
|
|
45
45
|
if page.BASE_PATH
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
link( rel="
|
|
46
|
+
//- When a project does not define its own assets, let's use the default ones (from a theme).
|
|
47
|
+
//- See: #1256.
|
|
48
|
+
- const basePath = !page.hasOwnAssets ? '' : page.BASE_PATH;
|
|
49
|
+
link( rel="icon" type="image/png" href=relative_url( page.path, pathJoin( basePath, 'assets/img/favicons/16x16.png' ) ) sizes="16x16" )
|
|
50
|
+
link( rel="icon" type="image/png" href=relative_url( page.path, pathJoin( basePath, 'assets/img/favicons/32x32.png' ) ) sizes="32x32" )
|
|
51
|
+
link( rel="icon" type="image/png" href=relative_url( page.path, pathJoin( basePath, 'assets/img/favicons/96x96.png' ) ) sizes="96x96" )
|
|
52
|
+
link( rel="apple-touch-icon" type="image/png" href=relative_url( page.path, pathJoin( basePath, 'assets/img/favicons/200x200.png' ) ) )
|
|
50
53
|
|
|
51
54
|
if ( docSearchConfig && docSearchConfig.isEnabled && !disableSearch && (!projectLocals || !projectLocals.disableSearch) )
|
|
52
55
|
link( rel = 'stylesheet', href = docSearchConfig.css )
|