Skip to content

Commit

Permalink
Remove duplicate guides from kit (#385)
Browse files Browse the repository at this point in the history
This removes the duplicate install guide, how to guides, branching examples and passing data from page to page examples, and the documentation homepage from kit.

These guides are all now hosted separately in on the [NHS.UK prototype kit](https://prototype-kit.service-manual.nhs.uk) website and maintained within a separate repository: [nhsuk.service-manual.prototype-kit.docs](http://github.com/nhsuk/nhsuk.service-manual.prototype-kit.docs).

This is intended to allow us to update the guidance more frequently (outside of the prototype kit release cycle). It also means that uses of the kit will always access the most up-to-date versions of the guidance, even if their prototype is a few versions old. 

The one acknowledged downside is that it means you now need to be online to view the guidance, vs having a local copy.

The one bit I’ve not removed is the collection of example page templates. These are also duplicated on the prototype kit website at https://prototype-kit.service-manual.nhs.uk/page-templates - however they might be more useful to have locally, as it’ll be easier to copy-and-paste them.  I've created a separate issue to consider what the best thing to do with the templates is: [#60](nhsuk/nhsuk.service-manual.prototype-kit.docs#60).
  • Loading branch information
frankieroberto authored Nov 11, 2024
1 parent dc8940c commit 9002146
Show file tree
Hide file tree
Showing 68 changed files with 13 additions and 3,017 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# NHS.UK prototype kit Changelog

## Unreleased

- Remove guidance and tutorials - these can now be found online on the [NHS Prototype Kit website](https://prototype-kit.service-manual.nhs.uk) - ([PR 385](https://github.com/nhsuk/nhsuk-prototype-kit/pull/385))

## 5.0.0 - 15 October 2024

:new: **New features**
Expand Down
5 changes: 0 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,6 @@ if (useDocumentation || onlyDocumentation === 'true') {
});
}

// Clear all data in session if you open /examples/passing-data/clear-data
app.post('/examples/passing-data/clear-data', (req, res) => {
req.session.data = {};
res.render('examples/passing-data/clear-data-success');
});

app.use('/prototype-admin', prototypeAdminRoutes);

Expand Down
13 changes: 5 additions & 8 deletions app/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

<!-- Extends the layout from /views/layout.html -->
{% extends 'layout.html' %}
<!--
<!--
In /views/layout.html you can:
- change the header and footer
- change the header and footer
- add custom CSS and JavaScript
-->

Expand Down Expand Up @@ -49,13 +49,13 @@ <h2>
<p>
Use this page as the index for your project.
</p>

<p>
You'll find the code for this page at <strong>/app/views/index.html</strong>.
</p>

<p>
There is also an <a href="/page-example">example page</a>, which contains a selection of NHS.UK frontend styles and components.
There is also an <a href="/page-example">example page</a>, which contains a selection of NHS.UK frontend styles and components and some <a href="/docs/page-templates">page templates</a>.
</p>

<hr>
Expand All @@ -68,10 +68,7 @@ <h2>

<ul>
<li>
<a href="/docs/how-tos">how to guides</a>
</li>
<li>
<a href="/docs/page-templates">page templates</a>
<a href="https://prototype-kit.service-manual.nhs.uk/how-tos">how to guides</a>
</li>
<li>
code snippets for styles and components from the <a href="https://service-manual.nhs.uk/design-system">NHS digital service manual</a>
Expand Down
7 changes: 0 additions & 7 deletions docs/assets/javascript/prism.js

This file was deleted.

68 changes: 0 additions & 68 deletions docs/assets/sass/docs.scss

This file was deleted.

140 changes: 0 additions & 140 deletions docs/assets/sass/prism.scss

This file was deleted.

52 changes: 0 additions & 52 deletions docs/documentation_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,4 @@ const packageJson = require('../package.json');

const router = express.Router();

// Documentation router
router.get('/', (req, res) => {
res.render('index');
});

// Install guide branching
router.post('/install', (req, res) => {
const { install } = req.session.data;

if (install === 'Simple') {
res.redirect('/docs/install/simple');
}
if (install === 'Developer') {
res.redirect('/docs/install/advanced');
} else {
res.redirect('/docs/install/download-zip');
}
});

// Install - Mac or Windows branching
router.post('/install/mac', (req, res) => {
const { machine } = req.session.data;

if (machine === 'Mac') {
res.redirect('/docs/install/mac/terminal');
} else {
res.redirect('/docs/install/windows/terminal');
}
});

router.get('/download', (req, res) => {
const { version } = packageJson;
res.redirect(
`https://github.com/nhsuk/nhsuk-prototype-kit/archive/refs/tags/v${version}.zip`,
);
});

// Branching example
router.post('/examples/branching/answer', (req, res) => {
// Make a variable and give it the value from 'know-nhs-number'
const nhsNumber = req.session.data['know-nhs-number'];

// Check whether the variable matches a condition
if (nhsNumber === 'Yes') {
// Send user to next page
res.redirect('/docs/examples/branching/answer-yes');
} else {
// Send user to ineligible page
res.redirect('/docs/examples/branching/answer-no');
}
});

module.exports = router;
Loading

0 comments on commit 9002146

Please sign in to comment.