Skip to content

Commit

Permalink
add seo analyzer #41
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Jan 20, 2024
1 parent 00e979d commit e5a4c2f
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ NEXT_PUBLIC_CONTACT_PHONE="+374 431 085 88"

NEXT_PUBLIC_LOCATION_GOOGLE_MAPS_LINK="https://shorturl.at/gsuK5"
NEXT_PUBLIC_LOCATION_ADDRESS_TEXT=" 41, 4 Abovyan St, Yerevan 0009"

PUBLIC
22 changes: 19 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@ name: Build
on:
pull_request:
workflow_dispatch:
push:
branches:
- master
inputs:
branch:
description: 'Branch to build'
required: true
default: 'master'
workflow_call:
inputs:
public_path:
type: string
description: 'Inject public path'
required: false
default: ''

jobs:
build:
Expand All @@ -32,6 +41,7 @@ jobs:
envkey_NEXT_PUBLIC_FORMSPREE_ID: "${{ secrets.NEXT_PUBLIC_FORMSPREE_ID }}"
envkey_NEXT_PUBLIC_HOTJAR_ID: ${{ secrets.NEXT_PUBLIC_HOTJAR_ID }}
envkey_NEXT_PUBLIC_HOTJAR_SNIPPET_VERSION: ${{ secrets.NEXT_PUBLIC_HOTJAR_SNIPPET_VERSION }}
envkey_PUBLIC_PATH: ${{ github.event.inputs.public_path }}
directory: '.'
file_name: .env.local
fail_on_empty: false
Expand All @@ -52,3 +62,9 @@ jobs:
with:
start: npm run start
record: false

- name: Upload build results
uses: actions/upload-artifact@v2
with:
name: build
path: out
52 changes: 52 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy

on:
push:
branches:
- master

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
uses: ./build.yml
with:
branch: ${{ github.event.head_commit.message }}
inject_public_path: https://${{ github.repository_owner }}.github.io/${{ github.repository_name }}

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Download build results
uses: actions/download-artifact@v2
with:
name: build
path: ./out
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
publish_branch: gh-pages
force_orphan: true
enable_jekyll: false
clean: true
commit_message: ${{ github.event.head_commit.message }}
commit_user_name: ${{ github.event.head_commit.author.name }}
commit_user_email: ${{ github.event.head_commit.author.email }}

2 changes: 2 additions & 0 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import Philosophy from '@/components/pages/About/Philosophy';
import CATLink from '@/components/shared/CATLink/CATLink';
import BlockWithImage from '@/components/pages/About/BlockWithImage';
import WhyJoinBlock from '@/components/pages/About/WhyJoinBlock/WhyJoinBlock';
import metadataBase from '../metadata';

export const metadata: Metadata = {
title: 'About',
openGraph: {
title: 'Salsaviva - About',
description: `Get ready to discover the Magic at Salsaviva. Read about our
welcoming and inspiring community of dancers`,
...metadataBase.openGraph,
},
};

Expand Down
2 changes: 2 additions & 0 deletions app/contact/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import AppearInViewport from '@/components/shared/AppearInViewport/AppearInViewp
import TransitionDuration from '@/lib/framerMotion/TransitionDuration';
import getTextSlideIntoViewVarinats from '@/lib/framerMotion/variants/getTextSlideIntoViewVarinats';
import FormWrapper from '@/components/pages/Contact/FormWrapper/FormWrapper';
import metadataBase from '../metadata';

export const metadata: Metadata = {
title: 'Contact',
openGraph: {
title: 'Salsaviva - Contact',
description: 'Connect and dance: Contacts for Your next breathtaking dancing adventure',
...metadataBase.openGraph,
},
};

Expand Down
2 changes: 2 additions & 0 deletions app/gallery/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import Gallery from '@/components/pages/Gallery/Gallery';
import AppearInViewport from '@/components/shared/AppearInViewport/AppearInViewport';
import SocialIcons from '@/components/shared/SocialIcons/SocialIcons';
import TransitionDuration from '@/lib/framerMotion/TransitionDuration';
import metadataBase from '../metadata';
import './styles.css';

export const metadata: Metadata = {
title: 'Gallery',
openGraph: {
title: 'Salsaviva - Gallery',
description: 'Explore the vibrant world of social dance',
...metadataBase.openGraph,
},
};

Expand Down
3 changes: 3 additions & 0 deletions app/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ const metadata: Metadata = {
],
locale: 'en_US',
type: 'website',
siteName: 'Salsaviva',
url: origin,
},
twitter: {
card: 'summary_large_image',
title: 'Salsaviva',
description: 'Salsa, Bachata and Kizomba in Yerevan',
images: ['/og.jpg'],
site: '@salsaviva',
},
icons: [
{
Expand Down
2 changes: 2 additions & 0 deletions app/teachers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import CATLink from '@/components/shared/CATLink/CATLink';
import AppearInViewport from '@/components/shared/AppearInViewport/AppearInViewport';
import TransitionDuration from '@/lib/framerMotion/TransitionDuration';
import getTextSlideIntoViewVarinats from '@/lib/framerMotion/variants/getTextSlideIntoViewVarinats';
import metadataBase from '../metadata';

const pageDescription = 'Meet your inspirational guides in the world of social dance';

Expand All @@ -13,6 +14,7 @@ export const metadata: Metadata = {
openGraph: {
title: 'Salsaviva - Teachers',
description: pageDescription,
...metadataBase.openGraph,
},
};

Expand Down
3 changes: 3 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import './app/env.mjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
images: {
unoptimized: true,
},
};

const withAnalyzer = withBundleAnalyzer({
Expand Down
12 changes: 6 additions & 6 deletions scripts/checkSeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ new SeoAnalyzer()
.inputFolders([process.cwd() + '/out'])
// Rules
.addRule('titleLengthRule', {min: 10, max: 50})
.addRule('canonicalLinkRule')
.addRule('metaBaseRule', {names: ['description', 'viewport']})
.addRule('metaSocialRule', {
properties: [
Expand All @@ -18,17 +17,18 @@ new SeoAnalyzer()
'og:image',
'og:image:width',
'og:image:height',
],
names: [
'twitter:card',
'twitter:text:title',
'twitter:title',
'twitter:description',
'twitter:image:src',
'twitter:url',
'twitter:image',
'twitter:site',
],
})
.addRule(h1TagRule)
//.addRule(h1TagRule)
.addRule('imgTagWithAltAttributeRule')
.addRule('aTagWithRelAttributeRule')
.addRule('canonicalLinkRule')
// Output
.outputConsole();

Expand Down

0 comments on commit e5a4c2f

Please sign in to comment.