Skip to content

Commit 46c944f

Browse files
carly-bartelhuguestenniercaitlin_wheelesscaitlinwheeless
authored
docs: Style and content updates (#5407)
style and content updates to open source and enterprise docs --------- Co-authored-by: Hugues Tennier <[email protected]> Co-authored-by: caitlin_wheeless <[email protected]> Co-authored-by: caitlin_wheeless <[email protected]>
1 parent 8090c77 commit 46c944f

File tree

418 files changed

+2965
-14517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

418 files changed

+2965
-14517
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,6 @@ docker-compose.override.yml
7777

7878
# actions-hub
7979
.github/actions-hub
80+
81+
# Local Netlify folder
82+
.netlify

docs/netlify.toml

+24-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
[[redirects]]
2-
from = "https://heartex-docs.netlify.app/api/*"
3-
to = "https://app.heartex.com/docs/api/:splat"
4-
status = 301
5-
force = true
2+
from = "https://heartex-docs.netlify.app/api/*"
3+
to = "https://app.heartex.com/docs/api/:splat"
4+
status = 301
5+
force = true
66

77
[[redirects]]
8-
from = "https://docs.humansignal.com/api/*"
9-
to = "https://app.heartex.com/docs/api/:splat"
10-
status = 301
11-
force = true
8+
from = "https://docs.humansignal.com/api/*"
9+
to = "https://app.heartex.com/docs/api/:splat"
10+
status = 301
11+
force = true
1212

1313
[[redirects]]
14-
from = "/guide/starter_cloud"
15-
to = "https://humansignal.com/platform/starter-cloud/manage"
16-
status = 301
17-
force = true
18-
14+
from = "/guide/starter_cloud"
15+
to = "https://humansignal.com/platform/starter-cloud/manage"
16+
status = 301
17+
force = true
18+
1919
[[redirects]]
20-
from = "/"
21-
to = "/guide"
22-
status = 301
23-
force = true
20+
from = "/"
21+
to = "/guide"
22+
status = 301
23+
force = true
2424

2525
[[redirects]]
26-
from = "/*"
27-
to = "/404.html"
28-
status = 404
26+
from = "/*"
27+
to = "/404.html"
28+
status = 404
29+
30+
[dev]
31+
command = "yarn start"
32+
targetPort = 4000

docs/netlify/edge-functions/open-graph-image.tsx

+77
Large diffs are not rendered by default.

docs/scripts/breadcrumb.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ var fs = require('hexo-fs');
33
var fm = require('front-matter')
44

55
module.exports = function(ctx) {
6-
return function includeTag({pageType, parentPage, currentPage}) {
7-
const parentFile = `${pageType}/${parentPage}.md`;
6+
return function includeTag({pageType, parentPage, currentPage, parentPageExtension = "md"}) {
7+
const parentFile = `${pageType}/${parentPage}.${parentPageExtension}`;
88
var path = pathFn.join(ctx.source_dir, parentFile);
99

1010
// exit if path is not defined
@@ -26,4 +26,4 @@ module.exports = function(ctx) {
2626
</nav>
2727
`
2828
};
29-
};
29+
};

docs/scripts/getRecentReleaseNotes.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
var HTMLParser = require("node-html-parser");
2+
3+
hexo.extend.helper.register('getRecentReleaseNotes', function() {
4+
5+
const compareVersions = (a, b) => {
6+
const versionRegExp = /(?<x>\d+)?\.(?<y>\d+)?\.(?<z>\d+)?(?<t>\.dev|dev-|-|\.post)?(?<n>\d+)?/;
7+
const aMatch = a.fileName.match(versionRegExp);
8+
const bMatch = b.fileName.match(versionRegExp);
9+
const toInt = (a, d) => a.groups[d]? a.groups[d] * 1 : 0;
10+
for (let d of ['x', 'y', 'z', 'n']) {
11+
const aMatchInt = toInt(aMatch, d);
12+
const bMatchInt = toInt(bMatch, d);
13+
if (aMatchInt === bMatchInt)
14+
continue;
15+
return bMatchInt - aMatchInt;
16+
}
17+
return 0
18+
};
19+
20+
const data = this.site.pages.filter(page => page.source.includes('release_notes') && !page.source.includes('index.md'));
21+
22+
const releaseNotes = data.map((note) => {
23+
24+
const fileName = note.source.split("/")[3];
25+
if(!fileName) return;
26+
27+
const template = HTMLParser.parse(note.content);
28+
29+
const h2 = template.querySelector("h2")
30+
const title = h2.text;
31+
const id = h2.id;
32+
33+
return {
34+
fileName,
35+
title,
36+
id
37+
}
38+
})
39+
40+
releaseNotes.sort(compareVersions);
41+
42+
const recentReleaseNotes = releaseNotes.slice(0, 3);
43+
44+
return recentReleaseNotes;
45+
});

docs/scripts/release-notes.js

+36-27
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,44 @@ const fs = require("hexo-fs");
22
const concatMd = require("concat-md");
33

44
hexo.extend.filter.register("after_init", async function () {
5-
const compareVersions = (a, b) => {
6-
const versionRegExp = /(?<x>\d+)?\.(?<y>\d+)?\.(?<z>\d+)?(?<t>\.dev|dev-|-|\.post)?(?<n>\d+)?/;
7-
const aMatch = a.match(versionRegExp);
8-
const bMatch = b.match(versionRegExp);
9-
const toInt = (a, d) => a.groups[d]? a.groups[d] * 1 : 0;
10-
for (let d of ['x', 'y', 'z', 'n']) {
11-
const aMatchInt = toInt(aMatch, d);
12-
const bMatchInt = toInt(bMatch, d);
13-
if (aMatchInt === bMatchInt)
14-
continue;
15-
return bMatchInt - aMatchInt;
16-
}
17-
return 0
18-
};
19-
20-
const markdownFiles = await concatMd.default(
21-
"source/guide/release_notes/onprem", {sorter: compareVersions}
22-
);
23-
24-
const frontmatter = `---
5+
const compareVersions = (a, b) => {
6+
const versionRegExp =
7+
/(?<x>\d+)?\.(?<y>\d+)?\.(?<z>\d+)?(?<t>\.dev|dev-|-|\.post)?(?<n>\d+)?/;
8+
const aMatch = a.match(versionRegExp);
9+
const bMatch = b.match(versionRegExp);
10+
const toInt = (a, d) => (a.groups[d] ? a.groups[d] * 1 : 0);
11+
for (let d of ["x", "y", "z", "n"]) {
12+
const aMatchInt = toInt(aMatch, d);
13+
const bMatchInt = toInt(bMatch, d);
14+
if (aMatchInt === bMatchInt) continue;
15+
return bMatchInt - aMatchInt;
16+
}
17+
return 0;
18+
};
19+
20+
const markdownFiles = await concatMd.default(
21+
"source/guide/release_notes/onprem",
22+
{ sorter: compareVersions, joinString: "\n\n\n\n\n\n-----newfile-----" }
23+
);
24+
25+
const wrappedPages = markdownFiles
26+
.split("\n-----newfile-----")
27+
.map(
28+
(page) =>
29+
`<div class="release-note"><button class="release-note-toggle"></button>${page}</div>`
30+
)
31+
.join("");
32+
33+
const frontmatter = `---
2534
NOTE: Don't change release_notes.md manually, it's automatically built from onprem/*.md files on hexo server run!
2635
2736
title: On-Premises Release Notes for Label Studio Enterprise
2837
short: On-Prem Release Notes
2938
type: guide
3039
tier: enterprise
3140
order: 0
32-
order_enterprise: 999
33-
section: "Reference"
41+
order_enterprise: 451
42+
section: "What's New"
3443
meta_title: On-premises release notes for Label Studio Enterprise
3544
meta_description: Review new features, enhancements, and bug fixes for on-premises Label Studio Enterprise installations.
3645
---
@@ -43,10 +52,10 @@ meta_description: Review new features, enhancements, and bug fixes for on-premis
4352
4453
`;
4554

46-
const finalString = frontmatter + markdownFiles;
55+
const finalString = frontmatter + wrappedPages;
4756

48-
//writing to file
49-
fs.writeFile("source/guide/release_notes.md", finalString, (err) => {
50-
console.log(err);
51-
});
57+
//writing to file
58+
fs.writeFile("source/guide/release_notes.md", finalString, (err) => {
59+
console.log(err);
60+
});
5261
});

docs/source/blog/6-costly-data-labeling-mistakes-and-how-to-avoid-them.md

-127
This file was deleted.

0 commit comments

Comments
 (0)