perf: cache head and header partials

- https://hexo.io/docs/templates#Optimization
This commit is contained in:
curben 2019-10-14 13:51:19 +01:00
parent 30fe50290c
commit e57d471d24
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
5 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<article id="<%= post.layout %>-<%= post.slug %>" class="h-entry article article-type-<%= post.layout %>" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<%- partial('_partial/header') %>
<%- partial('_partial/header', {}, { cache: true }) %>
<hr class="header-hr">
<div class="article-inner">
<%- partial('post/gallery') %>

View File

@ -1,5 +1,5 @@
<div class="archive-container">
<%- partial('_partial/header') %>
<%- partial('_partial/header', {}, { cache: true }) %>
<hr class="header-hr"/>
<%- partial('_partial/archive', {pagination: config.archive, index: true}) %>
</div>

View File

@ -1,5 +1,5 @@
<div class="category-container">
<%- partial('_partial/header') %>
<%- partial('_partial/header', {}, { cache: true }) %>
<hr class="header-hr">
<%- partial('_partial/archive', {pagination: config.category, index: true}) %>
</div>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="<%= config.language %>">
<%- partial('_partial/head') %>
<%- partial('_partial/head', {}, { cache: true }) %>
<%/* set /about page to use "home" page layout */%>
<% if (is_current('about/index.html')) { %>
<body class="home-body">

View File

@ -1,5 +1,5 @@
<div class="category-container">
<%- partial('_partial/header') %>
<%- partial('_partial/header', {}, { cache: true }) %>
<hr class="header-hr">
<%- partial('_partial/archive', {pagination: config.tag, index: true}) %>
</div>