Skip to content

Commit

Permalink
raw fixex
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Jones committed May 11, 2024
1 parent 7af14ee commit f740915
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "layouts/content-full-width.html" %}
{% set canonical = "https://design.education.gov.uk/design-system/dfe-frontend/updating-from-alpha"%}
{% set canonical = "https://design.education.gov.uk/design-system/dfe-frontend/updating" %}
{% set pageName = "Updating to dfe-frontend" %}
{% set pageDescription = "Guidance for updating your project to move from using dfe-frontend-alpha to dfe-frontend." %}
{% set selectedNav = "Design system" %}
Expand Down Expand Up @@ -49,7 +49,8 @@ <h1 class="govuk-heading-xl govuk-!-margin-top-5">{{pageName}}</h1>
<div class="govuk-grid-column-three-quarters">

<p>This guidance will help you move your project from <code>dfe-frontend-alpha</code> to
<code>dfe-frontend</code>.</p>
<code>dfe-frontend</code>.
</p>



Expand Down Expand Up @@ -78,7 +79,7 @@ <h2 class="govuk-summary-card__title">2. Install dfe-frontend</h2>
</div>
</div>

<p>Update references to the new package.</p>
<p>Update references to the new package.</p>

<div class="govuk-summary-card">
<div class="govuk-summary-card__title-wrapper">
Expand Down Expand Up @@ -112,10 +113,7 @@ <h2 class="govuk-summary-card__title">4. Update references for scripts</h2>
</div>
</div>

{% block scripts %}
{{ super() }}
<script src="/node_modules/dfe-frontend/dist/dfefrontend.min.js"></script>
{% endblock %}


<h3 class="govuk-heading-m">Header update</h3>

Expand All @@ -138,9 +136,7 @@ <h2 class="govuk-summary-card__title">5. Update node package reference</h2>
</div>
<div class="govuk-summary-card__content">
<p>Replace:</p>
<p>{%
raw%}<code>{% from 'node_modules/dfe-frontend-alpha/packages/components/header/macro.njk' import header %}</code>{%
endraw%}</p>
<p>{% raw%}<code>{% from 'node_modules/dfe-frontend-alpha/packages/components/header/macro.njk' import header %}</code>{%endraw%}</p>
<p>With:</p>
<p>{%raw%}
<pre><code>{% from 'node_modules/dfe-frontend/packages/components/header/macro.njk' import header %}</code></pre>
Expand Down Expand Up @@ -177,7 +173,7 @@ <h2 class="govuk-summary-card__title">7. Header logo link</h2>
<p>Add <code>"logoAltText": "Department for Education",</code> to the main list of nodes.</p>

</div>
</div>
</div>

<p>You should always check the published <a href="/design-system/components/header/variants">examples in
the header variants</a> for how to implement them correctly.</p>
Expand All @@ -186,5 +182,6 @@ <h2 class="govuk-summary-card__title">7. Header logo link</h2>
</div>
</div>
</div>
</section>

{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion app/views/design-system/dfe-frontend/whats-new.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h3 class="govuk-heading-m">Version 2.0.0</h3>
<li>Added the card component</li>
</ul>

<p><a href="/design-system/dfe-frontend/updating-from-alpha">Guidance for updating to dfe-frontend</a>
<p><a href="/design-system/dfe-frontend/updating">Guidance for updating to dfe-frontend</a>
from <code>dfe-frontend-alpha</code>.</p>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions app/views/includes/_side-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@
] %}

{% set dfefrontend = [
{
title: "Design system",
url: "/design-system"
},
{
title: "Design system",
url: "/design-system"
},
{
title: "Using DfE Frontend",
url: "/design-system/dfe-frontend"
Expand All @@ -118,7 +118,7 @@
url: "/design-system/dfe-frontend/installation"
},{
title: "Updating to dfe-frontend",
url: "/design-system/dfe-frontend/updating-from-alpha"
url: "/design-system/dfe-frontend/updating"
},{
title: "Release history",
url: "/design-system/dfe-frontend/whats-new"
Expand Down
22 changes: 11 additions & 11 deletions app/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2 class="govuk-heading-l">DfE Frontend V2 is now available</h2>
and the new <code>dfe-frontend</code> package.</p>

<ul class="govuk-list govuk-list--spaced">
<li><a href="/design-system/dfe-frontend/updating-from-alpha">Update to dfe-frontend from
<li><a href="/design-system/dfe-frontend/updating">Update to dfe-frontend from
dfe-frontend-alpha</a></li>
<li><a href="/design-system/dfe-frontend/whats-new">What's new in dfe-frontend 2</a></li>
</ul>
Expand Down Expand Up @@ -159,7 +159,7 @@ <h3 class="govuk-heading-m">
<h2 class="govuk-heading-l">Quick tools</h2>
</div>
<div class="govuk-grid-column-one-half">

<div class="govuk-summary-card">
<div class="govuk-summary-card__title-wrapper">
<h2 class="govuk-summary-card__title">How many people?</h2>
Expand All @@ -186,15 +186,15 @@ <h2 class="govuk-summary-card__title">How many people?</h2>
</div>
</div>
<div class="govuk-grid-column-one-half">
<h2 class="govuk-heading-m">Should your product be on GOV.UK?</h2>

<p>This tool will help you to determine whether your product should be on or connected to GOV.UK and
whether
it meets the GOV.UK proposition.</p>
<p><a href="/tools/proposition-checker" class="govuk-link">Check your product</a></p>

<h2 class="govuk-heading-m">Should your product be on GOV.UK?</h2>


<p>This tool will help you to determine whether your product should be on or connected to GOV.UK and
whether
it meets the GOV.UK proposition.</p>
<p><a href="/tools/proposition-checker" class="govuk-link">Check your product</a></p>

</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/site-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ul>
<li><a href="/design-system/installation">Getting Started</a></li>
<li><a href="/design-system/dfe-frontend">DfE Frontend</a></li>
<li><a href="/design-system/dfe-frontend/updating-from-alpha">Updating from dfe-frontend-alpha</a></li>
<li><a href="/design-system/dfe-frontend/updating">Updating from dfe-frontend-alpha</a></li>
<li><a href="/design-system/styles">Styles</a>
<ul>
<li><a href="/design-system/styles/typography">Typography</a></li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<priority>0.64</priority>
</url>
<url>
<loc>https://design.education.gov.uk/design-system/dfe-frontend/updating-from-alpha</loc>
<loc>https://design.education.gov.uk/design-system/dfe-frontend/updating</loc>
<lastmod>2024-03-07T20:29:10+00:00</lastmod>
<priority>0.64</priority>
</url>
Expand Down
24 changes: 0 additions & 24 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,30 +179,6 @@ app.get('/design-ops/maturity/results/september-2023', function (req, res) {
res.render('design-ops/maturity/results/september-2023', { data })
})

app.get(
'/design-system/dfe-frontend/updating-from-alpha',
function (req, res, next) {
const packageName = 'dfe-frontend'

axios
.get(`https://registry.npmjs.org/${packageName}`)
.then((response) => {
const version = response.data['dist-tags'].latest
const lastUpdatedv = new Date(
response.data.time.modified
).toISOString()

res.render('design-system/dfe-frontend/updating-from-alpha.html', {
version,
lastUpdatedv
})
})
.catch((error) => {
console.error(error)
})
}
)

app.get(
'/design-system/dfe-frontend',
function (req, res, next) {
Expand Down

0 comments on commit f740915

Please sign in to comment.