[NETLIFY TEST] Update logo-switch.astro (#5164)

* Update logo-switch.astro

* Update README.md

* convertPathToHtml bug fix

* Create index.html

* css-lint fixed
This commit is contained in:
Daniel
2023-06-11 13:23:03 +05:30
committed by REJack
parent a9d6e94817
commit 6b33ce3367
7 changed files with 131 additions and 18 deletions

View File

@@ -1,11 +1,28 @@
function convertPathToHtml(path) {
let htmlpath = ''
let count = 0
let htmlPath = ''
while (path.startsWith('../')) {
count++
path = path.slice(3)
htmlpath += htmlpath.length < 2 ? '.' : '/..'
}
return htmlpath
if (count === 2) {
htmlPath = '.'
}
if (count === 3) {
htmlPath = '..'
}
if (count === 4) {
htmlPath = '../..'
}
if (count === 5) {
htmlPath = '../../..'
}
return htmlPath
}
export { convertPathToHtml }