소개를 위한 동적 콘텐츠 추가
이제 HTML 콘텐츠가 포함된 여러 페이지로 구성된 웹사이트가 있으므로 동적 HTML을 추가할 차례입니다!
이번에 배울 내용
- 프런트매터에 페이지 제목을 정의하고 HTML에서 사용
- HTML 요소를 조건부로 표시
- 여러분에 관한 콘텐츠를 추가
모든 HTML 파일은 유효한 Astro 언어입니다. 하지만 Astro를 사용하면 일반 HTML보다 더 많은 일을 할 수 있습니다!
변수 정의 및 사용
섹션 제목: 변수 정의 및 사용다음과 같은 about.astro
를 엽니다.
------<html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>Astro</title> </head> <body> <a href="/">Home</a> <a href="/about/">About</a> <a href="/blog/">Blog</a> <h1>About Me</h1> <h2>... and my new Astro site!</h2>
<p>I am working through Astro's introductory tutorial. This is the second page on my website, and it's the first one I built myself!</p>
<p>This site will update as I complete more of the tutorial, so keep checking back and see how my journey is going!</p> </body></html>