Example starter code from official docs
This commit is contained in:
17
src/_includes/layout.html
Normal file
17
src/_includes/layout.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>{{ title | default: "Bloggy" }}</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
{{ content }}
|
||||||
|
</main>
|
||||||
|
<footer></footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
26
src/_site/index.html
Normal file
26
src/_site/index.html
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
|
||||||
|
|
||||||
|
<h2><a href="/posts/post-1/">Post Title</a></h2>
|
||||||
|
<p><p>First post!</p>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2><a href="/posts/post-2/">Post Title Two!</a></h2>
|
||||||
|
<p><p>Second post!</p>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
<footer></footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
18
src/_site/posts/post-1/index.html
Normal file
18
src/_site/posts/post-1/index.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>Post Title</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<p>First post!</p>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
<footer></footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
18
src/_site/posts/post-2/index.html
Normal file
18
src/_site/posts/post-2/index.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<h1>Post Title Two!</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<p>Second post!</p>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
<footer></footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
9
src/index.html
Normal file
9
src/index.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
layout: layout.html
|
||||||
|
title: Hello World!
|
||||||
|
---
|
||||||
|
|
||||||
|
{% for post in collections.post %}
|
||||||
|
<h2><a href="{{ post.url }}">{{ post.data.title }}</a></h2>
|
||||||
|
<p>{{ post.content }}</p>
|
||||||
|
{% endfor %}
|
||||||
5
src/posts/post-1.md
Normal file
5
src/posts/post-1.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: Post Title
|
||||||
|
---
|
||||||
|
|
||||||
|
First post!
|
||||||
5
src/posts/post-2.md
Normal file
5
src/posts/post-2.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
title: Post Title Two!
|
||||||
|
---
|
||||||
|
|
||||||
|
Second post!
|
||||||
4
src/posts/posts.json
Normal file
4
src/posts/posts.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"layout": "layout.html",
|
||||||
|
"tags": "post"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user