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 used

  • gscan is also used as a command line tool

Command line

To use GScan as a command line tool, globally install the gscan npm package:

Terminal
# 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的更多相关文章

  1. GHOST CMS - 结构 Structure

    Structure Ghost主题包含静态HTML模板,这些模板使用helper类从站点输出数据,并使用定制的CSS进行样式化 A Ghost theme contains static HTML t ...

  2. GHOST CMS - 创建自定义主页 Creating a custom home page

    创建自定义主页 Creating a custom home page 为你的网站创建一个自定义的主页是一个让你从人群中脱颖而出的好方法,并把你自己独特的印记存放在你的网上.本教程向您展示了如何在Gh ...

  3. GHOST CMS - 配置 Config

    Config For self-hosted Ghost users, a custom configuration file can be used to override Ghost's defa ...

  4. webpack引入handlebars报错'You must pass a string or Handlebars AST to Handlebars.compile'

    背景: webpack作为一个部分替代打包工具和模块化工具的优秀选择出现,作为尝试,也为了构建自己习惯的前端开发方式,我尝试了将webpack和自己常用handlebars模板引擎结合.整体项目背景为 ...

  5. Handlebars的基本用法 Handlebars.js使用介绍 http://handlebarsjs.com/ Handlebars.js 模板引擎 javascript/jquery模板引擎——Handlebars初体验 handlebars.js 入门(1) 作为一名前端的你,必须掌握的模板引擎:Handlebars 前端数据模板handlebars与jquery整

    Handlebars的基本用法 使用Handlebars,你可以轻松创建语义化模板,Mustache模板和Handlebars是兼容的,所以你可以将Mustache导入Handlebars以使用 Ha ...

  6. GHOST CMS - Package.json

    Package.json The package.json file is a set of meta data about a theme. package.json 文件是一组关于主题的元数据. ...

  7. GHOST CMS -上下文概述 Context Overview

    Context Overview上下文概述 Each page in a Ghost theme belongs to a context, which determines which templa ...

  8. [Orchard CMS系列] 创建主题(Writing a new theme)

    本文需要对Orchard CMS有基本了解. 开启模块 code generation 创建新的主题工程骨架 Codegen theme MyTheme 创建主题样式 src\Orchard.Web\ ...

  9. 使用VS Code开发纸壳CMS自动编译主题压缩CSS,JS

    Visual Studio Code (简称 VS Code / VSC) 是一款免费开源的现代化轻量级代码编辑器,支持语法高亮.智能代码补全.自定义热键.括号匹配.代码片段.代码对比 Diff.GI ...

随机推荐

  1. 【Linux系列】Centos7安装Samba并将工作区挂载到win(八)

    目的 本文主要介绍以下两点: 一. 安装Samba 二. 挂载到window 演示 一. 安装Samba Samba是基于smb协议的,主要作用是实现跨平台文件传输. 安装 yum install - ...

  2. Jrebel 激活的方法

    jrebel  激活的方法: 试了很多都不好用,下面这个方法比较简单快捷.(不知道可以坚持多久) myjrebel 7月分官方正式停用,致使广大朋友无法使用jrebel/XRebel,可按如下地址进行 ...

  3. oracle表结构

    表管理 新建表 语法 create table 表名 ( 列名1 类型(长度), 列名2 类型(长度), 列名3 类型(长度) ); create table:关键字,建表 后跟新建表的表名,表名长度 ...

  4. cenos7搭建gitlab

    git.github和gitlab的区别 git:是一种版本控制系统,是一个命令,是一种工具 gitlib:是基于实现功能的开发库 github:是一个基于git实现的在线代码仓库软件 gitlib可 ...

  5. 7. 彤哥说netty系列之Java NIO核心组件之Selector

    --日拱一卒,不期而至! 你好,我是彤哥,本篇是netty系列的第七篇. 简介 上一章我们一起学习了Java NIO的核心组件Buffer,它通常跟Channel一起使用,但是它们在网络IO中又该如何 ...

  6. salesforce lightning零基础学习(十六) 公用组件之 获取字段label信息

    我们做的项目好多都是多语言的项目,针对不同国家需要展示不同的语言的标题.我们在classic中的VF page可谓是得心应手,因为系统中已经封装好了我们可以直接在VF获取label/api name等 ...

  7. AWS re:Invent 2019 召开 | 云原生生态周报 Vol. 30

    作者 | 何淋波.宋净超.徐迪 业界要闻 1. AWS re:Invent 2019 AWS 年度云计算盛会于 12.2-12.6 在拉斯维加斯举行. 技术分享超过 2500 场,技术方向涵盖数据分析 ...

  8. django初始化

    Django 版本 安装 pip安装 pip install django 安装最新版本的 pip install django==1.11.11 安装指定版本的 验证安装 直接去代码中调用djang ...

  9. Qt之高DPI显示器(一) - 解决方案整理

    目录 DPI发展 1.PPI 2.DPI 一.Win自适应系统 二.Qt机制 1.Windows系统DWM缩放 2. Qt适配高DPI 3.适配DPI结论 三.Qt适配 四.自己适配 1.窗口大小 2 ...

  10. 蓝牙5.0芯片NRF52810和NRF52832可进行mesh组网

    提供智能化mesh照明解决方案,在现有传统灯具的基础上,插入NRF52832/52810的照明Mesh模块,可以迅速升级现有的传统灯具,配合手机APP和服务器系统,使每一盏灯成为物联网的一个智能节点, ...