Skip to content

写下你的第一行 Astro

Get ready to…

  • 对你的新网站进行首次编辑

¥Edit your home page

  1. In your code editor, navigate in the Explorer file pane to src/pages/index.astro and click on it to open the file’s contents in an editable tab.

    The contents of your index.astro file should look like this:

    src/pages/index.astro
    ---
    ---
    <html lang="en">
    <head>
    <meta charset="utf-8" />
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <meta name="viewport" content="width=device-width" />
    <meta name="generator" content={Astro.generator} >
    <title>Astro</title>
    </head>
    <body>
    <h1>Astro</h1>
    </body>
    </html>
  2. Edit the content of your page <body>.

    Type in the editor to change the heading text on your page and save the change.

    src/pages/index.astro
    <body>
    <h1>Astro</h1>
    <h1>My Astro Site</h1>
    </body>
  3. Check the browser preview and you should see your page content updated to the new text.

恭喜!你现在是一名 Astro 开发者了!

¥Congratulations! You are now an Astro developer!

本单元的其余部分将帮助你通过版本控制和可以炫耀的已发布网站取得成功。

¥The rest of this unit will set you up for success with version control and a published website you can show off.

¥Checklist

Astro 中文网 - 粤ICP备13048890号