Skip to content

Commit

Permalink
Add guides link in with metadata and rephrase docs link in main body.
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed Jun 5, 2024
1 parent 80e484e commit 86fa533
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
45 changes: 25 additions & 20 deletions src/templates/extension-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const ExtensionDetailTemplate = ({
const sponsors = metadata?.sponsors || metadata?.sponsor || metadata.sourceControl?.sponsors

const extensionCount = metadata?.sourceControl?.repository?.extensionCount

const guideDescription = metadata.guide?.includes("quarkus.io/") ? "quarkus.io/guides" : metadata.guide?.includes("docs.quarkiverse.io/") || metadata.guide?.includes("https://quarkiverse.github.io/quarkiverse-docs/") ? "docs.quarkiverse.io" : metadata.guide?.includes("README.md") ? "readme" : metadata.guide?.includes(".") ? "docs" : null
const alongWith = extensionCount > 1 ? `, along with ${extensionCount} other extensions,` : ""

return (
Expand Down Expand Up @@ -257,11 +257,11 @@ const ExtensionDetailTemplate = ({
{metadata.guide && (
<DocumentationSection>
<DocumentationHeading>Guides</DocumentationHeading>
Make sure to use the extension's{" "}
This extension has a{" "}
<VisibleLink href={metadata.guide}>
documentation
guide
</VisibleLink>{" "}
to get your questions answered.
to get you going.
</DocumentationSection>
)}
<DocumentationSection>
Expand Down Expand Up @@ -365,6 +365,20 @@ const ExtensionDetailTemplate = ({
text: metadata.maven?.artifactId,
}}
/>
<ExtensionMetadata
data={{
name: "Guide",
text: guideDescription,
url: metadata.guide,
}}
/>
<ExtensionMetadata
data={{
name: "Javadoc",
text: metadata.javadoc?.url ? "javadoc.io" : null, // Slight workaround to make sure we don't display the field if the url is null
url: metadata.javadoc?.url,
}}
/>
<ExtensionMetadata
data={{
name: "Built with",
Expand Down Expand Up @@ -409,21 +423,6 @@ const ExtensionDetailTemplate = ({
: qualifiedPrettyPlatform(element),
}}
/>
<ExtensionMetadata
data={{
name: "Minimum Java version",
fieldName: "minimumJavaVersion",
metadata,
}}
/>

<ExtensionMetadata
data={{
name: "Javadoc",
text: metadata.javadoc?.url ? "javadoc.io" : null, // Slight workaround to make sure we don't display the field if the url is null
url: metadata.javadoc?.url,
}}
/>
<ExtensionMetadata
data={{
name: "Sponsor",
Expand Down Expand Up @@ -470,7 +469,13 @@ const ExtensionDetailTemplate = ({
url: extension.metadata?.sourceControl?.issuesUrl,
}}
/>

<ExtensionMetadata
data={{
name: "Minimum Java version",
fieldName: "minimumJavaVersion",
metadata,
}}
/>
<ClosingRule />

<AuthorGuidance>
Expand Down
2 changes: 1 addition & 1 deletion test-integration/detail-page.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("an extension details page", () => {

it("should have a link to the documentation", async () => {
await expect(
page.waitForSelector(`xpath///*[contains(text(), "documentation")]`)
page.waitForSelector(`xpath///*[contains(text(), "guide")]`)
).resolves.toBeTruthy()
})

Expand Down

0 comments on commit 86fa533

Please sign in to comment.