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

Add redirection document type #8892

Merged
merged 9 commits into from
Jun 30, 2023

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Jun 20, 2023

Add new DocumentType Redirection according to comments on #8821.

What's included in this PR

  1. Add Redirection document type to DocumentType.
  2. Add logics to change document type from "Conceptual" to Redirection. If redirect_url metadata is specified.
  3. Add Redirection.html.primary.tmpl to default build-in template.
    -> Redirection documents are processed this Mustache template only. (Don't use _master.tmpl)
  4. Modify SitemapGenerator.cs to skip Redirection type documents. and some code refactoring.
  5. Test code for redirect_url .

Note
_master.tmpl's conditional statement ({{#redirect_url}}...{{/redirect_url}}) are left as is.
Because redirect_url can be set via global.json and may effects other DocumentTypes.

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Patch coverage: 87.50% and project coverage change: +0.04 🎉

Comparison is base (12f3998) 77.00% compared to head (6703ad6) 77.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8892      +/-   ##
==========================================
+ Coverage   77.00%   77.04%   +0.04%     
==========================================
  Files         605      605              
  Lines       25036    25040       +4     
==========================================
+ Hits        19278    19292      +14     
+ Misses       5758     5748      -10     
Impacted Files Coverage Δ
...de.Build.Engine/PostProcessors/SitemapGenerator.cs 83.33% <82.35%> (+14.21%) ⬆️
...ConceptualDocuments/ConceptualDocumentProcessor.cs 63.52% <100.00%> (+2.76%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

</head>
</html>
""", result);

Copy link
Contributor

Choose a reason for hiding this comment

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

Verify that:

  • the generated sitemap does not contain redirections
  • the content type in the generated manifest file is redirection

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix DocumentType constant definitions in this commit (17fa984)
And unit tests are added related to redirect_url and sitemap generation. (a09b8f8)

Copy link
Contributor

@yufeih yufeih left a comment

Choose a reason for hiding this comment

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

This is awesome, really appreciate all the hard work you put into this! ❤️❤️❤️

@yufeih yufeih merged commit c0b8541 into dotnet:main Jun 30, 2023
7 checks passed
@yufeih yufeih added the new-feature Makes the pull request to appear in "New Features" section of the next release note label Jun 30, 2023
p-kostov pushed a commit to ErpNetDocs/docfx that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Makes the pull request to appear in "New Features" section of the next release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants