diff --git a/example.index.json b/example.index.json index 8c9e6b2..b66accf 100644 --- a/example.index.json +++ b/example.index.json @@ -14,6 +14,7 @@ { "title": "Unreal Engine", "type": "folder", + "color": "#2196f3", "path": "docs/unreal-engine.md", "slug": "unreal-engine", "items": [ diff --git a/index.js b/index.js index 15f36f0..b6c53a8 100644 --- a/index.js +++ b/index.js @@ -197,9 +197,10 @@ class DOMService { } createFolderHeaderWithFile(iconClass, doc) { + const iconStyle = doc.color ? `color: ${doc.color};` : ''; return `
- +
${doc.title} @@ -208,9 +209,10 @@ class DOMService { } createFolderHeaderBasic(iconClass, doc) { + const iconStyle = doc.color ? `color: ${doc.color};` : ''; return `
- +
${doc.title}`; }