feat(layout): add elementary PWA support
parent
8b3e744878
commit
c40214d546
|
@ -7,6 +7,7 @@ module.exports = hexo => {
|
||||||
require('hexo-component-inferno/lib/hexo/generator/insight')(hexo);
|
require('hexo-component-inferno/lib/hexo/generator/insight')(hexo);
|
||||||
require('hexo-component-inferno/lib/hexo/generator/categories')(hexo);
|
require('hexo-component-inferno/lib/hexo/generator/categories')(hexo);
|
||||||
require('hexo-component-inferno/lib/hexo/generator/category')(hexo);
|
require('hexo-component-inferno/lib/hexo/generator/category')(hexo);
|
||||||
|
require('hexo-component-inferno/lib/hexo/generator/manifest')(hexo);
|
||||||
require('hexo-component-inferno/lib/hexo/generator/tags')(hexo);
|
require('hexo-component-inferno/lib/hexo/generator/tags')(hexo);
|
||||||
require('hexo-component-inferno/lib/hexo/helper/cdn')(hexo);
|
require('hexo-component-inferno/lib/hexo/helper/cdn')(hexo);
|
||||||
require('hexo-component-inferno/lib/hexo/helper/page')(hexo);
|
require('hexo-component-inferno/lib/hexo/helper/page')(hexo);
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
"default": "/img/favicon.svg",
|
"default": "/img/favicon.svg",
|
||||||
"nullable": true
|
"nullable": true
|
||||||
},
|
},
|
||||||
|
"manifest": {
|
||||||
|
"$ref": "/misc/manifest.json"
|
||||||
|
},
|
||||||
"open_graph": {
|
"open_graph": {
|
||||||
"$ref": "/misc/open_graph.json"
|
"$ref": "/misc/open_graph.json"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
const { Component } = require('inferno');
|
const { Component } = require('inferno');
|
||||||
const MetaTags = require('hexo-component-inferno/lib/view/misc/meta');
|
const MetaTags = require('hexo-component-inferno/lib/view/misc/meta');
|
||||||
|
const WebApp = require('hexo-component-inferno/lib/view/misc/web_app');
|
||||||
const OpenGraph = require('hexo-component-inferno/lib/view/misc/open_graph');
|
const OpenGraph = require('hexo-component-inferno/lib/view/misc/open_graph');
|
||||||
const StructuredData = require('hexo-component-inferno/lib/view/misc/structured_data');
|
const StructuredData = require('hexo-component-inferno/lib/view/misc/structured_data');
|
||||||
const Plugins = require('./plugins');
|
const Plugins = require('./plugins');
|
||||||
|
@ -40,6 +41,7 @@ module.exports = class extends Component {
|
||||||
} = config;
|
} = config;
|
||||||
const {
|
const {
|
||||||
meta = [],
|
meta = [],
|
||||||
|
manifest = {},
|
||||||
open_graph = {},
|
open_graph = {},
|
||||||
structured_data = {},
|
structured_data = {},
|
||||||
canonical_url = page.permalink,
|
canonical_url = page.permalink,
|
||||||
|
@ -112,6 +114,13 @@ module.exports = class extends Component {
|
||||||
|
|
||||||
<title>{getPageTitle(page, config.title, helper)}</title>
|
<title>{getPageTitle(page, config.title, helper)}</title>
|
||||||
|
|
||||||
|
<WebApp.Cacheable
|
||||||
|
helper={helper}
|
||||||
|
favicon={favicon}
|
||||||
|
icons={manifest.icons}
|
||||||
|
themeColor={manifest.theme_color}
|
||||||
|
name={manifest.name || config.title} />
|
||||||
|
|
||||||
{typeof open_graph === 'object' && open_graph !== null ? <OpenGraph
|
{typeof open_graph === 'object' && open_graph !== null ? <OpenGraph
|
||||||
type={open_graph.type || (is_post(page) ? 'article' : 'website')}
|
type={open_graph.type || (is_post(page) ? 'article' : 'website')}
|
||||||
title={open_graph.title || page.title || config.title}
|
title={open_graph.title || page.title || config.title}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"hexo-component-inferno": "^0.8.2",
|
"hexo-component-inferno": "^0.10.0",
|
||||||
"inferno": "^7.3.3",
|
"inferno": "^7.3.3",
|
||||||
"inferno-create-element": "^7.3.3",
|
"inferno-create-element": "^7.3.3",
|
||||||
"moment": "^2.22.2",
|
"moment": "^2.22.2",
|
||||||
|
|
Loading…
Reference in New Issue