Skip to content

Commit 664d06b

Browse files
Merge pull request #77 from frontendweb3/v1.1.0
Introduce new version of section blog theme V1.1.0
2 parents 37f9141 + 74be7a0 commit 664d06b

File tree

98 files changed

+1774
-1376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1774
-1376
lines changed

CODE_OF_CONDUCT.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within

README.md

Lines changed: 1 addition & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1 @@
1-
<div style="display: block; margin-left: auto; margin-right: auto;width: 40%;">
2-
<svg width="477" height="509" viewBox="0 0 477 509" fill="none" xmlns="http://www.w3.org/2000/svg">
3-
<path fill-rule="evenodd" clip-rule="evenodd" d="M247.177 104.672C242.99 97.1095 232.118 97.1095 227.93 104.672L68.3924 392.805C64.333 400.137 69.6354 409.133 78.0158 409.133H397.092C405.472 409.133 410.775 400.137 406.715 392.805L247.177 104.672ZM238.312 323.4C258.367 323.4 274.625 307.864 274.625 288.7C274.625 269.536 258.367 254 238.312 254C218.258 254 202 269.536 202 288.7C202 307.864 218.258 323.4 238.312 323.4Z" fill="white"/>
4-
</svg>
5-
</div>
6-
7-
Start your blog journey with Next.js, Nextra, and MDX using section themes. You can start your blog in less than two minutes, and you need only one command and zero configuration. Section theme comes with an inbuilt dark mode, a search bar, Customize Navigation, and SEO Support.
8-
9-
## Tech Stack
10-
11-
<div className="flex flex-row flex-wrap item-center md:justify-between">
12-
<img style="margin: 5px auto;" title="pnpm" alt="pnpm" src="https://img.shields.io/badge/pnpm-%234a4a4a.svg?style=for-the-badge&logo=pnpm&logoColor=f69220" />
13-
<img style="margin: 5px auto;" title="reactjs" alt="reactjs" src="https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB"/>
14-
<img style="margin: 5px auto;" title="nextjs" alt="nextjs" src="https://img.shields.io/badge/Next-black?style=for-the-badge&logo=next.js&logoColor=white"/>
15-
<img style="margin: 5px auto;" title="typescript" alt="typescript" src="https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white"/>
16-
<img style="margin: 5px auto;" title="radix ui" alt="radix ui" src="https://img.shields.io/badge/radixui-%23DD0031.svg?style=for-the-badge&logo=radixui&logoColor=white"/>
17-
<img style="margin: 5px auto;" title="tailwind css" alt="tailwind css" src="https://img.shields.io/badge/tailwindcss-%2338B2AC.svg?style=for-the-badge&logo=tailwind-css&logoColor=white" />
18-
<img style="margin: 5px auto;" title="markdown" alt="markdown" src="https://img.shields.io/badge/markdown-%23000000.svg?style=for-the-badge&logo=markdown&logoColor=white"/>
19-
<img style="margin: 5px auto;" title="turborepo" alt="turborepo" src="https://img.shields.io/badge/turborepo-000204?style=for-the-badge&logo=turborepo&logoColor=white">
20-
</div>
21-
22-
<div style="margin: 5px auto;width:100%;"></div>
23-
24-
## Installation
25-
26-
The Installation of the [section blog theme](https://www.npmjs.com/package/section-blog-theme) is a lot easier. You can install the section blog theme with the following command.
27-
28-
```bash
29-
pnpm add nextra section-blog-theme
30-
# or
31-
yarn add nextra section-blog-theme
32-
# or
33-
npm install nextra section-blog-theme
34-
```
35-
36-
## Configure the section blog with nextra
37-
38-
Create the following `next.config.js` file in your project’s root directory:
39-
40-
```javascript
41-
// next.config.js
42-
43-
const withNextra = require("nextra")({
44-
theme: "section-blog-theme",
45-
themeConfig: "./theme.config.jsx",
46-
});
47-
48-
module.exports = withNextra();
49-
```
50-
51-
## import css
52-
53-
Next step to import css file from section blog theme inside your `_app.mdx' file.
54-
55-
```javascript
56-
// _app.mdx
57-
58-
import "section-blog-theme/styles.css"
59-
export default function App({ Component, pageProps }) {
60-
return <Component {...pageProps} />
61-
}
62-
```
63-
64-
## Create Theme Config file
65-
66-
The lastly create a `theme.config.jsx` or `theme.config.tsx` file in your root level.
67-
68-
```javascript
69-
// theme.config.jsx or theme.config.tsx
70-
71-
const themeConfig = {
72-
settings: {
73-
title: "My title",
74-
description: "my descript is here ",
75-
SiteURL:"https://officialrajdeepsingh.dev",
76-
defaultSEO: {
77-
title: "default SEO title is here",
78-
titleTemplate: '%s | Section Blog Theme',
79-
twitter: {
80-
handle: "@FrontendWeb3",
81-
site: "FrontendWeb3",
82-
cardType: "summary_large_image",
83-
}
84-
}
85-
},
86-
bannerMessage: "Start your markdown portfolio blog with nextjs, nextra, tailwind CSS, and Shadcn UI using <a style='margin: 0px 4px;text-decoration:underline;' target='_blank' href='https://www.npmjs.com/package/section-blog-theme'> the section blog theme. </a>",
87-
SocialLinks: [
88-
{
89-
name: "twitter",
90-
url: "https://twitter.com/FrontendWeb3",
91-
},
92-
{
93-
name: "linkedin",
94-
url: "https://www.linkedin.com/company/frontendweb",
95-
},
96-
{
97-
name: "github",
98-
url: "https://github.com/frontendweb3/section-theme-blog",
99-
},
100-
],
101-
Logo: {
102-
text: "Section",
103-
logo:'<svg width="477" height="509" viewBox="0 0 477 509" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M247.177 104.672C242.99 97.1095 232.118 97.1095 227.93 104.672L68.3924 392.805C64.333 400.137 69.6354 409.133 78.0158 409.133H397.092C405.472 409.133 410.775 400.137 406.715 392.805L247.177 104.672ZM238.312 323.4C258.367 323.4 274.625 307.864 274.625 288.7C274.625 269.536 258.367 254 238.312 254C218.258 254 202 269.536 202 288.7C202 307.864 218.258 323.4 238.312 323.4Z" fill="white"/></svg>'
104-
},
105-
PrimaryNavigation: [
106-
{
107-
href: "/",
108-
title: "Home",
109-
},
110-
{
111-
href: "/posts",
112-
title: "Blog",
113-
},
114-
{
115-
title: "Projects",
116-
subNav: true,
117-
subNavigation: [
118-
{
119-
title: "Personal Blog",
120-
href: "https://officialrajdeepsingh.dev/",
121-
description:
122-
"Check out my personal portfolio blog website.",
123-
},
124-
{
125-
title: "Section Blog Theme",
126-
href: "https://github.com/frontendweb3/section-blog-theme",
127-
description: "Section blog theme is nextra based theme.",
128-
},
129-
{
130-
title: "Awesome Nextjs",
131-
href: "https://github.com/officialrajdeepsingh/awesome-nextjs",
132-
description:
133-
"A curated list of awesome Nextjs-based libraries that help build small and large-scale applications with next.js.",
134-
},
135-
],
136-
},
137-
{
138-
href: "/about",
139-
title: "About",
140-
},
141-
{
142-
href: "/contact",
143-
title: "Contact",
144-
},
145-
],
146-
SecondaryNavigation: [
147-
{
148-
href: "/disclaimer",
149-
title: "Disclaimer",
150-
},
151-
{
152-
href: "/privacy-policy",
153-
title: "Privacy policy",
154-
},
155-
{
156-
href: "/contact",
157-
title: "Contact",
158-
},
159-
]
160-
};
161-
export default themeConfig;
162-
```
163-
164-
## rename your file.
165-
Lastly, rename the file extension the `.tsx ` or `.jsx` to a `.mdx`. for every file inside the pages folder. But does not change the `_document.jsx or _document.tsx` file extension.
1+
packages/section-blog-theme/README.md

contributing.md

Lines changed: 66 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,119 @@
11
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.
22

33
How to start a contribution?
4+
45
1. Clone Repo
56
2. Install Package
67
3. Structure
78
4. Start local development server
89

910
## Clone Repo
11+
1012
First, clone the section blog theme repository from GitHub.
13+
1114
```bash
1215
git clone https://github.com/frontendweb3/section-blog-theme.git
16+
# or
17+
gh repo clone frontendweb3/section-blog-theme
1318
```
1419

1520
## Install-Package
21+
1622
Install the package with pnpm.
1723

1824
```bash
1925
cd section-blog-theme && pnpm install
2026
```
2127

2228
## Structure
23-
Our repository is part of a Monorepo structure, it is managed with Turbo.
29+
30+
Our repository is part of a Monorepo structure, it is managed with Turbo.
2431

2532
### Folder
33+
2634
1. Docs
2735
2. Package
2836
3. Example
2937

3038
### Docs
39+
3140
The Docs folder contains the documentation, the documentation site is built with the nextra and nextra docs theme.
3241

3342
### Packages
43+
3444
The package folder contains the actual code of the section blog theme.
3545

3646
### Example
37-
The example folder contains a demo site built or used with a section blog theme.
3847

48+
The example folder contains a demo site built or used with a section blog theme.
3949

4050
## Start local development server
51+
4152
1. Section blog theme server
4253
2. Documentation server
4354

4455
### Section blog theme server
56+
4557
You can start the local development server with the following command.
4658

4759
```bash
48-
pnpm dev --filter=section-blog-theme --filter=demo-section-blog
60+
pnpm dev
4961
```
62+
5063
### Documentation server
64+
5165
Start your documentation server with following command.
5266

5367
```bash
54-
pnpm dev --filter=docs
68+
pnpm dev:docs
5569
```
56-
## What and where we found components?
5770

58-
* `components/Article/Article.tsx` > article by frontmatter
59-
* `components/banner/Banner.tsx` > Banner
60-
* `components/Card/Card.tsx` > posts card
61-
* `components/Command/Command.tsx` > command or cmd
62-
* `components/Footer/Footer.tsx` > footer component
63-
* `components/Header/Header.tsx` > header component
64-
* `components/Header/ThemeToggle.tsx` > theme toggle
65-
* `components/Layouts` > layouts folders
66-
* `components/Layouts/404.tsx` > 404 error page
67-
* `components/Layouts/500.tsx` > 500 error page
68-
* `components/Layouts/BlogLayout.tsx` > posts type
69-
* `components/Layouts/HomePage.tsx` > home type
70-
* `components/Layouts/index.tsx` > main file
71-
* `components/Layouts/Page.tsx` > page type
72-
* `components/Layouts/Posts.tsx` > posts type
73-
* `components/Layouts/Read.tsx` > read type
74-
* `components/Layouts/Tag.tsx` > Generate Dynamic Tag
75-
* `components/Navigation/ListItem.tsx` > Part of Header
76-
* `components/Navigation/NavgationItem.tsx` > Part of Header
77-
* `components/Navigation/NavigationItems.tsx` > Part of Header
78-
* `components/Seo/Seo.tsx` > SEO component
79-
* `components/SocialLink/DynmicIcon.tsx` > Part of Header
80-
* `components/SocialLink/SocialLink.tsx` > Part of Header
81-
* `components/ui/*` > Part of shadcn/ui
82-
* `components.json` > shadcn/ui
83-
* `src/index.tsx` > Main
84-
* `src/tag.tsx` > Tag Page
85-
* `src/types.ts` > type
86-
* `styles/globals.css` > tailwind css
87-
* `tsup.config.ts` > tsup config
88-
* `utility/NextURL.ts` > check develpment or production *
89-
* `utility/slugify.ts` > convert title slugify *
90-
* `utility/useContent.ts` > return all posts *
91-
* `utility/useTagContent.ts` > return post based on tag
92-
* `utility/useTags.ts` > return all tags based on posts
93-
* `utility/utils.ts` > use by shadcn/ui and tailwind css
94-
* `public/` > Public folder
95-
* `__TEST__/` > testing folder
96-
* `tsconfig.json` > typescript config
71+
### Building
72+
73+
Building theme for production.
74+
75+
```bash
76+
pnpm build
77+
```
78+
79+
## What and where we found components?
9780

81+
- `components/Article/Article.tsx` > article by frontmatter
82+
- `components/banner/Banner.tsx` > Banner
83+
- `components/Card/Card.tsx` > posts card
84+
- `components/Command/Command.tsx` > command or cmd
85+
- `components/Footer/Footer.tsx` > footer component
86+
- `components/Header/Header.tsx` > header component
87+
- `components/Header/ThemeToggle.tsx` > theme toggle
88+
- `components/Layouts` > layouts folders
89+
- `components/Layouts/404.tsx` > 404 error page
90+
- `components/Layouts/500.tsx` > 500 error page
91+
- `components/Layouts/BlogLayout.tsx` > posts type
92+
- `components/Layouts/HomePage.tsx` > home type
93+
- `components/Layouts/index.tsx` > main file
94+
- `components/Layouts/Page.tsx` > page type
95+
- `components/Layouts/Posts.tsx` > posts type
96+
- `components/Layouts/Read.tsx` > read type
97+
- `components/Layouts/Tag.tsx` > Generate Dynamic Tag
98+
- `components/Navigation/ListItem.tsx` > Part of Header
99+
- `components/Navigation/NavgationItem.tsx` > Part of Header
100+
- `components/Navigation/NavigationItems.tsx` > Part of Header
101+
- `components/Seo/Seo.tsx` > SEO component
102+
- `components/SocialLink/DynmicIcon.tsx` > Part of Header
103+
- `components/SocialLink/SocialLink.tsx` > Part of Header
104+
- `components/ui/*` > Part of shadcn/ui
105+
- `components.json` > shadcn/ui
106+
- `src/index.tsx` > Main
107+
- `src/tag.tsx` > Tag Page
108+
- `src/types.ts` > type
109+
- `styles/globals.css` > tailwind css
110+
- `tsup.config.ts` > tsup config
111+
- `utility/NextURL.ts` > check develpment or production \*
112+
- `utility/slugify.ts` > convert title slugify \*
113+
- `utility/useContent.ts` > return all posts \*
114+
- `utility/useTagContent.ts` > return post based on tag
115+
- `utility/useTags.ts` > return all tags based on posts
116+
- `utility/utils.ts` > use by shadcn/ui and tailwind css
117+
- `public/` > Public folder
118+
- `__TEST__/` > testing folder
119+
- `tsconfig.json` > typescript config

docs/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6+
"clean": "rimraf .next/ ",
67
"dev": "next dev",
78
"build": "next build",
89
"start": "next start",
@@ -18,6 +19,7 @@
1819
"nextra-theme-docs": "^2.13.2",
1920
"react": "18.2.0",
2021
"react-dom": "18.2.0",
22+
"rimraf": "^5.0.5",
2123
"typescript": "5.3.3"
2224
}
2325
}

docs/public/404.png

-19.5 KB
Loading

docs/public/Home.png

-17.5 KB
Loading

docs/public/Page.png

-44.1 KB
Loading

docs/public/Post.png

37.3 KB
Loading

docs/public/Posts.png

-48.7 KB
Loading

docs/public/Tags.png

-46.3 KB
Loading

0 commit comments

Comments
 (0)