This VS Code extension allows you to automatically generate meta descriptions for HTML and Markdown files. It supports both single file processing (for the currently active file in the editor) and batch processing (for all .md and .html files in a selected folder).
Features
Single File Meta Description:
Right-click on an open file (Markdown or HTML) in the editor and select "Generate Meta Description".
The extension will check if the file contains frontmatter with a title: field and if a description: is already present.
If no description is found, it generates a meta description using OpenAI's GPT-4 model and inserts it into the frontmatter.
Batch Meta Description:
Right-click on a folder in the Explorer and select "Generate Meta Description Batch".
The extension will process all .md and .html files within the folder and its subfolders.
It will only process files that contain frontmatter with a title: field and no existing description: field.
A progress indicator shows how many files have been processed.
Validation:
The extension validates that each file has frontmatter and contains a title:, and does not already have a description:.
Files that do not meet these criteria are skipped.
Progress Indicators:
During batch processing, a progress bar will show the percentage of files processed, indicating how many .md and .html files had descriptions inserted.
API Key Management:
The OpenAI API key is securely stored in VS Code's globalState and persists across sessions.
You can reset the API key using the "Add/Reset OpenAI API Key" command.
Prerequisites
To use this extension, you need the following:
OpenAI API Key: You must have an OpenAI API key to generate meta descriptions.
Installation
Install the Extension:
Open Visual Studio Code.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or by pressing Ctrl+Shift+X.
Search for "TechComms - SEO AI Tools" and install the extension.