Skip to content

Commit

Permalink
A few updates to the docs section
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmypixel committed Jan 20, 2025
1 parent 79c6f60 commit f774e96
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/server/documentation/helpers/docs-breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import startCase from 'lodash/startCase.js'
function docsBreadcrumbs(docsPath) {
const breadcrumbs = [
{
text: 'Documentation',
text: 'CDP',
href: '/documentation'
}
]
Expand Down
8 changes: 4 additions & 4 deletions src/server/documentation/helpers/docs-breadcrumbs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ describe('#docsBreadcrumbs', () => {
test('Should return expected documentation breadcrumbs for a single file path', () => {
const result = docsBreadcrumbs('introduction.md')
expect(result).toEqual([
{ text: 'Documentation', href: '/documentation' },
{ text: 'CDP', href: '/documentation' },
{ text: 'Introduction' }
])
})

test('Should return expected documentation for a nested file path', () => {
const result = docsBreadcrumbs('guides/getting-started.md')
expect(result).toEqual([
{ text: 'Documentation', href: '/documentation' },
{ text: 'CDP', href: '/documentation' },
{ text: 'Guides', href: '/documentation/guides/README.md' },
{ text: 'Getting Started' }
])
Expand All @@ -21,15 +21,15 @@ describe('#docsBreadcrumbs', () => {
test('Should handle README.md files correctly', () => {
const result = docsBreadcrumbs('guides/README.md')
expect(result).toEqual([
{ text: 'Documentation', href: '/documentation' },
{ text: 'CDP', href: '/documentation' },
{ text: 'Guides' }
])
})

test('Should handle paths with multiple segments', () => {
const result = docsBreadcrumbs('guides/advanced/topics.md')
expect(result).toEqual([
{ text: 'Documentation', href: '/documentation' },
{ text: 'CDP', href: '/documentation' },
{ text: 'Guides', href: '/documentation/guides/README.md' },
{ text: 'Advanced', href: '/documentation/guides/advanced/README.md' },
{ text: 'Topics' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async function documentationStructure(request, bucket) {

return [
{
text: 'Documentation',
text: 'CDP',
href: path.join(docsRoute, 'README.md'),
level: 0
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('#directoryStructure', () => {
const result = await documentationStructure(mockRequest, mockBucket)

expect(result).toEqual([
{ text: 'Documentation', href: '/documentation/README.md', level: 0 },
{ text: 'CDP', href: '/documentation/README.md', level: 0 },
{ text: 'Guides', href: '/documentation/guides/README.md', level: 1 },
{
text: 'Getting Started',
Expand Down Expand Up @@ -106,7 +106,7 @@ describe('#directoryStructure', () => {
{
href: '/documentation/README.md',
level: 0,
text: 'Documentation'
text: 'CDP'
},
{
href: '/documentation/guides/README.md',
Expand Down
11 changes: 11 additions & 0 deletions src/server/documentation/views/documentation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@
{% from "documentation/macro.njk" import appDocumentation %}

{% block content %}
{{ appPageHeading({
text: "Documentation"
}) }}

<p class="govuk-!-margin-bottom-2">
All things Core Delivery Platform, onboarding, test suites, services, and more.
</p>

<hr class="app-section-break app-section-break--slim">

{{ appDocumentation({ nav: nav, content: content, toc: toc }) }}

{% endblock %}

0 comments on commit f774e96

Please sign in to comment.