You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/pages/docs/contributing.mdx
+54-53Lines changed: 54 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
3
3
The section blog theme comes under an open-source license. Before starting the contribution, first read our [Code of Conduct](./CODE_OF_CONDUCT.md) guidelines.
4
4
5
-
1. Clone Repo
6
-
2. Install Package
7
-
3. Structure
8
-
4. Start local development server
5
+
1.[Clone Repository](#clone-repository)
6
+
2.[Install Package](#install-package)
7
+
3.[Structure](#structure)
8
+
4.[Start local development server](#start-local-development-server)
9
9
10
-
## Clone Repo
10
+
## Clone Repository
11
11
12
12
First, clone the section blog theme repository from GitHub.
13
13
@@ -31,26 +31,27 @@ Our repository is part of a Monorepo structure, it is managed with Turbo.
31
31
32
32
**Folder :**
33
33
34
-
1. Docs
35
-
2.Package
36
-
3.Example
34
+
1.[Docs](#docs)
35
+
2.[Packages](#packages)
36
+
3.[Examples](#examples)
37
37
38
38
### Docs
39
39
40
40
The Docs folder contains the documentation, the documentation site is built with the nextra and nextra docs theme.
41
41
42
42
### Packages
43
43
44
-
The package folder contains the actual code of the section blog theme.
44
+
The packages folder contains the actual code of the section blog theme.
45
45
46
-
### Example
46
+
### Examples
47
47
48
-
The example folder contains a demo site built or used with a section blog theme.
48
+
The examples folder contains a demo site built or used with a section blog theme.
49
49
50
50
## Start local development server
51
51
52
52
1. Section blog theme server
53
53
2. Documentation server
54
+
3. Building
54
55
55
56
### Section blog theme server
56
57
@@ -73,51 +74,51 @@ pnpm dev:docs
73
74
Building theme for production.
74
75
75
76
```bash
76
-
pnpm build:core # buiding only section-blog-theme
77
+
pnpm build:core # buiding only code of section-blog-theme
77
78
# and
78
79
pnpm build # buiding section-blog-theme, and demo-section-blog package
79
80
# or
80
81
pnpm build:all # buiding section-blog-theme, demo-section-blog and docs
81
82
```
82
83
83
-
## What and where we found components?
84
-
85
-
-`components/Article/Article.tsx` article by front matter
86
-
-`components/banner/Banner.tsx` Banner
87
-
-`components/Card/Card.tsx` posts card
88
-
-`components/Command/Command.tsx` command or cmd
89
-
-`components/Footer/Footer.tsx` footer component
90
-
-`components/Header/Header.tsx` header component
91
-
-`components/Header/ThemeToggle.tsx` theme toggle
92
-
-`components/Layouts` layouts folders
93
-
-`components/Layouts/404.tsx` 404 error page
94
-
-`components/Layouts/500.tsx` 500 error page
95
-
-`components/Layouts/BlogLayout.tsx` posts type
96
-
-`components/Layouts/HomePage.tsx` home type
97
-
-`components/Layouts/index.tsx` main file
98
-
-`components/Layouts/Page.tsx` page type
99
-
-`components/Layouts/Posts.tsx` posts type
100
-
-`components/Layouts/Read.tsx` read type
101
-
-`components/Layouts/Tag.tsx` Generate Dynamic Tag
102
-
-`components/Navigation/ListItem.tsx` Part of Header
103
-
-`components/Navigation/NavgationItem.tsx` Part of Header
104
-
-`components/Navigation/NavigationItems.tsx` Part of Header
105
-
-`components/Seo/Seo.tsx` SEO component
106
-
-`components/SocialLink/DynmicIcon.tsx` Part of Header
107
-
-`components/SocialLink/SocialLink.tsx` Part of Header
108
-
-`components/ui/*`Part of shadcn UI
109
-
-`components.json` Part of shadcn UI
110
-
-`src/index.tsx` Main
111
-
-`src/tag.tsx` Tag Page
112
-
-`src/types.ts` type
113
-
-`styles/globals.css`tailwind CSS
114
-
-`tsup.config.ts` tsup config
115
-
-`utility/NextURL.ts` check development or production \*
116
-
-`utility/slugify.ts` convert title slugify
117
-
-`utility/useContent.ts` return all posts
118
-
-`utility/useTagContent.ts` return post based on tag
119
-
-`utility/useTags.ts` return all tags based on posts
120
-
-`utility/utils.ts` use by shadcn UI and tailwind CSS
121
-
-`public/` Public folder
122
-
-`__TEST__/` testing folder
123
-
-`tsconfig.json` typescript config
84
+
## Where do we find reactjs components?
85
+
86
+
-Article component located at: `components/Article/Article.tsx`.
87
+
-Banner component located at: `components/banner/Banner.tsx`.
88
+
-Card component located at:`components/Card/Card.tsx`.
89
+
-Command component located at: `components/Command/Command.tsx`.
90
+
-Footer component located at:`components/Footer/Footer.tsx`.
91
+
-Header component located at:`components/Header/Header.tsx`.
92
+
-Theme Toggle component located at:`components/Header/ThemeToggle.tsx`.
93
+
-Layouts component located at:`components/Layouts`.
94
+
-404 component located at:`components/Layouts/404.tsx`.
95
+
-505 component located at:`components/Layouts/500.tsx`.
96
+
-Posts component located at:`components/Layouts/BlogLayout.tsx`.
97
+
-Home component located at:`components/Layouts/HomePage.tsx`.
98
+
-Main component located at:`components/Layouts/index.tsx`.
99
+
-Page component located at:`components/Layouts/Page.tsx`.
100
+
-Posts component located at:`components/Layouts/Posts.tsx`.
101
+
-Read component located at:`components/Layouts/Read.tsx`.
102
+
-Tag component located at:`components/Layouts/Tag.tsx`.
103
+
-ListItem component located at:`components/Navigation/ListItem.tsx`.
104
+
-NavgationItem component located at:`components/Navigation/NavgationItem.tsx`.
105
+
-NavigationItems component located at:`components/Navigation/NavigationItems.tsx`.
106
+
-SEO component located at:`components/Seo/Seo.tsx`.
107
+
-DynmicIcon component located at:`components/SocialLink/DynmicIcon.tsx`.
108
+
-SocialLink component located at:`components/SocialLink/SocialLink.tsx`.
109
+
-Shadcn UI component located at:`components/ui/*`
110
+
-Shadcn UI components located at:`components.json`
111
+
-Main component located at:`src/index.tsx`
112
+
-Tag component located at:`src/tag.tsx`
113
+
-Section blog theme type located at:`src/types.ts`
114
+
-Tailwind CSS file located at:`styles/globals.css`
115
+
-Tsup Config file located at:`tsup.config.ts`
116
+
-Check development or production locat at:`utility/NextURL.ts`
117
+
-Command component located at:`utility/slugify.ts`
118
+
-Hook return posts located at:`utility/useContent.ts`
119
+
-Hook return tag-related posts located at:`utility/useTagContent.ts`
120
+
-Hook return all tags based on posts located at:`utility/useTags.ts`
121
+
-Used by shadcn UI and tailwind CSS components located at:`utility/utils.ts`
Copy file name to clipboardExpand all lines: docs/src/pages/docs/deploy.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,4 +227,4 @@ jobs:
227
227
```
228
228
Now push your local code into the GitHub repository and [enable GitHub pages permission](https://medium.com/frontendweb/how-to-deploy-the-next-js-app-router-application-on-github-pages-using-pnpm-54ac72424d80).
description: Generate an open graph image using the section blog theme.
4
+
---
5
+
6
+
To generate an [open graph image](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image) in the section theme blog, use the following code.
returnnewImageResponse(<>{'Visit with "?title=what is markdown "'}</>, {
22
+
width:1200,
23
+
height:630,
24
+
})
25
+
}
26
+
27
+
returnnewImageResponse(
28
+
(
29
+
<div
30
+
style={{
31
+
fontSize:60,
32
+
color:'black',
33
+
background:'#f6f6f6',
34
+
width:'100%',
35
+
height:'100%',
36
+
paddingTop:50,
37
+
flexDirection:'column',
38
+
justifyContent:'center',
39
+
alignItems:'center',
40
+
display:'flex',
41
+
}}
42
+
>
43
+
<h1>{title}</h1>
44
+
</div>
45
+
),
46
+
{
47
+
width:1200,
48
+
height:630,
49
+
}
50
+
)
51
+
}
52
+
53
+
```
54
+
55
+
You can use it with the following syntax: `api/og-image?title=10 Things You Most Likely Didn't Know About Health`
56
+
57
+
```mdx
58
+
---
59
+
type: post
60
+
title: 10 Things You Most Likely Didn't Know About Health.
61
+
description: Culpa laboris aliquip ea consectetur mollit ea ipsum sint qui culpa laboris dolor adipisicing proident. Et officia consequat do nulla tempor cupidatat elit.
62
+
date: 2022-11-12T08:05:53.939Z
63
+
64
+
65
+
image: http://localhost:3000/api/og-image?title=10 Things You Most Likely Didn't Know About Health
A raw page is a raw page without any typography or other style. You can control everything. Similar to the home page, you can also build a home page using Raw. It gives you more control over your design.
0 commit comments