chore(*): multiple improvements
parent
e94ec6f445
commit
7cc09f00e9
|
@ -4,7 +4,7 @@ module.exports = {
|
||||||
favicon: {
|
favicon: {
|
||||||
[type]: 'string',
|
[type]: 'string',
|
||||||
[doc]: 'Path or URL to the website\'s icon',
|
[doc]: 'Path or URL to the website\'s icon',
|
||||||
[defaultValue]: null
|
[defaultValue]: '/images/favicon.svg',
|
||||||
},
|
},
|
||||||
rss: {
|
rss: {
|
||||||
[type]: 'string',
|
[type]: 'string',
|
||||||
|
|
|
@ -5,22 +5,27 @@ module.exports = {
|
||||||
[doc]: 'Other plugin settings',
|
[doc]: 'Other plugin settings',
|
||||||
gallery: {
|
gallery: {
|
||||||
[type]: 'boolean',
|
[type]: 'boolean',
|
||||||
[doc]: 'Enable the lightGallery and Justified Gallery plugins',
|
[doc]: 'Enable the lightGallery and Justified Gallery plugins (http://ppoffice.github.io/hexo-theme-icarus/2016/07/08/plugin/Gallery/)',
|
||||||
[defaultValue]: true
|
[defaultValue]: true
|
||||||
},
|
},
|
||||||
'outdated-browser': {
|
'outdated-browser': {
|
||||||
[type]: 'boolean',
|
[type]: 'boolean',
|
||||||
[doc]: 'Enable the Outdated Browser plugin',
|
[doc]: 'Enable the Outdated Browser plugin (http://outdatedbrowser.com/)',
|
||||||
[defaultValue]: true
|
[defaultValue]: true
|
||||||
},
|
},
|
||||||
animejs: {
|
animejs: {
|
||||||
[type]: 'boolean',
|
[type]: 'boolean',
|
||||||
[doc]: 'Enable page animations',
|
[doc]: 'Enable page animations (http://animejs.com/)',
|
||||||
[defaultValue]: true
|
[defaultValue]: true
|
||||||
},
|
},
|
||||||
mathjax: {
|
mathjax: {
|
||||||
[type]: 'boolean',
|
[type]: 'boolean',
|
||||||
[doc]: 'Enable the MathJax plugin',
|
[doc]: 'Enable the MathJax plugin (http://ppoffice.github.io/hexo-theme-icarus/2018/01/01/plugin/MathJax/)',
|
||||||
|
[defaultValue]: true
|
||||||
|
},
|
||||||
|
'back-to-top': {
|
||||||
|
[type]: 'boolean',
|
||||||
|
[doc]: 'Show the back to top button on mobile devices',
|
||||||
[defaultValue]: true
|
[defaultValue]: true
|
||||||
},
|
},
|
||||||
'google-analytics': {
|
'google-analytics': {
|
||||||
|
|
|
@ -42,7 +42,7 @@ const DEFAULT_WIDGETS = [
|
||||||
position: 'left',
|
position: 'left',
|
||||||
links: {
|
links: {
|
||||||
Hexo: 'https://hexo.io',
|
Hexo: 'https://hexo.io',
|
||||||
Github: 'https://github.com/ppoffice'
|
PPOffice: 'https://github.com/ppoffice'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -121,7 +121,7 @@ const LinksSpec = {
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
[type]: 'array',
|
[type]: 'array',
|
||||||
[doc]: 'Sidebar widget settings',
|
[doc]: 'Sidebar widget settings (http://ppoffice.github.io/hexo-theme-icarus/categories/Widgets/)',
|
||||||
[defaultValue]: DEFAULT_WIDGETS,
|
[defaultValue]: DEFAULT_WIDGETS,
|
||||||
'*': {
|
'*': {
|
||||||
[type]: 'object',
|
[type]: 'object',
|
||||||
|
|
|
@ -11,7 +11,7 @@ const ConfigGenerator = require('../common/ConfigGenerator');
|
||||||
|
|
||||||
const CONFIG_PATH = path.join(__dirname, '../..', '_config.yml');
|
const CONFIG_PATH = path.join(__dirname, '../..', '_config.yml');
|
||||||
|
|
||||||
logger.info('Checking if the configuration file exists...');
|
logger.info('Validating the configuration file');
|
||||||
|
|
||||||
if (!fs.existsSync(CONFIG_PATH)) {
|
if (!fs.existsSync(CONFIG_PATH)) {
|
||||||
const relativePath = path.relative(process.cwd(), CONFIG_PATH);
|
const relativePath = path.relative(process.cwd(), CONFIG_PATH);
|
||||||
|
@ -21,7 +21,6 @@ if (!fs.existsSync(CONFIG_PATH)) {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info('Validating the configuration file...');
|
|
||||||
const validator = new ConfigValidator(rootSpec);
|
const validator = new ConfigValidator(rootSpec);
|
||||||
const config = yaml.safeLoad(fs.readFileSync(CONFIG_PATH));
|
const config = yaml.safeLoad(fs.readFileSync(CONFIG_PATH));
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
const logger = require('hexo-log')();
|
const logger = require('hexo-log')();
|
||||||
|
|
||||||
logger.info(`=======================================
|
logger.info(`=======================================
|
||||||
Icarus V2
|
██╗ ██████╗ █████╗ ██████╗ ██╗ ██╗███████╗
|
||||||
|
██║██╔════╝██╔══██╗██╔══██╗██║ ██║██╔════╝
|
||||||
|
██║██║ ███████║██████╔╝██║ ██║███████╗
|
||||||
|
██║██║ ██╔══██║██╔══██╗██║ ██║╚════██║
|
||||||
|
██║╚██████╗██║ ██║██║ ██║╚██████╔╝███████║
|
||||||
|
╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
||||||
=============================================`);
|
=============================================`);
|
|
@ -25,6 +25,8 @@ article:
|
||||||
read: 'read'
|
read: 'read'
|
||||||
about: 'About'
|
about: 'About'
|
||||||
words: 'words'
|
words: 'words'
|
||||||
|
plugin:
|
||||||
|
backtotop: 'Back to Top'
|
||||||
search:
|
search:
|
||||||
search: 'Search'
|
search: 'Search'
|
||||||
hint: 'Type something...'
|
hint: 'Type something...'
|
||||||
|
|
|
@ -25,6 +25,8 @@ article:
|
||||||
read: '读完'
|
read: '读完'
|
||||||
about: '大约'
|
about: '大约'
|
||||||
words: '个字'
|
words: '个字'
|
||||||
|
plugin:
|
||||||
|
backtotop: '回到顶端'
|
||||||
search:
|
search:
|
||||||
search: '搜索'
|
search: '搜索'
|
||||||
hint: '想要查找什么...'
|
hint: '想要查找什么...'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<nav class="navbar navbar-main">
|
<nav class="navbar navbar-main">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand is-flex-center">
|
||||||
<a class="navbar-item navbar-logo" href="<%- url_for('/') %>">
|
<a class="navbar-item navbar-logo" href="<%- url_for('/') %>">
|
||||||
<% if (has_config('logo.text') && get_config('logo.text')) { %>
|
<% if (has_config('logo.text') && get_config('logo.text')) { %>
|
||||||
<%= get_config('logo.text') %>
|
<%= get_config('logo.text') %>
|
||||||
|
|
|
@ -34,10 +34,10 @@ function pagination(c, m) {
|
||||||
<div class="card card-transparent">
|
<div class="card card-transparent">
|
||||||
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
||||||
<div class="pagination-previous<%= page.current > 1 ? '' : ' is-invisible is-hidden-mobile' %>">
|
<div class="pagination-previous<%= page.current > 1 ? '' : ' is-invisible is-hidden-mobile' %>">
|
||||||
<a class="has-text-black-ter" href="<%= link_url(page.current - 1) %>"><%= __('common.prev') %></a>
|
<a class="is-flex-grow has-text-black-ter" href="<%= link_url(page.current - 1) %>"><%= __('common.prev') %></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination-next<%= page.current < page.total ? '' : ' is-invisible is-hidden-mobile' %>">
|
<div class="pagination-next<%= page.current < page.total ? '' : ' is-invisible is-hidden-mobile' %>">
|
||||||
<a class="has-text-black-ter" href="<%= link_url(page.current + 1) %>"><%= __('common.next') %></a>
|
<a class="is-flex-grow has-text-black-ter" href="<%= link_url(page.current + 1) %>"><%= __('common.next') %></a>
|
||||||
</div>
|
</div>
|
||||||
<ul class="pagination-list is-hidden-mobile">
|
<ul class="pagination-list is-hidden-mobile">
|
||||||
<% pagination(page.current, page.total).forEach(element => { %>
|
<% pagination(page.current, page.total).forEach(element => { %>
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
<% if (plugin !== false) { %>
|
||||||
|
<% if (!head) { %>
|
||||||
|
<div id="back-to-top" class="is-flex is-flex-center is-hidden-tablet">
|
||||||
|
<i class="material-icons">keyboard_arrow_up</i>
|
||||||
|
<span class="is-size-7">
|
||||||
|
<%= __('plugin.backtotop') %></span>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
var lastScrollTop = 0;
|
||||||
|
$(window).scroll(function (event) {
|
||||||
|
var scrollTop = $(this).scrollTop();
|
||||||
|
if (scrollTop > lastScrollTop || scrollTop === 0) {
|
||||||
|
$('#back-to-top').removeClass('is-active');
|
||||||
|
} else {
|
||||||
|
$('#back-to-top').addClass('is-active');
|
||||||
|
}
|
||||||
|
lastScrollTop = scrollTop;
|
||||||
|
});
|
||||||
|
$('#back-to-top').on('click', function () {
|
||||||
|
$('body, html').animate({ scrollTop: 0 }, 400);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
|
@ -52,8 +52,6 @@ img.thumbnail
|
||||||
|
|
||||||
.navbar-main
|
.navbar-main
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05)
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05)
|
||||||
.navbar-brand
|
|
||||||
justify-content: center
|
|
||||||
.navbar-menu,
|
.navbar-menu,
|
||||||
.navbar-start,
|
.navbar-start,
|
||||||
.navbar-end
|
.navbar-end
|
||||||
|
@ -162,6 +160,21 @@ img.thumbnail
|
||||||
margin-left: 0.75rem
|
margin-left: 0.75rem
|
||||||
margin-right: 0
|
margin-right: 0
|
||||||
|
|
||||||
|
#back-to-top
|
||||||
|
position: fixed
|
||||||
|
bottom: 0
|
||||||
|
left: 0
|
||||||
|
right: 0
|
||||||
|
text-align: center
|
||||||
|
background: white
|
||||||
|
box-shadow: 0 -1px 8px rgba(0,0,0,0.1)
|
||||||
|
padding: 8px 0
|
||||||
|
line-height: 24px
|
||||||
|
transform: translateY(100px)
|
||||||
|
transition: 0.4s ease
|
||||||
|
&.is-active
|
||||||
|
transform: translateY(0)
|
||||||
|
|
||||||
/* ---------------------------------
|
/* ---------------------------------
|
||||||
* Custom modifiers
|
* Custom modifiers
|
||||||
* --------------------------------- */
|
* --------------------------------- */
|
||||||
|
@ -180,9 +193,15 @@ img.thumbnail
|
||||||
.is-overflow-x-auto
|
.is-overflow-x-auto
|
||||||
overflow-x: auto !important
|
overflow-x: auto !important
|
||||||
|
|
||||||
|
.is-flex-grow
|
||||||
|
flex-grow: 1 !important
|
||||||
|
|
||||||
.is-flex-wrap
|
.is-flex-wrap
|
||||||
flex-wrap: wrap !important
|
flex-wrap: wrap !important
|
||||||
|
|
||||||
|
.is-flex-start
|
||||||
|
justify-content: start !important
|
||||||
|
|
||||||
.is-flex-center
|
.is-flex-center
|
||||||
justify-content: center !important
|
justify-content: center !important
|
||||||
|
|
||||||
|
@ -260,7 +279,7 @@ img.thumbnail
|
||||||
figure.highlight
|
figure.highlight
|
||||||
padding: 0
|
padding: 0
|
||||||
width: 100%
|
width: 100%
|
||||||
margin: 0 0 1.5rem
|
margin: 1em 0 1em !important
|
||||||
|
|
||||||
pre,
|
pre,
|
||||||
table tr:hover
|
table tr:hover
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg" version="1.1" width="256" height="256" viewbox="0 0 949 256">
|
||||||
|
<path fill="#2366d1" d="M110.85125168440814 128L221.70250336881628 192L110.85125168440814 256L0 192Z"/>
|
||||||
|
<path fill="#609dff" d="M110.85125168440814 64L221.70250336881628 128L110.85125168440814 192L0 128Z"/>
|
||||||
|
<path fill="#a4c7ff" d="M110.85125168440814 0L221.70250336881628 64L110.85125168440814 128L0 64Z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -14,4 +14,15 @@
|
||||||
$(this).text(moment($(this).attr('datetime')).fromNow());
|
$(this).text(moment($(this).attr('datetime')).fromNow());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function adjustNavbar() {
|
||||||
|
const navbarWidth = $('.navbar-main .navbar-start').outerWidth() + $('.navbar-main .navbar-end').outerWidth();
|
||||||
|
if ($(document).outerWidth() < navbarWidth) {
|
||||||
|
$('.navbar-main .navbar-menu').addClass('is-flex-start');
|
||||||
|
} else {
|
||||||
|
$('.navbar-main .navbar-menu').removeClass('is-flex-start');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adjustNavbar();
|
||||||
|
$(window).resize(adjustNavbar);
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
Loading…
Reference in New Issue