Rename {analyses,docs}/**/README.md to index.md (#323)

This commit is contained in:
Patrice Chalin 2025-06-16 14:07:26 -04:00 committed by GitHub
parent c91a1e0028
commit 97a0fffdfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
41 changed files with 205 additions and 1 deletions

View File

@ -4,3 +4,4 @@
list-marker-space: false
no-inline-html: false
no-bare-urls: false
single-h1: false # Temporary

View File

@ -1,4 +1,5 @@
---
title: Docs assessment
cSpell:ignore: Horgan celestehorgan hashlinks
---

View File

@ -1,4 +1,5 @@
---
title: Notary Project Docs Assessment
cSpell:ignore: docset notaryproject celestehorgan
---

View File

@ -1,4 +1,5 @@
---
title: Krator Docs assessment
cSpell:ignore: Krator celestehorgan CODEOWNERS
---

View File

@ -1,4 +1,5 @@
---
title: 'Assessment: Project Tremor'
cSpell:ignore: Horgan onramps offramps LLDB Wayfair
---

View File

@ -1,4 +1,5 @@
---
title: Assessment template
cSpell:ignore: celestehorgan Horgan
---

View File

@ -1,4 +1,5 @@
---
title: 'Assessment: Project Kubernetes Gateway API'
cSpell:ignore: Meha Bhalodiya mehabhalodiya kubernetes
---

View File

@ -1,4 +1,5 @@
---
title: Porter Docs Analysis
cSpell:ignore: Uchechukwu Obasi
---

View File

@ -1,3 +1,7 @@
---
title: Backstage Glossary
---
# Backstage Glossary
## API

View File

@ -1,4 +1,5 @@
---
title: Backstage Insights
cSpell:ignore: flipside
---

View File

@ -1,3 +1,7 @@
---
title: Backstage umbrella issue
---
# Backstage umbrella issue
## Overview

View File

@ -1,3 +1,7 @@
---
title: Backstage User Roles for Doc
---
# Backstage User Roles for Doc
This document provides recommendations for user roles, or personas, for

View File

@ -1,3 +1,7 @@
---
title: Analysis of Existing Documentation
---
# Analysis of Existing Documentation
This document characterizes the effectiveness and completeness of the in-toto

View File

@ -1,3 +1,7 @@
---
title: Documentation Issues
---
# Documentation Issues
These issues identify and classify tasks that contributors can undertake to

View File

@ -1,4 +1,5 @@
---
title: Implementation
cSpell:ignore: roadmaps Cappos
---

View File

@ -1,3 +1,7 @@
---
title: README
---
# README
These documents are intended to recommend a direction for the ongoing

View File

@ -1,3 +1,7 @@
---
title: Survey of existing documentation as of 09/2023
---
# Survey of existing documentation as of 09/2023
The following links are loosely sorted into conceptual categories.

View File

@ -1,4 +1,5 @@
---
title: TUF Documentation Analysis
cSpell:ignore: theupdateframework
---

View File

@ -1,3 +1,7 @@
---
title: TechDocs Analysis for CNCF Projects
---
<!-- cSpell:ignore projectname -->
# TechDocs Analysis for CNCF Projects

View File

@ -1,3 +1,7 @@
---
title: Assessment criteria and examples
---
# Assessment criteria and examples
We recommend reading the

View File

@ -1,3 +1,7 @@
---
title: CNCF TechDocs Analysis How-To
---
# CNCF TechDocs Analysis How-To
## Audience
@ -217,5 +221,5 @@ Create issues in the project documentation GitHub repository for:
[analyses]: ../../analyses/
[criteria]: ./criteria.md
[project maturity level]: https://www.cncf.io/project-metrics
[templates]: ./templates/README.md
[templates]: ./templates/index.md
[issues list]: ./templates/issues-list.md

View File

@ -1,3 +1,7 @@
---
title: TechDoc Analysis
---
# TechDoc Analysis
This section contains instructions and criteria for completing a documentation

View File

@ -1,3 +1,7 @@
---
title: TechDoc Analysis Templates
---
# TechDoc Analysis Templates
This section contains templates for analyzing a CNCF project's documentation.

View File

@ -1,3 +1,7 @@
---
title: Analytics
---
# Analytics
## Google Analytics

View File

@ -1,4 +1,5 @@
---
title: Migrating Universal to Google Analytics 4
cSpell:ignore: gtag kubernetes
---

View File

@ -1,3 +1,7 @@
---
title: Assistance program for technical documentation
---
# Assistance program for technical documentation
This document outlines the Cloud Native Computing Foundation (CNCF) Technical

View File

@ -1,3 +1,7 @@
---
title: Hugo and Docsy
---
# Hugo and Docsy
Tips:

View File

@ -1,3 +1,8 @@
---
title: CNCF Techdocs how-tos
sidebar_position: 1
---
# CNCF Techdocs how-tos
This directory contains documentation on how the CNCF TechDocs team does things.

View File

@ -1,3 +1,7 @@
---
title: CNCF Localization Guides
---
# CNCF Localization Guides
This directory contains a growing collection of localization guides that CNCF

View File

@ -1,3 +1,7 @@
---
title: CNCF日本語ローカライゼーション向けガイドライン
---
# CNCF日本語ローカライゼーション向けガイドライン
このドキュメントでは、CNCFのプロジェクトをローカライズする際に参考になる一般的なガイドラインを提供します。

View File

@ -1,4 +1,5 @@
---
title: Netlify and domain setup
cSpell:ignore: caniszczyk
---

View File

@ -1,4 +1,5 @@
---
title: Repository setup
cSpell:ignore: cncf
---

View File

@ -1,3 +1,7 @@
---
title: CNCF sandbox project documentation primer
---
# CNCF sandbox project documentation primer
This document is a quick primer for CNCF project maintainers and contributors

View File

@ -1,3 +1,7 @@
---
title: Documentation Search
---
# Documentation Search
<!-- markdownlint-disable no-duplicate-heading -->

View File

@ -1,3 +1,7 @@
---
title: Services for projects
---
# Services for projects
The CNCF provides technical writing and documentation website services for all

View File

@ -1,4 +1,5 @@
---
title: prettier-ignore
# prettier-ignore
cSpell:ignore: Batard Brubaker Pursley velero fullversion githubbranch docsbranch Tanzu Rosland Horgan Takahashi
---

View File

@ -1,3 +1,7 @@
---
title: CNCF website guidelines checklist
---
# CNCF website guidelines checklist
As per the

100
scripts/add-frontmatter.mjs Normal file
View File

@ -0,0 +1,100 @@
import { readFile, writeFile } from 'fs/promises';
import { glob } from 'glob';
import path from 'path';
// Regular expression to match frontmatter
const frontmatterRegex = /^---\s*\n([\s\S]*?)\n---\s*\n/;
// Regular expression to match first heading
const headingRegex = /^#\s+(.+)$/m;
// Regular expression to match title in frontmatter
const titleRegex = /^title:\s*(.+)$/m;
async function processFile(filePath) {
try {
const content = await readFile(filePath, 'utf-8');
const headingMatch = content.match(headingRegex);
if (!headingMatch) {
console.log(`Warning: ${filePath} has no heading to use as title`);
return;
}
const headingTitle = headingMatch[1].trim();
let hasFrontmatter = false;
let existingTitle = null;
let contentWithoutFrontmatter = content;
let existingFrontmatter = '';
// Check for existing frontmatter
const frontmatterMatch = content.match(frontmatterRegex);
if (frontmatterMatch) {
hasFrontmatter = true;
existingFrontmatter = frontmatterMatch[1];
contentWithoutFrontmatter = content.slice(frontmatterMatch[0].length);
// Check if title already exists
const titleMatch = existingFrontmatter.match(titleRegex);
if (titleMatch) {
existingTitle = titleMatch[1].trim();
}
}
// Only update if:
// 1. No frontmatter exists, or
// 2. Frontmatter exists but has no title, or
// 3. Frontmatter title doesn't match the heading
const needsUpdate = !hasFrontmatter || !existingTitle;
// || existingTitle !== headingTitle
if (needsUpdate) {
let newFrontmatter;
const formattedTitle = headingTitle.includes(':')
? `'${headingTitle}'`
: headingTitle;
if (hasFrontmatter) {
// Remove existing title if it exists
const frontmatterWithoutTitle = existingFrontmatter
.replace(titleRegex, '')
.trim();
newFrontmatter = `title: ${formattedTitle}${frontmatterWithoutTitle ? '\n' + frontmatterWithoutTitle : ''}`;
} else {
newFrontmatter = `title: ${formattedTitle}`;
}
const newContent = `---
${newFrontmatter}
---\n
${contentWithoutFrontmatter}`;
await writeFile(filePath, newContent);
console.log(
`${hasFrontmatter ? 'Updated' : 'Added'} frontmatter to ${filePath}`,
);
} else {
console.log(`Skipping ${filePath} - frontmatter title matches heading`);
}
} catch (error) {
console.error(`Error processing ${filePath}:`, error);
}
}
async function main() {
try {
// Find all markdown files in docs directory
const files = await glob('{analyses,docs}/**/*.md');
console.log(`Found ${files.length} markdown files`);
// Process each file
for (const file of files) {
await processFile(file);
}
console.log('Done!');
} catch (error) {
console.error('Error:', error);
process.exit(1);
}
}
main();