Skip to content

Commit

Permalink
favicon added and compressed, deps updated, migrated to nextra v3, bu…
Browse files Browse the repository at this point in the history
…ild wf updated, tailwindcss added.
  • Loading branch information
darsan-in committed Nov 28, 2024
1 parent b4be176 commit 384132a
Show file tree
Hide file tree
Showing 81 changed files with 3,281 additions and 2,024 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "21"
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v5
Expand All @@ -64,10 +64,16 @@ jobs:
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Sitemap update
run: |
npm i @cresteem/hawk-js -g
cp hawk.config.json ./out/hawk.config.json
cd out
hawk genmap || true
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
path: ./out

# Deployment job
deploy:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.next
node_modules
next-env.d.ts
dist
out
gserv.json
.hawk.lrs
189 changes: 0 additions & 189 deletions components/utils.tsx

This file was deleted.

35 changes: 35 additions & 0 deletions dev/compress-images.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { compressImages } from "@cresteem/minomax";

class Compress {
favicons() {
// compress favicons
compressImages("public/favicons/*png", "webp", "compressed").catch(
console.error
);
}

svg() {
// compress all svg
compressImages("public/**/*svg", "svg", "compressed").catch(console.error);
}

serviceImages() {
// compress service visuals
compressImages(
"public/services-visuals/**/*{jpg,webp}",
"avif",
"compressed"
).catch(console.error);
}

brandAssets() {
// compress brand-assets non-svg
compressImages(
"public/brand-assets/*{png,webp}",
"webp",
"compressed"
).catch(console.error);
}
}

new Compress().favicons();
Binary file added dev/fav.webp
Binary file not shown.
4 changes: 2 additions & 2 deletions gen-favicons.mjs → dev/gen-favicons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { basename, join } from "path";
export async function generateFavicons(
metaDesc,
version,
baseImage = "fav.png",
baseImage = "./dev/fav.webp",
appName = basename(process.cwd()),
basepath = join(process.cwd(), "public"),
faviconsPath = "favicons",
Expand Down Expand Up @@ -75,5 +75,5 @@ export async function generateFavicons(

generateFavicons(
"Hawk JS is the ultimate tool for web developers and SEO enthusiasts. Find out how it can streamline your SEO efforts, ensuring your website gains visibility and improves its search engine ranking.",
"1.0.7"
"1.5.0"
);
Binary file removed fav.png
Binary file not shown.
13 changes: 9 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
const withNextra = require("nextra")({
import nextra from "nextra";

const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
themeConfig: "./theme.config.jsx",
staticImage: true,
});

module.exports = {
const config = {
...withNextra(),
images: {
unoptimized: true,
},
basePath: "",
output: "export",
distDir: "dist",
distDir: "out",
sassOptions: { silenceDeprecations: ["legacy-js-api"] },
};

export default config;
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@
},
"homepage": "https://hawkjs.cresteem.com/",
"devDependencies": {
"@types/node": "latest",
"next": "latest",
"nextra": "latest",
"nextra-theme-docs": "latest",
"@types/node": "22.10.1",
"@types/react": "^18.3.12",
"acorn": "^8.14.0",
"autoprefixer": "^10.4.20",
"next": "15.0.3",
"nextra": "3.2.4",
"nextra-theme-docs": "3.2.4",
"postcss": "^8.4.49",
"react": "latest",
"react-dom": "latest",
"react-icons": "^5.2.0",
"sass": "latest",
"typescript": "latest"
"react-icons": "^5.3.0",
"sass": "1.81.0",
"tailwindcss": "^3.4.15",
"typescript": "5.7.2"
},
"dependencies": {
"favicons": "^7.2.0"
Expand Down
11 changes: 11 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import "../stylesheets/globals.scss";

export default function App({
Component,
pageProps,
}: {
Component: any;
pageProps: Record<any, any>;
}) {
return <Component {...pageProps} />;
}
43 changes: 0 additions & 43 deletions pages/_meta.json

This file was deleted.

Loading

0 comments on commit 384132a

Please sign in to comment.