Skip to content

Commit

Permalink
canonical
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskls committed Nov 18, 2024
1 parent 953ee6f commit 4491a4d
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 21 deletions.
2 changes: 2 additions & 0 deletions pages/contacts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import style from '../src/components/main/Main.module.css';
import { Contacts } from "../src/components/contacts/Contacts";
import { Space } from "../src/components/Space";
import { Helmet, HelmetProvider } from "react-helmet-async";
import CanonicalUrl from "../src/components/CanonicalUrl";

export function Contacting() {
return (
<>
<HelmetProvider>
<CanonicalUrl />
<Helmet>
<meta name="description" content="Mus rasite adresu: Vytauto g. 8O Šiauliai. Skambinkite tel: +370 600 55316 " />
<title>Kontaktai</title>
Expand Down
2 changes: 2 additions & 0 deletions pages/gallery.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import CanonicalUrl from "../src/components/CanonicalUrl"
import { Footer } from "../src/components/footer/Footer"
import { Pictures } from "../src/components/gallery/Gallery"
import { Header } from "../src/components/header/Header"
Expand All @@ -9,6 +10,7 @@ export function Gallery() {
return (
<>
<HelmetProvider>
<CanonicalUrl />
<Helmet>
<meta name="description" content="Neringos Siuvimo Studijos galerija: Peržiūrėkite mūsų sukurtų drabužių nuotraukas. Įkvėpkite savo stilių!" />
<title>Neringos Siuvimo Studijos Galerija</title>
Expand Down
2 changes: 2 additions & 0 deletions pages/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import { Header } from "../src/components/header/Header";
import { Space } from "../src/components/Space";
import { Services } from "../src/components/services/Services";
import { Helmet, HelmetProvider } from "react-helmet-async";
import CanonicalUrl from "../src/components/CanonicalUrl";

export function Home() {
return (
<>
<HelmetProvider>
<CanonicalUrl />
<Helmet>
<title>Neringos Siuvimo Studija</title>
<meta name="description" content="Profesionalios siuvimo paslaugos Šiauliuose. Siuvykla. Drabužių taisymas. Individualus siuvimas.Aplikacijos ant drabužių.Vienetinių lekalų konstravimas" />
Expand Down
2 changes: 2 additions & 0 deletions pages/prices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import style from '../src/components/main/Main.module.css';
import { Price } from "../src/components/price/Price";
import { Space } from "../src/components/Space";
import { Helmet, HelmetProvider } from "react-helmet-async";
import CanonicalUrl from "../src/components/CanonicalUrl";

export function Pricing() {
return (
<>
<HelmetProvider>
<CanonicalUrl />
<Helmet>
<meta name="description" content="Greitas ir profesionalus drabužių taisymas Šiauliuose. Kelnių palenkimas, užtrauktukų keitimas, siuvimas ir taisymas - konkurencingomis kainomis. Peržiūrėkite mūsų kainoraštį!" />
<title>Drabužių taisymo kainos Šiauliuose</title>
Expand Down
2 changes: 2 additions & 0 deletions pages/products.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import style from '../src/components/main/Main.module.css';
import { Space } from "../src/components/Space";
import { NewProduct } from "../src/components/new_product/Newproduct";
import { Helmet, HelmetProvider } from "react-helmet-async";
import CanonicalUrl from "../src/components/CanonicalUrl";

export function Product() {
return (
<>
<HelmetProvider>
<CanonicalUrl />
<Helmet>
<meta name="description" content="Sušilkite stilingai su unikaliais, pagal užsakymą siuvamais flisiniais džemperiais Šiauliuose! Rinkitės ir pritaikykite dydį, spalvą ir detales. Užsisakykite ir mėgaukitės šiluma!" />
<title>Šilti flisiniai džemperiai</title>
Expand Down
2 changes: 2 additions & 0 deletions pages/repair.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import style from '../src/components/main/Main.module.css';
import { Repair } from "../src/components/repair/Repair";
import { Space } from "../src/components/Space";
import { Helmet, HelmetProvider } from "react-helmet-async";
import CanonicalUrl from "../src/components/CanonicalUrl";

export function Repairing() {
return (
<>
<HelmetProvider>
<CanonicalUrl />
<Helmet>
<meta name="description" content="Profesionalus drabužių taisymas Šiauliuose.Trumpiname, ilginame, siauriname, keičiame užtrauktukus ir atliekame kitus remonto darbus. Užsukite ir suteikite savo drabužiams antrą gyvenimą!"/>
<title>Rūbų Remonto Dirbtuvės</title>
Expand Down
2 changes: 2 additions & 0 deletions pages/sewing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import { Sewing } from "../src/components/sewing/Sewing";
import { Design } from "../src/components/design/Design";
import { Space } from "../src/components/Space";
import { Helmet, HelmetProvider } from "react-helmet-async";
import CanonicalUrl from "../src/components/CanonicalUrl";

export function Sew() {
return (
<>
<HelmetProvider>
<CanonicalUrl />
<Helmet>
<meta name="description" content="Ieškote siuvėjos Šiauliuose? Individualus suknelių, kelnių, kostiumėlių ir kitų drabužių siuvimas pagal Jūsų figūrą ir pageidavimus.Stilingi ir kokybiški drabužiai už patrauklią kainą." />
<title>Siuvykla Šiauliuose</title>
Expand Down
2 changes: 0 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ import { Pricing } from '../pages/prices';
import { Contacting } from '../pages/contacts';
import { Gallery } from '../pages/gallery';
import GoogleAnalytics from './googleAnalytics';
import CanonicalUrl from './components/CanonicalUrl';

export function App() {
return (
<>
<HelmetProvider>
<GoogleAnalytics />
<CanonicalUrl />
<Router>
<Routes>
<Route path="/" element={<Home />} />
Expand Down
32 changes: 13 additions & 19 deletions src/components/CanonicalUrl.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import { Helmet } from "react-helmet-async";
import { Helmet } from "react-helmet-async";
import { useLocation } from 'react-router-dom';

const CanonicalUrl = () => {
const canonicalUrl = 'https://www.neringos-siuvimo-studija.lt';
const location = useLocation();
let canonicalUrl = `https://www.neringos-siuvimo-studija.lt`;

return (
<Helmet>
<link rel="canonical" href={canonicalUrl} />
{[
'http://neringos-siuvimo-studija.lt',
'https://neringos-siuvimo-studija.lt',
'http://www.neringos-siuvimo-studija.lt',
'http://neringossiuvimostudija.lt',
'https://neringossiuvimostudija.lt',
'http://www.neringossiuvimostudija.lt',
'https://www.neringossiuvimostudija.lt',
'https://siuvimo-studija-3.vercel.app'
].map((url) => (
<link key={url} rel="alternate" href={url} />
))}
</Helmet>
);
if (location.pathname !== '/') {
canonicalUrl += location.pathname;
}

return (
<Helmet>
<link rel="canonical" href={canonicalUrl} />
</Helmet>
);
};

export default CanonicalUrl;

0 comments on commit 4491a4d

Please sign in to comment.