fix(cv): restore distinct responsive templates
This commit is contained in:
@@ -53,6 +53,7 @@ public sealed class CvTheme
|
||||
public bool AtsFriendly { get; init; }
|
||||
public bool Premium { get; init; }
|
||||
public bool NumberSections { get; init; }
|
||||
public string DefaultSkillsStyle { get; init; } = "tags"; // tags | text | bullets
|
||||
|
||||
// Builder options this template intentionally exposes. The renderer remains generic; the
|
||||
// registry tells the editor which controls make sense for a selected template.
|
||||
@@ -86,7 +87,7 @@ public static class CvThemeCatalog
|
||||
Layout = "single", HeaderStyle = "plain", HeadingStyle = "plain",
|
||||
Accent = "#111827", HeadingColor = "#111827", Muted = "#6b7280",
|
||||
HeadingFont = "'Helvetica Neue', Arial, sans-serif", BodyFont = "'Helvetica Neue', Arial, sans-serif",
|
||||
SectionGapMm = 7, EntryGapMm = 5, PhotoShape = "none", AtsFriendly = true,
|
||||
SectionGapMm = 7, EntryGapMm = 5, PhotoShape = "none", AtsFriendly = true, DefaultSkillsStyle = "text",
|
||||
},
|
||||
new()
|
||||
{
|
||||
@@ -95,7 +96,7 @@ public static class CvThemeCatalog
|
||||
Layout = "single", HeaderStyle = "centered", HeadingStyle = "underline",
|
||||
Accent = "#7c2d12", Ink = "#1c1917", Muted = "#57534e", Line = "#1c1917",
|
||||
HeadingFont = "Georgia, 'Times New Roman', serif", BodyFont = "Georgia, 'Times New Roman', serif",
|
||||
NameSizePt = 27, PhotoShape = "square", AtsFriendly = true,
|
||||
NameSizePt = 27, PhotoShape = "square", AtsFriendly = true, DefaultSkillsStyle = "text",
|
||||
},
|
||||
new()
|
||||
{
|
||||
@@ -104,7 +105,7 @@ public static class CvThemeCatalog
|
||||
Layout = "sidebar-left", HeaderStyle = "band", HeadingStyle = "bar",
|
||||
Accent = "#0f4c5c", Ink = "#102a43", Muted = "#486581", SidebarBg = "#0f4c5c", SidebarInk = "#ffffff",
|
||||
HeadingFont = "'Roboto', Arial, sans-serif", BodyFont = "'Roboto', Arial, sans-serif",
|
||||
BodySizePt = 9.5, LineHeight = 1.36, DefaultIcons = true,
|
||||
BodySizePt = 9.5, LineHeight = 1.36, DefaultIcons = true, DefaultSkillsStyle = "bullets",
|
||||
SidebarSections = new() { "contact", "skills", "languages", "certifications" },
|
||||
},
|
||||
new()
|
||||
@@ -114,7 +115,7 @@ public static class CvThemeCatalog
|
||||
Layout = "single", HeaderStyle = "plain", HeadingStyle = "caps-rule",
|
||||
Accent = "#334155", Ink = "#111827", Muted = "#374151",
|
||||
HeadingFont = "Arial, Helvetica, sans-serif", BodyFont = "Arial, Helvetica, sans-serif",
|
||||
PhotoShape = "none", AtsFriendly = true,
|
||||
PhotoShape = "none", AtsFriendly = true, DefaultSkillsStyle = "bullets",
|
||||
},
|
||||
new()
|
||||
{
|
||||
@@ -153,7 +154,7 @@ public static class CvThemeCatalog
|
||||
HeadingFont = "'Segoe UI', Roboto, Arial, sans-serif", BodyFont = "'Segoe UI', Roboto, Arial, sans-serif",
|
||||
UtilityFont = "Consolas, 'Courier New', monospace", NameSizePt = 25.5, HeadingSizePt = 9.5,
|
||||
BodySizePt = 9.4, LineHeight = 1.43, PageMarginMm = 15.24, SectionGapMm = 5.6, EntryGapMm = 4.3,
|
||||
PhotoShape = "none", DefaultIcons = false, AtsFriendly = true, NumberSections = true,
|
||||
PhotoShape = "none", DefaultIcons = false, AtsFriendly = true, NumberSections = true, DefaultSkillsStyle = "bullets",
|
||||
SupportedSettings = new() { "accent", "typography", "spacing", "skills", "page" },
|
||||
},
|
||||
};
|
||||
|
||||
@@ -130,13 +130,14 @@ public sealed class ThemedCvRenderer : IThemedCvRenderer
|
||||
private static string RenderSection(CvRenderSection section, CvTheme theme, CvVariantSettings? settings = null)
|
||||
{
|
||||
if (section.IsEmpty) return string.Empty;
|
||||
var skillsStyle = settings?.SkillsStyle ?? theme.DefaultSkillsStyle;
|
||||
var inner = section.Kind switch
|
||||
{
|
||||
"bullets" => $@"<ul class=""bullets"">{Items(section.Bullets)}</ul>",
|
||||
"paragraphs" => $@"<div class=""paragraphs"">{string.Join("", section.Bullets.Select(item => $@"<p>{Inline(item)}</p>"))}</div>",
|
||||
"skill-groups" => $@"<div class=""skill-groups"">{string.Join("", section.SkillGroups.Select(RenderSkillGroup))}</div>",
|
||||
"tags" when section.Key == "skills" && settings?.SkillsStyle == "bullets" => $@"<ul class=""bullets skill-bullets"">{Items(section.Tags)}</ul>",
|
||||
"tags" when section.Key == "skills" && settings?.SkillsStyle == "text" => $@"<p class=""skills-text"">{string.Join(" · ", section.Tags.Select(Enc))}</p>",
|
||||
"tags" when section.Key == "skills" && skillsStyle == "bullets" => $@"<ul class=""bullets skill-bullets"">{Items(section.Tags)}</ul>",
|
||||
"tags" when section.Key == "skills" && skillsStyle == "text" => $@"<p class=""skills-text"">{string.Join(" · ", section.Tags.Select(Enc))}</p>",
|
||||
"tags" => $@"<ul class=""tags"">{string.Join("", section.Tags.Select(t => $@"<li class=""tag"">{Enc(t)}</li>"))}</ul>",
|
||||
_ => string.Join("", section.Entries.Select(RenderEntry)),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user