crisp-hexo-theme
crisp-hexo-theme copied to clipboard
change the photo in the index
May I ask that how I change the photo in the index of this theme
I just changed the logo path in the theme configuration file.
Specifically, I set:
logo: asset/portrait.jpg
Which corresponds to a file, public/asset/portrait.jpg. I'm hosting my blog in a subdirectory at https://specious.github.io/blog/ so using an absolute path didn't work.
Actually, I also made a change in layout/layout.ejs to accommodate the subdirectory:
--- a/layout/layout.ejs
+++ b/layout/layout.ejs
<header id="header">
- <% if (theme.logo) { %><a id="logo" href="<%- config.root %>"><img src="<%- theme.logo %>" alt="<%- config.title%>" /></a><% } %>
+ <% if (theme.logo) { %><a id="logo" href="<%- config.root %>"><img src="<%- config.root + theme.logo %>" alt="<%- config.title%>" /></a><% } %>
<h1><a href="<%- config.root %>"><%- config.author %></a></h1>
<p><%- config.subtitle %></p>
<%- partial('_partial/follow') %>