Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKati Paizee <kpaizee@gitlab.com>2022-11-23 12:47:04 +0300
committerKati Paizee <kpaizee@gitlab.com>2022-11-23 12:47:04 +0300
commitdf2068e74ff4036946da168e74ca77ac3aaa0ab5 (patch)
treeb67d68be6ee35714ec9fefce9a89a99df35c7145
parentf16d3590d93f434fd944f00d1d3572d1faee3737 (diff)
parenta7b878a3fe879de16cb39f225694cd0ff346e5d0 (diff)
Merge branch 'sarahg/nav-report-skip-deprecated' into 'main'
Ignore pages with deprecated features in the navigation report Closes #1317 See merge request https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/3299 Merged-by: Kati Paizee <kpaizee@gitlab.com> Approved-by: Kati Paizee <kpaizee@gitlab.com> Co-authored-by: Sarah German <sgerman@gitlab.com>
-rwxr-xr-xscripts/pages_not_in_nav.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/pages_not_in_nav.js b/scripts/pages_not_in_nav.js
index 87e15fe0..28811fb4 100755
--- a/scripts/pages_not_in_nav.js
+++ b/scripts/pages_not_in_nav.js
@@ -23,9 +23,16 @@ const nav = JSON.stringify(navYaml);
// Read the markdown file and extract the fields we need.
const getPageData = (filename) => {
const contents = fs.readFileSync(filename, 'utf-8');
+ const title = contents
+ .split('\n')
+ .filter((line) => line.startsWith('# '))
+ .toString()
+ .toLowerCase();
+
return {
filename,
isRedirect: contents.includes('redirect_to'),
+ isDeprecated: title.includes('(deprecated)') || title.includes('(removed)'),
stage: fm(contents).attributes.stage,
group: fm(contents).attributes.group,
};
@@ -36,7 +43,7 @@ const lostPages = [];
dataSources.forEach((source) => {
glob.sync(`${source.content_dir}/**/*.md`).forEach((filename) => {
const pageData = getPageData(filename);
- if (pageData.isRedirect) {
+ if (pageData.isRedirect || pageData.isDeprecated) {
return;
}