i18n
xaoxuu 5 years ago
parent 84dd201daf
commit 94e126241d
  1. 10
      _config.yml
  2. 23
      layout/_cover/search.ejs
  3. 8
      layout/layout.ejs
  4. 4
      source/js/app.js
  5. 5
      source/less/_base.less
  6. 2
      source/less/_header.less

@ -4,9 +4,9 @@ info:
docs: https://xaoxuu.com/wiki/material-x/
cdn: # 把对应的那一行注释掉就使用本地的文件
css:
style: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.9/css/style.css
style: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.10/css/style.css
js:
app: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.9/js/app.js
app: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.10/js/app.js
search: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.9/js/search.js
volantis: https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1/js/volantis.min.js
@ -46,8 +46,8 @@ updated_date_format: 'llll' # 文章更新日期的格式
############################### 自定义 ###############################
# 主页封面
home_cover:
# page的封面
cover:
scheme: search # 后期将会提供多种封面方案
# height: half # full(默认值): 首页封面占据整个第一屏幕,其他页面占半个屏幕高度, half: 所有页面都封面都只占半个屏幕高度
title: "xaoxuu"
@ -57,7 +57,7 @@ home_cover:
features:
- name: 博文
icon: fas fa-rss
url: '#posts'
url: /
- name: 项目
icon: fas fa-code-branch
url: projects/

@ -1,33 +1,26 @@
<% if (theme.home_cover.logo) { %>
<img class='logo' src='<%- url_for(theme.home_cover.logo) %>'/>
<% if (theme.cover.logo) { %>
<img class='logo' src='<%- url_for(theme.cover.logo) %>'/>
<% } else { %>
<h1 class='title'><%- theme.home_cover.title ? theme.home_cover.title : config.title %></h1>
<h1 class='title'><%- theme.cover.title ? theme.cover.title : config.title %></h1>
<% } %>
<br>
<% if (theme.search.enable === true) { %>
<div class="m_search">
<form name="searchform" class="form u-search-form">
<input type="text" class="input u-search-input" placeholder="<%- theme.home_cover.search_placeholder %>" />
<input type="text" class="input u-search-input" placeholder="<%- theme.cover.search_placeholder %>" />
<span class="icon"><i class="fas fa-search fa-fw"></i></span>
</form>
</div>
<% } %>
<div class='menu navgation'>
<ul class='h-list'>
<% if (theme.home_cover.features) { %>
<% (theme.home_cover.features || []).forEach(function(value){ %>
<% if (theme.cover.features) { %>
<% (theme.cover.features || []).forEach(function(value){ %>
<li>
<% if (value.url == '#posts') { %>
<a id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>"
class="posts" >
<a class="nav home" href="<%= url_for(value.url) %>"
id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>">
<i class='<%= value.icon %> fa-fw'></i>&nbsp;<%= __('navbar.'+value.name) == ('navbar.'+value.name) ? value.name : __('navbar.'+value.name) %>
</a>
<% } else { %>
<a id="<%= url_for(value.url).replace(/\/|%/g, "")?url_for(value.url).replace(/\/|%/g, ""):"home" %>"
class="nav home" href="<%= url_for(value.url) %>" >
<i class='<%= value.icon %> fa-fw'></i>&nbsp;<%= __('navbar.'+value.name) == ('navbar.'+value.name) ? value.name : __('navbar.'+value.name) %>
</a>
<% } %>
</li>
<%})%>
<% } %>

@ -2,10 +2,10 @@
<html>
<%- partial('_partial/head') %>
<body>
<% if (!page.prev && theme.home_cover) { %>
<div class="home-wrapper">
<div class='home-cover <%- is_home() ? theme.home_cover.height : "half" %>'>
<% if (theme.home_cover.scheme == 'search') { %>
<% if (!page.prev && theme.cover) { %>
<div class="cover-wrapper">
<div class='cover <%- is_home() ? theme.cover.height : "half" %>'>
<% if (theme.cover.scheme == 'search') { %>
<%- partial('_cover/search') %>
<% } %>
</div>

@ -13,7 +13,7 @@ var customSearch;
function setBackToTop(){
const $top = $('.s-top', '.l_body');
let pos = document.body.scrollTop;
const $header = $('.l_header', '.home-wrapper');
const $header = $('.l_header', '.cover-wrapper');
$(document, window).scroll(() => {
const scrollTop = $(window).scrollTop();
const del = scrollTop - pos;
@ -229,7 +229,7 @@ var customSearch;
}, 300);
// posts
const $postsBtn = $('.menu .posts');
const $postsBtn = $('.menu .active');
const $postsTarget = $('.l_body');
if ($postsBtn.length && $postsTarget) {
$postsBtn.click(e => { e.preventDefault(); e.stopPropagation(); scrolltoElement($postsTarget); });

@ -47,7 +47,8 @@ fancybox{
justify-content: center;
}
.home-cover{
.cover-wrapper{
.cover{
top: 0;
left: 0;
max-width: 100%;
@ -197,6 +198,8 @@ fancybox{
}
}
}
.z-depth-nav {

@ -341,7 +341,7 @@
}
}
}
.home-wrapper{
.cover-wrapper{
.l_header{
.enable-trans(0.5s);
transform: translateY(-1.5*@height_navbar);

Loading…
Cancel
Save