mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +00:00
Add styling to unresolved links
This commit is contained in:
parent
c9d68e2d0f
commit
a12c3b3e0a
@ -127,6 +127,7 @@ module.exports = function(eleventyConfig) {
|
|||||||
|
|
||||||
let permalink = `/notes/${slugify(fileName)}`;
|
let permalink = `/notes/${slugify(fileName)}`;
|
||||||
const title = linkTitle ? linkTitle : fileName;
|
const title = linkTitle ? linkTitle : fileName;
|
||||||
|
let deadLink = false;
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -136,10 +137,10 @@ module.exports = function(eleventyConfig) {
|
|||||||
permalink = frontMatter.data.permalink;
|
permalink = frontMatter.data.permalink;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
//Ignore if file doesn't exist
|
deadLink = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `<a class="internal-link" href="${permalink}${headerLinkPath}">${title}</a>`;
|
return `<a class="internal-link ${deadLink?'is-unresolved':''}" href="${permalink}${headerLinkPath}">${title}</a>`;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -39,6 +39,9 @@ h4 {
|
|||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Roboto', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.is-unresolved{
|
||||||
|
color: rgb(97 186 245 / 65%);
|
||||||
|
}
|
||||||
a {
|
a {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
color: rgb(97, 186, 245);
|
color: rgb(97, 186, 245);
|
||||||
@ -73,4 +76,4 @@ p>code {
|
|||||||
//Inline code
|
//Inline code
|
||||||
color: #c7254e;
|
color: #c7254e;
|
||||||
background-color: #1a1a1a;
|
background-color: #1a1a1a;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user