Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oh14.de Links
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felix-123
oh14.de Links
Commits
4e24b1c7
Commit
4e24b1c7
authored
1 year ago
by
Luca
Browse files
Options
Downloads
Patches
Plain Diff
Update 404 page for the new format
parent
bf2230ae
Branches
main
No related tags found
No related merge requests found
Pipeline
#150892
passed
1 year ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/404.html
+3
-3
3 additions, 3 deletions
public/404.html
with
3 additions
and
3 deletions
public/404.html
+
3
−
3
View file @
4e24b1c7
...
...
@@ -70,15 +70,15 @@
<script>
async
function
addFuzzySearch
()
{
const
vanityMap
=
await
(
await
fetch
(
"
/vanitymap.json
"
)).
json
()
const
keys
=
Object
.
keys
(
vanityMap
);
const
keys
=
vanityMap
[
'
shortlinks
'
].
map
((
object
)
=>
object
.
sources
).
flat
(
1
)
const
fuse
=
new
Fuse
(
keys
,
{})
const
pathToSearchFor
=
window
.
location
.
pathname
.
replace
(
"
/
"
,
""
).
replace
(
"
.html
"
,
""
).
trim
();
const
results
=
fuse
.
search
(
pathToSearchFor
)
if
(
results
.
length
!==
0
)
{
const
bestShortlink
=
results
[
0
].
item
;
const
bestHref
=
vanityMap
[
bestShortlink
]
;
const
bestHref
=
vanityMap
[
'
shortlinks
'
].
filter
((
object
)
=>
object
.
sources
.
includes
(
bestShortlink
))[
0
].
destination
;
document
.
getElementById
(
"
suggestion-text
"
).
innerText
=
bestShortlink
;
document
.
getElementById
(
"
suggestion-text
"
).
innerText
=
"
/
"
+
bestShortlink
;
document
.
getElementById
(
"
suggestion-href
"
).
href
=
bestHref
;
document
.
getElementById
(
"
suggestion-section
"
).
classList
.
remove
(
"
is-invisible
"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment