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

Fall back to Hugo's default behavior for disableHugoGeneratorInject #1734

Merged

Conversation

chalin
Copy link
Collaborator

@chalin chalin commented Nov 13, 2023

  • Fixes Docsy does not respect configuration parameter "disableHugoGeneratorInject" #1707
    That is, without this PR we get the generator meta tag in every page:
    $ find userguide/public/* -type f -name "*.html" -exec grep -nH -e 'name="generator"' {} +
    userguide/public/404.html:6:<meta name="generator" content="Hugo 0.120.4">
    userguide/public/about/index.html:6:<meta name="generator" content="Hugo 0.120.4">
    userguide/public/blog/2022/hello/index.html:6:<meta name="generator" content="Hugo 0.120.4">
    ...
  • With this fix, with or without disableHugoGeneratorInject set to true, we get the Hugo-default behavior of at most adding the meta tag to the homepage:
    $ npm run build 
    $ find userguide/public/* -type f -name "*.html" -exec grep -nH -e 'name="generator"' {} +
    userguide/public/index.html:4:  <meta name="generator" content="Hugo 0.120.4">
    $ HUGO_DISABLEHUGOGENERATORINJECT=true npm run build                                                
    $ find userguide/public/* -type f -name "*.html" -exec grep -nH -e 'name="generator"' {} +
    $ 

@chalin chalin force-pushed the chalin-im-disableHugoGeneratorInject-2023-11-13 branch from 6b7c4de to 3f6806a Compare November 13, 2023 15:11
@chalin chalin added this to the 23Q4 milestone Nov 13, 2023
Copy link
Collaborator

@fekete-robert fekete-robert left a comment

Choose a reason for hiding this comment

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

Works as expected

@chalin chalin force-pushed the chalin-im-disableHugoGeneratorInject-2023-11-13 branch from 3f6806a to abefb47 Compare November 17, 2023 10:59
@chalin chalin merged commit 2f71d33 into google:main Nov 17, 2023
5 checks passed
@chalin chalin deleted the chalin-im-disableHugoGeneratorInject-2023-11-13 branch November 17, 2023 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docsy does not respect configuration parameter "disableHugoGeneratorInject"
4 participants