A free and open-source Jekyll theme. Great for blogs and easy to customize.
git clone https://github.com/rohanchandra/type-theme
gem install jekyll
bundle install
jekyll serve
Open _config.yml
in a text editor to change most of the blog's settings.
If a variable in this document is marked as "optional", disable the feature by removing all text from the variable. For example, to prevent the avatar from rendering in the header, the avatar line should read:
theme:
title: Type Theme
avatar:
gravatar:
Notice the avatar variable is left intentionally blank.
Below is a summary of the configuration options in Type Theme.
The most common configurations, included here for guidance, are:
Jekyll website without a subpath (such as a GitHub Pages website for a given username):
# SITE CONFIGURATION
baseurl: ""
url: "https://username.github.io"
Jekyll website with subpath (like the Type Theme demo page):
# SITE CONFIGURATION
baseurl: "/sub-directory"
url: "https://username.github.io/"
Please configure this in _config.yml
before using the theme.
Meta variables hold basic information about your Jekyll site which will be used throughout the site and as meta properties for search engines, browsers, and the site's RSS feed.
Change these variables in _config.yml
:
Variable | Example | Description | Optional |
---|---|---|---|
title | My Jekyll Blog | Name of website | Yes |
avatar | assets/img/avatar.png | Path of avatar image, to be displayed in the theme's header | Yes |
gravatar | f9879d71855b5ff21e4963273a886bfc | MD5 hash of your email address to load your Gravatar in the theme's header | Yes |
description | My blog posts | Short description, primarily used by search engines | Yes |
Change these variables in _config.yml
:
Variable | Example | Description | Optional |
---|---|---|---|
header_text | Welcome to my Jekyll blog | HTML (shown below the navigation) with a background colour for emphasis | Yes |
header_text_feature_image | assets/img/sample_feature_img_3.png | Background image for the header text | Yes |
footer_text | Copyright 2014 | HTML (shown at end of the site) with lighter text | Yes |
Add your username on selected websites in the icon section of the _config.yml
file to display the site's icon from Font Awesome in the header navigation. All icon variables should be your username enclosed in quotes (e.g. "username"), except for the following variables:
Variable | Example | Description | Optional |
---|---|---|---|
rss | true | Takes boolean value (true/false) to show RSS feed icon | Yes |
email_address | type@example.com | Email address | Yes |
https://www.linkedin.com/in/FirstLast | Full URL to profile on LinkedIn | Yes | |
stack_exchange | https://stackoverflow.com/users/0000/first-last | Full URL to profile on Stack Exchange | Yes |
Change these variables in _config.yml
:
Variable | Example | Description | Optional |
---|---|---|---|
google_analytics | UA-123456-01 | Google Analytics tracking ID | Yes |
disqus_shortname | shortname | Disqus shortname | Yes |
katex | true | Takes boolean value (true/false) to conditionally load KaTeX scripts required for math typesetting | Yes |
Scripts listed here are only loaded if you provide a value in the _config.yml
file.
Change localization string variables in _config.yml
.
English text used in the theme (such as the "continue reading" label) has been grouped so you can quickly translate the theme or change labels to suit your needs.
Variable | Example | Description | Optional |
---|---|---|---|
google_fonts | "Playfair+Display:400,700\ | PT+Sans:400,700,700italic,400italic" | Google Fonts to load for use |
Navigate to the _sass > base
directory and open _variables.scss
to change colours, typography and padding used in the theme with CSS.
Once you have loaded a Google Font in config.yml
, you can integrate the fonts into your CSS by changing the font-family in _variables.scss
. For example, after loading the Playfair Display and PT Sans fonts from Google:
// Typography
$font-family-main: 'PT Sans', Helvetica, Arial, sans-serif;
$font-family-headings: 'Playfair Display', Helvetica, Arial, sans-serif;
Mozilla's ColorPicker is a helpful tool to get your preferred colours in hexadecimal or RGBA form for use in _variables.scss
.
If you're using Type Theme as a remote_theme
, you can override variables and styles.To do so, simply create a assets/css/main.scss
file on your website with the following content:
// assets/css/main.scss
---
---
@import "type-theme";
@import "type-theme";
includes the theme styles, so you can add custom imports before and after it, depending on your needs.Best practice is to put your custom files in the _sass
folder of your project. Jekyll will automatically look for them there.For example, say you wanted to override some theme variables and add some custom styles, you can create the following files:
// _sass/_variables.scss
$background-color: black;
// _sass/_custom.sass
// SASS is supported as well, just note the file extension is .sass
.feature-image header
height: 300px
Then import them both into main.scss
:
// assets/css/main.scss
---
---
@import "variables";
@import "type-theme";
@import "custom";
Please refer to the Jekyll docs for writing posts. Non-standard features are documented below.
Wrap math expressions with $$
signs in your posts and make sure you have set the katex
variable in _config.yml
to true
for math typesetting.
For inline math typesetting, type your math expression on the same line as your content. For example:
Type math within a sentence $$2x^2 + x + c$$ to display inline
For display math typesetting, type your math expression on a new line. For example:
$$
\bar{y} = {1 \over n} \sum_{i = 1}^{n}y_i
$$
Type Theme makes use for KaTeX for typesetting.
Add a feature image by specifying a path to an image in the front matter in the form of feature-img: "img/PATH_TO_IMAGE.png"
.
For example:
---
layout: post
title: Hello World
feature-img: "assets/img/sample_feature_img.png"
---
By default, the page title is displayed on top of the feature image, as well as on the browser's tab. You can change the feature image's displayed title by specifying a feature-title
in the front matter:
---
layout: post
title: Short title
feature-title: A much longer title
feature-img: "assets/img/sample_feature_img.png"
---
In the front matter of a page, add hide: true
to prevent the page from showing up in the header's navigation bar (visitors can still visit the URL through other means).
For example:
---
layout: page
title: "Error 404: Page not found"
permalink: /404.html
hide: true
---
You can configure this theme to sort your pages in the header's navigation bar.
site_navigation_sort
in theme settings to a property name e.g. 'order'
order: n
For example:
---
layout: page
title: Team
permalink: /team/
order: 4
---
Post tags should be placed between []
in your post metadata. Separate each tag with a comma.
For example:
---
layout: post
title: Markdown and HTML
tags: [sample, markdown, html]
---
A tags listing will be automatically generated using the tags.html
file provided in Type Theme. If you're not using the tags feature it is safe to delete tags.html
.
The search feature can be activated in the _config.yml
file by changing its value from false
to true
.
#Scripts
search: true
Once activated, the search bar will appear in the header. This feature uses Lunr and searches through the title, tags and content of your posts.
A subtitle can be displayed below your title on permalink post pages.
To enable this feature, add subtitle
to your post metadata.
For example:
---
layout: post
title: "This is a title"
subtitle: "This is a subtitle"
---
安装 npm install -D antd-theme-webpack-plugin 关键源码 构造器选项: const defaulOptions = { varFile: path.join(__dirname, "../../src/styles/variables.less"), antDir: path.join(__dirname, "../../node_modules/a
公司的项目是基于ant design开发的,年前初步完成了整个系统的动态主题切换,主要是利用了antd-theme-generator这个插件,使用 less 的 modifyVars 来更改主题。 这里要先交待一下我的依赖版本,ant design是3.19.1,antd-theme-generator是1.2.6,如果你的项目用的是ant design 4.x版本,可以直接安装最新的antd-
public/index.html <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="time" content="<%= htmlWebpackPlugin.options.createDate %>"> <!-- 关闭de
我正在开发Angular 4应用,我想应用一些全局样式。在有关角度站点的教程之后,我在应用程序的根目录中创建了一个“ styles.css”文件,并在我的应用程序的index.html中引用了该样式表: angular应用已成功编译: $ ng serve ** NG Live Development Server is listening on localhost:4200, open your
介绍 项目地址:vuepress-theme-reform 效果展示: 我的博客 此主题继承至vuepress的默认主题,添加功能有标签页改造,主页改造,博客分类及展示,gitalk集成及gitalk自动化配置,最新google Analytics集成等。 使用 npm install vuepress-theme-reform -D # or yarn add vuepress-theme-re
TYPE key 返回 key 所储存的值的类型。 可用版本: >= 1.0.0 时间复杂度: O(1) 返回值: none (key不存在) string (字符串) list (列表) set (集合) zset (有序集) hash (哈希表) # 字符串 redis> SET weather "sunny" OK redis> TYPE weather string # 列表 r
描述: 记录一个对象的类型。 语法 @type {typeName} 概述 @type标签允许你提供一个表达式,用于标识一个标识符可能包含的值的类型,或由函数返回值的类型。您还可以将其包含与其他JSDoc标签类型的表达式结合使用,如@param 标签。 类型表达式可以包括标识符的namepath(例如,myNamespace.MyClass);一个内置的JavaScript类型(例如,string
Type: Minimal and Clean Free Jekyll Theme Configurations Deployment Posts Pages Navigation Disqus Comments Social Media Links Update favicon Configurations Type theme comes with different customizatio
深入的语言特性 本文所讲的是一个高阶主题,能帮你更好地理解一些边缘情况。 这仅是锦上添花。许多经验丰富的的开发者不甚了了也过得不错。如果你想了解代码运行的本质,那就继续读下去吧。 一个动态执行的方法调用可能会丢失 this。 例如: let user = { name: "John", hi() { alert(this.name); }, bye() { alert("Bye");
TYPE key 返回 key 所储存的值的类型。 可用版本: >= 1.0.0 时间复杂度: O(1) 返回值: none (key不存在)string (字符串)list (列表)set (集合)zset (有序集)hash (哈希表) # 字符串 redis> SET weather "sunny" OK redis> TYPE weather string # 列表 redis>
描述 (Description) java.lang.reflect.Method.getGenericReturnType()方法返回一个Type对象,该对象表示此Method对象表示的方法的正式返回类型。 声明 (Declaration) 以下是java.lang.reflect.Method.getGenericReturnType()方法的声明。 public Type getGeneri