umberto 10.1.2 → 10.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/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [10.1.4](https://github.com/cksource/umberto/compare/v10.1.3...v10.1.4) (March 20, 2026)
5
+
6
+ ### Other changes
7
+
8
+ * Filter search results from Algolia to match the current docs version: `latest` or `lts-v47`. Filtering remains backward-compatible: hits without the docs version are still allowed.
9
+
10
+
11
+ ## [10.1.3](https://github.com/cksource/umberto/compare/v10.1.2...v10.1.3) (March 10, 2026)
12
+
13
+ ### Bug fixes
14
+
15
+ * Fix regression introduced in `v10.1.2` affecting slugs generated for headings. Slugs generated now should be the same as in `v10.1.1` and previous versions of Umberto.
16
+
17
+
4
18
  ## [10.1.2](https://github.com/cksource/umberto/compare/v10.1.1...v10.1.2) (March 9, 2026)
5
19
 
6
20
  ### Bug fixes
@@ -26,30 +40,6 @@ Changelog
26
40
  * Fixed the deprecation warning regarding the `Sass if() syntax` thrown during building docs.
27
41
  * Disabled inserting a space between the anchor link and heading when converting a document from Markdown to HTML.
28
42
 
29
-
30
- ## [10.0.0](https://github.com/cksource/umberto/compare/v9.4.0...v10.0.0) (February 16, 2026)
31
-
32
- ### BREAKING CHANGES
33
-
34
- * Migrate the package to [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules).
35
- * Remove the `validateW3C` option.
36
-
37
-
38
- ## [9.4.0](https://github.com/cksource/umberto/compare/v9.3.0...v9.4.0) (February 2, 2026)
39
-
40
- ### Features
41
-
42
- * Introduced configuration option to prevent selected project pages from being indexed by search engines. For these projects, the build injects `<meta name="robots" content="noindex, nofollow">` into the page `<head>`.
43
-
44
- * When using `buildSingleProject()`, set the `shouldInjectNoIndexMeta` option in `umberto.json`:
45
- `"shouldInjectNoIndexMeta": true`
46
- * When using `buildMultiProjects()`, set the `nonIndexableProjects` option in `umberto-main.json` using the paths of projects that should not be indexed, e.g.:
47
- `"nonIndexableProjects": [ "projects-external/ckeditor5-commercial/external/ckeditor5", "projects/trial" ]`
48
-
49
- ### Other changes
50
-
51
- * Reduced the size of API docs sidebars by only rendering the full navigation tree for the current package. Other packages now link to their landing pages, significantly lowering total link count and improving build size and performance.
52
-
53
43
  ---
54
44
 
55
45
  To see all releases, visit the [release page](https://github.com/cksource/umberto/releases).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umberto",
3
- "version": "10.1.2",
3
+ "version": "10.1.4",
4
4
  "description": "CKSource Documentation builder",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -33,7 +33,6 @@
33
33
  "hexo-generator-category": "^2.0.0",
34
34
  "hexo-generator-index": "^4.0.0",
35
35
  "hexo-generator-tag": "^2.0.0",
36
- "hexo-util": "^4.0.0",
37
36
  "hexo-renderer-pug": "^3.0.0",
38
37
  "highlight.js": "^11.11.1",
39
38
  "htmlparser2": "^10.0.0",
@@ -41,10 +40,10 @@
41
40
  "jquery": "~3.7.1",
42
41
  "js-beautify": "^1.14.4",
43
42
  "lodash": "^4.17.21",
43
+ "markdown-it": "^14.1.1",
44
44
  "markdown-it-abbr": "^1.0.4",
45
45
  "markdown-it-deflist": "^2.1.0",
46
46
  "markdown-it-emoji": "^2.0.2",
47
- "markdown-it": "^14.1.1",
48
47
  "markdown-it-expand-tabs": "^1.0.13",
49
48
  "markdown-it-footnote": "^3.0.3",
50
49
  "markdown-it-ins": "^3.0.1",
@@ -58,6 +57,7 @@
58
57
  "sass": "^1.54.0",
59
58
  "shiki": "^3.4.0",
60
59
  "sitemap": "^8.0.0",
60
+ "slug": "^11.0.1",
61
61
  "tinypool": "^2.0.0",
62
62
  "tippy.js": "^6.3.7",
63
63
  "tree-model": "^1.0.7",
@@ -6,7 +6,7 @@
6
6
  'use strict';
7
7
 
8
8
  const cloneDeep = require( 'lodash/cloneDeep' );
9
- const { slugize } = require( 'hexo-util' );
9
+ const { default: slugify } = require( 'slug' );
10
10
 
11
11
  class Token {
12
12
  constructor( type, tag, nesting ) {
@@ -31,7 +31,7 @@ const TOC_RE = /^@\[toc\]/i;
31
31
 
32
32
  const repeat = ( string, num ) => new Array( num + 1 ).join( string );
33
33
 
34
- const defaultSlugify = title => slugize( title, { transform: 1 } );
34
+ const defaultSlugify = title => slugify( title, { charmap: { '_': '_' } } );
35
35
 
36
36
  const makeSafe = ( string, localHeadingIds, slugifyFn ) => {
37
37
  const key = slugifyFn( string );
@@ -9,6 +9,7 @@ import { injectScript } from '../helpers/inject-script.js';
9
9
  import { compose } from '../helpers/compose.js';
10
10
 
11
11
  const DOCSEARCH_JS_URL = 'https://cdn.jsdelivr.net/npm/@docsearch/js@3.9.0/dist/umd/index.min.js';
12
+ const LTS_DOC_VERSION_REGEXP = /\/ckeditor5\/(lts-v\d+)(?:\/|$)/;
12
13
 
13
14
  /**
14
15
  * Component responsible for binding the algolia search component to the header.
@@ -60,6 +61,8 @@ export class AlgoliaSearch extends BaseComponent {
60
61
  const { boost, filters } = this;
61
62
  const { slug, tags } = filters;
62
63
 
64
+ const docVersion = window.location.pathname.match( LTS_DOC_VERSION_REGEXP )?.[ 1 ] || 'latest';
65
+
63
66
  window.docsearch( {
64
67
  container: this.elements.wrapper,
65
68
  ...this.config,
@@ -73,7 +76,7 @@ export class AlgoliaSearch extends BaseComponent {
73
76
  client.search = async ( options, ...rest ) => {
74
77
  const { results: [ firstResult ] } = await originalSearch( options, ...rest );
75
78
  const mappedResults = compose(
76
- filterByTags( { slug, tags } ),
79
+ filterResults( { slug, tags, docVersion } ),
77
80
  boostByTags( boost.tags )
78
81
  )( firstResult.hits );
79
82
 
@@ -136,14 +139,15 @@ export class AlgoliaSearch extends BaseComponent {
136
139
  }
137
140
 
138
141
  /**
139
- * Crates filters for Algolia that allow to filter out results from different projects.
140
- * Algolia shares the same index for all projects, so we need to filter results
142
+ * Creates filters for Algolia that allow to filter out results from different projects and types of the documentation (latest vs. LTS).
143
+ * Algolia shares the same index for all projects, so we need to filter results.
141
144
  */
142
- function filterByTags( { slug, tags } ) {
145
+ function filterResults( { slug, tags, docVersion } ) {
143
146
  return hits => hits.filter(
144
147
  hit =>
145
148
  ( !slug || hit.tags.includes( slug ) ) &&
146
- ( !tags || hit.tags.some( tag => tags.includes( tag ) ) )
149
+ ( !tags || hit.tags.some( tag => tags.includes( tag ) ) ) &&
150
+ ( !hit.docVersion || hit.docVersion === docVersion )
147
151
  );
148
152
  }
149
153