hexo-theme-minimalism
Version:
a minimalist Hexo theme that is simple yet elegant, enabling your blog content to shine. Its powerful features also help you create a personalized blog that truly stands out.
33 lines (25 loc) • 645 B
JavaScript
/* global hexo */
;
/**
* Export theme config to js
*/
hexo.extend.helper.register('export_config', function() {
const {theme} = this;
const { image, search } = Object.assign({image: {
lazyload_enable: true,
photo_zoom: 'simple-lightbox'
}, search: {
enable: false
}}, theme);
const theme_config = {
image: image,
search: search,
language: this.config.language
};
const script = `<script id="hexo-configurations">
window.theme_config = ${JSON.stringify(theme_config)};
window.is_post = ${this.is_post()};
</script>`;
// compression
return script.replace(/\s+/g, ' ');
});