mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 04:35:20 +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)}`;
|
||||
const title = linkTitle ? linkTitle : fileName;
|
||||
let deadLink = false;
|
||||
|
||||
|
||||
try {
|
||||
@ -136,10 +137,10 @@ module.exports = function(eleventyConfig) {
|
||||
permalink = frontMatter.data.permalink;
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
|
||||
a.is-unresolved{
|
||||
color: rgb(97 186 245 / 65%);
|
||||
}
|
||||
a {
|
||||
text-decoration: underline;
|
||||
color: rgb(97, 186, 245);
|
||||
@ -73,4 +76,4 @@ p>code {
|
||||
//Inline code
|
||||
color: #c7254e;
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user