From 4e2c1f0eca3b05e5f8f87102f3295c416572a864 Mon Sep 17 00:00:00 2001 From: Reorx Date: Tue, 14 Feb 2023 13:12:51 +0800 Subject: [PATCH] theme reorx: enhance location display --- src/themes/reorx/index.ejs | 9 ++++++++- src/themes/reorx/index.scss | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/themes/reorx/index.ejs b/src/themes/reorx/index.ejs index bc11524..11f6005 100644 --- a/src/themes/reorx/index.ejs +++ b/src/themes/reorx/index.ejs @@ -4,6 +4,13 @@ function linkInDiv(url) { return `
${fn.noSchemaURL(url)}
` } %> +<% +function formatLocation(loc) { + const cityToCountry = ['city', 'postalCode', 'region', 'countryCode'].map(key => loc[key]).filter(v => v).join(', ') + if (!loc.address) return cityToCountry + return `${loc.address}. ${cityToCountry}` +} +%>
@@ -36,7 +43,7 @@ function linkInDiv(url) { <% if (cv.basics.location) { %>
<%- fn.getIconSVG('mdi:location') %> - <%= cv.basics.location.city %>, <%= cv.basics.location.countryCode %> + <%= formatLocation(cv.basics.location) %>
<% } %> diff --git a/src/themes/reorx/index.scss b/src/themes/reorx/index.scss index 92811f7..54cb0ea 100644 --- a/src/themes/reorx/index.scss +++ b/src/themes/reorx/index.scss @@ -165,14 +165,14 @@ section { .contact { color: $color-text-dim; display: flex; + flex-wrap: wrap; + gap: .4em 1em; @media screen and (max-width: 500px) { flex-direction: column; - gap: .4em; } .item { - margin-right: 1em; a { color: $color-text-dim; }