mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Nobelium 支持切换头像
This commit is contained in:
@@ -3,9 +3,10 @@ import Link from 'next/link'
|
||||
import BLOG from '@/blog.config'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import CONFIG_NOBELIUM from '../config_nobelium'
|
||||
import { SvgIcon } from './SvgIcon'
|
||||
|
||||
const Nav = props => {
|
||||
const { navBarTitle, fullWidth } = props
|
||||
const { navBarTitle, fullWidth, siteInfo } = props
|
||||
const useSticky = !BLOG.autoCollapsedNavBar
|
||||
const navRef = useRef(null)
|
||||
const sentinalRef = useRef([])
|
||||
@@ -42,33 +43,12 @@ const Nav = props => {
|
||||
<Link href="/" aria-label={BLOG.title}>
|
||||
|
||||
<div className="h-6">
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<rect
|
||||
width="24"
|
||||
height="24"
|
||||
className="fill-current text-black dark:text-white"
|
||||
/>
|
||||
<rect width="24" height="24" fill="url(#paint0_radial)" />
|
||||
<defs>
|
||||
<radialGradient
|
||||
id="paint0_radial"
|
||||
cx="0"
|
||||
cy="0"
|
||||
r="1"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="rotate(45) scale(39.598)"
|
||||
>
|
||||
<stop stopColor="#CFCFCF" stopOpacity="0.6" />
|
||||
<stop offset="1" stopColor="#E9E9E9" stopOpacity="0" />
|
||||
</radialGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
{/* <SvgIcon/> */}
|
||||
{CONFIG_NOBELIUM.NAV_NOTION_ICON
|
||||
/* eslint-disable-next-line @next/next/no-img-element */
|
||||
? <img src={siteInfo?.icon} width={24} height={24} alt={BLOG.AUTHOR}/>
|
||||
: <SvgIcon/>}
|
||||
|
||||
</div>
|
||||
|
||||
</Link>
|
||||
@@ -80,8 +60,8 @@ const Nav = props => {
|
||||
)
|
||||
: (
|
||||
<p className="ml-2 font-medium text-day dark:text-night header-name">
|
||||
{BLOG.title},{' '}
|
||||
<span className="font-normal">{BLOG.description}</span>
|
||||
{siteInfo?.title}
|
||||
{/* ,{' '}<span className="font-normal">{siteInfo?.description}</span> */}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
29
themes/nobelium/components/SvgIcon.js
Normal file
29
themes/nobelium/components/SvgIcon.js
Normal file
@@ -0,0 +1,29 @@
|
||||
export const SvgIcon = () => {
|
||||
return <svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<rect
|
||||
width="24"
|
||||
height="24"
|
||||
className="fill-current text-black dark:text-white"
|
||||
/>
|
||||
<rect width="24" height="24" fill="url(#paint0_radial)" />
|
||||
<defs>
|
||||
<radialGradient
|
||||
id="paint0_radial"
|
||||
cx="0"
|
||||
cy="0"
|
||||
r="1"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="rotate(45) scale(39.598)"
|
||||
>
|
||||
<stop stopColor="#CFCFCF" stopOpacity="0.6" />
|
||||
<stop offset="1" stopColor="#E9E9E9" stopOpacity="0" />
|
||||
</radialGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
}
|
||||
@@ -5,6 +5,9 @@ const CONFIG_NOBELIUM = {
|
||||
MENU_TAG: true, // 显示标签
|
||||
MENU_ARCHIVE: false, // 显示归档
|
||||
MENU_SEARCH: true, // 显示搜索
|
||||
MENU_RSS: false // 显示订阅
|
||||
MENU_RSS: false, // 显示订阅
|
||||
|
||||
NAV_NOTION_ICON: true // 是否读取Notion图标作为站点头像
|
||||
|
||||
}
|
||||
export default CONFIG_NOBELIUM
|
||||
|
||||
Reference in New Issue
Block a user