Skip to content

Commit

Permalink
list js javascript nur laden wenn benötigt.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcilurzo committed Jun 28, 2024
1 parent 1a4ef7f commit aac9ca4
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 36 deletions.
26 changes: 5 additions & 21 deletions src/_includes/head.njk
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,19 @@
<base href="http://localhost:8080/">
{% endif %}

<link
rel="preload"
href="https://cdn.app.sbb.ch/fonts/v1_6_subset/SBBWeb-Roman.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="https://cdn.app.sbb.ch/fonts/v1_6_subset/SBBWeb-Bold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="https://cdn.app.sbb.ch/fonts/v1_6_subset/SBBWeb-Light.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link rel="preload" href="https://cdn.app.sbb.ch/fonts/v1_6_subset/SBBWeb-Roman.woff2" as="font" type="font/woff2" crossorigin="anonymous"/>
<link rel="preload" href="https://cdn.app.sbb.ch/fonts/v1_6_subset/SBBWeb-Bold.woff2" as="font" type="font/woff2" crossorigin="anonymous"/>
<link rel="preload" href="https://cdn.app.sbb.ch/fonts/v1_6_subset/SBBWeb-Light.woff2" as="font" type="font/woff2" crossorigin="anonymous"/>

<link rel="stylesheet" href="/assets/css/lyne.css">
<link rel="stylesheet" href="/assets/css/styles.css">

<link rel="modulepreload" href="/assets/js/lyne-bundle.js" />
<link rel="modulepreload" href="/assets/js/ux-components/ux-components.esm.js" />

{% if (layout == "community-assets.njk") or (layout == "assets.njk") or (layout == "overview.njk") or (layout == "overview-lyne.njk") or (layout == "pattern.njk")or (layout == "pattern-lyne.njk") %}
<script src="/assets/js/listjs/list.min.js"></script>
{% endif %}

<link rel="apple-touch-icon" href="/assets/images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/favicon/favicon-32x32.png">
Expand Down
10 changes: 10 additions & 0 deletions src/_layouts/assets.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: base.njk
---
{% if availablelanguages.length %}
{% include "../_includes/missing-languages.njk" %}
{% else %}
{% include "../_includes/title.njk" %}
{{ content | safe }}
{% endif %}

6 changes: 3 additions & 3 deletions src/_layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
</sbb-container>
{% include "../_includes/footer.njk" %}

<script type="module" src="/assets/js/lyne-bundle.js"></script>
<script type="module" src="/assets/js/ux-components/ux-components.esm.js"></script>

<script src="/assets/js/navigation.js"></script>
{% if layout == "community-assets.njk" %}
<script src="/assets/js/community-assets.js"></script>
Expand All @@ -36,9 +39,6 @@
<script>hljs.highlightAll();</script>
{% else %}
{% endif %}

<script type="module" src="/assets/js/lyne-bundle.js"></script>
<script type="module" src="/assets/js/ux-components/ux-components.esm.js"></script>
</body>
</html>

Expand Down
2 changes: 1 addition & 1 deletion src/de/foundation/assets/fpl/fpl.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: fpl_de
title: Fahrplan-Icons
Expand Down
2 changes: 1 addition & 1 deletion src/de/foundation/assets/icons/icons.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: icons_de
title: Icons
Expand Down
2 changes: 1 addition & 1 deletion src/de/foundation/assets/pictos/pictos.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: pictos_de
title: Piktogramme
Expand Down
2 changes: 1 addition & 1 deletion src/en/foundation/assets/fpl/fpl.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: fpl_en
title: Timetable icons
Expand Down
2 changes: 1 addition & 1 deletion src/en/foundation/assets/icons/icons.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: icons_en
title: Icons
Expand Down
2 changes: 1 addition & 1 deletion src/en/foundation/assets/pictos/pictos.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: pictos_en
title: Pictograms
Expand Down
2 changes: 1 addition & 1 deletion src/fr/foundation/assets/fpl/fpl.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: fpl_fr
title: Icônes de l’horaire
Expand Down
2 changes: 1 addition & 1 deletion src/fr/foundation/assets/icons/icons.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: icons_fr
title: Icônes
Expand Down
2 changes: 1 addition & 1 deletion src/fr/foundation/assets/pictos/pictos.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: pictos_fr
title: Pictogrammes
Expand Down
2 changes: 1 addition & 1 deletion src/it/foundation/assets/fpl/fpl.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: fpl_it
title: Icone dell'orario
Expand Down
2 changes: 1 addition & 1 deletion src/it/foundation/assets/icons/icons.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: icons_it
title: Icone
Expand Down
2 changes: 1 addition & 1 deletion src/it/foundation/assets/pictos/pictos.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: page.njk
layout: assets.njk
tags: page
key: pictos_it
title: Pittogrammi
Expand Down

0 comments on commit aac9ca4

Please sign in to comment.