Skip to content

Commit

Permalink
feat: #1 代码块优化,项目结构重构
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Feb 24, 2023
1 parent b4ebff3 commit a9dcaf4
Show file tree
Hide file tree
Showing 17 changed files with 260 additions and 143 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
<meta charset="UTF-8" />
<link href="/vite.svg" rel="icon" type="image/svg+xml" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<title>Vite + React + TS</title>
<title>基于思源笔记的在线博客</title>
</head>
<body>
<div id="root"></div>
<script src="/src/main.tsx" type="module"></script>
<script src="/src/blog-main.tsx" type="module"></script>
</body>
</html>
10 changes: 5 additions & 5 deletions src/App.tsx → src/apps/blog/BlogApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
*/

import { useState } from "react"
import reactLogo from "./assets/react.svg"
import "./App.css"
import reactLogo from "../../assets/react.svg"
import "../../styles/app/BlogApp.sass"

function App() {
function BlogApp() {
const [count, setCount] = useState(0)

return (
<div className="App">
<div>
<a href="https://vitejs.dev" target="_blank">
<img src="./vite.svg" className="logo" alt="Vite logo" />
<img src={"./vite.svg"} className="logo" alt="Vite logo" />
</a>
<a href="https://reactjs.org" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
Expand All @@ -56,4 +56,4 @@ function App() {
)
}

export default App
export default BlogApp
File renamed without changes.
2 changes: 1 addition & 1 deletion src/zhi/bootstrap.ts → src/apps/zhi/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* questions.
*/

import Lifecycle from "~/src/zhi/Lifecycle"
import Lifecycle from "~/src/apps/zhi/Lifecycle"

/**
* zhi主题唯一激活入口
Expand Down
6 changes: 3 additions & 3 deletions src/main.tsx → src/blog-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@

import React from "react"
import ReactDOM from "react-dom/client"
import App from "./App"
import "./index.css"
import BlogApp from "./apps/blog/BlogApp"
import "./blog-theme.sass"
import zhi from "~/src/zhi-theme"

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<App />
<BlogApp />
</React.StrictMode>
)

Expand Down
134 changes: 134 additions & 0 deletions src/blog-theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/blog-theme.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 0 additions & 99 deletions src/index.css

This file was deleted.

34 changes: 11 additions & 23 deletions src/App.css → src/styles/app/BlogApp.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/styles/app/BlogApp.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a9dcaf4

Please sign in to comment.