Allow articles with missing shortTitles to appear on home page (#54389)
This commit is contained in:
@@ -109,4 +109,4 @@ If you want to improve your profile even more, incorporate these practices into
|
||||
|
||||
## Further reading
|
||||
|
||||
* [AUTOTITLE](/copilot/example-prompts-for-github-copilot-chat/refactoring-code/improving-code-readability-and-maintainability)
|
||||
* [AUTOTITLE](/copilot/copilot-chat-cookbook/refactoring-code/improving-code-readability-and-maintainability)
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Debugging invalid JSON
|
||||
shortTitle: Debug invalid JSON
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can identify and resolve syntax errors or structural issues in JSON data.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/debugging-errors/debugging-invalid-json
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Handling API rate limits
|
||||
shortTitle: Handle API rate limits
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help handle API rate limits by suggesting code that detects implements retry logic.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/debugging-errors/handling-api-rate-limits
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Debugging errors
|
||||
intro: 'Discover ways that you can use {% data variables.product.prodname_copilot %} to debug errors during development.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/debugging-errors
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Documenting legacy code'
|
||||
shortTitle: Document legacy code
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help with documenting legacy code.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/documenting-code/documenting-legacy-code
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Explaining complex algorithms or logic'
|
||||
shortTitle: Explain complex logic
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help add clear and concise documentation on complex algorithms or logic.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/documenting-code/explaining-complex-algorithms-or-logic
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Explaining legacy code'
|
||||
shortTitle: Explain legacy code
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help with explaining unfamiliar code.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/documenting-code/explaining-legacy-code
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Documenting code
|
||||
intro: 'Discover ways that you can use {% data variables.product.prodname_copilot_chat %} to document your code.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/documenting-code
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Syncing documentation with code changes'
|
||||
shortTitle: Sync documentation
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help with keeping code documentation up-to-date.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/documenting-code/syncing-documentation-with-code-changes
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Analyzing and incorporating user feedback'
|
||||
shortTitle: Incorporate feedback
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can enhance the process of incorporating user feedback into your project.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/functionality-analysis-and-feature-suggestions/analyzing-and-incorporating-user-feedback
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -4,6 +4,8 @@ shortTitle: Explore feature implementations
|
||||
intro: >-
|
||||
{% data variables.product.prodname_copilot_chat_short %} can help explore
|
||||
different approaches for implementing a single feature.
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/functionality-analysis-and-feature-suggestions/exploring-potential-feature-implementations
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Functionality analysis and feature suggestions
|
||||
intro: 'Discover ways that you can use {% data variables.product.prodname_copilot %} to improve the functionality of your project.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/functionality-analysis-and-feature-suggestions
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
title: Copilot Chat Cookbook
|
||||
shortTitle: Example prompts
|
||||
intro: 'Find examples of prompts to use with {% data variables.product.prodname_copilot_chat %}.'
|
||||
allowTitleToDifferFromFilename: true
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Decoupling business logic from UI components
|
||||
shortTitle: Decoupling business logic
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help you separate your business logic from your user interface code, making it easier to maintain and scale your application.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/decoupling-business-logic-from-ui-components
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Fixing database deadlocks or data integrity issues'
|
||||
shortTitle: Fixing database deadlocks
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help you avoid code that causes slow or blocked database operations, or tables with missing or incorrect data.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/fixing-database-deadlocks-or-data-integrity-issues
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Fixing lint errors
|
||||
shortTitle: Lint errors
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can suggest ways to fix issues identified by a code linter.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/fixing-lint-errors
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Handling cross-cutting concerns
|
||||
shortTitle: Cross-cutting concerns
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help you avoid code that relates to a concern other than the core concern of the method or function in which the code is located.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/handling-cross-cutting-concerns
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Improving code readability and maintainability'
|
||||
shortTitle: Improve code readability
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can suggest ways to make your code easier to understand and maintain.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/improving-code-readability-and-maintainability
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -19,7 +21,7 @@ Code with poor readability is difficult for other developers to maintain and ext
|
||||
* [Reducing nested logic](#reducing-nested-logic)
|
||||
* [Splitting large methods into smaller, more readable ones](#splitting-up-large-methods)
|
||||
|
||||
Documenting your code is another way to improve the maintainability of your code. For information about using {% data variables.product.prodname_copilot_chat_short %} to help you add useful comments to your code, see the example prompts in [Documenting code](/copilot/example-prompts-for-github-copilot-chat/documenting-code).
|
||||
Documenting your code is another way to improve the maintainability of your code. For information about using {% data variables.product.prodname_copilot_chat_short %} to help you add useful comments to your code, see the example prompts in [Documenting code](/copilot/copilot-chat-cookbook/documenting-code).
|
||||
|
||||
> [!NOTE] The responses shown in this article are examples. {% data variables.product.prodname_copilot_chat_short %} responses are non-deterministic, so you may get different responses from the ones shown here.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Refactoring code
|
||||
intro: 'Discover ways that you can use {% data variables.product.prodname_copilot %} to refactor your code.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Refactoring data access layers
|
||||
shortTitle: Data access layers
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can suggest ways to decouple your data access code from your business logic, making an application easier to maintain and scale.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/refactoring-data-access-layers
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Refactoring for performance optimization
|
||||
shortTitle: Performance optimization
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can suggest ways to speed up slow-running code.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/refactoring-for-performance-optimization
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Refactoring to implement a design pattern
|
||||
shortTitle: Design patterns
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can suggest design patterns that you can use to improve your code.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/refactoring-to-implement-a-design-pattern
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: Simplifying complex inheritance hierarchies
|
||||
shortTitle: Simplify inheritance hierarchies
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help you to refactor code to avoid classes with multiple layers of inheritance.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/refactoring-code/simplifying-complex-inheritance-hierarchies
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Finding existing vulnerabilities in code'
|
||||
shortTitle: Finding vulnerabilities
|
||||
intro: 'Copilot Chat can help find common vulnerabilities in your code and suggest fixes.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/security-analysis/finding-existing-vulnerabilities-in-code
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Security analysis
|
||||
intro: 'Discover ways that you can use {% data variables.product.prodname_copilot %} to improve code security.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/security-analysis
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Create end-to-end tests for a webpage'
|
||||
shortTitle: Create end-to-end tests
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help with generating end-to-end tests.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/testing-code/create-end-to-end-tests-for-a-webpage
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Create mock objects to abstract layers'
|
||||
shortTitle: Create mock objects
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help with creating mock objects that you can use for unit tests.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/testing-code/create-mock-objects-to-abstract-layers
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -2,6 +2,8 @@
|
||||
title: 'Generate unit tests'
|
||||
shortTitle: Generate unit tests
|
||||
intro: '{% data variables.product.prodname_copilot_chat_short %} can help with generating unit tests for a function.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/testing-code/generate-unit-tests
|
||||
versions:
|
||||
feature: copilot
|
||||
category:
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Testing code
|
||||
intro: 'Discover ways that you can use {% data variables.product.prodname_copilot %} to test your code.'
|
||||
redirect_from:
|
||||
- /copilot/example-prompts-for-github-copilot-chat/testing-code
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
@@ -16,7 +16,7 @@ featuredLinks:
|
||||
popular:
|
||||
- /copilot/using-github-copilot/best-practices-for-using-github-copilot
|
||||
- /copilot/using-github-copilot/prompt-engineering-for-github-copilot
|
||||
- /copilot/example-prompts-for-github-copilot-chat
|
||||
- /copilot/copilot-chat-cookbook
|
||||
- /copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot
|
||||
- /copilot/using-github-copilot/asking-github-copilot-questions-in-your-ide
|
||||
- /copilot/using-github-copilot/using-github-copilot-in-the-command-line
|
||||
@@ -28,7 +28,7 @@ children:
|
||||
- /about-github-copilot
|
||||
- /setting-up-github-copilot
|
||||
- /using-github-copilot
|
||||
- /example-prompts-for-github-copilot-chat
|
||||
- /copilot-chat-cookbook
|
||||
- /managing-copilot
|
||||
- /rolling-out-github-copilot-at-scale
|
||||
- /customizing-copilot
|
||||
|
||||
@@ -74,7 +74,7 @@ You can also use {% data variables.product.prodname_discussions %} to create a s
|
||||
|
||||
### Providing learning resources
|
||||
|
||||
In addition to your onboarding resources, you may want to provide a library of learning resources to help teams advance their skills with {% data variables.product.prodname_copilot_short %}. The {% data variables.product.prodname_copilot_chat_short %} Cookbook is a great place to start. The Cookbook is a collection of example prompts that you can use to learn how to ask {% data variables.product.prodname_copilot_short %} for help with a wide range of tasks. See [AUTOTITLE](/copilot/example-prompts-for-github-copilot-chat).
|
||||
In addition to your onboarding resources, you may want to provide a library of learning resources to help teams advance their skills with {% data variables.product.prodname_copilot_short %}. The {% data variables.product.prodname_copilot_chat_short %} Cookbook is a great place to start. The Cookbook is a collection of example prompts that you can use to learn how to ask {% data variables.product.prodname_copilot_short %} for help with a wide range of tasks. See [AUTOTITLE](/copilot/copilot-chat-cookbook).
|
||||
|
||||
### Communicating expectations
|
||||
|
||||
|
||||
@@ -162,4 +162,4 @@ With these tactics, you're well equipped to start squashing bugs in your project
|
||||
|
||||
## Next steps
|
||||
|
||||
As you continue coding, you'll likely encounter specific problem scenarios and errors that are difficult to debug. For a list of potential issues and example {% data variables.product.prodname_copilot_chat_short %} prompts to fix them, see [AUTOTITLE](/copilot/example-prompts-for-github-copilot-chat/debugging-errors).
|
||||
As you continue coding, you'll likely encounter specific problem scenarios and errors that are difficult to debug. For a list of potential issues and example {% data variables.product.prodname_copilot_chat_short %} prompts to fix them, see [AUTOTITLE](/copilot/copilot-chat-cookbook/debugging-errors).
|
||||
|
||||
@@ -106,7 +106,7 @@ childGroups:
|
||||
- copilot
|
||||
- copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot
|
||||
- copilot/using-github-copilot/prompt-engineering-for-github-copilot
|
||||
- copilot/example-prompts-for-github-copilot-chat
|
||||
- copilot/copilot-chat-cookbook
|
||||
- copilot/using-github-copilot/asking-github-copilot-questions-in-github
|
||||
- copilot/using-github-copilot/guides-on-using-github-copilot/refactoring-code-with-github-copilot
|
||||
- name: CI/CD and DevOps
|
||||
|
||||
@@ -92,7 +92,7 @@ export const CategoryLanding = () => {
|
||||
title="Generate unit tests"
|
||||
description="Copilot Chat can help with generating unit tests for a function."
|
||||
spotlight={true}
|
||||
url="/en/copilot/example-prompts-for-github-copilot-chat/testing-code/generate-unit-tests"
|
||||
url="/copilot/copilot-chat-cookbook/testing-code/generate-unit-tests"
|
||||
tags={[]}
|
||||
/>
|
||||
</div>
|
||||
@@ -102,7 +102,7 @@ export const CategoryLanding = () => {
|
||||
title="Improving code readability and maintainability"
|
||||
description="Learn how to improve your code readability and maintainability."
|
||||
spotlight={true}
|
||||
url="/en/copilot/example-prompts-for-github-copilot-chat/refactoring-code/improving-code-readability-and-maintainability"
|
||||
url="/copilot/copilot-chat-cookbook/refactoring-code/improving-code-readability-and-maintainability"
|
||||
tags={[]}
|
||||
/>
|
||||
</div>
|
||||
@@ -113,7 +113,7 @@ export const CategoryLanding = () => {
|
||||
description="Copilot can identify and resolve syntax errors or structural issues in JSON data."
|
||||
spotlight={true}
|
||||
tags={[]}
|
||||
url="/en/copilot/example-prompts-for-github-copilot-chat/debugging-errors/debugging-invalid-json"
|
||||
url="/copilot/copilot-chat-cookbook/debugging-errors/debugging-invalid-json"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -79,9 +79,7 @@ function NavListItem({ childPage }: { childPage: ProductTreeNode }) {
|
||||
const { asPath, locale } = useRouter()
|
||||
const routePath = `/${locale}${asPath.split('?')[0].split('#')[0]}`
|
||||
const isActive = routePath === childPage.href
|
||||
const specialCategory = childPage.href.endsWith(
|
||||
'/copilot/example-prompts-for-github-copilot-chat',
|
||||
)
|
||||
const specialCategory = childPage.href.endsWith('/copilot/copilot-chat-cookbook')
|
||||
|
||||
return (
|
||||
<NavList.Item
|
||||
|
||||
@@ -70,7 +70,7 @@ async function getPage(
|
||||
}
|
||||
// Either the page didn't have a `rawShortTitle` or it was empty when
|
||||
// rendered out with Liquid. Either way, have to fall back to `rawTitle`.
|
||||
if (!name) {
|
||||
if (!name || !page.rawShortTitle) {
|
||||
name = await renderContentWithFallback(page, 'rawTitle', context, {
|
||||
textOnly: true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user