Feature to Add <link rel="next/prev" href="..." > in head. #52923
-
Unable to find how to add or <link rel="prev> in Metadata. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
I was looking to do this on my next.js 13 app, so visiting web browsers were made aware of my RSS feed. To do this, I needed to put a From browsing discussions, it looks like this isn't supported using a statically defined Metadata object. Here's what I did to get this to work. import { ReactNode } from 'react'
import Footer from "./components/footer"
import Navbar from "./components/navbar"
import "../assets/styles/global.sass";
import "@fortawesome/fontawesome-svg-core/styles.css";
import { AuthProvider } from './components/auth'
import type { Metadata } from 'next'
export const metadata: Metadata = {
title: 'example.com,
description: "The Galaxy's Best Coffee",
other: {
RATING: 'RTA-5042-1996-1400-1577-RTA'
}
}
type Props = {
children: ReactNode;
}
export default function RootLayout({
children,
}: Props) {
return (
<html lang="en">
<head>
<link rel="alternate" type="application/atom+xml" title="ATOM" href="/feed/feed.xml" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/feed.rss" />
<link rel="alternate" type="application/json" title="JSON" href="/feed/feed.json" />
</head>
<body>
<AuthProvider>
<Navbar />
<div className="container">
{children}
<Footer />
</div>
</AuthProvider>
</body>
</html>
)
} In the above code, I defined my own |
Beta Was this translation helpful? Give feedback.
-
I've just found out there is a workaround which consist in injecting custom
I've just inserted this on my website and seems to work correctly.
|
Beta Was this translation helpful? Give feedback.
-
This seems like it could have issues down he track nor does it seems appropriate to put SEO tags linke next/prev under icons? |
Beta Was this translation helpful? Give feedback.
I've just found out there is a workaround which consist in injecting custom
<link />
tags using theicons
object in the Metadata APII've just inserted this on my website and seems to work correctly.
This is the output