Skip to content

Commit 8e1a74d

Browse files
committed
Merge views subtree
2 parents 88439bf + 69d8575 commit 8e1a74d

File tree

2 files changed

+66
-2
lines changed

2 files changed

+66
-2
lines changed

template/pages/#cms/pages.ejs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<%
22
const { slug, content } = await _.resolveRoute()
3+
const isNotFound = !Object.keys(content).length
34
_.breadcrumbs = [{
45
name: content.title,
56
link: `/pages/${slug}`
@@ -15,4 +16,35 @@ if (!content.sections || !content.sections.length) {
1516
}
1617
%>
1718

18-
<%- await include('@/view') %>
19+
<% if (!isNotFound) { %>
20+
<%- await include('@/view') %>
21+
<% } else { %>
22+
<!doctype html>
23+
<html lang="<%= _.lang.replace('_', '-') %>" dir="ltr">
24+
<head>
25+
<%- await include('@/head') %>
26+
</head>
27+
<body id="page-404">
28+
<%- await include('@/layout/menu') %>
29+
<main role="main" id="main">
30+
<%- await include('@/layout/header') %>
31+
<div class="container py-5">
32+
<article id="fallback-404">
33+
<p class="display-1">
34+
<b>404</b>
35+
</p>
36+
<p class="display-4 text-muted">
37+
Página não encontrada.
38+
</p>
39+
<p class="display-4">
40+
<a href="/">Ir para a home</a>
41+
</p>
42+
</article>
43+
</div>
44+
<%- await include('@/layout/footer') %>
45+
</main>
46+
<%- await include('@/json') %>
47+
<%- await include('@/scripts') %>
48+
</body>
49+
</html>
50+
<% } %>

template/pages/#cms/posts.ejs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<%
22
const blogPage = _.cms('blog')
33
const { slug, content } = await _.resolveRoute()
4+
const isNotFound = !Object.keys(content).length
45
_.breadcrumbs = [{
56
name: blogPage.title,
67
link: `/blog`
@@ -19,4 +20,35 @@ if (!content.sections || !content.sections.length) {
1920
}
2021
%>
2122

22-
<%- await include('@/view') %>
23+
<% if (!isNotFound) { %>
24+
<%- await include('@/view') %>
25+
<% } else { %>
26+
<!doctype html>
27+
<html lang="<%= _.lang.replace('_', '-') %>" dir="ltr">
28+
<head>
29+
<%- await include('@/head') %>
30+
</head>
31+
<body id="page-404">
32+
<%- await include('@/layout/menu') %>
33+
<main role="main" id="main">
34+
<%- await include('@/layout/header') %>
35+
<div class="container py-5">
36+
<article id="fallback-404">
37+
<p class="display-1">
38+
<b>404</b>
39+
</p>
40+
<p class="display-4 text-muted">
41+
Post não encontrado.
42+
</p>
43+
<p class="display-4">
44+
<a href="/blog">Ir para o blog</a>
45+
</p>
46+
</article>
47+
</div>
48+
<%- await include('@/layout/footer') %>
49+
</main>
50+
<%- await include('@/json') %>
51+
<%- await include('@/scripts') %>
52+
</body>
53+
</html>
54+
<% } %>

0 commit comments

Comments
 (0)