[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:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user