Skip to content

Conversation

@matt-goldman
Copy link
Owner

Summary

This pull request adds a new "clean" option to the site generation process, allowing users to delete the output directory before generating new site content. It also improves logging and template mapping diagnostics for better clarity during site generation.

New "Clean" Option:

  • Added a Clean property to the GenerationOptions class to allow users to specify if the output directory should be deleted before site generation.
  • Updated CLI help text and argument parsing to support the --clean and -c flags. [1] [2]
  • Modified the BuildAsync method in SiteGenerator to delete the output directory if the Clean option is set and the directory exists, with appropriate logging.

Template Mapping and Logging Improvements:

  • Enhanced template mapping logic to provide more detailed logging: logs when no markdown files are found and when templates are mapped, including the count of markdown files per folder.
  • Improved debug logging for skipped missing folders during template mapping.

🧷 This PR will be released as a preview by default.

To trigger a stable release:

  • Remove the preview label
  • Add the release label
  • Optionally add Semver-Minor or Semver-Major to control version bump

🏷️ Add labels to control release notes:

  • enhancement, bug, breaking-change, dependencies
  • Or use ignore-for-release to suppress it from notes

- Introduced `Clean` property in `GenerationOptions` to control output directory cleaning before generation, defaulting to `false`.
- Enhanced `SiteGenerator` to delete the output directory if `Clean` is enabled and it exists, with logging for the action.
- Updated command-line help in `Program` to document the new `--clean` option.
- Adjusted `options` initialization in `Program` to reflect the `Clean` property based on command-line arguments.
…arent level without checking children

Improve logging and markdown file handling in SiteGenerator

Refactor logging to remove messages for missing folders and
no markdown files. Add a log entry for the count of markdown
files found in each folder. Adjust logic to map templates
only when markdown files are present, enhancing code clarity
and functionality.
Copilot AI review requested due to automatic review settings August 5, 2025 04:00
@github-actions github-actions bot added preview Triggers a release of preview version of Nuget packages enhancement New feature or request Blake.CLI Blake.BuildTools labels Aug 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds a new "clean" option to the Blake site generator that allows users to delete the output directory before generating new content, along with improved logging for template mapping diagnostics.

  • Added --clean/-c command-line flag support with corresponding Clean property in GenerationOptions
  • Implemented output directory deletion functionality in SiteGenerator.BuildAsync when clean option is enabled
  • Enhanced template mapping logging to provide better visibility into the process, including file counts and folder processing status

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Blake.CLI/Program.cs Added CLI help text and argument parsing for the new --clean/-c flags
src/Blake.BuildTools/Generator/SiteGenerator.cs Implemented clean functionality and improved template mapping logging
src/Blake.BuildTools/Generator/GeneratorOptions.cs Added Clean property to support the new feature

matt-goldman and others added 2 commits August 5, 2025 14:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@matt-goldman matt-goldman added bug Something isn't working logging Improve logging and diagnostics release Triggers a release of a production version of Nuget packages and removed preview Triggers a release of preview version of Nuget packages labels Aug 5, 2025
@matt-goldman matt-goldman merged commit 4e0946a into main Aug 5, 2025
1 check passed
@matt-goldman matt-goldman deleted the dx-tweaks branch August 5, 2025 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blake.BuildTools Blake.CLI bug Something isn't working enhancement New feature or request logging Improve logging and diagnostics release Triggers a release of a production version of Nuget packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants