-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
190 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { data } from '@/components/Sidebar/mockData'; | ||
|
||
export type AboutWidgetProps = { | ||
title?: string; | ||
}; | ||
|
||
export const AboutWidget = (props: AboutWidgetProps) => { | ||
return ( | ||
<div className="widget"> | ||
<h4 className="widget-title">{data.aboutPage.title}</h4> | ||
{data.aboutPage.params.image && ( | ||
<img | ||
src={data.aboutPage.params.image} | ||
alt="" | ||
className="img-fluid author-thumb-sm d-block mx-auto rounded-circle mb-4" | ||
/> | ||
)} | ||
<p>{data.aboutPage.params.summary}</p> | ||
<a href={data.aboutPage.params.permalink} className="btn btn-outline-primary" type="button"> | ||
Know More | ||
</a> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './AboutWidget'; |
13 changes: 13 additions & 0 deletions
13
src/components/AdvertisementWidget/AdvertisementWidget.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { data } from '@/components/Sidebar/mockData'; | ||
|
||
export type AdvertisementWidgetProps = { | ||
title?: string; | ||
}; | ||
|
||
export const AdvertisementWidget = (props: AdvertisementWidgetProps) => { | ||
return ( | ||
<div className="widget"> | ||
<img src={data.advertisementImage} alt="" className="img-fluid" /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './AdvertisementWidget'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,31 @@ | ||
export const data = { | ||
paginator: { | ||
pages: [ | ||
{ | ||
params: { | ||
image: 'https://example.com/image.jpg', | ||
categories: ['category1', 'category2'], | ||
permalink: 'https://example.com/post1', | ||
title: 'Post 1', | ||
summary: 'This is the summary of Post 1', | ||
hideDate: false | ||
}, | ||
site: { | ||
params: { | ||
author: 'John Doe' | ||
} | ||
}, | ||
publishDate: new Date() | ||
}, | ||
{ | ||
params: { | ||
image: null, | ||
categories: ['category3'], | ||
permalink: 'https://example.com/post2', | ||
title: 'Post 2', | ||
summary: 'This is the summary of Post 2', | ||
hideDate: true | ||
}, | ||
site: { | ||
params: { | ||
author: 'Jane Smith' | ||
} | ||
}, | ||
publishDate: new Date() | ||
} | ||
// Add more pages here if needed | ||
] | ||
import { Page } from '@/components/Paginator'; | ||
|
||
export const pages: Page[] = [ | ||
{ | ||
title: 'Post 1', | ||
publishDate: new Date(), | ||
params: { | ||
image: 'https://example.com/image.jpg', | ||
categories: [ | ||
{ id: '1', title: 'category1' }, | ||
{ id: '2', title: 'category2' } | ||
], | ||
permalink: 'https://example.com/post1', | ||
summary: 'This is the summary of Post 1', | ||
hideDate: false, | ||
author: 'John Doe' | ||
} | ||
}, | ||
{ | ||
title: 'Post 2', | ||
publishDate: new Date(), | ||
params: { | ||
image: 'https://example.com/image.jpg', | ||
categories: [{ id: '3', title: 'category3' }], | ||
permalink: 'https://example.com/post2', | ||
summary: 'This is the summary of Post 2', | ||
hideDate: true, | ||
author: 'Jane Smith' | ||
} | ||
} | ||
}; | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { data } from '@/components/Sidebar/mockData'; | ||
|
||
export type CategoryWidgetProps = { | ||
title?: string; | ||
}; | ||
|
||
export const CategoryWidget = (props: CategoryWidgetProps) => { | ||
return ( | ||
<div className="widget"> | ||
<h4 className="widget-title">Category</h4> | ||
{Object.entries(data.categories).length !== 0 && ( | ||
<ul className="list-unstyled"> | ||
{Object.entries(data.categories).map(([name, items]) => ( | ||
<li key={`category-${name}`}> | ||
<a href={`/categories/${name.toLowerCase()}/`}>{name}</a> | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './CategoryWidget'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,19 @@ | ||
<div class="col-lg-4"> | ||
<div class="widgets"> | ||
<!-- about --> | ||
<div class="widget"> | ||
{{ with .Site.GetPage "/about" }} | ||
<h4 class="widget-title">{{ .Title | markdownify }}</h4> | ||
{{ if .Params.Image }} | ||
<img src="{{ .Params.Image | absURL }}" alt="" | ||
class="img-fluid author-thumb-sm d-block mx-auto rounded-circle mb-4"> | ||
{{ end }} | ||
<p>{{ .Summary }}</p> | ||
<a href="{{ .Permalink }}" class="btn btn-outline-primary">Know More</a> | ||
{{ end }} | ||
import { AdvertisementWidget } from '@/components/AdvertisementWidget'; | ||
import { AboutWidget } from '@/components/AboutWidget'; | ||
import { CategoryWidget } from '@/components/CategoryWidget'; | ||
import { SocialWidget } from '@/components/SocialWidget'; | ||
import { TagWidget } from '@/components/TagWidget'; | ||
|
||
export const Sidebar = () => { | ||
return ( | ||
<div className="col-lg-4"> | ||
<div className="widgets"> | ||
<AboutWidget /> | ||
<CategoryWidget /> | ||
<TagWidget /> | ||
<SocialWidget /> | ||
<AdvertisementWidget /> | ||
</div> | ||
</div> | ||
<!-- category --> | ||
<div class="widget"> | ||
<h4 class="widget-title">Category</h4> | ||
{{- if isset .Site.Taxonomies "categories" }} | ||
{{- if not (eq (len .Site.Taxonomies.categories) 0) }} | ||
<ul class="list-unstyled"> | ||
{{- range $name, $items := .Site.Taxonomies.categories }} | ||
<li><a | ||
href="{{ `categories/` | relLangURL }}{{ $name | urlize | lower }}/">{{ $name | title | humanize }}</a> | ||
</li> | ||
{{- end }} | ||
</ul> | ||
{{- end }} | ||
{{- end }} | ||
</div> | ||
<!-- Tags --> | ||
<div class="widget"> | ||
<h4 class="widget-title">Tag</h4> | ||
{{- if isset .Site.Taxonomies "tags" }} | ||
{{- if not (eq (len .Site.Taxonomies.tags) 0) }} | ||
<ul class="list-inline"> | ||
{{- range $name, $items := .Site.Taxonomies.tags }} | ||
<li class="list-inline-item"><a class="d-block p-2 bg-primary text-white" | ||
href="{{ `tags/` | relLangURL }}{{ $name | urlize | lower }}/">{{ $name | humanize }}</a></li> | ||
{{- end }} | ||
</ul> | ||
{{- end }} | ||
{{- end }} | ||
</div> | ||
<!-- social --> | ||
<div class="widget"> | ||
<h4 class="widget-title">Social</h4> | ||
<ul class="list-inline social-links"> | ||
{{ range .Site.Params.social }} | ||
<li class="list-inline-item"><a href="{{ .link | safeURL }}"><i class="{{ .icon }}"></i></a></li> | ||
{{ end }} | ||
</ul> | ||
</div> | ||
<!-- advertisement --> | ||
<div class="widget"> | ||
<img src="{{`images/promotion.png` | absURL}}" alt="" class="img-fluid"> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export const data = { | ||
aboutPage: { | ||
title: 'About Page', | ||
params: { | ||
image: 'https://example.com/about-image.jpg', | ||
summary: 'This is the summary of the about page', | ||
permalink: 'https://example.com/about' | ||
} | ||
}, | ||
categories: { | ||
category1: ['post1', 'post2'], | ||
category2: ['post3'] | ||
// Add more categories here if needed | ||
}, | ||
tags: { | ||
tag1: ['post4', 'post5'], | ||
tag2: ['post6'] | ||
// Add more tags here if needed | ||
}, | ||
socialLinks: [ | ||
{ link: 'https://example.com/social-link1', icon: 'fab fa-twitter' }, | ||
{ link: 'https://example.com/social-link2', icon: 'fab fa-facebook' } | ||
// Add more social links here if needed | ||
], | ||
advertisementImage: 'https://example.com/promotion.png' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { data } from '@/components/Sidebar/mockData'; | ||
|
||
export type SocialWidgetProps = { | ||
title?: string; | ||
}; | ||
|
||
export const SocialWidget = (props: SocialWidgetProps) => { | ||
return ( | ||
<div className="widget"> | ||
<h4 className="widget-title">Social</h4> | ||
<ul className="list-inline social-links"> | ||
{data.socialLinks.map((link, index) => ( | ||
<li key={`social-link-${index}`} className="list-inline-item"> | ||
<a href={link.link}> | ||
<i className={link.icon} /> | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './SocialWidget'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { data } from '@/components/Sidebar/mockData'; | ||
|
||
export type TagWidgetProps = { | ||
title?: string; | ||
}; | ||
|
||
export const TagWidget = (props: TagWidgetProps) => { | ||
return ( | ||
<div className="widget"> | ||
<h4 className="widget-title">Tag</h4> | ||
{Object.entries(data.tags).length !== 0 && ( | ||
<ul className="list-inline"> | ||
{Object.entries(data.tags).map(([name, items]) => ( | ||
<li key={`tag-${name}`} className="list-inline-item"> | ||
<a href={`/tags/${name.toLowerCase()}/`} className="d-block p-2 bg-primary text-white"> | ||
{name} | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './TagWidget'; |