fix(layout): fix rss meta link & clean main.js config
parent
9b2681f94a
commit
23553f212a
|
@ -141,7 +141,7 @@ module.exports = class extends Component {
|
||||||
images={structuredImages} /> : null}
|
images={structuredImages} /> : null}
|
||||||
|
|
||||||
{canonical_url ? <link rel="canonical" href={canonical_url} /> : null}
|
{canonical_url ? <link rel="canonical" href={canonical_url} /> : null}
|
||||||
{rss ? <link rel="alternative" href={url_for(rss)} title={config.title} type="application/atom+xml" /> : null}
|
{rss ? <link rel="alternate" href={url_for(rss)} title={config.title} type="application/atom+xml" /> : null}
|
||||||
{favicon ? <link rel="icon" href={url_for(favicon)} /> : null}
|
{favicon ? <link rel="icon" href={url_for(favicon)} /> : null}
|
||||||
<link rel="stylesheet" href={iconcdn()} />
|
<link rel="stylesheet" href={iconcdn()} />
|
||||||
{hlTheme ? <link rel="stylesheet" href={cdn('highlight.js', '9.12.0', 'styles/' + hlTheme + '.css')} /> : null}
|
{hlTheme ? <link rel="stylesheet" href={cdn('highlight.js', '9.12.0', 'styles/' + hlTheme + '.css')} /> : null}
|
||||||
|
|
|
@ -5,19 +5,9 @@ module.exports = class extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { site, config, helper, page } = this.props;
|
const { site, config, helper, page } = this.props;
|
||||||
const { url_for, cdn } = helper;
|
const { url_for, cdn } = helper;
|
||||||
const { external_link, article } = config;
|
const { article } = config;
|
||||||
const language = page.lang || page.language || config.language || 'en';
|
const language = page.lang || page.language || config.language || 'en';
|
||||||
|
|
||||||
let externalLink;
|
|
||||||
if (typeof external_link === 'boolean') {
|
|
||||||
externalLink = { enable: external_link, exclude: [] };
|
|
||||||
} else {
|
|
||||||
externalLink = {
|
|
||||||
enable: typeof external_link.enable === 'boolean' ? external_link.enable : true,
|
|
||||||
exclude: external_link.exclude || []
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
let fold = 'unfolded';
|
let fold = 'unfolded';
|
||||||
let clipboard = true;
|
let clipboard = true;
|
||||||
if (article && article.highlight) {
|
if (article && article.highlight) {
|
||||||
|
@ -30,10 +20,6 @@ module.exports = class extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
const embeddedConfig = `var IcarusThemeSettings = {
|
const embeddedConfig = `var IcarusThemeSettings = {
|
||||||
site: {
|
|
||||||
url: '${config.url}',
|
|
||||||
external_link: ${JSON.stringify(externalLink)}
|
|
||||||
},
|
|
||||||
article: {
|
article: {
|
||||||
highlight: {
|
highlight: {
|
||||||
clipboard: ${clipboard},
|
clipboard: ${clipboard},
|
||||||
|
|
Loading…
Reference in New Issue