diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..db4c6d9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist +node_modules \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..a6507d0 --- /dev/null +++ b/index.html @@ -0,0 +1,235 @@ + + + + + + Link Later + + + +
+
+

+ Link Later +

+

Automating keyword links

+ +
+ Logistics solutions lorem test test ipsum dolor test sit amet, consectetuer adipiscing elit. + Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque + penatibus et magnis dis parturient montes, nascetur ridiculus mus. + Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. + Nulla consequat massa quis enim. logistics solutions Donec pede justo, fringilla vel, + aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, + imperdiet a, venenatis vitae, justo. Spoon Nullam dictum felis eu pede + mollis pretium. Integer tincidunt. Cras dapibus. Vivamus + elementum semper nisi. test1. Digital solutions. test-fr +
+ +
+ Lorem test ipsum dolor warehouse LCL test sit amet, consectetuer adipiscing elit. + Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque + penatibus et magnis dis parturient montes, nascetur ridiculus mus. + Donec quam felis, ultricies nec, logistics solutions pellentesque eu, pretium quis, sem. + Nulla consequat massa quis enim. A test link Donec pede justo, fringilla vel, + aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, + imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede + mollis pretium. Integer tincidunt. Cras dapibus. Vivamus + elementum semper nisi. test1 +
+ +
+ Test Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, + consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, + viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus + varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam logistics solutions1 ultricies nisi + vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam + rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam + semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, + blandit vel, luctus pulvinar, hendrerit id, lorem. test. +
+ +
+ Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut + libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget + eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. + Donec sodales sagittis magna. Sed consequat, leo eget bibendum + sodales, augue velit cursus nunc, logistics solutions quis gravida magna mi a libero. + Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque + ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras + ultricies mi eu turpis hendrerit fringilla. +
+ +
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices + posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam + pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet + nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer + ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent + adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy + metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros + et nisl sagittis vestibulum. +
+ +
+ Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, + pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in + justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec + neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, + nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere + imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed + cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus + accumsan cursus velit. +
+ +
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices + posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit + erat euismod orci, ac placerat dolor lectus quis orci. Phasellus + consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, + posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet + augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean + posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu + sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales + nec, volutpat a, suscipit non, turpis. +
+ +
+ Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, + sem libero volutpat nibh, nec pellentesque velit pede quis nunc. + Vestibulum ante ipsum primis in faucibus orci luctus et ultrices + posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. + Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut + neque. Pellentesque habitant morbi tristique senectus et netus et + malesuada fames ac turpis egestas. In dui magna, posuere eget, + vestibulum et, tempor auctor, justo. In ac felis quis tortor malesuada + pretium. Pellentesque auctor neque nec urna. Proin sapien ipsum, porta + a, auctor quis, euismod ut, mi. Aenean viverra rhoncus pede. + Pellentesque habitant morbi tristique senectus et netus et malesuada + fames ac turpis egestas. Ut non enim eleifend felis pretium feugiat. + Vivamus quis mi. Phasellus a est. Phasellus magna. In hac habitasse + platea dictumst. Curabitur at lacus ac velit ornare lobortis. + Curabitur a felis in nunc fringilla tristique. +
+ +
+ Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, + consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, + viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus + varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi + vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam + rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam + semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, + blandit vel, luctus pulvinar, hendrerit id, lorem. +
+ +
+ Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut + libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget + eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. + Donec sodales sagittis magna. Sed consequat, leo eget bibendum + sodales, augue velit cursus nunc, quis gravida magna mi a libero. + Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque + ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras + ultricies mi eu turpis hendrerit fringilla. +
+ +
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices + posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam + pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet + nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer + ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent + adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy + metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros + et nisl sagittis vestibulum. +
+ +
+ Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, + pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in + justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec + neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, + nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere + imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed + cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus + accumsan cursus velit. +
+ +
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices + posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit + erat euismod orci, ac placerat dolor lectus quis orci. Phasellus + consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, + posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet + augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean + posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu + sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales + nec, volutpat a, suscipit non, turpis. +
+ +
+ Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, + sem libero volutpat nibh, nec pellentesque velit pede quis nunc. + Vestibulum ante ipsum primis in faucibus orci luctus et ultrices + posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. + Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut + neque. Pellentesque habitant morbi tristique senectus et netus et + malesuada fames ac turpis egestas. In dui magna, posuere eget, + vestibulum et, tempor auctor, justo. In ac felis quis tortor malesuada + pretium. Pellentesque auctor neque nec urna. Proin sapien ipsum, porta + a, auctor quis, euismod ut, mi. Aenean viverra rhoncus pede. + Pellentesque habitant morbi tristique senectus et netus et malesuada + fames ac turpis egestas. Ut non enim eleifend felis pretium feugiat. + Vivamus quis mi. Phasellus a est. Phasellus magna. In hac habitasse + platea dictumst. Curabitur at lacus ac velit ornare lobortis. + Curabitur a felis in nunc fringilla tristique. +
+
+
+ + + + + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..5996ed0 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,801 @@ +{ + "name": "link-later", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "link-later", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "vite": "^5.0.12" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", + "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", + "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", + "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", + "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", + "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", + "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", + "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", + "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", + "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", + "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", + "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", + "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", + "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", + "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", + "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", + "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.18.0", + "@rollup/rollup-android-arm64": "4.18.0", + "@rollup/rollup-darwin-arm64": "4.18.0", + "@rollup/rollup-darwin-x64": "4.18.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", + "@rollup/rollup-linux-arm-musleabihf": "4.18.0", + "@rollup/rollup-linux-arm64-gnu": "4.18.0", + "@rollup/rollup-linux-arm64-musl": "4.18.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", + "@rollup/rollup-linux-riscv64-gnu": "4.18.0", + "@rollup/rollup-linux-s390x-gnu": "4.18.0", + "@rollup/rollup-linux-x64-gnu": "4.18.0", + "@rollup/rollup-linux-x64-musl": "4.18.0", + "@rollup/rollup-win32-arm64-msvc": "4.18.0", + "@rollup/rollup-win32-ia32-msvc": "4.18.0", + "@rollup/rollup-win32-x64-msvc": "4.18.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.0.tgz", + "integrity": "sha512-hA6vAVK977NyW1Qw+fLvqSo7xDPej7von7C3DwwqPRmnnnK36XEBC/J3j1V5lP8fbt7y0TgTKJbpNGSwM+Bdeg==", + "dev": true, + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.38", + "rollup": "^4.13.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..53eb2c1 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "link-later", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "vite --host 0.0.0.0", + "build": "vite build" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "vite": "^5.0.12" + } +} diff --git a/public/4906292.png b/public/4906292.png new file mode 100644 index 0000000..dd1c2f8 Binary files /dev/null and b/public/4906292.png differ diff --git a/public/what.jpg b/public/what.jpg new file mode 100644 index 0000000..b7f405e Binary files /dev/null and b/public/what.jpg differ diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..7ecc1b5 --- /dev/null +++ b/readme.md @@ -0,0 +1,82 @@ + + +# Link Later + +## Introduction + +This is a small library to find and replace keywords in your html with linked keywords, it could also be easily adapted for different purposes, such as highlighting specific keywords. + +Use cases might internal linking for SEO purposes, or affiliate linking. + +## What it does + +In a nutshell it does this + +![What it does](/public/what.jpg) + + +## Options + +| | Description | Type | +| ----------- | ----------- | ------- | +| scope | The path to scope keyword replacement. For example if you only want to replace keywords under your products section the scope might be "/products" | string | +| config | See Config | Config[] | + + +## Config +| | Description | Type | +| ----------- | ----------- | ------- | +| keywords | Comma separated list of keywords | string | +| href | The href to link to | string | +| target? | An optional value for the target attribute | string | +| classes? | Optional classes to be added to the link | string | +| debug? | Optionally add a yellow background to the created links | boolean | +| ignore? | Optionally provide an array of html tags to ignore* if the text resides within them | string[] | + +* the default list of ignored tags is: +["HEAD", "SCRIPT", "STYLE", "A", "BUTTON", "INPUT", "H1", "H2", "H3", "H4", "H5"] + + +## How to use + +```javascript +import start from "./link-later" +import Option from "./interfaces" + +/** + * config + */ + +const options: Option[] = [ +{ + scope: "/", + configs: [ + { + keywords: "test,logistics solutions", + href: "/my-logistical-solutions-link", + target: "_blank", + classes: "test-class", + debug: true + }, + ], +}, +{ + scope: "/", + configs: [ + { + keywords: "warehouse", + href: "/my-warehousing-link", + selector: ".rich-text", + debug: true + }, + { + keywords: "Inland transportation", + href: "/my-inland-services-link", + selector: ".rich-text", + debug: true + }, + ], +}]; + +start(options); +``` \ No newline at end of file diff --git a/src/interfaces.ts b/src/interfaces.ts new file mode 100644 index 0000000..3d41ef6 --- /dev/null +++ b/src/interfaces.ts @@ -0,0 +1,21 @@ +/** + * interfaces + */ + +export interface Config { + keywords: string, + href: string, + selector?: string, + target?: string, + classes?: string, + max?: number, + debug?: boolean, + ignore?: string[], +} + +export interface Option { + scope: (string), + configs: Config[] +} + +export default Option \ No newline at end of file diff --git a/src/link-later.ts b/src/link-later.ts new file mode 100644 index 0000000..f1c3c77 --- /dev/null +++ b/src/link-later.ts @@ -0,0 +1,170 @@ +/** + * Link later + * a library to replace keywords with links + */ + +import { Option, Config } from "./interfaces"; + + +/** + * constants + */ + +const ignoredTags: string[] = ["HEAD", "SCRIPT", "STYLE", "A", "BUTTON", "INPUT", "H1", "H2", "H3", "H4", "H5"]; + +/** + * variables + */ + +let maxCounter: number = 0; + +/** + * if selector has been provided loop through them + */ +const selectorLoop = (els: NodeListOf, config): void => { + els.forEach((el: HTMLElement) => { + if (!parentCheck(el, config)) { + loop(el, config); + } + }); +}; + +/** + * check the parents for tags meaning we should ignore +*/ +const parentCheck = (el: HTMLElement, config: Config): boolean => { + const ignored = config.ignore ? config.ignore : ignoredTags; + + while (el.parentNode) { + el = el.parentNode as HTMLElement; + if (ignored.includes(el.tagName)) { + return true; + } + } + + return false; +} + +/** + * recursive loop + */ +const loop = (parent: HTMLElement, config: any) => { + const ignored = config.ignore ? config.ignore : ignoredTags; + + if (parent.childNodes) { + const children = [...parent.childNodes as NodeListOf]; + + children.forEach((el) => { + // check if we've reached a provided maximum + if (config.max && maxCounter > config.max) { + return; + } + + // check for links and skip over + if (ignored.includes(el.tagName)) { + return; + } + + if (el.childNodes.length) { + loop(el, config); + } else { + replace(el, config); + } + }); + } +}; + +/** + * replace the contents of the node + */ +const replace = (el: HTMLElement, { keywords, classes, href, target, max, debug }) => { + const wordsArray = keywords.split(","); + const re = new RegExp("\\b(" + wordsArray.join("|") + ")(?!-)\\b", "gi"); + + // text node + if (el.nodeType === 3) { + const str = el.nodeValue as string; + let match; + let position: number = 0; + const splitElements: (HTMLElement | Text)[] = []; + + // loop through the regex matches + while ((match = re.exec(str)) !== null) { + // check if we've reached a provided maximum + if (max && maxCounter >= max) { + continue; + } + + // the textNode before any match + const textNode: Text = document.createTextNode(str.slice(position, match.index)); + + // the new link + const a: HTMLElement = createLink(match[0], href, target, classes, debug); + + splitElements.push(textNode); + splitElements.push(a); + + position = re.lastIndex; + maxCounter += 1; + } + + // the final textNode to be added + if (position > 0) { + splitElements.push(document.createTextNode(str.slice(position))); + el.replaceWith(...splitElements); + } + } +}; + +/** + * creating a html link element + */ +const createLink = (text: string, href: string, target: string, classes: string, debug: boolean): HTMLAnchorElement => { + const a: HTMLAnchorElement = document.createElement("a"); + a.innerText = text; + a.href = href; + + if (target) { + a.target = target; + } + + if (classes) { + a.classList.add(classes); + } + + if (debug) { + a.setAttribute("style", "background: yellow"); + } + + return a; +}; + +/** + * main sniping loop + */ +const start = (data: Option[]): void => { + data.forEach((section: Option) => { + const path = window.location.pathname; + + // check to see if the scope is within the current path + if ((path.endsWith(section.scope) || path.startsWith(section.scope + "/"))) { + const docEl: HTMLElement = document.body; + + section.configs.forEach((config: Config) => { + // if a selector has been provided + if (config.selector) { + const els: NodeListOf = document.querySelectorAll(`${config.selector || docEl}`); + selectorLoop(els, config); + } + // fallback to the entire document element, best avoided + else { + loop(docEl, config); + } + }); + + maxCounter = 0; + } + }); +}; + +export default start; diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..62bdc15 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,41 @@ +import start from "./link-later" +import Option from "./interfaces" + +/** + * config + */ + +const options: Option[] = [ + { + scope: "/", + configs: [ + { + keywords: "test,logistics solutions", + href: "/my-logistical-solutions-link", + target: "_blank", + classes: "test-class", + debug: true, + ignore: ["SPAN"] + }, + ], + }, + { + scope: "/", + configs: [ + { + keywords: "warehouse", + href: "/my-warehousing-link", + selector: ".rich-text", + debug: true + }, + { + keywords: "Inland transportation", + href: "/my-inland-services-link", + selector: ".rich-text", + debug: true + }, + ], + }, +]; + +start(options); \ No newline at end of file diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..2be7977 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,17 @@ +// import pkg from "./package.json"; +import fs from "fs"; +import { defineConfig } from "vite"; +import { resolve } from "path"; + +export default defineConfig({ + build: { + lib: { + // formats: ["es", "iife"], + entry: resolve(__dirname, "src/link-later.ts"), + name: "ls", + fileName: "ls" + }, + }, + plugins: [ + ] +});