Skip to content

Commit

Permalink
Rename default Markdown layout name.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeanwallace committed Mar 27, 2024
1 parent b7d3ce4 commit 3d1c675
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mysite/
│   └── my-story.html
├── jinjabread.toml
├── layouts
│   └── base.html
│   └── markdown.html
├── public
│   ├── about.html
│   ├── index.html
Expand Down Expand Up @@ -119,7 +119,7 @@ prettify_html = true
[[pages]]
type = "jinjabread.MarkdownPage"
glob_pattern = "**/*.md"
layout_name = "base.html"
layout_name = "markdown.html"

[[pages]]
type = "jinjabread.Page"
Expand Down Expand Up @@ -165,7 +165,7 @@ output_dir = "dist"
[[pages]]
type = "jinjabread.MarkdownPage"
glob_pattern = "**/*.md"
layout_name = "base.html"
layout_name = "markdown.html"

[[pages]]
type = "jinjabread.Page"
Expand Down Expand Up @@ -206,7 +206,7 @@ It was a cold stormy night...
```

```html
<!-- layouts/base.html -->
<!-- layouts/markdown.html -->
<h1>{{ title }}</h1>
<h2>{{ description }}</h2>
<h3>Written by {{ author }}</h3>
Expand Down
2 changes: 1 addition & 1 deletion jinjabread/defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ prettify_html = true

[[pages]]
type = "jinjabread.MarkdownPage"
layout_name = "base.html"
layout_name = "markdown.html"

[[pages]]
type = "jinjabread.Page"
2 changes: 1 addition & 1 deletion jinjabread/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def new(*, project_dir=None):
This is my new website.
""".lstrip()
)
layout_file = project_dir / "layouts" / "base.html"
layout_file = project_dir / "layouts" / "markdown.html"
layout_file.parent.mkdir(parents=True)
with layout_file.open("w") as file:
file.write(
Expand Down
4 changes: 2 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ def test_html_content_extends_layout(self):
with content_path.open("w") as file:
file.write(
"""
{% extends 'base.html' %}
{% extends 'markdown.html' %}
{% block body %}
<p>Blah blah blah</p>
{% endblock body %}
"""
)
layout_path = self.working_dir / "layouts" / "base.html"
layout_path = self.working_dir / "layouts" / "markdown.html"
layout_path.parent.mkdir(parents=True, exist_ok=True)
with layout_path.open("w") as file:
file.write(
Expand Down

0 comments on commit 3d1c675

Please sign in to comment.