Skip to content

Commit

Permalink
Merge pull request #52 from betagouv/add-site-title
Browse files Browse the repository at this point in the history
Ajouter titre et metadescription
  • Loading branch information
hfroot committed Jan 15, 2021
2 parents a0c863f + ec0b106 commit 255dd7f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions front-end/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<title>ma-cantine.beta.gouv.fr</title>
<meta name="description" content="Pour une alimentatation saine, de qualité et plus durable dans nos assiettes grâce à EGAlim">
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>ma-cantine.beta.gouv.fr a besoin de Javascript pour fonctionner.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
Expand Down
8 changes: 7 additions & 1 deletion front-end/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ export default {
components: {
TheNavbar,
TheFooter,
}
},
watch: {
'$route' (to) {
const suffix = "ma-cantine.beta.gouv.fr";
document.title = to.meta.title ? to.meta.title + " - " + suffix : suffix;
}
},
}
</script>

Expand Down
3 changes: 3 additions & 0 deletions front-end/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const routes = [
path: '/mesures-phares',
name: 'KeyMeasuresPage',
component: KeyMeasuresPage,
meta: {
title: "Les 5 mesures-phares de la loi EGAlim"
}
}
];

Expand Down

0 comments on commit 255dd7f

Please sign in to comment.