Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lobehub/dumi-theme-lobehub
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.10.1
Choose a base ref
...
head repository: lobehub/dumi-theme-lobehub
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.10.2
Choose a head ref
  • 2 commits
  • 9 files changed
  • 2 contributors

Commits on Nov 24, 2024

  1. 🐛 fix: Fix analytics

    canisminor1990 committed Nov 24, 2024
    Copy the full SHA
    08ebdca View commit details
  2. 🔖 chore(release): v1.10.2 [skip ci]

    ### [Version 1.10.2](v1.10.1...v1.10.2)
    <sup>Released on **2024-11-24**</sup>
    
    #### 🐛 Bug Fixes
    
    - **misc**: Fix analytics.
    
    <br/>
    
    <details>
    <summary><kbd>Improvements and Fixes</kbd></summary>
    
    #### What's fixed
    
    * **misc**: Fix analytics ([08ebdca](08ebdca))
    
    </details>
    
    <div align="right">
    
    [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
    
    </div>
    semantic-release-bot committed Nov 24, 2024
    Copy the full SHA
    a255b0a View commit details
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,31 @@

# Changelog

### [Version 1.10.2](https://github.com/lobehub/dumi-theme-lobehub/compare/v1.10.1...v1.10.2)

<sup>Released on **2024-11-24**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix analytics.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **misc**: Fix analytics ([08ebdca](https://github.com/lobehub/dumi-theme-lobehub/commit/08ebdca))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.10.1](https://github.com/lobehub/dumi-theme-lobehub/compare/v1.10.0...v1.10.1)

<sup>Released on **2024-11-24**</sup>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dumi-theme-lobehub",
"version": "1.10.1",
"version": "1.10.2",
"description": "dumi-theme-lobehub is a documentation site theme package designed for dumi2. It provides a more beautiful and user-friendly development and reading experience based on @lobehub/ui",
"keywords": [
"lobehub",
20 changes: 0 additions & 20 deletions src/components/Analytics/Clarity.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions src/components/Analytics/GoogleAnalytics.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions src/components/Analytics/Plausible.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions src/components/Analytics/index.tsx

This file was deleted.

4 changes: 3 additions & 1 deletion src/layouts/DemoLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -12,11 +12,12 @@ import {
import isEqual from 'fast-deep-equal';
import { memo, useMemo } from 'react';

import Analytics from '@/components/Analytics';
import { Provider, createStore, useThemeStore } from '@/store';

import Analytics from '../DocLayout/Head/Analytics';
import Favicons from '../DocLayout/Head/Favicons';
import Og from '../DocLayout/Head/Og';
import StructuredData from '../DocLayout/Head/StructuredData';
import GlobalStyle from './GlobalStyle';

const App = memo(({ initState }: any) => {
@@ -28,6 +29,7 @@ const App = memo(({ initState }: any) => {
<Favicons />
<Og />
<Analytics />
<StructuredData />
<ThemeProvider themeMode={themeMode}>
<GlobalStyle />
{outlet}
56 changes: 56 additions & 0 deletions src/layouts/DocLayout/Head/Analytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { Helmet } from 'dumi';
import { FC } from 'react';

import { siteSelectors, useSiteStore } from '@/store';

const Analytics: FC = () => {
const analytics = useSiteStore(siteSelectors.analytics);
return (
<Helmet>
{analytics?.googleAnalytics && (
<>
<script
async
src={`https://www.googletagmanager.com/gtag/js?id=${analytics.googleAnalytics.measurementId}`}
/>
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${analytics.googleAnalytics.measurementId}');
`,
}}
id="google-analytics"
type="text/javascript"
/>
</>
)}
{analytics?.clarity && (
<script
dangerouslySetInnerHTML={{
__html: `
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "${analytics.clarity.projectId}");
`,
}}
id="microsoft-clarity-init"
/>
)}
{analytics?.plausible && (
<script
data-domain={analytics.plausible.domain}
defer
src={`${analytics.plausible.scriptBaseUrl}/js/script.js`}
/>
)}
</Helmet>
);
};

export default Analytics;
4 changes: 2 additions & 2 deletions src/layouts/DocLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -9,11 +9,11 @@ import {
} from 'dumi';
import { memo, useMemo } from 'react';

import Analytics from '@/components/Analytics';
import { StoreUpdater } from '@/components/StoreUpdater';
import { Provider, createStore } from '@/store';

import DocumentLayout from './DocumentLayout';
import Analytics from './Head/Analytics';
import Favicons from './Head/Favicons';
import Og from './Head/Og';
import StructuredData from './Head/StructuredData';
@@ -24,8 +24,8 @@ const App = memo(({ initState }: any) => {
<Provider createStore={() => createStore(initState)}>
<Favicons />
<Og />
<StructuredData />
<Analytics />
<StructuredData />
<StoreUpdater />
<ThemeProvider>
<DocumentLayout />