Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused partials and add some way to automatically detect it #38004

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Feb 5, 2023

Description

This PR allows to automatically detect unused templates with a new docs-check-unused-templates npm command. The latter is added in docs. Unfortunately, hugo --printUnusedTemplates prints warning messages with the unused files but doesn't exit as an error so it can't be used in our "Docs" workflow (would be silent)

The second commit removes the unused templates spotted by hugo --printUnusedTemplates.

Motivation & Context

Never forget to remove templates in the future and clean up our current project.

Type of changes

  • Enhancement (non-breaking change which adds functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • (N/A) My change introduces changes to the documentation
  • (N/A) I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@julien-deramond julien-deramond changed the title Add docs-check-unused-templates in npm commands and workflow Add docs-check-unused-templates in npm commands and workflow Feb 5, 2023
@julien-deramond julien-deramond force-pushed the main-jd-hugo-find-unused-templates branch from 906d0e4 to b84d9c2 Compare February 5, 2023 15:19
@julien-deramond julien-deramond force-pushed the main-jd-hugo-find-unused-templates branch from b84d9c2 to de92352 Compare February 5, 2023 15:23
@julien-deramond julien-deramond marked this pull request as ready for review February 5, 2023 15:27
@julien-deramond julien-deramond changed the title Add docs-check-unused-templates in npm commands and workflow Remove unused partials and add some way to automatically detect it Feb 5, 2023
Copy link
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

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

Nice!

@mdo mdo merged commit 30e8d13 into main Feb 14, 2023
@mdo mdo deleted the main-jd-hugo-find-unused-templates branch February 14, 2023 16:48
@louismaximepiton louismaximepiton mentioned this pull request Mar 8, 2023
7 tasks
@mahilanmjd mahilanmjd mentioned this pull request Apr 16, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants