crisp-hexo-theme icon indicating copy to clipboard operation
crisp-hexo-theme copied to clipboard

change the photo in the index

Open hustlrr opened this issue 9 years ago • 2 comments

May I ask that how I change the photo in the index of this theme

hustlrr avatar Dec 18 '16 02:12 hustlrr

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.

specious avatar Dec 21 '16 23:12 specious

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') %>

specious avatar Dec 23 '16 04:12 specious