diff --git a/README.md b/README.md index e3e80a3..3a34152 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,4 @@ I use a python script backend to produce the blog posts and imagery. MD is limit I would like to use MDX instead of just MarkDown for the content. For now Dec 2024 I need to see how Google likes the total SEO approach and if it gags on the AI blog posts which are not the best. A proper contact form solution to be implemented. +Logo and Favicon for better branding. diff --git a/app/layout.tsx b/app/layout.tsx index c49d292..d9652da 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -137,6 +137,10 @@ export default function RootLayout({ © {new Date().getFullYear()} Dubai Pool Services. All rights reserved.

+

+ Web Design and SEO by Cambs + Digital +

diff --git a/app/lib/getPage.ts b/app/lib/getPage.ts index 62787e7..27819a3 100644 --- a/app/lib/getPage.ts +++ b/app/lib/getPage.ts @@ -2,7 +2,8 @@ import fs from 'fs'; import path from 'path'; import matter from 'gray-matter'; import { remark } from 'remark'; -import html from 'remark-html'; +import remarkHtml from 'remark-html'; +import remarkYouTubeEmbed from './youTubePlugin'; import gfm from 'remark-gfm'; // Import the plugin for tables //global files used in both methods @@ -33,9 +34,11 @@ export async function getPageContent(slug:string){ //parse the whole page // Use remark to convert markdown into HTML string const processedContent = await remark() - .use(gfm) - .use(html) - .process(matterResult.content); + .use(gfm) + .use(remarkYouTubeEmbed) + .use(remarkHtml) + .process(matterResult.content); + //console.log(processedContent.value); const contentHtml = processedContent.value; return { contentHtml diff --git a/app/lib/youTubePlugin.js b/app/lib/youTubePlugin.js new file mode 100644 index 0000000..f02da63 --- /dev/null +++ b/app/lib/youTubePlugin.js @@ -0,0 +1,20 @@ +import { visit } from "unist-util-visit"; + +function remarkYouTubeEmbed() { + return (tree) => { + visit(tree, "text", (node, index, parent) => { + const youtubeRegex = /{{< youtube (\S+) >}}/; + const match = youtubeRegex.exec(node.value); + if (match) { + const videoId = match[1]; + parent.children[index] = { + type: "html", + value: ``, + }; + //console.log("youtubeRegex match", videoId); + } + }); + }; +} + +export default remarkYouTubeEmbed; diff --git a/content/top-5-luxury-pools-dubai.md b/content/top-5-luxury-pools-dubai.md index fd93508..d2cf8c4 100644 --- a/content/top-5-luxury-pools-dubai.md +++ b/content/top-5-luxury-pools-dubai.md @@ -55,6 +55,12 @@ Citations: [4] https://www.factmagazines.com/uae/dubai/things-to-do-dubai/editors-picks-the-most-instagrammable-swimming-pools-in-dubai [5] https://dubainight.com/news/2024-10-30/dive-into-luxury-dubais-best-rooftop-pools +xyz + +{{< youtube dQw4w9WgXcQ >}} + +abc + ## **1. Panoramic Infinity Pools** There’s nothing quite like dipping into an infinity pool with panoramic views of Dubai's iconic skyline. From the towering **Burj Khalifa** to the shimmering **Arabian Gulf**, these pools let you relax while enjoying breathtaking scenery. diff --git a/package-lock.json b/package-lock.json index 0a21fe9..4909f22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,8 @@ "react-dom": "^18", "remark": "^15.0.1", "remark-gfm": "^4.0.0", - "remark-html": "^16.0.1" + "remark-html": "^16.0.1", + "unist-util-visit": "^5.0.0" }, "devDependencies": { "@types/node": "^20", diff --git a/package.json b/package.json index 4549763..ca9d24f 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "react-dom": "^18", "remark": "^15.0.1", "remark-gfm": "^4.0.0", - "remark-html": "^16.0.1" + "remark-html": "^16.0.1", + "unist-util-visit": "^5.0.0" }, "devDependencies": { "@types/node": "^20", diff --git a/tsconfig.json b/tsconfig.json index d81d4ee..306b4e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,7 +33,7 @@ "**/*.ts", "**/*.tsx", ".next/types/**/*.ts" - ], +, "app/lib/youTubePlugin.js" ], "exclude": [ "node_modules" ]