首页 > 解决方案 > 使用 Nuxt.js 从单个 HTML 页面预渲染多个页面

问题描述

我有一个提供的 HTML 文件,其内容位于单独的<section>标签中。

我需要在构建期间使用 Nuxt(最好)或其他生成器将这些部分预渲染到单独的静态页面中。

提供的 HTML:

<html>
  <head>
    ...
  </head>
  <body>
    <header>...</header>
    <section id="home">...</section>
    <section id="features">...</section>
    <section id="about">...</section>
    <section id="contact">...</section>
    <footer>...</footer>
  </body>
</html>

在构建期间生成的静态页面:

index.html, features.html,about.htmlcontact.html

每个页面都包含 common和<head>content 。<header><footer>

我该怎么做呢?

对于上下文:提供的 HTML 来自站点构建器,因此我无法控制输出。我需要生成单独的静态页面,因为最终站点将托管在像 S3 这样的静态主机上。

标签: htmlvue.jsnuxt.jsstatic-site

解决方案


推荐阅读