Skip to content

Commit 53583be

Browse files
committed
Asset Prefix
1 parent 0004ef4 commit 53583be

File tree

8 files changed

+20
-7
lines changed

8 files changed

+20
-7
lines changed

components/Global/Navbar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { HiMenuAlt4 } from 'react-icons/hi'
33
import { AiOutlineClose } from 'react-icons/ai'
44
import Link from 'next/link'
55
import { useRouter } from 'next/router'
6-
6+
import {prefix} from '../../constants'
77
const NavBarItem = ({ item, pathname, classprops }) => (
88
<a href={item.url}>
99
<li
@@ -38,7 +38,7 @@ const Navbar = () => {
3838
href='/'
3939
passHref
4040
>
41-
<img src='/logo.png' alt='WebXDAO' className='w-24 h-14 md:w-36 md:h-20'/>
41+
<img src={prefix+'/logo.png'} alt='WebXDAO' className='w-24 h-14 md:w-36 md:h-20'/>
4242
</Link>
4343
</div>
4444
<ul className='lg:flex hidden list-none flex-row justify-end items-center ml-auto'>

components/Home/DeveloperPath.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { prefix } from "../../constants"
2+
13
const DeveloperPath = () => {
24
const devPaths = [
35
{
@@ -51,7 +53,7 @@ const DeveloperPath = () => {
5153
<img
5254
alt={name}
5355
className='bg-gray-50 p-5 rounded-md'
54-
src={imgUrl}
56+
src={prefix+imgUrl}
5557
/>
5658
</div>
5759
<div id='body' className='flex flex-col gap-y-3 pl-5'>

components/Home/DevprotocolBrands.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from 'next/link'
2+
import { prefix } from '../../constants'
23

34
const DevprotocolBrands = () => {
45
const projects = [
@@ -42,7 +43,7 @@ const DevprotocolBrands = () => {
4243
<Link key={name + index} href={url} passHref className='h-full group'>
4344
<div className='mx-auto flex flex-col justify-evenly items-center h-full object-center text-center p-8 shadow cursor-pointer rounded-md focus:outline-none focus:shadow-outline transform bg-white transition hover:shadow-lg hover:scale-105 duration-300 ease-in-out'>
4445
<div className='relative h-24 w-full flex-shrink-0'>
45-
<img src={imgUrl} alt={name} className="object-contain" />
46+
<img src={prefix + imgUrl} alt={name} className="object-contain" />
4647
</div>
4748
<p className='text-gray-800 mt-8 mb-2 text-sm px-8 sm:px-4 h-full'>{text}</p>
4849
</div>

components/Home/Testimonials.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { prefix } from "../../constants"
12

23
const Testimonials = () => {
34
const data = [
@@ -72,7 +73,7 @@ const Testimonials = () => {
7273
<p className='text-gray-600 text-base mb-2'>{text}</p>
7374
<div className='flex flex-row items-center justify-start py-2'>
7475
<div className='relative h-16 w-16 flex-shrink-0'>
75-
<img src={imgUrl} alt={name} className='object-contain' />
76+
<img src={prefix + imgUrl} alt={name} className='object-contain' />
7677
</div>
7778

7879
<div className='flex flex-col justify-center pl-3'>

constants/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const prefix = '/WebXDAO.github.io'

next.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
module.exports = {
2+
basePath: '/WebXDAO.github.io',
3+
assetPrefix: '/WebXDAO.github.io',
24
exportPathMap: function () {
35
return {
46
'/': { page: '/' }

pages/partners.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Head from 'next/head'
2+
import { prefix } from '../constants'
23

34
export default function Partners() {
45
const data = [
@@ -54,7 +55,11 @@ export default function Partners() {
5455
>
5556
<div className='grid grid-cols-3 items-center justify-start overflow-hidden'>
5657
<div className='relative col-span-1'>
57-
<img alt={name} className='bg-gray-50 p-5 rounded-md' src={imgUrl} />
58+
<img
59+
alt={name}
60+
className='bg-gray-50 p-5 rounded-md'
61+
src={prefix + imgUrl}
62+
/>
5863
</div>
5964
<div className='flex flex-col col-span-2 gap-y-3 pl-5'>
6065
<h4 className='text-xl font-semibold'>{title}</h4>

pages/projects.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Head from 'next/head'
2+
import { prefix } from '../constants'
23

34
export default function Projects() {
45
const data = [
@@ -53,7 +54,7 @@ export default function Projects() {
5354
<div className='relative mb-6'>
5455
<img
5556
className='lg:h-60 xl:h-56 md:h-64 h-72 w-full object-cover object-center rounded-md'
56-
src={imgUrl}
57+
src={prefix + imgUrl}
5758
alt={name}
5859
/>
5960
</div>

0 commit comments

Comments
 (0)