我想将我的 NEXT.js 项目与静态网站链接 [英] I want to Link my NEXT.js project with a static website

查看:45
本文介绍了我想将我的 NEXT.js 项目与静态网站链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 HTML 和 CSS 开发的网站,它是一个静态网站,但现在我使用与 Strapi API 集成的 NEXT.js 创建了一个博客项目.我的问题是如何将我的静态网站与我的 Next.js 项目链接起来?

I have a website that I developed using HTML, CSS it's a static website, but now I created a blog project using NEXT.js Integrated with Strapi API. My question is how I can link my static website with my Next.js project?

我尝试使用链接标签,但没有用

import Link from "next/link";

function Home({ posts }) {
  return (
    <>
      <HomeHeader />
      <Link href="./index.html">
        <a>Static Page</a>
      </Link>
      <HomeLatestPosts Posts={posts} />
    </>
  );
}

推荐答案

不要使用路由器或链接"成分.只需使用带有 href 属性的标准 html a 标签即可.

Don't use the router or the "Link" component. Just use the standard html a tag with a href attribute.

 <a href="insert link"> </a> 

这篇关于我想将我的 NEXT.js 项目与静态网站链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆