Skip to content

Commit

Permalink
Revert "intruduce <link rel="canonical" href..."
Browse files Browse the repository at this point in the history
This reverts commit 491281e.
  • Loading branch information
martinheppner committed Sep 1, 2024
1 parent 4c130dd commit 248cbd8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
25 changes: 24 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,28 @@ app.use((req, res, next) => {
});

app.get([ '/*' ], function(req, res) {
res.sendFile(path.join(__dirname, '../app/index.html'));
var host = req.get('host');

if(host.indexOf('zuugle.si') >= 0) {
res.sendFile(path.join(__dirname, '../app/index-si.html'));
}
else if(host.indexOf('zuugle.it') >= 0) {
res.sendFile(path.join(__dirname, '../app/index-it.html'));
}
else if(host.indexOf('zuugle.fr') >= 0) {
res.sendFile(path.join(__dirname, '../app/index-fr.html'));
}
else if(host.indexOf('zuugle.de') >= 0) {
res.sendFile(path.join(__dirname, '../app/index-de.html'));
}
else if(host.indexOf('zuugle.ch') >= 0) {
res.sendFile(path.join(__dirname, '../app/index-ch.html'));
}
else if(host.indexOf('zuugle.li') >= 0) {
res.sendFile(path.join(__dirname, '../app/index-li.html'));
}
else {
res.sendFile(path.join(__dirname, '../app/index.html'));
}

});
2 changes: 1 addition & 1 deletion src/utils/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const get_meta_data = (page) => {
meta.twitter = '<meta property="twitter:url" content="'+host+'"><meta property="twitter:title" content="Search - '+t("start.helmet_title")+'"><meta property="twitter:description" content="'+t("index.zuugle_description")+'"><meta property="twitter:image" content="'+host+'/app_static/img/Zuugle_Opengraph.jpg">';
}

// console.log("meta: ", meta.currLang+meta.canonical+meta.preconnect_bzb+meta.opengraph+meta.twitter)
console.log("meta: ", meta.currLang+meta.canonical+meta.preconnect_bzb+meta.opengraph+meta.twitter)
return meta.currLang+meta.canonical+meta.preconnect_bzb+meta.opengraph+meta.twitter;
}

Expand Down
27 changes: 2 additions & 25 deletions src/views/Main/DetailReworked.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,32 +538,10 @@ useEffect(() => {
</Box>
);

const transform_canonical_url = () => {
let string = '';

if (!!tour && validTour) {
// <link rel="canonical" href="https://www.zuugle.at/tour/462/" hreflang="de-at"/>
// <link rel="alternate" href="https://www.zuugle.si/tour/462/" hreflang="sl-si"/>

for(let i=0; i < tour.canonical.length; i++){
let entry = tour.canonical[i];
if (entry.canonical_yn == 'y') {
string = string + '<link rel="canonical" ';
}
else {
string = string + '<link rel="alternate" ';
}
string = string + 'href="https://'+entry.zuugle_url+'" hreflang="'+entry.href_lang+'"/>';
}
}

return '';
}

const currLanguage = get_currLanguage();
let page_title = 'Zuugle';
if (!!tour) {
page_title = 'Zuugle: '+tour.title+' ('+tour.provider_name+')';
page_title = tour.title+' - '+tour.provider_name;
}

return (
Expand All @@ -581,9 +559,8 @@ useEffect(() => {
<meta property="og:image" content="{(tour?.image_url && tour?.image_url.length > 0) && tour?.image_url}" />
<meta property="twitter:url" content="'+host+'" />
<meta property="twitter:title" content="{page_title}" />
<meta property="twitter:description" content="{(tour?.description)}" />
<meta property="twitter:description" content="" />
<meta property="twitter:image" content="{(tour?.image_url && tour?.image_url.length > 0) && tour?.image_url}" />
{transform_canonical_url()}
</Helmet>
<Box className="newHeader" sx={{ position: "relative" }}>
<Box component={"div"} className="rowing blueDiv">
Expand Down

0 comments on commit 248cbd8

Please sign in to comment.