diff --git a/data/projects/projects.json b/data/projects/projects.json index 75e38d8..09d18ed 100644 --- a/data/projects/projects.json +++ b/data/projects/projects.json @@ -3,6 +3,8 @@ "slug": "1No1PXOF6A88TofuMBpcGKGm3VEWG6hPV", "name": "Random", "dateAdded": "4-2-2024", + "desc": "", + "displayURL": "", "text": "", "images": [] }, @@ -10,14 +12,18 @@ "slug": "10XHgqaww72QZE6IERnNf4RlFTUVT3KIX", "name": "Project 2", "dateAdded": "4-2-2024", - "text": "
Project 2\n
", + "desc": "", + "displayURL": "", + "text": "", "images": [] }, { "slug": "1vZ-HBwff_sAiBSfDGxAmYx9O7aJ3mMiW", "name": "Project 1", "dateAdded": "4-1-2024", - "text": " \nProject 1\n
\n \nLorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices quam eget est interdum hendrerit. Morbi erat ante, gravida ut porttitor sit amet, suscipit quis odio. Praesent eget malesuada ante. Aliquam ullamcorper metus sed turpis blandit, vitae pharetra nisl lacinia. Etiam ipsum ante, tempus at turpis ac, placerat hendrerit magna. Morbi a eros sed nulla sodales aliquam. Nullam rutrum justo lorem, sed blandit magna hendrerit ac. Ut congue laoreet pellentesque. Integer rhoncus, velit vitae consectetur hendrerit, augue erat laoreet ligula, vel bibendum magna ex ac neque. Aliquam congue est at ante eleifend accumsan. Quisque egestas venenatis lacus in porttitor. Cras iaculis metus quis neque dictum, quis sagittis libero elementum. Proin feugiat a velit nec congue.\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nPhasellus semper maximus pretium. Vivamus placerat eros non elit posuere sollicitudin. Aenean blandit ante est, et suscipit ligula porttitor eget. Nunc dictum luctus felis, id volutpat nibh congue id. Aenean maximus metus a erat consequat, eu rutrum elit ullamcorper. Vestibulum id vulputate sem, non varius odio. Nullam
id turpis dignissim, facilisis ex sed, ullamcorper metus. Nunc id orci eget ex accumsan sodales quis posuere nibh. Praesent at massa ac nisl viverra ultricies vel in dolor. Nullam lacinia lacus ut leo cursus, et ullamcorper tortor fermentum.\n
\n ", + "desc": "This is the example of a welding project\n
", + "displayURL": "https://lh3.googleusercontent.com/d/1hX0sTKNxhq4SbW9DUL15KfYq4Jd2UEbn", + "text": " \n \nProject 1\n
\n \nLorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices quam eget est interdum hendrerit. Morbi erat ante, gravida ut porttitor sit amet, suscipit quis odio. Praesent eget malesuada ante. Aliquam ullamcorper metus sed turpis blandit, vitae pharetra nisl lacinia. Etiam ipsum ante, tempus at turpis ac, placerat hendrerit magna. Morbi a eros sed nulla sodales aliquam. Nullam rutrum justo lorem, sed blandit magna hendrerit ac. Ut congue laoreet pellentesque. Integer rhoncus, velit vitae consectetur hendrerit, augue erat laoreet ligula, vel bibendum magna ex ac neque. Aliquam congue est at ante eleifend accumsan. Quisque egestas venenatis lacus in porttitor. Cras iaculis metus quis neque dictum, quis sagittis libero elementum. Proin feugiat a velit nec congue.\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nPhasellus semper maximus pretium. Vivamus placerat eros non elit posuere sollicitudin. Aenean blandit ante est, et suscipit ligula porttitor eget. Nunc dictum luctus felis, id volutpat nibh congue id. Aenean maximus metus a erat consequat, eu rutrum elit ullamcorper. Vestibulum id vulputate sem, non varius odio. Nullam
id turpis dignissim, facilisis ex sed, ullamcorper metus. Nunc id orci eget ex accumsan sodales quis posuere nibh. Praesent at massa ac nisl viverra ultricies vel in dolor. Nullam lacinia lacus ut leo cursus, et ullamcorper tortor fermentum.\n
\n ", "images": [] } ] \ No newline at end of file diff --git a/generateProjects.js b/generateProjects.js index d56a992..efc0d85 100644 --- a/generateProjects.js +++ b/generateProjects.js @@ -19,6 +19,24 @@ function getFileName(file = "") { return file.split(".").slice(0, -1).join("."); } let lineee = 0; +function isImage(element) { + // Check if the element is a table (which images are represented as) + if (!element.table) return false; + + // Iterate through rows in the table + for (let row of element.table.rows) { + // Iterate through cells in the row + for (let cell of row.cells) { + // Check if the cell contains an image + if (cell.image) { + return true; // Found an image + } + } + } + + return false; // No image found +} + async function getDocData(id=""){ let txt = "" await docs.documents.get({ @@ -71,12 +89,13 @@ async function getDocData(id=""){ async function fetchFiles(token = "") { // List files in the public folder const response = await drive.files.list({ - q: `'${process.env.GOOGLE_FOLDER_ID}' in parents`, + q: `'${process.env.GOOLGE_FOLDER_ID_PROJECTS}' in parents`, pageSize: 1000, //pageToken: token, key: process.env.GOOGLE_API_KEY, fields: 'nextPageToken, files(id, name, createdTime)' }); + // if folder exists if(response.data.files){ let folders = response.data.files for(let i=0;i