Skip to content

Commit

Permalink
format: fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Centaurus99 committed Jan 16, 2022
1 parent 212678e commit a05b870
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion layout/archive.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = class extends Component {
const { config, page, helper } = this.props;
const { url_for, __, date_xml, date } = helper;

page.posts && page.posts.filter(p => !p.thumbnail).forEach(p => p.thumbnail = '/img/thumbnail.svg');
page.posts && page.posts.filter(p => !p.thumbnail).forEach(p => { p.thumbnail = '/img/thumbnail.svg'; });

const language = page.lang || page.language || config.language;

Expand Down
26 changes: 13 additions & 13 deletions layout/common/article.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ module.exports = class extends Component {
{/* Metadata */}
{/* Title */}
<h1 className="title is-size-3 is-size-4-mobile has-text-weight-normal">
{index ?
<a className="has-link-black-ter" href={url_for(page.link || page.path)}>
{index
? <a className="has-link-black-ter" href={url_for(page.link || page.path)}>
<i className="fas fa-angle-double-right"></i>{page.title}
</a> :
[<i className="fas fa-angle-double-right"></i>, page.title]
</a>
: [<i className="fas fa-angle-double-right"></i>, page.title]
}
</h1>
{page.layout !== 'page' ? <div class="article-meta is-size-7 is-uppercase level is-mobile">
Expand Down Expand Up @@ -102,15 +102,15 @@ module.exports = class extends Component {
? <ArticleLicensing.Cacheable page={page} config={config} helper={helper} /> : null}
<hr style="height:1px;margin:1rem 0"/>
<div className="level is-mobile is-flex">
{/* Tags */}
{page.tags && page.tags.length ? <div class="article-tags is-size-7 is-uppercase">
<i class="fas fa-tags has-text-grey"></i>&nbsp;
{page.tags.map((tag, index) => {
return <a class="link-muted" rel="tag" href={url_for(tag.path)}>{tag.name}{index !== page.tags.length-1? ', ':''}</a>;
})}
</div> : null}
{/* "Read more" button */}
{index && page.excerpt ? <a class="article-more button is-small is-size-7" href={`${url_for(page.link || page.path)}#more`}><i class="fas fa-book-reader has-text-grey"></i>&nbsp;&nbsp;{__('article.more')}</a> : null}
{/* Tags */}
{page.tags && page.tags.length ? <div class="article-tags is-size-7 is-uppercase">
<i class="fas fa-tags has-text-grey"></i>&nbsp;
{page.tags.map((tag, index) => {
return <a class="link-muted" rel="tag" href={url_for(tag.path)}>{tag.name}{index !== page.tags.length - 1 ? ', ' : ''}</a>;
})}
</div> : null}
{/* "Read more" button */}
{index && page.excerpt ? <a class="article-more button is-small is-size-7" href={`${url_for(page.link || page.path)}#more`}><i class="fas fa-book-reader has-text-grey"></i>&nbsp;&nbsp;{__('article.more')}</a> : null}
</div>
{/* Share button */}
{!index ? <Share config={config} page={page} helper={helper} /> : null}
Expand Down
10 changes: 5 additions & 5 deletions layout/common/footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class Footer extends Component {
const link = links[name];
return <p class="control">
<a class={`button is-transparent ${link.icon ? 'is-large' : ''}`} target="_blank" rel="noopener" title={name} href={link.url}>
{link.icon ?
(Array.isArray(link.icon) ?
link.icon.map(i => [<i className={i}></i>, '\u00A0']) :
<i className={link.icon}></i>
) : name}
{link.icon // eslint-disable-line no-nested-ternary
? Array.isArray(link.icon)
? link.icon.map(i => [<i className={i}></i>, '\u00A0'])
: <i className={link.icon}></i>
: name}
</a>
</p>;
})}
Expand Down
48 changes: 24 additions & 24 deletions layout/ext/article_licensing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ArticleLicensing extends Component {
updatedAt,
updatedTitle,
licenses,
licensedTitle,
licensedTitle
} = this.props;
return (
<div class="article-licensing box">
Expand All @@ -53,54 +53,54 @@ class ArticleLicensing extends Component {
</div>
<div class="licensing-meta level is-mobile">
<div class="level-left">
{author ? (
<div class="level-item is-narrow">
{author
? <div class="level-item is-narrow">
<div>
<h6>{authorTitle}</h6>
<p>{author}</p>
</div>
</div>
) : null}
{createdAt ? (
<div class="level-item is-narrow">
: null}
{createdAt
? <div class="level-item is-narrow">
<div>
<h6>{createdTitle}</h6>
<p>{createdAt}</p>
</div>
</div>
) : null}
{updatedAt ? (
<div class="level-item is-narrow">
: null}
{updatedAt
? <div class="level-item is-narrow">
<div>
<h6>{updatedTitle}</h6>
<p>{updatedAt}</p>
</div>
</div>
) : null}
{licenses && Object.keys(licenses).length ? (
<div class="level-item is-narrow">
: null}
{licenses && Object.keys(licenses).length
? <div class="level-item is-narrow">
<div>
<h6>{licensedTitle}</h6>
<p>
{Object.keys(licenses).map((name) => (
{Object.keys(licenses).map(name =>
<a
rel="noopener"
target="_blank"
title={name}
class={licenses[name].icon && !Array.isArray(licenses[name].icon) ? 'icon' : ''}
href={licenses[name].url}>
{licenses[name].icon ? (
Array.isArray(licenses[name].icon)?
licenses[name].icon.map(i => [<i className={i}></i>, '\u00A0']):
<i className={licenses[name].icon}></i>
) : name}
{licenses[name].icon // eslint-disable-line no-nested-ternary
? Array.isArray(licenses[name].icon)
? licenses[name].icon.map(i => [<i className={i}></i>, '\u00A0'])
: <i className={licenses[name].icon}></i>
: name}
{licenses[name].text || ''}
</a>
))}
)}
</p>
</div>
</div>
) : null}
: null}
</div>
</div>
</div>
Expand Down Expand Up @@ -134,18 +134,18 @@ class ArticleLicensing extends Component {
* url_for: function() {...}
* }} />
*/
ArticleLicensing.Cacheable = cacheComponent(ArticleLicensing, 'misc.articlelicensing', (props) => {
ArticleLicensing.Cacheable = cacheComponent(ArticleLicensing, 'misc.articlelicensing', props => {
const { config, page, helper } = props;
const { licenses } = config.article || {};

const links = {};
if (licenses) {
Object.keys(licenses).forEach((name) => {
Object.keys(licenses).forEach(name => {
const license = licenses[name];
links[name] = {
url: helper.url_for(typeof license === 'string' ? license : license.url),
icon: license.icon,
text: license.text,
text: license.text
};
});
}
Expand All @@ -163,7 +163,7 @@ ArticleLicensing.Cacheable = cacheComponent(ArticleLicensing, 'misc.articlelicen
updatedAt: page.updated ? helper.date(page.updated) : null,
updatedTitle: helper.__('article.licensing.updated_at'),
licenses: links,
licensedTitle: helper.__('article.licensing.licensed_under'),
licensedTitle: helper.__('article.licensing.licensed_under')
};
});

Expand Down
4 changes: 2 additions & 2 deletions layout/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ module.exports = class extends Component {
render() {
const { site, config, page, helper, body } = this.props;

site.posts && site.posts.filter(p => !p.thumbnail).forEach(p => p.thumbnail = '/img/thumbnail.svg');
site.posts && site.posts.filter(p => !p.thumbnail).forEach(p => { p.thumbnail = '/img/thumbnail.svg'; });

const language = page.lang || page.language || config.language;
const columnCount = Widgets.getColumnCount(config.widgets, config, page);

return <html lang={language ? language.substr(0, 2) : ''}>
<Head site={site} config={config} helper={helper} page={page} />
<body class={`is-3-column`}>
<body class={'is-3-column'}>
<Navbar config={config} helper={helper} page={page} />
<section class="section">
<div class="container">
Expand Down

0 comments on commit a05b870

Please sign in to comment.