Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #105

Merged
merged 44 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8519a35
update the changesets version
officialrajdeepsingh Feb 19, 2024
759acc1
adding demo-section-blog , docs package in ignore list (#100)
officialrajdeepsingh Feb 19, 2024
e0e6c08
creating icons
officialrajdeepsingh Apr 14, 2024
5c313d0
move the lucide icon to simple icons #98
officialrajdeepsingh Apr 14, 2024
0736e5b
introduce raw layout
officialrajdeepsingh Apr 14, 2024
35e87d1
adding raw layout support
officialrajdeepsingh Apr 14, 2024
5be335f
create raw example page
officialrajdeepsingh Apr 14, 2024
aa071d5
update the page
officialrajdeepsingh Apr 14, 2024
08b0eb0
update the social link and remove the unused code.
officialrajdeepsingh Apr 14, 2024
b6b234c
update the packages
officialrajdeepsingh Apr 14, 2024
332c17a
delete the unused file
officialrajdeepsingh Apr 14, 2024
97984fe
update the packages
officialrajdeepsingh Apr 14, 2024
d694e6a
introduce raw layout
officialrajdeepsingh Apr 14, 2024
5f7dcc3
remove the lucide icon and fetch search bar data useFetch to swr
officialrajdeepsingh Apr 14, 2024
f2ec0a9
remove the comment
officialrajdeepsingh Apr 14, 2024
366f374
remove the lucide icon type and add CardType
officialrajdeepsingh Apr 14, 2024
33143d6
export the raw layout
officialrajdeepsingh Apr 14, 2024
26e1696
update the ui
officialrajdeepsingh Apr 14, 2024
cf0c533
introduce multiple card
officialrajdeepsingh Apr 14, 2024
bf22a93
introduce multiple card
officialrajdeepsingh Apr 14, 2024
7958f52
support two card layout
officialrajdeepsingh Apr 14, 2024
a353fb8
file formating change
officialrajdeepsingh Apr 14, 2024
4566185
adding hostname for raw layout
officialrajdeepsingh Apr 14, 2024
d9709e7
CardType for card
officialrajdeepsingh Apr 14, 2024
6304bec
update the post
officialrajdeepsingh Apr 14, 2024
ac64fce
update the home page
officialrajdeepsingh Apr 14, 2024
2f395df
raw image
officialrajdeepsingh Apr 15, 2024
dfeb331
write docs about cardType and update the sociallinks docs
officialrajdeepsingh Apr 15, 2024
38e388b
introduce new raw page docs
officialrajdeepsingh Apr 15, 2024
4cf1c45
update the docs
officialrajdeepsingh Apr 15, 2024
7886027
format the file
officialrajdeepsingh Apr 15, 2024
1563262
opengraph image docs
officialrajdeepsingh Apr 15, 2024
d187eca
update the docs
officialrajdeepsingh Apr 15, 2024
f49e233
no more lucide icon
officialrajdeepsingh Apr 15, 2024
e3853ee
update the icon
officialrajdeepsingh Apr 15, 2024
a532d11
update the homepage url
officialrajdeepsingh Apr 15, 2024
4671ec1
update the image
officialrajdeepsingh Apr 15, 2024
a7b45b6
update the cardtype
officialrajdeepsingh Apr 15, 2024
6762fe2
update the icon
officialrajdeepsingh Apr 15, 2024
0ff8ecb
update the package
officialrajdeepsingh Apr 15, 2024
48f4112
V1.1.5 (#103)
officialrajdeepsingh Apr 15, 2024
e19cebb
Merge branch 'v1.1.5' into canary
officialrajdeepsingh Apr 15, 2024
bb56062
Merge branch 'canary' of https://github.com/frontendweb3/section-blog…
officialrajdeepsingh Apr 15, 2024
1f03ad8
adding demo-section-blog , docs package in ignore list (#104)
officialrajdeepsingh Apr 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": ["demo-section-blog","docs"]
}
Binary file modified docs/public/icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions docs/src/pages/docs/Built-ins/Icons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ The section blog theme provides icons to use with the Alert component.
<BadgeAlert />
<BadgeX />
<Shield />
<Braces />
<CommandIcon />
<FileIcon />
```

## How to use it?
Expand All @@ -29,7 +30,7 @@ import { AlertTriangle } from "section-blog-theme/icons"
```
Next step is use inbuilt icons, inside you mdx file.
```javascript
import { AlertTriangle, Ban, Check, CheckCircle, HelpCircle, Terminal, Braces, BadgeAlert, BadgeX, Shield, Lightbulb} from "section-blog-theme/icons"
import { AlertTriangle, Ban, Check, CheckCircle, HelpCircle, Terminal, BadgeAlert, BadgeX, Shield, Lightbulb, CommandIcon, FileIcon } from "section-blog-theme/icons"

<AlertTriangle />
<Ban />
Expand All @@ -41,6 +42,6 @@ import { AlertTriangle, Ban, Check, CheckCircle, HelpCircle, Terminal, Braces, B
<BadgeAlert />
<BadgeX />
<Shield />
<Braces />

<CommandIcon />
<FileIcon />
```
1 change: 1 addition & 0 deletions docs/src/pages/docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"configuration": "",
"theme":"Theme",
"Built-ins": "Built-ins",
"opengraph-image":"Opengraph Image",
"deploy":"Deploy",
"contributing":"Contributing"
}
12 changes: 11 additions & 1 deletion docs/src/pages/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ Change the date DateFormat in your blog site. By default date type is `MMM DD, Y
------------- | ------------- | ------- | -------------
DateFormat | `string` | `false` | Change the date format.


## CardType
Currently, we have three cards for the section blog theme. The card names are one, two and three. The one card is the default card.

Option | TYPE | Require| Description
------------- | ------------- | ------- | -------------
CardType.post | `one` & `two` & `three` | `false` | Available card option for posts.
CardType.tag | `two` & `three` | `false` | Available card option for tag.


## bannerMessage
Show banner on top website.

Expand Down Expand Up @@ -166,4 +176,4 @@ Social media icon show on your website header. I all
Option | TYPE | Require | Description
------------- | ------------- | ------ | -------------
url | `string` | `true` | full link of social media
name | use any [Lucide icon(ex: facebook)](https://lucide.dev/icons/) | `true` | name of url
name | use any [Simple Icons(ex: facebook)](https://simpleicons.org/) | `true` | name of icon
107 changes: 54 additions & 53 deletions docs/src/pages/docs/contributing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

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.

1. Clone Repo
2. Install Package
3. Structure
4. Start local development server
1. [Clone Repository](#clone-repository)
2. [Install Package](#install-package)
3. [Structure](#structure)
4. [Start local development server](#start-local-development-server)

## Clone Repo
## Clone Repository

First, clone the section blog theme repository from GitHub.

Expand All @@ -31,26 +31,27 @@ Our repository is part of a Monorepo structure, it is managed with Turbo.

**Folder :**

1. Docs
2. Package
3. Example
1. [Docs](#docs)
2. [Packages](#packages)
3. [Examples](#examples)

### Docs

The Docs folder contains the documentation, the documentation site is built with the nextra and nextra docs theme.

### Packages

The package folder contains the actual code of the section blog theme.
The packages folder contains the actual code of the section blog theme.

### Example
### Examples

The example folder contains a demo site built or used with a section blog theme.
The examples folder contains a demo site built or used with a section blog theme.

## Start local development server

1. Section blog theme server
2. Documentation server
3. Building

### Section blog theme server

Expand All @@ -73,51 +74,51 @@ pnpm dev:docs
Building theme for production.

```bash
pnpm build:core # buiding only section-blog-theme
pnpm build:core # buiding only code of section-blog-theme
# and
pnpm build # buiding section-blog-theme, and demo-section-blog package
# or
pnpm build:all # buiding section-blog-theme, demo-section-blog and docs
```

## What and where we found components?

- `components/Article/Article.tsx` article by front matter
- `components/banner/Banner.tsx` Banner
- `components/Card/Card.tsx` posts card
- `components/Command/Command.tsx` command or cmd
- `components/Footer/Footer.tsx` footer component
- `components/Header/Header.tsx` header component
- `components/Header/ThemeToggle.tsx` theme toggle
- `components/Layouts` layouts folders
- `components/Layouts/404.tsx` 404 error page
- `components/Layouts/500.tsx` 500 error page
- `components/Layouts/BlogLayout.tsx` posts type
- `components/Layouts/HomePage.tsx` home type
- `components/Layouts/index.tsx` main file
- `components/Layouts/Page.tsx` page type
- `components/Layouts/Posts.tsx` posts type
- `components/Layouts/Read.tsx` read type
- `components/Layouts/Tag.tsx` Generate Dynamic Tag
- `components/Navigation/ListItem.tsx` Part of Header
- `components/Navigation/NavgationItem.tsx` Part of Header
- `components/Navigation/NavigationItems.tsx` Part of Header
- `components/Seo/Seo.tsx` SEO component
- `components/SocialLink/DynmicIcon.tsx` Part of Header
- `components/SocialLink/SocialLink.tsx` Part of Header
- `components/ui/*` Part of shadcn UI
- `components.json` Part of shadcn UI
- `src/index.tsx` Main
- `src/tag.tsx` Tag Page
- `src/types.ts` type
- `styles/globals.css` tailwind CSS
- `tsup.config.ts` tsup config
- `utility/NextURL.ts` check development or production \*
- `utility/slugify.ts` convert title slugify
- `utility/useContent.ts` return all posts
- `utility/useTagContent.ts` return post based on tag
- `utility/useTags.ts` return all tags based on posts
- `utility/utils.ts` use by shadcn UI and tailwind CSS
- `public/` Public folder
- `__TEST__/` testing folder
- `tsconfig.json` typescript config
## Where do we find reactjs components?

- Article component located at: `components/Article/Article.tsx`.
- Banner component located at: `components/banner/Banner.tsx`.
- Card component located at:`components/Card/Card.tsx`.
- Command component located at: `components/Command/Command.tsx`.
- Footer component located at:`components/Footer/Footer.tsx`.
- Header component located at:`components/Header/Header.tsx`.
- Theme Toggle component located at:`components/Header/ThemeToggle.tsx`.
- Layouts component located at:`components/Layouts`.
- 404 component located at:`components/Layouts/404.tsx`.
- 505 component located at:`components/Layouts/500.tsx`.
- Posts component located at:`components/Layouts/BlogLayout.tsx`.
- Home component located at:`components/Layouts/HomePage.tsx`.
- Main component located at:`components/Layouts/index.tsx`.
- Page component located at:`components/Layouts/Page.tsx`.
- Posts component located at:`components/Layouts/Posts.tsx`.
- Read component located at:`components/Layouts/Read.tsx`.
- Tag component located at:`components/Layouts/Tag.tsx`.
- ListItem component located at:`components/Navigation/ListItem.tsx`.
- NavgationItem component located at:`components/Navigation/NavgationItem.tsx`.
- NavigationItems component located at:`components/Navigation/NavigationItems.tsx`.
- SEO component located at:`components/Seo/Seo.tsx`.
- DynmicIcon component located at:`components/SocialLink/DynmicIcon.tsx`.
- SocialLink component located at:`components/SocialLink/SocialLink.tsx`.
- Shadcn UI component located at:`components/ui/*`
- Shadcn UI components located at:`components.json`
- Main component located at:`src/index.tsx`
- Tag component located at:`src/tag.tsx`
- Section blog theme type located at:`src/types.ts`
- Tailwind CSS file located at:`styles/globals.css`
- Tsup Config file located at:`tsup.config.ts`
- Check development or production locat at:`utility/NextURL.ts`
- Command component located at:`utility/slugify.ts`
- Hook return posts located at:`utility/useContent.ts`
- Hook return tag-related posts located at:`utility/useTagContent.ts`
- Hook return all tags based on posts located at:`utility/useTags.ts`
- Used by shadcn UI and tailwind CSS components located at:`utility/utils.ts`
- Public folder located at:`public/`
- Testing folder located at: `__TEST__/`
- Typescript config located at:`tsconfig.json`
2 changes: 1 addition & 1 deletion docs/src/pages/docs/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,4 @@ jobs:
```
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).

</Steps>
</Steps>
70 changes: 70 additions & 0 deletions docs/src/pages/docs/opengraph-image.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title : Opengraph image
description: Generate an open graph image using the section blog theme.
---

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.

```javascript filename="page/api/og-image.tsx"

import { ImageResponse } from '@vercel/og'
import { NextRequest } from 'next/server'
export const config = {
runtime: 'edge',
}

export default async function handler(req: NextRequest) {
const { searchParams } = req.nextUrl
const title = searchParams.get('title')

if (!title) {
return new ImageResponse(<>{'Visit with "?title=what is markdown "'}</>, {
width: 1200,
height: 630,
})
}

return new ImageResponse(
(
<div
style={{
fontSize: 60,
color: 'black',
background: '#f6f6f6',
width: '100%',
height: '100%',
paddingTop: 50,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
}}
>
<h1>{title}</h1>
</div>
),
{
width: 1200,
height: 630,
}
)
}

```

You can use it with the following syntax: `api/og-image?title=10 Things You Most Likely Didn't Know About Health`

```mdx
---
type: post
title: 10 Things You Most Likely Didn't Know About Health.
description: Culpa laboris aliquip ea consectetur mollit ea ipsum sint qui culpa laboris dolor adipisicing proident. Et officia consequat do nulla tempor cupidatat elit.
date: 2022-11-12T08:05:53.939Z


image: http://localhost:3000/api/og-image?title=10 Things You Most Likely Didn't Know About Health

author: Curtis Lopez
---
```

12 changes: 12 additions & 0 deletions docs/src/pages/docs/page-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,21 @@ type: home
title: Home Page - Rajdeep Singh
description : Home page
image: https://cdn.pixabay.com/photo/2023/05/21/19/45/rose-8009275_1280.jpg
---
```

## Raw Page

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.

```mdx markdown {2} filename="index.mdx"
---
type: raw
title : Raw with Home Page
description : Raw with Home Page
---
```
![Raw Page](/raw.png "Raw Page")

## Basic Page
![Page](/Page.png "Page")
Expand Down
2 changes: 2 additions & 0 deletions examples/demo-section-blog/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module.exports = withNextra({
reactStrictMode: true,
images: {
remotePatterns: [
{ hostname:"assets.website-files.com" },
{ hostname: "localhost"},
{
hostname: "flowbite.s3.amazonaws.com",
},
Expand Down
13 changes: 7 additions & 6 deletions examples/demo-section-blog/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"name": "demo-section-blog",
"version": "0.0.0",
"private":"true",
"private": "true",
"scripts": {
"clean": "rimraf .next/ ",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"format":"pnpm exec prettier ./src --write"
"format": "pnpm exec prettier ./src --write"
},
"dependencies": {
"@types/node": "20.11.0",
"@types/react": "18.2.47",
"@types/react-dom": "18.2.18",
"@vercel/og": "^0.6.2",
"autoprefixer": "10.4.16",
"eslint": "^8.56.0",
"eslint-config-next": "^14.0.4",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.0",
"next": "14.0.4",
"nextra": "^2.13.2",
"nextra": "^2.13.4",
"postcss": "8.4.33",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand All @@ -28,6 +29,6 @@
"typescript": "5.3.3"
},
"devDependencies": {
"prettier": "^3.1.1"
"prettier": "^3.2.5"
}
}
Loading