GHOST CMS - Ghost Handlebars主题 Ghost Handlebars Themes
Ghost Handlebars主题
Ghost Handlebars Themes
Ghost主题层被设计为让开发人员和设计人员能够灵活地构建由Ghost平台支持的自定义发布
The Ghost theme layer has been engineered to give developers and designers the flexibility to build custom publications that are powered by the Ghost platform.
主题开发
Theme development
Ghost主题使用了Handlebars模板语言,它使用helper类在模板(HTML)和任何JavaScript逻辑之间创建了一个强隔离。这使得主题可以非常快,有动态的客户端应用程序和服务器端发布内容,这些内容以静态HTML的形式发送到浏览器。
Ghost themes use the Handlebars templating language which creates a strong separation between templates (the HTML) and any JavaScript logic with the use of helpers. This allows themes to be super fast, with a dynamic client side app, and server side publication content that is sent to the browser as static HTML.
Ghost还利用了一个名为express-hbs的附加库,它为把手增加了一些额外的功能,比如布局和局部。
Ghost also makes use of an additional library called express-hbs
which adds some additional features to Handlebars, such as layouts and partials.
本文档为您提供了为主题创建静态HTML和CSS所需的工具,在需要呈现动态数据时使用把手表达式。
This documentation gives you the tools required to create static HTML and CSS for a theme, using Handlebars expressions when you need to render dynamic data.
Handlebars
Handlebars模板语言提供了有效构建语义模板的能力。该文档为您提供了开始为您的出版物开发主题所需的所有知识。另外,如果你想熟悉官方的把手文档并学习更多的基本表达,使用这些有用的资源:
The Handlebars templating language provides the power to build semantic templates effectively. This documentation gives you all the knowledge you need to start developing a theme for your publication. In addition, if you would like to make yourself familiar with the official Handlebars docs and learn more about basic expressions, use these helpful resources:
在Ghost中已经为您完成了Handlebars的安装
Installation of Handlebars is already done for you in Ghost ✨
GScan
验证你的Ghost主题是有效地处理,使用GScan工具。GScan会检查你的主题是否有错误、不支持和兼容性问题。GScan有几种用途:
Validating your Ghost theme is handled efficiently with the GScan tool. GScan will check your theme for errors, deprecations and compatibility issues. GScan is used in several ways:
GScan站点是测试您正在构建的任何主题以获得完整验证报告的第一个调用端口 The GScan site is your first port of call to test any themes that you're building to get a full validation report
当一个主题是上传 Ghost 管理,它将自动检查与gscan和任何致命的错误将阻止使用的主题 When a theme is uploaded in Ghost admin, it will automatically be checked with
gscan
and any fatal errors will prevent the theme from being usedgscan
is also used as a command line tool
Command line
To use GScan as a command line tool, globally install the gscan
npm package:
# Install the npm package
npm install -g gscan
# Use gscan <file path> anywhere to run gscan against a folder
gscan /path/to/ghost/content/themes/casper
# Run gscan on a zip file
gscan -z /path/to/download/theme.zip
What's next?
That's all of the background context required to get started. From here you'll take a look at the structure of Ghost themes and templates, and learn everything you need to know about the package.json
file.
For community led support about theme development, visit the forum.
GHOST CMS - Ghost Handlebars主题 Ghost Handlebars Themes的更多相关文章
- GHOST CMS - 结构 Structure
Structure Ghost主题包含静态HTML模板,这些模板使用helper类从站点输出数据,并使用定制的CSS进行样式化 A Ghost theme contains static HTML t ...
- GHOST CMS - 创建自定义主页 Creating a custom home page
创建自定义主页 Creating a custom home page 为你的网站创建一个自定义的主页是一个让你从人群中脱颖而出的好方法,并把你自己独特的印记存放在你的网上.本教程向您展示了如何在Gh ...
- GHOST CMS - 配置 Config
Config For self-hosted Ghost users, a custom configuration file can be used to override Ghost's defa ...
- webpack引入handlebars报错'You must pass a string or Handlebars AST to Handlebars.compile'
背景: webpack作为一个部分替代打包工具和模块化工具的优秀选择出现,作为尝试,也为了构建自己习惯的前端开发方式,我尝试了将webpack和自己常用handlebars模板引擎结合.整体项目背景为 ...
- Handlebars的基本用法 Handlebars.js使用介绍 http://handlebarsjs.com/ Handlebars.js 模板引擎 javascript/jquery模板引擎——Handlebars初体验 handlebars.js 入门(1) 作为一名前端的你,必须掌握的模板引擎:Handlebars 前端数据模板handlebars与jquery整
Handlebars的基本用法 使用Handlebars,你可以轻松创建语义化模板,Mustache模板和Handlebars是兼容的,所以你可以将Mustache导入Handlebars以使用 Ha ...
- GHOST CMS - Package.json
Package.json The package.json file is a set of meta data about a theme. package.json 文件是一组关于主题的元数据. ...
- GHOST CMS -上下文概述 Context Overview
Context Overview上下文概述 Each page in a Ghost theme belongs to a context, which determines which templa ...
- [Orchard CMS系列] 创建主题(Writing a new theme)
本文需要对Orchard CMS有基本了解. 开启模块 code generation 创建新的主题工程骨架 Codegen theme MyTheme 创建主题样式 src\Orchard.Web\ ...
- 使用VS Code开发纸壳CMS自动编译主题压缩CSS,JS
Visual Studio Code (简称 VS Code / VSC) 是一款免费开源的现代化轻量级代码编辑器,支持语法高亮.智能代码补全.自定义热键.括号匹配.代码片段.代码对比 Diff.GI ...
随机推荐
- Linux -- 进程间通信几种方式的总结
管道 优点 管道文件不占磁盘空间,打开管道时在内存中分配空间: 管道读端会在读取完管道内数据后自动进入阻塞,直到写端再次写入数据: 缺点 管道是半双工的,数据只能从一个方向上流动: 管道大小 PIPE ...
- 源码分析— java读写锁ReentrantReadWriteLock
前言 今天看Jraft的时候发现了很多地方都用到了读写锁,所以心血来潮想要分析以下读写锁是怎么实现的. 先上一个doc里面的例子: class CachedData { Object data; vo ...
- Linux如何切换图形界面和命令行界面
在命令行,输入 init 3 命令,并按回车键执行,切换到命令行界面 切换到命令行界面后,在界面上只显示一个闪烁的光标,按下 Ctrl+Alt+F6(非虚拟机)或者 Alt+F6(虚拟机),显示用户登 ...
- js模块导入/导出大全
说明 module.exports与exports是CommonJS的规范 export与export default是es6规范 require 是 AMD规范引入方式 import是es6的一个语 ...
- PAT甲级专题|树的遍历
PAT甲级专题-树的遍历 涉及知识点:树.建树.深度优先搜索.广度优先搜索.递归 甲级PTA 1004 输出每一层的结点,邻接表vector建树后.用dfs.bfs都可以边搜边存当前层的数据, #in ...
- ThinkPHP5——模型关联(多对多关联)
关联定义 多对多关联不像一对一和一对多关联,它还要多建一个中间表用来处理多对多的关联,例如: #城市 create table city ( c_id int primary key AUTO_INC ...
- 【华为云实战开发】9.如何进行PHP项目的快速搭建并实现CICD?【华为云技术分享】
1 概述 1.1 文章目的 本文主要想为研发PHP项目的企业或个人提供上云指导,通过本文中的示例项目 “workerman-todpole”,为开发者提供包括项目管理,代码托管,代码检查,编译构建,测 ...
- 【HUAWEI Mate30】抽奖啦!华为IoT新福利上线!
华为云OceanConnect IoT云服务包括应用管理.设备管理.系统管理等能力,实现统一安全的网络接入.各种终端的灵活适配.海量数据的采集分析,从而实现新价值的创造. 华为云OceanConnec ...
- ZZ:SDNLAB技术分享(一):ODL的SFC入门和Demo
在网络通信过程中,包含各式各样的网络服务功能.既可以包含传统的像防火墙,NAT等功能,也有包含特定的网络应用功能(Service Function).将特定的网络应用功能有序地组合起来,接着让流量通过 ...
- 在Tinymce编辑器里,集成数学公式
在以前,需要在Web页面显示数学公式,常用的都是先制作成图片,然后插入到页面里.这使得后期对数学公式的修改变的麻烦,同时也不利于搜索引擎搜索. 本文将介绍如何在TinyMce编辑器里集成数学公式.先看 ...