From 3165c7b566a0fabed3d2402ab80a083b1e7f761a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Sat, 21 May 2022 20:34:09 +0800 Subject: [PATCH] :wrench: :triangular_flag_on_post: :construction: Finished the outline variable replace content. --- assets/css/_common/outline/footer/index.scss | 13 ++++---- .../css/_common/outline/header/bookmark.scss | 4 +-- .../_common/outline/header/github-banner.scss | 4 +-- assets/css/_common/outline/mobile.scss | 4 +-- .../outline/sidebar/sidebar-author-links.scss | 2 +- .../outline/sidebar/sidebar-author.scss | 4 +-- .../_common/outline/sidebar/sidebar-toc.scss | 6 ++-- .../outline/sidebar/sidebar-toggle.scss | 4 +-- .../_common/outline/sidebar/site-state.scss | 2 +- assets/css/_sitevars.scss | 26 ++++++++++++++++ assets/css/main.scss | 2 +- exampleSite/config.yaml | 30 +++++++++---------- 12 files changed, 63 insertions(+), 38 deletions(-) diff --git a/assets/css/_common/outline/footer/index.scss b/assets/css/_common/outline/footer/index.scss index 4cba027..34b8f7b 100644 --- a/assets/css/_common/outline/footer/index.scss +++ b/assets/css/_common/outline/footer/index.scss @@ -66,16 +66,16 @@ } .with-love { - color: hexo-config('footer.icon.color'); + color: $footer_icon_color; display: inline-block; margin: 0 5px; - @if hexo-config('footer.icon.animated') { + @if $footer_icon_animated { animation: icon-animate 1.33s ease-in-out infinite; } } -@if hexo-config('footer.beian.enable') and hexo-config('footer.beian.gongan_icon_url') { +@if $footer_beian_enable { .beian img { display: inline-block; margin: 0 3px; @@ -83,15 +83,14 @@ } } -@if hexo-config('busuanzi_count.enable') { +@if $busuanzi_enable { .busuanzi-count { - @if hexo-config('busuanzi_count.total_visitors') { + @if $busuanzi_visitors { #busuanzi_container_site_uv { display: none; } } - - @if hexo-config('busuanzi_count.total_views') { + @if $busuanzi_views { #busuanzi_container_site_pv { display: none; } diff --git a/assets/css/_common/outline/header/bookmark.scss b/assets/css/_common/outline/header/bookmark.scss index c7a7587..28876ce 100644 --- a/assets/css/_common/outline/header/bookmark.scss +++ b/assets/css/_common/outline/header/bookmark.scss @@ -1,4 +1,4 @@ -@if hexo-config('bookmark.enable') { +@if $bookmark_enable { .book-mark-link { border-bottom: 0; position: fixed; @@ -11,7 +11,7 @@ } &::before { - color: convert(hexo-config('bookmark.color')); + color: convert($bookmark_color); font-size: 32px; line-height: 1; @include font-family-icons('\f02e'); diff --git a/assets/css/_common/outline/header/github-banner.scss b/assets/css/_common/outline/header/github-banner.scss index 82c5203..918384b 100644 --- a/assets/css/_common/outline/header/github-banner.scss +++ b/assets/css/_common/outline/header/github-banner.scss @@ -1,4 +1,4 @@ -@if hexo-config('github_banner.enable') { +@if $github_banner_enable { @keyframes octocat-wave { 0%, 100% { transform: rotate(0); @@ -28,7 +28,7 @@ } @include tablet-mobile() { - @if hexo-config('local_search.enable') or hexo-config('algolia_search.enable') { + @if $local_search_enable or $algolia_search_enable { display: none; } diff --git a/assets/css/_common/outline/mobile.scss b/assets/css/_common/outline/mobile.scss index 71502c9..8282056 100644 --- a/assets/css/_common/outline/mobile.scss +++ b/assets/css/_common/outline/mobile.scss @@ -5,7 +5,7 @@ } */ -@if hexo-config('mobile_layout_economy') { +@if $mobile_layout_economy { @include mobile-small() { // For Pisces & Gemini schemes only wider width (remove main blocks in Gemini). .main-inner { @@ -56,7 +56,7 @@ margin-bottom: 10px !important; padding: 10px !important; - @if hexo-config('note.icons') { + @if $note_icons { &:not(.no-icon) { padding-left: 35px !important; } diff --git a/assets/css/_common/outline/sidebar/sidebar-author-links.scss b/assets/css/_common/outline/sidebar/sidebar-author-links.scss index 0ad756e..3479984 100644 --- a/assets/css/_common/outline/sidebar/sidebar-author-links.scss +++ b/assets/css/_common/outline/sidebar/sidebar-author-links.scss @@ -3,7 +3,7 @@ font-size: $font-size-smaller; } - @if not hexo-config('social_icons.icons_only') { + @if not $social_icons_only { .fa, .fab, .far, .fas { margin-right: 2px; } diff --git a/assets/css/_common/outline/sidebar/sidebar-author.scss b/assets/css/_common/outline/sidebar/sidebar-author.scss index 7eb67ec..b903716 100644 --- a/assets/css/_common/outline/sidebar/sidebar-author.scss +++ b/assets/css/_common/outline/sidebar/sidebar-author.scss @@ -3,11 +3,11 @@ max-width: $site-author-image-width; padding: 2px; - @if hexo-config('avatar.rounded') { + @if $avatar_rounded { border-radius: 50%; } - @if hexo-config('avatar.rotated') { + @if $avatar_rotated { transition: transform 1s ease-out; &:hover { diff --git a/assets/css/_common/outline/sidebar/sidebar-toc.scss b/assets/css/_common/outline/sidebar/sidebar-toc.scss index 86b0eb8..d378d7c 100644 --- a/assets/css/_common/outline/sidebar/sidebar-toc.scss +++ b/assets/css/_common/outline/sidebar/sidebar-toc.scss @@ -1,4 +1,4 @@ -@if hexo-config('toc.enable') { +@if $toc_enable { .post-toc { font-size: $font-size-small; @@ -22,14 +22,14 @@ overflow: hidden; text-overflow: ellipsis; - @if not hexo-config('toc.wrap') { + @if not $toc_wrap { white-space: nowrap; } } .nav { .nav-child { - display: if(hexo-config('toc.expand_all'), block, none); + display: if($toc_expand_all, block, none); } .active > .nav-child { diff --git a/assets/css/_common/outline/sidebar/sidebar-toggle.scss b/assets/css/_common/outline/sidebar/sidebar-toggle.scss index 0fafdea..4347f6e 100644 --- a/assets/css/_common/outline/sidebar/sidebar-toggle.scss +++ b/assets/css/_common/outline/sidebar/sidebar-toggle.scss @@ -12,10 +12,10 @@ @media (any-hover: hover) { body:not(.sidebar-active) .sidebar-toggle:hover { - @include toggle-arrow(hexo-config('sidebar.position')); + @include toggle-arrow($sidebar_position); } } .sidebar-active .sidebar-toggle { - @include toggle-close(hexo-config('sidebar.position')); + @include toggle-close($sidebar_position); } diff --git a/assets/css/_common/outline/sidebar/site-state.scss b/assets/css/_common/outline/sidebar/site-state.scss index 123b049..08068e8 100644 --- a/assets/css/_common/outline/sidebar/site-state.scss +++ b/assets/css/_common/outline/sidebar/site-state.scss @@ -1,4 +1,4 @@ -@if hexo-config('site_state') { +@if $site_state { .site-state { @include flex-wrap(); line-height: 1.4; diff --git a/assets/css/_sitevars.scss b/assets/css/_sitevars.scss index 7acadf9..6175977 100644 --- a/assets/css/_sitevars.scss +++ b/assets/css/_sitevars.scss @@ -6,6 +6,22 @@ $scheme: {{ $P.scheme }}; $darkmode: {{ $P.darkmode }}; $theme_color_dark: {{ $P.themeColor.dark }}; $theme_color_light: {{ $P.themeColor.light }}; +$mobile_layout_economy: {{ $P.mobileLayoutEconomy }}; + +// Header +$bookmark_enable: {{ $P.bookmark.enable }}; +$bookmark_color: {{ $P.bookmark.color }}; +$github_banner_enable: {{ $P.githubBanner.enable }}; + +// Footer +$footer_icon_color: {{ $P.footer.icon.color }}; +$footer_icon_animated: {{ $P.footer.icon.animated }}; +$footer_beian_enable: {{ $P.footer.beian.enable }}; + +// Counter +$busuanzi_enable: {{ $P.busuanzi.enable }}; +$busuanzi_visitors: {{ $P.busuanzi.visitors }}; +$busuanzi_views: {{ $P.busuanzi.views }}; // Font $font_enable: {{ $P.font.enable }}; @@ -26,8 +42,18 @@ $sidebar_padding: {{ $P.sidebar.padding }}; $sidebar_position: {{ $P.sidebar.position }}; $sidebar_width: {{ $P.sidebar.width }}; +$avatar_rotated: {{ $P.avatar.rotated }}; +$avatar_rounded: {{ $P.avatar.rounded }}; +$avatar_rounded: {{ $P.avatar.rounded }}; +$site_state: {{ $P.siteState }}; +$social_icons_only: {{ $P.socialIcons.iconsOnly }}; +$toc_enable: {{ $P.toc.enable }}; +$toc_expand_all: {{ $P.toc.expandAll }}; +$toc_wrap: {{ $P.toc.wrap }}; + // Note $note_light_bg_offset: {{ $P.note.lightBgOffset }}; +$note_icons: {{ $P.note.icons }}; // Reading progress bar $reading_progress_start: {{ $P.readingProgress.start }}; diff --git a/assets/css/main.scss b/assets/css/main.scss index 8b618a3..0fb4ff5 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -27,7 +27,7 @@ // @import '_common/scaffolding'; // Layout -// @import '_common/outline'; +@import '_common/outline'; // Components @import '_common/components'; diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 5ed87b9..ad6a517 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -152,7 +152,7 @@ params: rotated: false # Posts / Categories / Tags in sidebar. - site_state: true + siteState: true # Social Links # Usage: `Key: permalink || icon` @@ -170,9 +170,9 @@ params: #Instagram: https://instagram.com/yourname || fab fa-instagram #Skype: skype:yourname?call|chat || fab fa-skype - social_icons: + socialIcons: enable: true - icons_only: false + iconsOnly: false transition: false # Blog rolls @@ -194,9 +194,9 @@ params: # If true, all words will placed on next lines if header width longer then sidebar width. wrap: false # If true, all level of TOC in a post will be displayed, rather than the activated part of it. - expand_all: false + expandAll: false # Maximum heading depth of generated toc. - max_depth: 6 + maxDepth: 6 # --------------------------------------------------------------- @@ -346,13 +346,13 @@ params: preconnect: false # Set the text alignment in posts / pages. - text_align: + textAlign: # Available values: start | end | left | right | center | justify | justify-all | match-parent desktop: justify mobile: justify # Reduce padding / margin indents on devices with narrow width. - mobile_layout_economy: false + mobileLayoutEconomy: false # Browser header panel color. themeColor: @@ -409,7 +409,7 @@ params: save: auto # `Follow me on GitHub` banner in the top-right corner. - github_banner: + githubBanner: enable: false permalink: https://github.com/yourname title: Follow me on GitHub @@ -722,14 +722,14 @@ params: # Show Views / Visitors of the website / page with busuanzi. # For more information: http://ibruce.info/2015/04/04/busuanzi/ - busuanzi_count: + busuanzi: enable: false - total_visitors: true - total_visitors_icon: fa fa-user - total_views: true - total_views_icon: fa fa-eye - post_views: true - post_views_icon: far fa-eye + visitors: true + visitorsIcon: fa fa-user + views: true + viewsIcon: fa fa-eye + postViews: true + postViewsIcon: far fa-eye # ---------------------------------------------------------------