mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-20 19:02:33 +00:00
Optimize semantic elements' name
This commit is contained in:
parent
c7b92c3af8
commit
b78fb3ac90
@ -15,14 +15,14 @@
|
|||||||
<div class="headband"></div>
|
<div class="headband"></div>
|
||||||
|
|
||||||
<main class="main">
|
<main class="main">
|
||||||
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
|
<div class="column">
|
||||||
<div class="header-inner">
|
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
|
||||||
{%- include '_partials/header/index.njk' -%}
|
{%- include '_partials/header/index.njk' -%}
|
||||||
</div>
|
</header>
|
||||||
{%- if theme.sidebar.display !== 'remove' %}
|
{%- if theme.sidebar.display !== 'remove' %}
|
||||||
{% block sidebar %}{% endblock %}
|
{% block sidebar %}{% endblock %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</header>
|
</div>
|
||||||
|
|
||||||
<div class="main-inner {% block class %}{% endblock %}">
|
<div class="main-inner {% block class %}{% endblock %}">
|
||||||
{%- include '_partials/header/sub-menu.njk' -%}
|
{%- include '_partials/header/sub-menu.njk' -%}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
{% macro render(display_toc) %}
|
{% macro render(display_toc) %}
|
||||||
<aside class="sidebar">
|
<aside class="sidebar">
|
||||||
{%- set display_toc = page.toc.enable and display_toc %}
|
|
||||||
{%- if display_toc %}
|
{%- if display_toc %}
|
||||||
{%- set toc = toc(page.content, {class: 'nav', list_number: page.toc.number, max_depth: page.toc.max_depth}) %}
|
{%- set toc = toc(page.content, {class: 'nav', list_number: page.toc.number, max_depth: page.toc.max_depth}) %}
|
||||||
{%- set display_toc = toc.length > 1 and display_toc %}
|
{%- set display_toc = toc.length > 1 and display_toc %}
|
||||||
|
|||||||
@ -50,5 +50,5 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
{{ sidebar_template.render(true) }}
|
{{ sidebar_template.render(page.toc.enable) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -12,5 +12,5 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
{{ sidebar_template.render(true) }}
|
{{ sidebar_template.render(page.toc.enable) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -9,12 +9,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix issue #521
|
.column {
|
||||||
header.header {
|
|
||||||
background: $head-bg;
|
background: $head-bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-inner {
|
.header {
|
||||||
main-container();
|
main-container();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,7 +24,7 @@ header.header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.use-motion {
|
.use-motion {
|
||||||
header.header, .site-brand-container .toggle {
|
.column, .site-brand-container .toggle {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Header
|
// Header
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
.header-inner {
|
.header {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
background: var(--btn-default-bg);
|
background: var(--btn-default-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-inner {
|
.header {
|
||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
|
|
||||||
+mobile() {
|
+mobile() {
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-inner, .main-inner, .footer-inner {
|
.header, .main-inner, .footer-inner {
|
||||||
+mobile() {
|
+mobile() {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
.header-inner {
|
.header {
|
||||||
background: var(--content-bg-color);
|
background: var(--content-bg-color);
|
||||||
border-radius: $border-radius-inner;
|
border-radius: $border-radius-inner;
|
||||||
box-shadow: $box-shadow-inner;
|
box-shadow: $box-shadow-inner;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ body { margin-top: 2rem; }
|
|||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.use-motion header.header,
|
.use-motion .column,
|
||||||
.use-motion .site-brand-container .toggle,
|
.use-motion .site-brand-container .toggle,
|
||||||
.use-motion .footer { opacity: initial; }
|
.use-motion .footer { opacity: initial; }
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ NexT.motion.middleWares = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pushToSequence('header.header');
|
pushToSequence('.column');
|
||||||
CONFIG.scheme === 'Mist' && getMistLineSettings('.logo-line');
|
CONFIG.scheme === 'Mist' && getMistLineSettings('.logo-line');
|
||||||
CONFIG.scheme === 'Muse' && pushToSequence('.custom-logo-image');
|
CONFIG.scheme === 'Muse' && pushToSequence('.custom-logo-image');
|
||||||
pushToSequence('.site-title');
|
pushToSequence('.site-title');
|
||||||
|
|||||||
@ -50,7 +50,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
function updateFooterPosition() {
|
function updateFooterPosition() {
|
||||||
const footer = document.querySelector('.footer');
|
const footer = document.querySelector('.footer');
|
||||||
const containerHeight = document.querySelector('header.header').offsetHeight + document.querySelector('.main').offsetHeight + footer.offsetHeight;
|
const containerHeight = document.querySelector('.column').offsetHeight + document.querySelector('.main').offsetHeight + footer.offsetHeight;
|
||||||
footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight);
|
footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user