简体   繁体   English

编写 React/Framework 组件并构建纯 html/css

[英]Write React/Framework components and build pure html/css

What i'm trying to accomplish is to build tool that will let me build website like lego blocks.我想要完成的是构建工具,让我可以像乐高积木一样构建网站。 This way i will have most unique blogs without too much coding.这样,我将拥有最独特的博客,而无需太多编码。 For example i want 100 wordpress looking blogs.例如,我想要 100 个 wordpress 寻找博客。 Each blog will have header/main/sidebar/footer.每个博客都会有页眉/主/侧边栏/页脚。 So i'm thinking about coding 5 headers, 5 main, 5 sidebar, 5 footer each as component.所以我正在考虑将 5 个标题、5 个主要、5 个侧边栏、5 个页脚分别编码为组件。 Then i will randomly use header A, main B, sidebar C, footer D and voila i have first blog:) The blogs needs to be as unique as they can be using this method.然后我将随机使用 header A,主 B,侧边栏 C,页脚 D,瞧,我有第一个博客:) 博客需要尽可能独特,因为它们可以使用这种方法。 Second important this is that i have to have them as html/css not js.第二个重要的是我必须将它们作为 html/css 而不是 js。 So i was looking for framework that will let me achive this.所以我一直在寻找可以让我实现这一目标的框架。 First i was looking at gatsbyjs, but i cannot get html files, then i tried nextjs because there at build U can export html.首先我正在查看 gatsbyjs,但我无法获取 html 文件,然后我尝试了 nextjs,因为在构建时 U 可以导出 html。 But in simple blog with only one main page i got such index.html但是在只有一个主页的简单博客中,我得到了这样的索引。html

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <meta name="next-head-count" content="2" />
    <noscript data-n-css=""></noscript>
    <link
      rel="preload"
      href="/_next/static/chunks/main-925041ce925730787a8a.js"
      as="script"
    />
    <link
      rel="preload"
      href="/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js"
      as="script"
    />
    <link
      rel="preload"
      href="/_next/static/chunks/framework.6323d7e8995473683279.js"
      as="script"
    />
    <link
      rel="preload"
      href="/_next/static/chunks/f6078781a05fe1bcb0902d23dbbb2662c8d200b3.964928bcb82fd5c6065f.js"
      as="script"
    />
    <link
      rel="preload"
      href="/_next/static/chunks/pages/_app-0a8231baaa9660ceaca9.js"
      as="script"
    />
    <link
      rel="preload"
      href="/_next/static/chunks/pages/index-7638f3314f35e6ffac1c.js"
      as="script"
    />
  </head>
  <body>
    <div id="__next"><div>Welcome to the Next.js blog</div></div>
    <script id="__NEXT_DATA__" type="application/json">
      {
        "props": { "pageProps": {} },
        "page": "/",
        "query": {},
        "buildId": "ElUp7syt_UnrlISSJbfd4",
        "nextExport": true,
        "autoExport": true,
        "isFallback": false
      }
    </script>
    <script
      nomodule=""
      src="/_next/static/chunks/polyfills-4acaa4b69e5977b3ab87.js"
    ></script>
    <script
      src="/_next/static/chunks/main-925041ce925730787a8a.js"
      async=""
    ></script>
    <script
      src="/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js"
      async=""
    ></script>
    <script
      src="/_next/static/chunks/framework.6323d7e8995473683279.js"
      async=""
    ></script>
    <script
      src="/_next/static/chunks/f6078781a05fe1bcb0902d23dbbb2662c8d200b3.964928bcb82fd5c6065f.js"
      async=""
    ></script>
    <script
      src="/_next/static/chunks/pages/_app-0a8231baaa9660ceaca9.js"
      async=""
    ></script>
    <script
      src="/_next/static/chunks/pages/index-7638f3314f35e6ffac1c.js"
      async=""
    ></script>
    <script
      src="/_next/static/ElUp7syt_UnrlISSJbfd4/_buildManifest.js"
      async=""
    ></script>
    <script
      src="/_next/static/ElUp7syt_UnrlISSJbfd4/_ssgManifest.js"
      async=""
    ></script>
  </body>
</html>```

Its a lot of scripts that i don't really need. Then i was thinking maybe jekyll but also couldnt find html to export. So now i.m writing here, because maybe some of U know any framework that will let me accomplish what i'm trying to do?

see if you want your app to be dynamic then you need to use js or its library or frameworks.看看您是否希望您的应用程序是动态的,那么您需要使用 js 或其库或框架。 Since you have a pre written code in html/css so you can use React https://reactjs.org/docs/add-react-to-a-website.html which can be easily added to your html/css code.由于您在 html/css 中有预先编写的代码,因此您可以使用 React https://reactjs.org/docs/add-react-to-a-website.html可以轻松添加到您的 html/css 代码中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM