Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: allow custom app title

Abdullah Attaa5d39a18a798
diff --git a/apps/web/src/global.d.ts b/apps/web/src/global.d.ts
index 577b62edd..94be6907c 100644
--- a/apps/web/src/global.d.ts
+++ b/apps/web/src/global.d.ts
@@ -29,6 +29,7 @@ declare global {
var IS_TESTING: boolean;
var PLATFORM: "web" | "desktop";
var IS_BETA: boolean;
+ var APP_TITLE: string;
interface Window {
os?: () => NodeJS.Platform | "mas";
diff --git a/apps/web/src/utils/dom.ts b/apps/web/src/utils/dom.ts
index 06cd83747..3e31276c6 100644
--- a/apps/web/src/utils/dom.ts
+++ b/apps/web/src/utils/dom.ts
@@ -18,6 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export const setDocumentTitle = (title?: string) => {
- if (!title) document.title = "Notesnook";
- else document.title = `${title} - Notesnook`;
+ if (!title) document.title = APP_TITLE;
+ else document.title = `${title} - ${APP_TITLE}`;
};
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index eae6f70cf..e26912b83 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -64,6 +64,7 @@ export default defineConfig({
}
},
define: {
+ APP_TITLE: `"${isThemeBuilder ? "Notesnook Theme Builder" : "Notesnook"}"`,
GIT_HASH: `"${gitHash}"`,
APP_VERSION: `"${appVersion}"`,
PUBLIC_URL: `"${process.env.PUBLIC_URL || ""}"`,