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

docs(side navigation): initial build of the side navigation #610

Merged
merged 48 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
55c9b9e
docs(side navigation): initial build of the side navigation
chrispymm Aug 5, 2024
e5eebc7
docs(side navigation): update layouts to add side nav to all pages
chrispymm Aug 7, 2024
fffcc87
docs(side navigation): add basic styles
chrispymm Aug 7, 2024
5a3594a
docs(side navigation): main site layout and basic responsiveness
chrispymm Aug 8, 2024
49b992d
docs(side navigation): ensure all side nav links work
chrispymm Aug 8, 2024
747dcf4
docs(side navigation): implement responsive menu toggling behaviour
chrispymm Aug 8, 2024
beb7a6e
docs(side navigation): non-JS menu collapse/hiding functionality
chrispymm Aug 9, 2024
e4312ad
docs(side navigation): add indicators to side nav and enable view tra…
chrispymm Aug 9, 2024
8663765
docs(side navigation): update header menu toggle styles
chrispymm Aug 9, 2024
a8d150d
docs(index pages): styling for index listing pages
chrispymm Aug 12, 2024
d4ec86e
docs(side navigation): adjust site layout to left aligned
chrispymm Aug 12, 2024
0422ac2
docs(side navigation): adjust footer to be left aligned too
chrispymm Aug 12, 2024
a741536
docs(side navigation): extract macros and other small tweaks
chrispymm Aug 13, 2024
72498b4
docs(side navigation): fixes after visual/functional review
chrispymm Aug 15, 2024
929222e
docs(side navigation): wIP - adding accordion behaviour to side nav
chrispymm Sep 23, 2024
36cff9e
docs(side nav): style navigation toggles
chrispymm Sep 23, 2024
bef47ca
docs(side navigation): resolve issues after rebasing
chrispymm Oct 30, 2024
5143252
docs(side navigation): make both menus js toggle navs
chrispymm Oct 31, 2024
f32f6ca
docs(side navigation): fix chevron indicators and adjust hover colours
chrispymm Oct 31, 2024
f2663e6
docs: adding side nav category
robertjmccarthy Oct 31, 2024
b6613df
docs: side navigation updates
robertjmccarthy Oct 31, 2024
06fbda4
docs: updates to url structure
robertjmccarthy Nov 4, 2024
d54779a
docs: removing redundant pages
robertjmccarthy Nov 5, 2024
f9d3f4a
docs: changing typo
robertjmccarthy Nov 5, 2024
0f7390c
docs(side navigation): fix error froim
chrispymm Nov 5, 2024
270d4e5
docs: side nav and content style guide updates
robertjmccarthy Nov 5, 2024
c748eb4
docs: resolving side nav error with duplicate ethics section
robertjmccarthy Nov 5, 2024
71739b0
docs: resolving style sheet issue with incorrect layout file being re…
robertjmccarthy Nov 5, 2024
d6939e9
docs: resolving margin spacing on style guide
robertjmccarthy Nov 5, 2024
79966cf
docs: updating links and removing redundant content and pages
robertjmccarthy Nov 6, 2024
c221cb9
docs: excerpt content added for components
robertjmccarthy Nov 6, 2024
4bd1a7e
docs: updated excerpts as temporary holding text
robertjmccarthy Nov 6, 2024
318898d
docs(side navigation): fix content errors
helennickols Nov 6, 2024
e2fb88d
docs(side navigation): add new content style guide entries
helennickols Nov 6, 2024
50789ab
docs(side navigation): fix section breaks
helennickols Nov 6, 2024
62786e7
docs: adding in excerpts for no-js pages
robertjmccarthy Nov 6, 2024
248df23
docs(redirects): add redirect from old prototyping page
chrispymm Nov 8, 2024
0b7d247
docs: fix link to help page updated in template partial
Nov 8, 2024
fcf488d
docs: updates to docs site for url changes and fixing errors
robertjmccarthy Nov 11, 2024
219aaf2
docs: adding redirects
robertjmccarthy Nov 11, 2024
d7c3ea5
docs: adding redirects for removed pages
robertjmccarthy Nov 11, 2024
5c3221e
docs: adding redirect for IE8 page
robertjmccarthy Nov 11, 2024
d4b8f66
docs: adding in Figma links for messages and timeline component
robertjmccarthy Nov 12, 2024
c3ad511
docs(side navigation): tweaks to chevrons
chrispymm Nov 12, 2024
c0e881a
docs(side navigation): fix collapsible nav js to work better
chrispymm Nov 12, 2024
8bfdc83
docs(side navigation): further tweaks to chevron svg
chrispymm Nov 12, 2024
66c1799
docs(accessibility): fix duplicate id on standards and ethics nav
chrispymm Nov 12, 2024
1a8431c
docs(style guide): remove content style guide from output and navigation
chrispymm Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ const path = require("path");
const { execSync } = require("child_process");
const releasePackage = require("./package/package.json");
const sass = require("sass");
const esbuild = require("esbuild");
const esbuild = require('esbuild');
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");

module.exports = function (eleventyConfig) {

eleventyConfig.addPlugin(eleventyNavigationPlugin);
/*
* If the node env is 'dev' then we include the src dir allowing components
* under development to be watched and loaded
Expand Down Expand Up @@ -42,6 +45,8 @@ module.exports = function (eleventyConfig) {
nunjucksEnv.addFilter(name, callback);
});

nunjucksEnv.addFilter("eleventyNavigation", eleventyNavigationPlugin.navigation.find);

eleventyConfig.setLibrary("njk", nunjucksEnv);

eleventyConfig.setLibrary(
Expand Down Expand Up @@ -166,6 +171,7 @@ module.exports = function (eleventyConfig) {
},
);


eleventyConfig.addFilter("getScriptPath", function (inputPath) {
return inputPath.split("/").slice(1, -1).join("/") + "/script.js";
});
Expand Down
12 changes: 12 additions & 0 deletions docs/_includes/layouts/archive.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "./base.njk" %}

{% block content %}
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if not isIndex %}<span class="govuk-caption-xl">Archive</span>{% endif %}
{{ title }}
</h1>
{{ content | safe }}
</div>

{% endblock %}
27 changes: 19 additions & 8 deletions docs/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,28 @@
<body class="govuk-template__body">
<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
{% block body %}
<div>
{% include "./partials/header.njk" %}
{% include "./partials/navigation.njk" %}
{% block content %}
<main class="app-prose-scope" role="main">
<div>
{% include "./partials/header.njk" %}

<div class="app-layout">
<div id="sidebar" class="app-layout__sidebar">
{% include "./partials/side-navigation.njk" %}
</div>


<div class="app-layout__page app-page">
<main id="main-content" class="app-prose-scope">
{% block content %}
{{ content | safe }}
</main>
{% endblock %}
{% include "./partials/footer.njk" %}
{% endblock %}
</main>
</div>
</div>

{% include "./partials/footer.njk" %}
</div>
{% endblock %}
{% block pageScripts %}{% endblock %}
</body>
</html>

57 changes: 2 additions & 55 deletions docs/_includes/layouts/community.njk
Original file line number Diff line number Diff line change
@@ -1,66 +1,13 @@
{% extends "./base.njk" %}

{%- from "node_modules/@ministryofjustice/frontend/moj/components/side-navigation/macro.njk" import mojSideNavigation %}

{% macro appSideNavigation(config) %}
{% set config = config|addActiveAttribute(page.filePathStem | url) %}

{{ mojSideNavigation(config) }}
{% endmacro %}

{% block content %}
<div class="govuk-width-container govuk-grid-row app-flex-container">
<div class="govuk-grid-column-one-third">
{{ appSideNavigation({
classes: 'govuk-!-padding-top-6',
sections: [
{
heading: {
text: "Contributing"
},
items: [
{
text: 'Propose a component or pattern',
href: ('/community/contribute' | url)
},
{
text: 'Contribution criteria',
href: ('/community/criteria' | url)
},
{
text: 'Suggest a change',
href: ('/community/suggest-a-change' | url)
}
]
},
{
heading: {
text: "Support"
},
items: [
{
text: 'Help and feedback',
href: ('/community/help-and-feedback' | url)
}
]
}
]
}) }}

{% include "./partials/back-to-top.njk" %}
</div>

<div class="govuk-grid-column-two-thirds">
<main id="main-content" class="govuk-main-wrapper app-prose-scope" role="main">
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if subsection %}<span class="govuk-caption-xl">{{ subsection }}</span>{% endif %}
{{ title }}
</h1>
{{ content | safe }}
</main>

{% include "./partials/get-help.njk" %}

{% include "./partials/get-help.njk" %}
</div>
</div>
{% endblock %}
13 changes: 13 additions & 0 deletions docs/_includes/layouts/component-no-feedback.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends "./base.njk" %}

{% block content %}
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if not isIndex %}<span class="govuk-caption-xl">Components</span>{% endif %}
{{ title }}
</h1>
{{ content | safe }}
</div>

{% endblock %}

149 changes: 6 additions & 143 deletions docs/_includes/layouts/component.njk
Original file line number Diff line number Diff line change
@@ -1,155 +1,18 @@
{% extends "./base.njk" %}

{%- from "node_modules/@ministryofjustice/frontend/moj/components/side-navigation/macro.njk" import mojSideNavigation %}

{% macro appSideNavigation(config) %}
{% set config = config|addActiveAttribute(page.filePathStem | url) %}

{{ mojSideNavigation(config) }}
{% endmacro %}

{% block content %}
<div class="govuk-width-container govuk-grid-row app-flex-container">
<div class="govuk-grid-column-one-third">
{{ appSideNavigation({
classes: 'govuk-!-padding-top-6',
sections: [
{
heading: {
text: "Components"
},
items: [
{
text: 'Add another',
href: ('/components/add-another' | url)
},
{
text: 'Badge',
href: ('/components/badge' | url)
},
{
text: 'Banner',
href: ('/components/banner' | url)
},
{
text: 'Button menu',
href: ('/components/button-menu' | url)
},
{
text: 'Date picker',
href: ('/components/date-picker' | url)
},
{
text: 'Filter',
href: ('/components/filter' | url)
},
{
text: 'Header',
href: ('/components/header' | url)
},
{
text: 'Identity bar',
href: ('/components/identity-bar' | url)
},
{
text: 'Messages',
href: ('/components/messages' | url)
},
{
text: 'Multi file upload',
href: ('/components/multi-file-upload' | url)
},
{
text: 'Multi select',
href: ('/components/multi-select' | url)
},
{
text: 'Notification badge',
href: ('/components/notification-badge' | url)
},
{
text: 'Organisation switcher',
href: ('/components/organisation-switcher' | url)
},
{
text: 'Page header actions',
href: ('/components/page-header-actions' | url)
},
{
text: 'Pagination',
href: ('/components/pagination' | url)
},
{
text: 'Password reveal',
href: ('/components/password-reveal' | url)
},
{
text: 'Primary navigation',
href: ('/components/primary-navigation' | url)
},
{
text: 'Scrollable pane',
href: ('/components/scrollable-pane' | url)
},
{
text: 'Search',
href: ('/components/search' | url)
},
{
text: 'Side navigation',
href: ('/components/side-navigation' | url)
},
{
text: 'Sortable table',
href: ('/components/sortable-table' | url)
},
{
text: 'Sub navigation',
href: ('/components/sub-navigation' | url)
},
{
text: 'Ticket panel',
href: ('/components/ticket-panel' | url)
},
{
text: 'Timeline',
href: ('/components/timeline' | url)
}
]
}
]

}) }}

<hr class="govuk-section-break govuk-section-break--s govuk-section-break--visible">

{{ appSideNavigation({
items: [
{
text: 'Archived components',
href: ('/components/archived-components' | url)
}
]
}) }}

{% include "./partials/back-to-top.njk" %}
</div>

<div class="govuk-grid-column-two-thirds">
<main id="main-content" class="govuk-main-wrapper app-prose-scope" role="main">
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if not isIndex %}<span class="govuk-caption-xl">Components</span>{% endif %}
{{ title }}
</h1>

{{ content | safe }}
</main>

{% if isIndex or isArchive %}
{% else %}
{% include "./partials/get-help-and-contribute.njk" %}
{% endif %}

{% if isIndex or isArchive %}
{% else %}
{% include "./partials/get-help-and-contribute.njk" %}
{% endif %}

</div>
</div>
{% endblock %}
11 changes: 11 additions & 0 deletions docs/_includes/layouts/content.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "./base.njk" %}

{% block content %}
<div class="app-layout__content">
<h1 class="govuk-heading-xl">
{% if subsection %}<span class="govuk-caption-xl">{{ subsection }}</span>{% endif %}
{{ title }}
</h1>
{{ content | safe }}
</div>
{% endblock %}
Loading