Skip to content

Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.

fix: update STATIC_ASSETS_URL in config and restore generateStaticPar… (#108)

Vlad Sazonau158d98fd05b7
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 2cd781c..fc05466 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -71,6 +71,18 @@ jobs:
path: playwright-output/report/
retention-days: 3
+ - name: 🔍 Get PR URL
+ id: pr-url
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ PR_URL=$(curl -s \
+ -H "Authorization: Bearer $GITHUB_TOKEN" \
+ -H "Accept: application/vnd.github+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls?head=${{ github.repository_owner }}:${{ github.ref_name }}" \
+ | jq -r '.[0].html_url')
+ echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
+
- name: 📧 Send email
if: always()
uses: dawidd6/action-send-mail@611879133a9569642c41be66f4a323286e9b8a3b # v4
@@ -89,5 +101,7 @@ jobs:
Playwright Browser Binaries Installation Time: ${{ steps.playwright-install.outputs.duration_formatted }}
${{ steps.playwright.outcome == 'success' && format('Playwright Tests Duration: {0}', steps.playwright.outputs.duration_formatted) }}
- For more details, please check the GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ For more details, please check:
+ - GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ ${{ steps.pr-url.outputs.pr_url && format('- Pull Request: {0}', steps.pr-url.outputs.pr_url) }}
attachments: playwright-output/report/index.html
diff --git a/public/fonts/open-sans-700.ttf b/public/fonts/open-sans-700.ttf
deleted file mode 100644
index fd79d43..0000000
Binary files a/public/fonts/open-sans-700.ttf and /dev/null differ
diff --git a/public/fonts/open-sans-regular.ttf b/public/fonts/open-sans-regular.ttf
deleted file mode 100644
index db43334..0000000
Binary files a/public/fonts/open-sans-regular.ttf and /dev/null differ
diff --git a/src/app/[locale]/about/layout.tsx b/src/app/[locale]/about/layout.tsx
index 44143ad..7a19d8b 100644
--- a/src/app/[locale]/about/layout.tsx
+++ b/src/app/[locale]/about/layout.tsx
@@ -82,10 +82,6 @@ export async function generateMetadata({
}
}
-export function generateStaticParams() {
- return routing.locales.map((locale) => ({ locale }));
-}
-
export default async function AboutLocaleLayout({
children,
params,
diff --git a/src/app/[locale]/about/page.tsx b/src/app/[locale]/about/page.tsx
index 0eb37eb..81815f1 100644
--- a/src/app/[locale]/about/page.tsx
+++ b/src/app/[locale]/about/page.tsx
@@ -25,77 +25,12 @@ import { setRequestLocale } from "next-intl/server";
import { type Graph } from "schema-dts";
import { LanguageSwitcher } from "./components/language-switcher";
import { STATIC_ASSETS_URL, VIDEO_DEMO_URL } from "@/config";
+import { routing } from "@/i18n/routing";
-const JSON_LD: Graph = {
- "@context": "https://schema.org",
- "@graph": [
- {
- "@type": "WebPage",
- "@id": "https://easyinvoicepdf.com/en/about",
- url: "https://easyinvoicepdf.com/en/about",
- name: "About | Free Invoice Generator – Live Preview, No Sign-Up",
- description:
- "EasyInvoicePDF is a free, open-source tool to create professional invoices with real-time PDF preview, no sign-up required.",
- mainEntity: {
- "@id": "https://easyinvoicepdf.com/en/about",
- },
- },
- {
- "@type": "FAQPage",
- "@id": "https://easyinvoicepdf.com/en/about#faq",
- mainEntity: [
- {
- "@type": "Question",
- name: "What is EasyInvoicePDF?",
- acceptedAnswer: {
- "@type": "Answer",
- text: "EasyInvoicePDF is a free, open-source tool that helps you create professional invoices instantly. It features a live preview, customizable templates, and supports multiple languages and currencies.",
- },
- },
- {
- "@type": "Question",
- name: "Is it really free?",
- acceptedAnswer: {
- "@type": "Answer",
- text: "Yes, EasyInvoicePDF is completely free to use. The entire project is open-source and available on GitHub.",
- },
- },
- {
- "@type": "Question",
- name: "Do I need to create an account?",
- acceptedAnswer: {
- "@type": "Answer",
- text: "No, you don't need to create an account or sign up. You can start creating invoices immediately without any registration process.",
- },
- },
- {
- "@type": "Question",
- name: "Can I customize the invoice template?",
- acceptedAnswer: {
- "@type": "Answer",
- text: "Yes, you can customize various aspects of your invoice including company details, currency, and language. More customization options are being added regularly.",
- },
- },
- {
- "@type": "Question",
- name: "Is my data secure?",
- acceptedAnswer: {
- "@type": "Answer",
- text: "Your privacy is important to us. All invoice data is processed entirely in your browser - we don't store any of your information on our servers. You can even use the tool offline once loaded.",
- },
- },
- {
- "@type": "Question",
- name: "Can I share invoices with others?",
- acceptedAnswer: {
- "@type": "Answer",
- text: "Yes, you can generate shareable links for your invoices that others can view and download. These links are secure and only accessible to people you share them with.",
- },
- },
- ],
- },
- ],
-};
+// statically generate the pages for all locales
+export function generateStaticParams() {
+ return routing.locales.map((locale) => ({ locale }));
+}
export default function AboutPage({ params }: { params: { locale: Locale } }) {
const { locale } = params;
@@ -699,3 +634,74 @@ function Logo() {
</div>
);
}
+
+const JSON_LD: Graph = {
+ "@context": "https://schema.org",
+ "@graph": [
+ {
+ "@type": "WebPage",
+ "@id": "https://easyinvoicepdf.com/en/about",
+ url: "https://easyinvoicepdf.com/en/about",
+ name: "About | Free Invoice Generator – Live Preview, No Sign-Up",
+ description:
+ "EasyInvoicePDF is a free, open-source tool to create professional invoices with real-time PDF preview, no sign-up required.",
+ mainEntity: {
+ "@id": "https://easyinvoicepdf.com/en/about",
+ },
+ },
+ {
+ "@type": "FAQPage",
+ "@id": "https://easyinvoicepdf.com/en/about#faq",
+ mainEntity: [
+ {
+ "@type": "Question",
+ name: "What is EasyInvoicePDF?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "EasyInvoicePDF is a free, open-source tool that helps you create professional invoices instantly. It features a live preview, customizable templates, and supports multiple languages and currencies.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Is it really free?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "Yes, EasyInvoicePDF is completely free to use. The entire project is open-source and available on GitHub.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Do I need to create an account?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "No, you don't need to create an account or sign up. You can start creating invoices immediately without any registration process.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Can I customize the invoice template?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "Yes, you can customize various aspects of your invoice including company details, currency, and language. More customization options are being added regularly.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Is my data secure?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "Your privacy is important to us. All invoice data is processed entirely in your browser - we don't store any of your information on our servers. You can even use the tool offline once loaded.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Can I share invoices with others?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "Yes, you can generate shareable links for your invoices that others can view and download. These links are secure and only accessible to people you share them with.",
+ },
+ },
+ ],
+ },
+ ],
+};
diff --git a/src/app/components/invoice-form/sections/general-information.tsx b/src/app/components/invoice-form/sections/general-information.tsx
index 6858551..79ebd1c 100644
--- a/src/app/components/invoice-form/sections/general-information.tsx
+++ b/src/app/components/invoice-form/sections/general-information.tsx
@@ -279,26 +279,24 @@ export const GeneralInformation = memo(function GeneralInformation({
{!isInvoiceNumberInCurrentMonth &&
!errors.invoiceNumberObject?.value && (
- <InputHelperMessage>
- <div className="flex flex-col items-start">
- <span className="mb-2 flex items-center md:mb-0 lg:mb-2">
- <AlertIcon />
- Invoice number does not match current month
- </span>
-
- <ButtonHelper
- onClick={() => {
- setValue(
- "invoiceNumberObject.value",
- `1/${CURRENT_MONTH_AND_YEAR}`
- );
- }}
- >
- Click to set the invoice number to the current month (
- {`1/${CURRENT_MONTH_AND_YEAR}`})
- </ButtonHelper>
- </div>
- </InputHelperMessage>
+ <div className="mt-1 flex flex-col items-start text-balance text-xs text-zinc-700/90">
+ <span className="mb-2 flex items-center md:mb-0 lg:mb-2">
+ <AlertIcon />
+ Invoice number does not match current month
+ </span>
+
+ <ButtonHelper
+ onClick={() => {
+ setValue(
+ "invoiceNumberObject.value",
+ `1/${CURRENT_MONTH_AND_YEAR}`
+ );
+ }}
+ >
+ Click to set the invoice number to the current month (
+ {`1/${CURRENT_MONTH_AND_YEAR}`})
+ </ButtonHelper>
+ </div>
)}
</div>
</div>
diff --git a/src/app/components/invoice-pdf-download-link.tsx b/src/app/components/invoice-pdf-download-link.tsx
index 7cad3e6..2fb979b 100644
--- a/src/app/components/invoice-pdf-download-link.tsx
+++ b/src/app/components/invoice-pdf-download-link.tsx
@@ -132,6 +132,7 @@ export function InvoicePDFDownloadLink({
return (
<a
+ translate="no"
href={url || "#"}
download={filename}
onClick={handleClick}
diff --git a/src/app/components/invoice-pdf-template/index.tsx b/src/app/components/invoice-pdf-template/index.tsx
index 3398e1a..f50173f 100644
--- a/src/app/components/invoice-pdf-template/index.tsx
+++ b/src/app/components/invoice-pdf-template/index.tsx
@@ -18,6 +18,7 @@ import { InvoiceVATSummaryTable } from "./invoice-vat-summary-table";
import { InvoicePaymentTotals } from "./invoice-payment-totals";
import { memo, useMemo } from "react";
import { TRANSLATIONS } from "@/app/schema/translations";
+import { STATIC_ASSETS_URL } from "@/config";
const PROD_WEBSITE_URL = "https://dub.sh/easy-invoice";
@@ -29,10 +30,10 @@ Font.register({
family: fontFamily,
fonts: [
{
- src: "/fonts/open-sans-regular.ttf",
+ src: `${STATIC_ASSETS_URL}/open-sans-regular.ttf`,
},
{
- src: "/fonts/open-sans-700.ttf",
+ src: `${STATIC_ASSETS_URL}/open-sans-700.ttf`,
fontWeight: 700,
},
],
diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts
index 798029f..0fb5340 100644
--- a/src/app/sitemap.ts
+++ b/src/app/sitemap.ts
@@ -3,23 +3,30 @@ import { type MetadataRoute } from "next";
import { SUPPORTED_LANGUAGES } from "./schema";
export default function sitemap(): MetadataRoute.Sitemap {
- const lastModified = new Date().toISOString().split("T")[0];
+ const lastModified = new Date();
+
+ const languages = Object.fromEntries(
+ SUPPORTED_LANGUAGES.map((lang) => [lang, `${APP_URL}/${lang}/about`])
+ );
const sitemapEntries: MetadataRoute.Sitemap = [
// Main app page (non-shared version)
{
- url: `${APP_URL}/`,
+ url: `${APP_URL}`,
lastModified,
changeFrequency: "weekly",
priority: 1,
},
-
// About pages in all languages
...SUPPORTED_LANGUAGES.map((locale) => ({
url: `${APP_URL}/${locale}/about`,
lastModified,
changeFrequency: "weekly" as const,
priority: 1,
+ // Add alternates for each about page for each language
+ alternates: {
+ languages: languages,
+ },
})),
];
diff --git a/src/components/ui/select-native.tsx b/src/components/ui/select-native.tsx
index eee258d..0b423bb 100644
--- a/src/components/ui/select-native.tsx
+++ b/src/components/ui/select-native.tsx
@@ -23,6 +23,7 @@ const SelectNative = React.forwardRef<HTMLSelectElement, SelectPropsNative>(
className
)}
ref={ref}
+ translate="no"
{...props}
>
{children}
diff --git a/src/config.ts b/src/config.ts
index 2fb44ec..7af3c51 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -4,7 +4,6 @@ export const APP_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
: `http://localhost:${port}`;
-export const STATIC_ASSETS_URL =
- "https://easy-invoice-pdf-assets.1xeq.workers.dev";
+export const STATIC_ASSETS_URL = "https://static.easyinvoicepdf.com";
export const VIDEO_DEMO_URL = `${STATIC_ASSETS_URL}/easy-invoice-demo.mp4`;
diff --git a/src/i18n/routing.ts b/src/i18n/routing.ts
index a39576b..013b173 100644
--- a/src/i18n/routing.ts
+++ b/src/i18n/routing.ts
@@ -15,6 +15,9 @@ export const routing = defineRouting({
// For the about page, we'll use locale prefixes (handled by pathnames in routing)
localePrefix: "always",
+ localeDetection: false,
+ alternateLinks: false,
+
// Define pathnames for our routes
// pathnames: {
// // "/app": {
diff --git a/src/middleware.ts b/src/middleware.ts
deleted file mode 100644
index 8938877..0000000
--- a/src/middleware.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import createMiddleware from "next-intl/middleware";
-import { routing } from "./i18n/routing";
-import type { NextRequest } from "next/server";
-
-const intlMiddleware = createMiddleware(routing);
-
-export default function middleware(request: NextRequest) {
- return intlMiddleware(request);
-}
-
-// ___IMPORTANT__: we restrict the middleware to only the /about page for i18n
-// because the /about page is the only page that has i18n
-// if you want to add i18n to other pages, you need to add them to the matcher
-export const config = {
- // Match only "/:locale/about" paths for i18n (en/about, pl/about, de/about, etc.)
- matcher: ["/:locale/about"],
-};