Skip to content

Commit 150c97d

Browse files
authored
Merge pull request #179 from AbhinavMV/main
Add new nextjs deploy script + fix SSR features not working on Github page by @AbhinavMV
2 parents d58d4bd + f09369f commit 150c97d

22 files changed

+7631
-203
lines changed

.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": "next/core-web-vitals",
3+
"rules": {
4+
"@next/next/no-img-element": "off"
5+
}
36
}

.github/workflows/deploy-node.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [14.x, 16.x]
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'npm'
28+
- run: npm ci
29+
- run: npm run build
30+
env:
31+
NEXT_PUBLIC_BASE_PATH: /WebXDAO.github.io
32+
- run: npm run export
33+
env:
34+
NEXT_PUBLIC_BASE_PATH: /WebXDAO.github.io
35+
- run: touch ./out/.nojekyll
36+
37+
- name: Deploy 🚀
38+
uses: JamesIves/[email protected]
39+
with:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
BRANCH: gh-pages
42+
FOLDER: out #nextjs static output is in out folder

.github/workflows/deploy_nextjs.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

3-
#package-lock.json
4-
package-lock.json
5-
63
# dependencies
74
/node_modules
85
/.pnp

components/Global/Blogs.jsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Image from 'next/image'
21
import Link from 'next/link'
32

43
const Blogs = ({ articles, contentOnly = false, show = articles.length }) => {
@@ -21,11 +20,8 @@ const Blogs = ({ articles, contentOnly = false, show = articles.length }) => {
2120
<div className='flex flex-col justify-between items-stretch col-span-3 md:col-span-1 cursor-pointer p-2 shadow rounded-md focus:outline-none focus:shadow-outline transform transition hover:shadow-lg hover:scale-105 duration-300 ease-in-out'>
2221
<div className='bg-white p-4 rounded-lg'>
2322
<div className='relative bg-contain'>
24-
<Image
23+
<img
2524
alt={article.title}
26-
layout='responsive'
27-
height={150}
28-
width={150}
2925
className='lg:h-60 xl:h-56 md:h-64 sm:h-72 xs:h-72 h-72 rounded-md w-full object-cover object-center mb-6'
3026
src={article.social_image}
3127
/>
@@ -36,13 +32,11 @@ const Blogs = ({ articles, contentOnly = false, show = articles.length }) => {
3632
<p className='leading-relaxed text-sm text-gray-600'>{article.description}</p>
3733
</div>
3834
<time className='p-4 text-gray-500 text-xs flex items-end'>
39-
<Image
40-
layout='fixed'
41-
width={40}
42-
height={40}
35+
<img
36+
4337
src={article?.user?.profile_image}
4438
alt={article.user.name}
45-
className='rounded-full'
39+
className='rounded-full w-16 h-16 mr-1'
4640
/>
4741
<p className='ml-2 opacity-50'>
4842
by {article.user.name} on

components/Global/Navbar.jsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useState } from 'react'
22
import { HiMenuAlt4 } from 'react-icons/hi'
33
import { AiOutlineClose } from 'react-icons/ai'
4-
import Image from 'next/image'
54
import Link from 'next/link'
65
import { useRouter } from 'next/router'
6+
import {prefix} from '../../constants'
77

88
const NavBarItem = ({ item, pathname, classprops }) => (
99
<a href={item.url}>
@@ -21,13 +21,13 @@ const Navbar = () => {
2121
const router = useRouter()
2222
const [toggleMenu, setToggleMenu] = useState(false)
2323
const navItems = [
24-
{ title: 'HOME', url: '/' },
25-
{ title: 'LEARN', url: '#' },
26-
{ title: 'BLOG', url: '/blog' },
27-
{ title: 'ABOUT', url: '#' },
28-
{ title: 'PROJECTS', url: '/projects' },
29-
{ title: 'COMMUNITY PARTNERS', url: '/partners' },
30-
{ title: 'OUR MODERATORS', url: '/moderators' }
24+
{ title: 'HOME', url: prefix+'/' },
25+
{ title: 'LEARN', url: prefix+'#' },
26+
{ title: 'BLOG', url: prefix+'/blog' },
27+
{ title: 'ABOUT', url: prefix+'#' },
28+
{ title: 'PROJECTS', url: prefix+'/projects' },
29+
{ title: 'COMMUNITY PARTNERS', url: prefix+'/partners' },
30+
{ title: 'OUR MODERATORS', url: prefix+'/moderators' }
3131
]
3232

3333
return (
@@ -39,7 +39,7 @@ const Navbar = () => {
3939
href='/'
4040
passHref
4141
>
42-
<Image layout='fixed' width={150} height={80} src='/logo.png' alt='WebXDAO' />
42+
<img src={prefix+'/logo.png'} alt='WebXDAO' className='w-24 h-14 md:w-36 md:h-20'/>
4343
</Link>
4444
</div>
4545
<ul className='lg:flex hidden list-none flex-row justify-end items-center ml-auto'>
@@ -67,7 +67,7 @@ const Navbar = () => {
6767
className='z-10 fixed -top-0 -right-2 p-3 w-[70vw] h-screen shadow-2xl lg:hidden list-none
6868
flex flex-col justify-start items-end rounded-md blue-glassmorphism'
6969
>
70-
<li className='text-xl w-full my-2 text-blue-600'>
70+
<li className='text-xl w-full my-2 text-blue-600 cursor-pointer '>
7171
<AiOutlineClose onClick={() => setToggleMenu(false)} />
7272
</li>
7373
{navItems.map((item, index) => (

components/Home/DeveloperPath.jsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Image from 'next/image'
1+
import { prefix } from "../../constants"
22

33
const DeveloperPath = () => {
44
const devPaths = [
@@ -50,13 +50,10 @@ const DeveloperPath = () => {
5050
>
5151
<div className='flex items-center justify-start overflow-hidden'>
5252
<div className='relative bg-contain w-1/3'>
53-
<Image
53+
<img
5454
alt={name}
55-
layout='responsive'
56-
height={150}
57-
width={150}
5855
className='bg-gray-50 p-5 rounded-md'
59-
src={imgUrl}
56+
src={prefix+imgUrl}
6057
/>
6158
</div>
6259
<div id='body' className='flex flex-col gap-y-3 pl-5'>

components/Home/DevprotocolBrands.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Image from 'next/image'
21
import Link from 'next/link'
2+
import { prefix } from '../../constants'
33

44
const DevprotocolBrands = () => {
55
const projects = [
@@ -43,7 +43,7 @@ const DevprotocolBrands = () => {
4343
<Link key={name + index} href={url} passHref className='h-full group'>
4444
<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'>
4545
<div className='relative h-24 w-full flex-shrink-0'>
46-
<Image src={imgUrl} alt={name} layout='fill' objectFit='contain' />
46+
<img src={prefix + imgUrl} alt={name} className="object-contain" />
4747
</div>
4848
<p className='text-gray-800 mt-8 mb-2 text-sm px-8 sm:px-4 h-full'>{text}</p>
4949
</div>

components/Home/Hero.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import Image from 'next/image'
1+
import {prefix} from '../../constants'
22

33
const Hero = () => {
44
return (
55
<div className='text-white bg-[#00007F] pt-24 py-24'>
66
<div className='container px-5 mx-auto flex flex-wrap flex-col md:flex-row items-center'>
7-
<div className='px-5 flex flex-col w-full md:w-2/5 items-start text-center md:text-left'>
7+
<div className='px-5 flex flex-col mx-auto w-full md:w-2/5 items-start text-center md:text-left'>
88
<h1 className='my-4 text-3xl font-bold leading-tight'>
99
A new community for Blockchain developers, designers, and Dapp Owners
1010
</h1>
@@ -21,8 +21,8 @@ const Hero = () => {
2121
</div>
2222
</div>
2323

24-
<div className='relative w-full md:w-3/5 h-96 py-6 text-center items-end'>
25-
<Image src='/hero.gif' layout='fill' objectFit='contain' alt='Web3' />
24+
<div className='w-full md:w-2/5 flex mx-auto items-end'>
25+
<img src={prefix+'/hero.gif'} className='object-contain' alt='Web3' />
2626
</div>
2727
</div>
2828
</div>

components/Home/Testimonials.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Image from 'next/image'
1+
import { prefix } from "../../constants"
22

33
const Testimonials = () => {
44
const data = [
@@ -73,7 +73,7 @@ const Testimonials = () => {
7373
<p className='text-gray-600 text-base mb-2'>{text}</p>
7474
<div className='flex flex-row items-center justify-start py-2'>
7575
<div className='relative h-16 w-16 flex-shrink-0'>
76-
<Image src={imgUrl} alt={name} layout='fill' objectFit='contain' />
76+
<img src={prefix + imgUrl} alt={name} className='object-contain' />
7777
</div>
7878

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

0 commit comments

Comments
 (0)