diff --git a/public/css/theme-fukasawa.css b/public/css/theme-fukasawa.css deleted file mode 100644 index d5a56963..00000000 --- a/public/css/theme-fukasawa.css +++ /dev/null @@ -1 +0,0 @@ -/* fukasawa的主题相关 */ \ No newline at end of file diff --git a/public/css/theme-hexo.css b/public/css/theme-hexo.css deleted file mode 100644 index ff509ec5..00000000 --- a/public/css/theme-hexo.css +++ /dev/null @@ -1,30 +0,0 @@ -/* 菜单下划线动画 */ -#theme-hexo .menu-link { - text-decoration: none; - background-image: linear-gradient(#928CEE, #928CEE); - background-repeat: no-repeat; - background-position: bottom center; - background-size: 0 2px; - transition: background-size 100ms ease-in-out; -} - -#theme-hexo .menu-link:hover { - background-size: 100% 2px; - color: #928CEE; -} - -/* 设置了从上到下的渐变黑色 */ -#theme-hexo .header-cover::before { - content: ""; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 10%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.5) 100%); -} - -/* Custem */ -.tk-footer{ - opacity: 0; -} \ No newline at end of file diff --git a/public/css/theme-matery.css b/public/css/theme-matery.css deleted file mode 100644 index e3a01f01..00000000 --- a/public/css/theme-matery.css +++ /dev/null @@ -1,11 +0,0 @@ - -/* 设置了从上到下的渐变黑色 */ -#theme-matery .header-cover::before { - content: ""; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 10%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.5) 100%); -} \ No newline at end of file diff --git a/public/css/theme-simple.css b/public/css/theme-simple.css deleted file mode 100644 index d02b7661..00000000 --- a/public/css/theme-simple.css +++ /dev/null @@ -1,34 +0,0 @@ -#theme-simple #announcement-content { - /* background-color: #f6f6f6; */ -} - -#theme-simple .blog-item-title { - color: #276077; -} - -.dark #theme-simple .blog-item-title { - color: #d1d5db; -} - -.notion { - margin-top: 0 !important; - margin-bottom: 0 !important; -} - - -/* 菜单下划线动画 */ -#theme-simple .menu-link { - text-decoration: none; - background-image: linear-gradient(#dd3333, #dd3333); - background-repeat: no-repeat; - background-position: bottom center; - background-size: 0 2px; - transition: background-size 100ms ease-in-out; -} - -#theme-simple .menu-link:hover { - background-size: 100% 2px; - color: #dd3333; - cursor: pointer; -} - diff --git a/themes/example/index.js b/themes/example/index.js index 51986843..77ad1b3a 100644 --- a/themes/example/index.js +++ b/themes/example/index.js @@ -26,6 +26,7 @@ import CategoryItem from './components/CategoryItem' import TagItem from './components/TagItem' import { useRouter } from 'next/router' import { Transition } from '@headlessui/react' +import { Style } from './style' /** * 基础布局框架 @@ -50,6 +51,7 @@ const LayoutBase = props => {
{/* 网页SEO信息 */} + +} + +export { Style } diff --git a/themes/fukasawa/index.js b/themes/fukasawa/index.js index af73a189..aab7d3a0 100644 --- a/themes/fukasawa/index.js +++ b/themes/fukasawa/index.js @@ -5,7 +5,7 @@ import CommonHead from '@/components/CommonHead' import TopNav from './components/TopNav' import AsideLeft from './components/AsideLeft' import BLOG from '@/blog.config' -import { isBrowser, loadExternalResource } from '@/lib/utils' +import { isBrowser } from '@/lib/utils' import { useGlobal } from '@/lib/global' import BlogListPage from './components/BlogListPage' import BlogListScroll from './components/BlogListScroll' @@ -19,6 +19,7 @@ import Link from 'next/link' import { Transition } from '@headlessui/react' import dynamic from 'next/dynamic' import { AdSlot } from '@/components/GoogleAdsense' +import { Style } from './style' const Live2D = dynamic(() => import('@/components/Live2D')) const Mark = dynamic(() => import('mark.js')) @@ -61,15 +62,12 @@ const LayoutBase = (props) => { } }, [isCollapsed]) - if (isBrowser()) { - loadExternalResource('/css/theme-fukasawa.css', 'css') - } - return (
+ +} + +export { Style } diff --git a/themes/gitbook/index.js b/themes/gitbook/index.js index e5bb0323..f79d44a3 100644 --- a/themes/gitbook/index.js +++ b/themes/gitbook/index.js @@ -30,6 +30,7 @@ import TocDrawer from './components/TocDrawer' import NotionPage from '@/components/NotionPage' import { ArticleLock } from './components/ArticleLock' import { Transition } from '@headlessui/react' +import { Style } from './style' // 主题全局变量 const ThemeGlobalGitbook = createContext() @@ -58,6 +59,7 @@ const LayoutBase = (props) => { return ( + +} + +export { Style } diff --git a/themes/heo/components/CategoryBar.js b/themes/heo/components/CategoryBar.js index 8820fe6d..41022122 100644 --- a/themes/heo/components/CategoryBar.js +++ b/themes/heo/components/CategoryBar.js @@ -5,5 +5,15 @@ * @returns */ export default function CategoryBar(props) { - return
+ const { categoryOptions } = props + console.log(categoryOptions) + return
+ {categoryOptions?.map(c => { + return ( +
+ {c.name} +
+ ) + })} +
} diff --git a/themes/heo/index.js b/themes/heo/index.js index 47025da9..fbc795ad 100644 --- a/themes/heo/index.js +++ b/themes/heo/index.js @@ -31,6 +31,7 @@ import TagItemMini from './components/TagItemMini' import Link from 'next/link' import CategoryBar from './components/CategoryBar' import { Transition } from '@headlessui/react' +import { Style } from './style' /** * 基础布局 采用上中下布局,移动端使用顶部侧边导航栏 @@ -51,6 +52,7 @@ const LayoutBase = props => {
{/* 网页SEO */} + +} + +export { Style } diff --git a/themes/hexo/index.js b/themes/hexo/index.js index 603c8b75..77690dcd 100644 --- a/themes/hexo/index.js +++ b/themes/hexo/index.js @@ -7,7 +7,7 @@ import SideRight from './components/SideRight' import TopNav from './components/TopNav' import { useGlobal } from '@/lib/global' import BLOG from '@/blog.config' -import { isBrowser, loadExternalResource } from '@/lib/utils' +import { isBrowser } from '@/lib/utils' import BlogPostListPage from './components/BlogPostListPage' import BlogPostListScroll from './components/BlogPostListScroll' import Hero from './components/Hero' @@ -32,6 +32,7 @@ import TagItemMini from './components/TagItemMini' import Link from 'next/link' import SlotBar from './components/SlotBar' import { Transition } from '@headlessui/react' +import { Style } from './style' /** * 基础布局 采用左右两侧布局,移动端使用顶部导航栏 @@ -43,16 +44,11 @@ const LayoutBase = props => { const { children, headerSlot, floatSlot, slotTop, meta, siteInfo, className } = props const { onLoading } = useGlobal() - // 加载主题样式 - if (isBrowser()) { - loadExternalResource('/css/theme-hexo.css', 'css') - } - return (
{/* 网页SEO */} - + ) +} + +export { Style } diff --git a/themes/landing/style.js b/themes/landing/style.js new file mode 100644 index 00000000..7a59e053 --- /dev/null +++ b/themes/landing/style.js @@ -0,0 +1,17 @@ +/* eslint-disable react/no-unknown-property */ +/** + * 此处样式只对当前主题生效 + * 此处不支持tailwindCSS的 @apply 语法 + * @returns + */ +const Style = () => { + return +} + +export { Style } diff --git a/themes/matery/index.js b/themes/matery/index.js index 7c30aefe..8c6331a9 100644 --- a/themes/matery/index.js +++ b/themes/matery/index.js @@ -4,7 +4,6 @@ import TopNav from './components/TopNav' import Live2D from '@/components/Live2D' import { useGlobal } from '@/lib/global' import BLOG from '@/blog.config' -import { isBrowser, loadExternalResource } from '@/lib/utils' import Footer from './components/Footer' import { useEffect } from 'react' import RightFloatButtons from './components/RightFloatButtons' @@ -31,6 +30,7 @@ import Card from './components/Card' import JumpToCommentButton from './components/JumpToCommentButton' import BlogListBar from './components/BlogListBar' import { Transition } from '@headlessui/react' +import { Style } from './style' /** * 基础布局 @@ -43,14 +43,11 @@ const LayoutBase = props => { const { children, headerSlot, meta, siteInfo, containerSlot, post } = props const { onLoading } = useGlobal() - if (isBrowser()) { - loadExternalResource('/css/theme-matery.css', 'css') - } - return (
{/* SEO相关 */} + +} + +export { Style } diff --git a/themes/medium/index.js b/themes/medium/index.js index a0884129..039652ea 100644 --- a/themes/medium/index.js +++ b/themes/medium/index.js @@ -34,6 +34,7 @@ import TagItemMini from './components/TagItemMini' import ShareBar from '@/components/ShareBar' import Link from 'next/link' import { Transition } from '@headlessui/react' +import { Style } from './style' // 主题全局状态 const ThemeGlobalMedium = createContext() @@ -54,7 +55,10 @@ const LayoutBase = props => { return ( + {/* SEO相关 */} + {/* CSS样式 */} + +} + +export { Style } diff --git a/themes/next/index.js b/themes/next/index.js index 98582634..621dd912 100644 --- a/themes/next/index.js +++ b/themes/next/index.js @@ -27,6 +27,7 @@ import ArticleDetail from './components/ArticleDetail' import Link from 'next/link' import BlogListBar from './components/BlogListBar' import { Transition } from '@headlessui/react' +import { Style } from './style' /** * 基础布局 采用左中右三栏布局,移动端使用顶部导航栏 @@ -73,6 +74,8 @@ const LayoutBase = (props) => {
{/* SEO相关 */} + +} + +export { Style } diff --git a/themes/nobelium/index.js b/themes/nobelium/index.js index 7462d8f1..ffbd7f75 100644 --- a/themes/nobelium/index.js +++ b/themes/nobelium/index.js @@ -27,6 +27,7 @@ import ShareBar from '@/components/ShareBar' import Link from 'next/link' import BlogListBar from './components/BlogListBar' import { Transition } from '@headlessui/react' +import { Style } from './style' /** * 基础布局 采用左右两侧布局,移动端使用顶部导航栏 @@ -44,6 +45,7 @@ const LayoutBase = props => {
{/* SEO相关 */} + +} + +export { Style } diff --git a/themes/plog/index.js b/themes/plog/index.js index 43844a92..5aaab85a 100644 --- a/themes/plog/index.js +++ b/themes/plog/index.js @@ -25,6 +25,7 @@ import { Transition } from '@headlessui/react' import BottomNav from './components/BottomNav' import { saveDarkModeToCookies } from '@/themes/theme' import Modal from './components/Modal' +import { Style } from './style' // 主题全局状态 const ThemeGlobalPlog = createContext() @@ -63,6 +64,7 @@ const LayoutBase = props => {
{/* SEO相关 */} + +} + +export { Style } diff --git a/themes/simple/index.js b/themes/simple/index.js index 059fb0b1..9676254b 100644 --- a/themes/simple/index.js +++ b/themes/simple/index.js @@ -25,6 +25,7 @@ import { Footer } from './components/Footer' import { useGlobal } from '@/lib/global' import SearchInput from './components/SearchInput' import { Transition } from '@headlessui/react' +import { Style } from './style' /** * 基础布局 @@ -42,6 +43,7 @@ const LayoutBase = props => { return (
+ +} + +export { Style }