Skip to content

Commit

Permalink
fix(pages): update/merge default views
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 18, 2024
2 parents 3b4321b + 0379e53 commit 9112a44
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 2 deletions.
34 changes: 33 additions & 1 deletion template/pages/#cms/pages.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<%
const { slug, content } = await _.resolveRoute()
const isNotFound = !Object.keys(content).length
_.breadcrumbs = [{
name: content.title,
link: `/pages/${slug}`
Expand All @@ -15,4 +16,35 @@ if (!content.sections || !content.sections.length) {
}
%>

<%- await include('@/view') %>
<% if (!isNotFound) { %>
<%- await include('@/view') %>
<% } else { %>
<!doctype html>
<html lang="<%= _.lang.replace('_', '-') %>" dir="ltr">
<head>
<%- await include('@/head') %>
</head>
<body id="page-404">
<%- await include('@/layout/menu') %>
<main role="main" id="main">
<%- await include('@/layout/header') %>
<div class="container py-5">
<article id="fallback-404">
<p class="display-1">
<b>404</b>
</p>
<p class="display-4 text-muted">
Página não encontrada.
</p>
<p class="display-4">
<a href="/">Ir para a home</a>
</p>
</article>
</div>
<%- await include('@/layout/footer') %>
</main>
<%- await include('@/json') %>
<%- await include('@/scripts') %>
</body>
</html>
<% } %>
34 changes: 33 additions & 1 deletion template/pages/#cms/posts.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<%
const blogPage = _.cms('blog')
const { slug, content } = await _.resolveRoute()
const isNotFound = !Object.keys(content).length
_.breadcrumbs = [{
name: blogPage.title,
link: `/blog`
Expand All @@ -19,4 +20,35 @@ if (!content.sections || !content.sections.length) {
}
%>

<%- await include('@/view') %>
<% if (!isNotFound) { %>
<%- await include('@/view') %>
<% } else { %>
<!doctype html>
<html lang="<%= _.lang.replace('_', '-') %>" dir="ltr">
<head>
<%- await include('@/head') %>
</head>
<body id="page-404">
<%- await include('@/layout/menu') %>
<main role="main" id="main">
<%- await include('@/layout/header') %>
<div class="container py-5">
<article id="fallback-404">
<p class="display-1">
<b>404</b>
</p>
<p class="display-4 text-muted">
Post não encontrado.
</p>
<p class="display-4">
<a href="/blog">Ir para o blog</a>
</p>
</article>
</div>
<%- await include('@/layout/footer') %>
</main>
<%- await include('@/json') %>
<%- await include('@/scripts') %>
</body>
</html>
<% } %>

0 comments on commit 9112a44

Please sign in to comment.