Skip to content

Commit

Permalink
Fix double post title
Browse files Browse the repository at this point in the history
By creating separate base and default layout
  • Loading branch information
chrisglein committed Dec 29, 2023
1 parent 90a8e00 commit 18312fd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 39 deletions.
31 changes: 31 additions & 0 deletions _layouts/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en-us">

{% include head.html %}

<body class="theme-base-0e layout-reverse">

{% include sidebar.html %}

<!-- Wrap is the content to shift when toggling the sidebar. We wrap the
content to avoid any CSS collisions with our real content. -->
<div class="wrap">
<div class="masthead">
<div class="container">
<h3 class="masthead-title">
<a href="{{ site.baseurl }}/" title="Home">{{ site.title }}</a>
<small>{{ site.tagline }}</small>
</h3>
</div>
</div>

<div class="container content">
{{ content }}
</div>
</div>

<label for="sidebar-checkbox" class="sidebar-toggle"></label>

<script src='{{ site.baseurl }}/public/js/script.js'></script>
</body>
</html>
52 changes: 14 additions & 38 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
<!DOCTYPE html>
<html lang="en-us">

{% include head.html %}

<body class="theme-base-0e reverse-layout">

{% include sidebar.html %}

<!-- Wrap is the content to shift when toggling the sidebar. We wrap the
content to avoid any CSS collisions with our real content. -->
<div class="wrap">
<div class="masthead">
<div class="container">
<h3 class="masthead-title">
<a href="{{ site.baseurl }}/" title="Home">{{ site.title }}</a>
<small>{{ site.tagline }}</small>
</h3>
</div>
</div>

<div class="container content">
{% if page.title %}
<h1 id="page-title">{{ page.title }}</h1>
{% endif %}
{% if page.description %}
<p id="page-description" class="message">{{ page.description }}</p>
{% endif %}

{{ content }}
</div>
</div>

<label for="sidebar-checkbox" class="sidebar-toggle"></label>

<script src='{{ site.baseurl }}/public/js/script.js'></script>
</body>
</html>
---
layout: base
---

<div class="page">
{% if page.title %}
<h1 id="page-title">{{ page.title }}</h1>
{% endif %}
{% if page.description %}
<p id="page-description" class="message">{{ page.description }}</p>
{% endif %}

{{ content }}
</div>
2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: default
layout: base
---

<div class="post">
Expand Down

0 comments on commit 18312fd

Please sign in to comment.