on master help sign in
Merge pull request #238 from dym-sh/master

[sites] fix duplicated `feed:` property and adds in some fancy css magic

commitb8f8cd9bac8b1c75bc9db324bc064f5e61e663ae authorChris <ckipp@pm.me> dateMon 5 Aug 2019, 21:59 (7 years ago) parentf07b0e0f360a86
2 files changed+9−7
links/main.css+5−5 scripts/portal.js+4−2
links/main.css+5−5
@@ -62,22 +62,22 @@ body #hallway ul li:last-child { border-bottom:0px; }
6262body #portal #icon { display: block;width: 30px;height: 30px;background-image: url(../icon.white.svg);background-size: cover;background-repeat: no-repeat;position: absolute;bottom: 15px;right:15px;background-position: center;padding:0px }
6363body #portal ul { columns:3; }
6464body #portal ul li { display:block; padding-left:5px; text-overflow: ellipsis; text-transform: lowercase;}
65−body #portal ul li.wiki::after { content:"<wiki>"; color:#555; }
66−body #portal ul li.blog::after { content:"<blog>"; color:#555; }
65+body #portal ul li:before { content: attr(id) ")"; }
66+body #portal ul li[data-type]::after { content:"<" attr(data-type) ">"; color:#555; }
6767body #portal ul li a { line-height: 20px; padding:0px 5px; text-decoration: none;}
6868body #portal ul li a:visited { color:#ccc; text-decoration: none;}
6969body #portal ul li a:hover { text-decoration: underline; }
7070
7171@media (max-width: 730px) {
72− body #portal ul li span.counter { display: none }
72+ body #portal ul li:before { display: none }
7373}
7474@media (max-width: 630px) {
7575 body #portal ul { columns: 2 !important; }
76− body #portal ul li span.counter { display: none }
76+ body #portal ul li:before { display: none }
7777}
7878@media (max-width: 530px) {
7979 body #portal ul { columns: 1 !important; }
80− body #portal ul li span.counter { display: inline }
80+ body #portal ul li:before { display: inline }
8181}
8282
8383/* Wiki */
scripts/portal.js+4−2
@@ -17,11 +17,13 @@ function Portal (sites) {
1717
1818 function _directory (sites) {
1919 return `
20− <ul>${sites.reduce((acc, site, id) => { return `${acc}<li class='${site.type}'><span class='counter'>${id})</span><a href='${site.url}'>${_name(site)}</a></li>` }, '')}</ul>\n${_readme()}${_buttons()}`
20+ <ul>${sites.reduce( (acc, site, id) =>
21+ `${acc}<li ${site.type ? `data-type="${site.type}"` : ''} id='${id}'><a href='${site.url}'>${_name(site)}</a></li>`
22+ , '')}</ul>\n${_readme()}${_buttons()}`
2123 }
2224
2325 function _name (site) {
24− return site.title ? site.title : `${site.url.split('//')[1]}`
26+ return site.title || `${site.url.split('//')[1]}`
2527 }
2628
2729 function _redirect (site) {