美好365app官方下载-beat365体育ios版下载-365bet手机客户端

Hugo Stack 魔改美化

全局零碎玩意在 /assets/scss/custom.scss 中加入以下代码: // 页面基本配色 :root { // 全局顶部边距 --main-top-padding: 30px; // 全局卡片圆角 --card-border-radi

Hugo Stack 魔改美化

全局零碎玩意在 /assets/scss/custom.scss 中加入以下代码:

// 页面基本配色

:root {

// 全局顶部边距

--main-top-padding: 30px;

// 全局卡片圆角

--card-border-radius: 25px;

// 标签云卡片圆角

--tag-border-radius: 8px;

// 卡片间距

--section-separation: 40px;

// 全局字体大小

--article-font-size: 1.8rem;

// 行内代码背景色

--code-background-color: #f8f8f8;

// 行内代码前景色

--code-text-color: #e96900;

// 暗色模式下样式

&[data-scheme="dark"] {

// 行内代码背景色

--code-background-color: #ff6d1b17;

// 行内代码前景色

--code-text-color: #e96900;

}

}

//------------------------------------------------------

// 修复引用块内容窄页面显示问题

a {

word-break: break-all;

}

code {

word-break: break-all;

}

//---------------------------------------------------

// 文章内容图片圆角阴影

.article-page .main-article .article-content {

img {

max-width: 96% !important;

height: auto !important;

border-radius: 8px;

}

}

//------------------------------------------------

// 文章内容引用块样式

.article-content {

blockquote {

border-left: 6px solid #358b9a1f !important;

background: #3a97431f;

}

}

// ---------------------------------------

// 代码块基础样式修改

.highlight {

max-width: 102% !important;

background-color: var(--pre-background-color);

padding: var(--card-padding);

position: relative;

border-radius: 20px;

margin-left: -7px !important;

margin-right: -12px;

box-shadow: var(--shadow-l1) !important;

&:hover {

.copyCodeButton {

opacity: 1;

}

}

// keep Codeblocks LTR

[dir="rtl"] & {

direction: ltr;

}

pre {

margin: initial;

padding: 0;

margin: 0;

width: auto;

}

}

// light模式下的代码块样式调整

[data-scheme="light"] .article-content .highlight {

background-color: #fff9f3;

}

[data-scheme="light"] .chroma {

color: #ff6f00;

background-color: #fff9f3cc;

}

//-------------------------------------------

// 设置选中字体的区域背景颜色

//修改选中颜色

::selection {

color: #fff;

background: #34495e;

}

a {

text-decoration: none;

color: var(--accent-color);

&:hover {

color: var(--accent-color-darker);

}

&.link {

color: #4288b9ad;

font-weight: 600;

padding: 0 2px;

text-decoration: none;

cursor: pointer;

&:hover {

text-decoration: underline;

}

}

}

//-------------------------------------------------

//文章封面高度更改

.article-list article .article-image img {

width: 100%;

height: 150px;

object-fit: cover;

@include respond(md) {

height: 200px;

}

@include respond(xl) {

height: 305px;

}

}

//---------------------------------------------------

// 全局页面布局间距调整

.main-container {

min-height: 100vh;

align-items: flex-start;

padding: 0 15px;

gap: var(--section-separation);

padding-top: var(--main-top-padding);

@include respond(md) {

padding: 0 37px;

}

}

//--------------------------------------------------

//页面三栏宽度调整

.container {

margin-left: auto;

margin-right: auto;

.left-sidebar {

order: -3;

max-width: var(--left-sidebar-max-width);

}

.right-sidebar {

order: -1;

max-width: var(--right-sidebar-max-width);

/// Display right sidebar when min-width: lg

@include respond(lg) {

display: flex;

}

}

&.extended {

@include respond(md) {

max-width: 1024px;

--left-sidebar-max-width: 25%;

--right-sidebar-max-width: 22% !important;

}

@include respond(lg) {

max-width: 1280px;

--left-sidebar-max-width: 20%;

--right-sidebar-max-width: 30%;

}

@include respond(xl) {

max-width: 1453px; //1536px;

--left-sidebar-max-width: 15%;

--right-sidebar-max-width: 25%;

}

}

&.compact {

@include respond(md) {

--left-sidebar-max-width: 25%;

max-width: 768px;

}

@include respond(lg) {

max-width: 1024px;

--left-sidebar-max-width: 20%;

}

@include respond(xl) {

max-width: 1280px;

}

}

}

//-------------------------------------------------------

//全局页面小图片样式微调

.article-list--compact article .article-image img {

width: var(--image-size);

height: var(--image-size);

object-fit: cover;

border-radius: 17%;

}

菜单栏圆角在 /assets/scss/custom.scss 中加入以下代码:

// 菜单栏样式

// 下拉菜单改圆角样式

.menu {

padding-left: 0;

list-style: none;

flex-direction: column;

overflow-x: hidden;

overflow-y: scroll;

flex-grow: 1;

font-size: 1.6rem;

background-color: var(--card-background);

box-shadow: var(--shadow-l2); //改个阴影

display: none;

margin: 0; //改为0

border-radius: 10px; //加个圆角

padding: 30px 30px;

@include respond(xl) {

padding: 15px 0;

}

&,

.menu-bottom-section {

gap: 30px;

@include respond(xl) {

gap: 25px;

}

}

&.show {

display: flex;

}

@include respond(md) {

align-items: flex-end;

display: flex;

background-color: transparent;

padding: 0;

box-shadow: none;

margin: 0;

}

li {

position: relative;

vertical-align: middle;

padding: 0;

@include respond(md) {

width: 100%;

}

svg {

stroke-width: 1.33;

width: 20px;

height: 20px;

}

a {

height: 100%;

display: inline-flex;

align-items: center;

color: var(--body-text-color);

gap: var(--menu-icon-separation);

}

span {

flex: 1;

}

&.current {

a {

color: var(--accent-color);

font-weight: bold;

}

}

}

}

滚动条在 /assets/scss/custom.scss 中加入以下代码:

//将滚动条修改为圆角样式

//菜单滚动条美化

.menu::-webkit-scrollbar {

display: none;

}

// 全局滚动条美化

html {

::-webkit-scrollbar {

width: 20px;

}

::-webkit-scrollbar-track {

background-color: transparent;

}

::-webkit-scrollbar-thumb {

background-color: #d6dee1;

border-radius: 20px;

border: 6px solid transparent;

background-clip: content-box;

}

::-webkit-scrollbar-thumb:hover {

background-color: #a8bbbf;

}

}

加载进度条在 /layouts/partials/footer/custom.html 中加入以下代码:

深色模式开关图标不太喜欢默认图标,默认图标不够直观,当然你可以不换我选取了 Tabler Icons 中的 sun-high 和 moon-stars 这两个图标在 /assets/scss/partials/sidebar.scss 第 154~180 行中将图标名进行修改,最终效果:

/* .\assets\scss\partials\sidebar.scss Line 154*/

[data-scheme="dark"] {

#dark-mode-toggle {

color: var(--accent-color);

font-weight: 700;

.icon-tabler-sun-high {

display: none;

}

.icon-tabler-moon-stars {

display: unset;

}

}

}

#dark-mode-toggle {

margin-top: auto;

color: var(--body-text-color);

display: flex;

align-items: center;

cursor: pointer;

gap: var(--menu-icon-separation);

.icon-tabler-moon-stars {

display: none;

}

}

在 /layouts/partials/sidebar/left.html 第 91~97 行中将图标名进行修改,最终效果:

{{ if (default false .Site.Params.colorScheme.toggle) }}

  • {{ partial "helper/icon" "sun-high" }}

    {{ partial "helper/icon" "moon-stars" }}

    {{ T "darkMode" }}

  • {{ end }}

    修改布局在 /assets/scss/grid.scss 中修改 left-sidebar 和 right-sidebar 的描述:

    .left-sidebar {

    order: -3;

    // max-width: var(--left-sidebar-max-width);

    max-width: 10%;

    }

    .right-sidebar {

    order: -1;

    // max-width: var(--right-sidebar-max-width);

    max-width: 20%;

    /// Display right sidebar when min-width: lg

    @include respond(lg) {

    display: flex;

    }

    }

    把正文的占比改到了 70%, 原来的只有 50% 左右

    页面归档双栏在 /assets/scss/custom.scss 中加入以下代码:

    // 归档页面两栏

    @media (min-width: 1024px) {

    .article-list--compact {

    display: grid;

    grid-template-columns: 1fr 1fr;

    background: none;

    box-shadow: none;

    gap: 1rem;

    article {

    background: var(--card-background);

    border: none;

    box-shadow: var(--shadow-l2);

    margin-bottom: 8px;

    border-radius: 16px;

    }

    }

    }

    卡片缩放动画在 /assets/scss/custom.scss 中加入以下代码:

    /*-----------归档页面----------*/

    //归档页面卡片缩放

    .article-list--tile article {

    transition: .6s ease;

    }

    .article-list--tile article:hover {

    transform: scale(1.03, 1.03);

    }

    友链三栏在 /assets/scss/custom.scss 中加入以下代码:

    // 友情链接三栏

    @media (min-width: 1024px) {

    .article-list--compact.links {

    display: grid;

    grid-template-columns: 1fr 1fr 1fr;

    background: none;

    box-shadow: none;

    gap: 1rem;

    article {

    background: var(--card-background);

    border: none;

    box-shadow: var(--shadow-l2);

    margin-bottom: 8px;

    border-radius: var(--card-border-radius);

    &:nth-child(odd) {

    margin-right: 8px;

    }

    }

    }

    }

    首页布局在 /assets/scss/custom.scss 中加入以下代码:

    /*主页布局间距调整*/

    .main-container {

    gap: 50px; //文章宽度

    @include respond(md) {

    padding: 0 30px;

    gap: 40px; //中等屏幕时的文章宽度

    }

    }

    .related-contents {

    overflow-x: visible; //显示隐藏的图标

    padding-bottom: 15px;

    }

    右侧导航栏动画在 /assets/scss/custom.scss 中加入以下代码:

    /*------------------右侧导航栏--------------*/

    // 搜索菜单动画

    .search-form.widget {

    transition: transform 0.6s ease;

    }

    .search-form.widget:hover {

    transform: scale(1.1, 1.1);

    }

    //归档小图标放大动画

    .widget.archives .widget-archive--list {

    transition: transform .3s ease;

    }

    .widget.archives .widget-archive--list:hover {

    transform: scale(1.05, 1.05);

    }

    //右侧标签放大动画

    .tagCloud .tagCloud-tags a {

    border-radius: 10px;

    font-size: 1.4rem;

    transition: transform .3s ease;

    }

    .tagCloud .tagCloud-tags a:hover {

    transform: scale(1.1, 1.1);

    }

    细节首页欢迎横幅在 /layouts/index.html 的

    前添加以下代码:

    👋

    Welcome

    To

    Xalaok's

    Blog

    在 /assets/scss/custom.scss 中加入以下代码:

    //首页欢迎板块样式

    .welcome {

    color: var(--card-text-color-main);

    background: var(--card-background);

    box-shadow: var(--shadow-l2);

    border-radius: 30px;

    display: inline-block;

    }

    // 👋emoji实现摆动效果

    .shake {

    display: inline-block;

    animation: shake 1s;

    animation-duration: 1s;

    animation-timing-function: ease;

    animation-delay: 0s;

    animation-iteration-count: 1;

    animation-direction: normal;

    animation-fill-mode: none;

    animation-play-state: running;

    animation-name: shake;

    animation-timeline: auto;

    animation-range-start: normal;

    animation-range-end: normal;

    animation-delay: 2s;

    @keyframes shake {

    0% {

    transform: rotate(0);

    }

    25% {

    transform: rotate(45deg) scale(1.2);

    }

    50% {

    transform: rotate(0) scale(1.2);

    }

    75% {

    transform: rotate(45deg) scale(1.2);

    }

    100% {

    transform: rotate(0);

    }

    }

    }

    // 实现字符跳动动画

    .jump-text1 {

    display: inline-block;

    animation: jump 0.5s 1;

    }

    .jump-text2 {

    display: inline-block;

    animation: jump 0.5s 1;

    animation-delay: 0.1s;

    }

    .jump-text3 {

    display: inline-block;

    animation: jump 0.5s 1;

    animation-delay: 0.2s;

    }

    .jump-text4 {

    display: inline-block;

    animation: jump 0.5s 1;

    animation-delay: 0.3s;

    }

    .jump-text5 {

    display: inline-block;

    animation: jump 0.5s 1;

    animation-delay: 0.4s;

    }

    .jump-text6 {

    display: inline-block;

    animation: jump 0.5s 1;

    animation-delay: 0.5s;

    }

    .jump-text7 {

    display: inline-block;

    animation: jump 0.5s 1;

    animation-delay: 0.6s;

    }

    .jump-text8 {

    display: inline-block;

    animation: jump 0.5s 1;

    animation-delay: 0.7s;

    }

    .jump-text9 {

    display: inline-block;

    animation: jump 0.5s 1;

    animation-delay: 0.9s;

    }

    @keyframes jump {

    0% {

    transform: translateY(0);

    }

    50% {

    transform: translateY(-20px);

    }

    100% {

    transform: translateY(0);

    }

    }

    代码块macOS 风格红绿灯图标在 /assets/scss/custom.scss 中加入以下代码:

    // macOS 风格代码块

    .article-content {

    .highlight:before {

    content: '';

    display: block;

    background: url(/code-header.svg);

    height: 32px;

    width: 100%;

    background-size: 57px;

    background-repeat: no-repeat;

    margin-bottom: 5px;

    background-position: -1px 2px;

    }

    }

    在 static 文件夹下新建 code-header.svg,写入以下代码:

    // macOS 红绿灯图标

    显示语言和复制按钮在 /assets/ts/custom.ts 中加入以下代码:

    // 显示语言和复制按钮

    const highlights = document.querySelectorAll('.article-content div.highlight');

    const copyText = `📄拷贝`,

    copiedText = `已拷贝!`;

    highlights.forEach(highlight => {

    const copyButton = document.createElement('button');

    copyButton.innerHTML = copyText;

    copyButton.classList.add('copyCodeButton');

    highlight.appendChild(copyButton);

    const codeBlock = highlight.querySelector('code[data-lang]');

    // 获取语言

    const lang = codeBlock.getAttribute('data-lang');

    if (!codeBlock) return;

    copyButton.addEventListener('click', () => {

    navigator.clipboard.writeText(codeBlock.textContent)

    .then(() => {

    copyButton.textContent = copiedText;

    setTimeout(() => {

    copyButton.textContent = copyText;

    }, 1000);

    })

    .catch(err => {

    alert(err)

    console.log('Something went wrong', err);

    });

    });

    // Add language code button

    const languageButton = document.createElement('button');

    languageButton.innerHTML = lang.toUpperCase()+'  ';

    languageButton.classList.add('languageCodeButton');

    highlight.appendChild(languageButton);

    });

    new StackColorScheme(document.getElementById('dark-mode-toggle'));

    在 /assets/scss/custom.scss 中加入以下代码(可按需自行修改):

    //代码复制按钮

    .article-content .copyCodeButton {

    position: absolute;

    top: 10px;

    right: 18px;

    border-radius: 12px;

    opacity: 1;

    color: #ffffffad;

    background: none;

    border: none;

    padding: 0;

    font-weight: 500;

    }

    .article-content .languageCodeButton {

    position: absolute;

    border: none;

    top: 9px;

    right: 69px;

    border-radius: 12px;

    opacity: 1;

    padding: 0 5px;

    background: 0;

    color: #ffffffad;

    font-family: lato;

    font-size: 1.5rem;

    }

    固定块的高度过长的内容影响观感,所以把 block 的高度限制在 20em,并隐藏滚动条在 /assets/scss/partials/layout/article.scss 中进行如下修改(已隐藏无关片段):

    .article-content { // line 205

    .highlight { // line 331

    background-color: var(--pre-background-color);

    - padding: var(--card-padding);

    position: relative;

    pre { // line 345

    margin: initial;

    padding: 0;

    margin: 0;

    width: auto;

    + max-height: 20em;

    + scrollbar-width: none; /* Firefox */

    + &::-webkit-scrollbar {

    + display: none; /* Chrome Safari */

    + }

    }

    }

    }

    使图床链接的图片居中来自 Hugo Stack 主题装修笔记 Part 3 | 第三夏尔目前 Stack 默认只支持本地引用的图片居中,而在使用 url 图片链接时没有居中格式。在 /assets/scss/partials/layout/article.scss Line 256 处(同级任意位置)增加以下代码:

    // Center image from url source

    p > img {

    display: block;

    margin: 0 auto;

    max-width: 100%;

    height: auto;

    }

    键盘样式在 /assets/scss/custom.scss 中加入以下代码:

    // 键盘样式

    kbd {

    margin: 0 .1em;

    padding: .1em .6em;

    font-size: .8em;

    color: #242729;

    background: #fff;

    border: 1px solid #adb3b9;

    border-radius: 3px;

    box-shadow: 0px 1px 0 rgba(12, 13, 14, 0.2), 0 0 0 2px #fff inset;

    white-space: nowrap;

    vertical-align: middle;

    font-family: monospace;

    }

    这样即可使用如下 Markdown 高级语法生成键盘样式:CTRL + CCTRL + C

    头像旋转在 /assets/scss/custom.scss 中加入以下代码:

    // 头像旋转动画

    .sidebar header .site-avatar .site-logo {

    transition: transform 1.65s ease-in-out; // 旋转时间

    }

    .sidebar header .site-avatar .site-logo:hover {

    transform: rotate(360deg); // 旋转角度为360度

    }

    鸣谢Stack 主题文档Stack 主题的自定义 | L1nSn0w博客最近的一些变化 | 小骆同学基于 Hugo 的网站搭建日志 02 | 小骆同学『Hugo』Hugo Styles | EchosecHugo Stack 主题装修笔记 Part 3 | 第三夏尔

    ← 上一篇: LOL老鼠黑金炫彩新皮肤:神秘诱惑的魅力之选2025版
    下一篇: 什么是 CooMeet? →

    相关推荐

    PDF转DOC - 在线转换PDF文件

    PDF转DOC - 在线转换PDF文件

    步骤: 1. 点击“文件”或“链接”按钮切换本地文件或在线文件。点击“选择文件”按钮选择本地文件或输入在线文件URL。 2. 选择目标格式。

    DNF星空深渊灵石都有哪些获取方法?灵石总是不够用怎么办?(dnf2020星空深渊灵石)

    DNF星空深渊灵石都有哪些获取方法?灵石总是不够用怎么办?(dnf2020星空深渊灵石)

    DNF星空深渊灵石的获取方法 星空深渊灵石是DNF中进入星空深渊副本(区别于普通深渊)的必须材料,通过副本可获得泰波尔斯材料或装备,获取

    LOL战场女武神价格解析:多少钱才能获得这位强势英雄?

    LOL战场女武神价格解析:多少钱才能获得这位强势英雄?

    本文旨在为玩家提供关于LOL(英雄联盟)中“战场女武神”这一英雄的价格信息。我们将详细介绍不同平台或不同活动下,获得这位英雄所需花

    巽位风水代表什么?是什么方位?

    巽位风水代表什么?是什么方位?

    在风水上,东南方还被称为财帛位,那么巽位风水代表什么?有不少房屋在建造的时候因为种种原因会导致东南方缺一块凹进去,在风水上就叫做

    苏泊尔电饭煲一直滴滴响怎么回事

    苏泊尔电饭煲一直滴滴响怎么回事

    导读:苏泊尔电饭煲为什么一直滴滴响?请问苏泊尔电饭煲一直滴滴响怎么办? 苏泊尔 电饭煲 为什么一直滴滴响 1. 电器故障,报警提示。 2.

    [这么过分,一定要发Colg]昨天体验了前21个号的vp 19个职业 简述一下评价排名

    [这么过分,一定要发Colg]昨天体验了前21个号的vp 19个职业 简述一下评价排名

    [这么过分,一定要发Colg] 昨天体验了前21个号的vp 19个职业 简述一下评价排名 [复制链接] ICJM 串个门 发消息 不看ta ICJM 当前离线 权威会员 UID247784