20
Jekyll linuxihaa.ir /dʒɛkəl/ or /dʒiːkəl/ Misam Saki SFD 1395

Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Jekyll

linuxihaa.ir

/dʒɛkəl/ or /dʒiːkəl/

Misam Saki

SFD 1395

Page 2: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Dynamic site generator

Code (Ex. PHP, ASP)CMS (Ex. Wordpress, Joomla)Theme & PluginDatabase (Ex. MySQL, SQL Server)Compile by the request

+ Support other services (Ex. Comments)

Static site generator

Code (Ex. Ruby)Framework (Ex. Jekyll)Theme & PluginContent (Ex. Markdown)Compile to HTML & Store

+ Any web server+ Fast+ No security vulnerabilities

? Discus, Facebook comments …

2

Dynamic/Static

Page 3: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Place your screenshot here

3

StaticGenwww.staticgen.com

Page 4: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

A simple, blog-aware, static site generator

4

Page 5: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Install

Install ruby

gem install jekyll

New Site

jekyll new linuxihaa

cd linuxihaa

jekyll serve

New Site

5

Page 6: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Place your screenshot here

6

New Site (2)http://localhost:4000

Page 7: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

index.html

_config.yml (title, url, …)

_layouts/ (Ex. default.hmtl, post.html)

_post/ (Ex. 2016-09-25-hello-world.md)

_includes/ (Ex. head.hml, footer.html)

_plugins (.rb)

_data (YAML, JSON, CSV)

_sass (.scss)

_drafts (.md)

css, js,img, …

Structure

Ruby + Liquid + YAML

7

Page 8: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

_site

Structure (2)

8

Page 9: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

---

layout: post

title: Hello World

date: 2016-09-25 20:42:18

categories: news

tags:

- test

- other

---

CONTENT

Post

9

Page 10: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

# Site settings

title: Linuxihaa

email: [email protected]

description: > # this means to ignore newlines until

Write an awesome description…

baseurl: /blog

url: http://linuxihaa.ir

twitter_username: linuxihaa

github_username: linuxihaa

# Build settings

markdown: kramdown

config

10

Page 11: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

#H1 or ======

##H2 or ------

###H3

**bold** or __bold__

*italic* or _italic_

~~scratch~~

1. First ordered list item

2. Another item

Markdown

11

* Unordered list item

* Another item

[Linuxihaa](http://linuxihaa.ir)

![alt text][image]

Page 12: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

`code`

```sh

gem install jekyll

```

> Blockquotes

Markdown (2)

12

Lines: ---, ***, ___

| Personal ID | Name | Family |

| :---------: | :--- | -----: |

| Centered |Right | Left|

Page 13: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

13

Themes

Page 14: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

default.html

<!DOCTYPE html>

<html>

{% include head.html %}

<body>

{% include header.html %}

<div class="page-content">

<div class="wrapper">

{{ content }}

</div>

</div>

{% include footer.html %}

</body>

</html>

Liquid Templates

14

Page 15: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Filters

{{ 'uppercase'| upcase }}

Loops

{% for post in posts %}

{{ post.title }}

{% endfor %}

Liquid Templates (2)

15

Conditionals

{% if variable_name %}

variable_name exists

{% else %}

variable_name doesn't exist

{% endif %}

Page 16: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Plugin

▸ LESS / SASS

▸ CoffeeScript

▸Minification

▸ Emoticons

▸ Youtube / Tweet embedding

▸ Flicker galleries

▸…

16

Page 17: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

17

Github Pages

New repo: username.github.io

http://username.github.io

New branch: gh-pages

http://username.github.io/repo

Page 18: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Place your screenshot here

18

Linuxihaalinuxihaa/linuxihaa.github.io

@linuxiha 8K

@linuxiha 2K

Page 19: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

Referenceshttps://jekyllrb.comhttps://en.wikipedia.org/wiki/Jekyll_(software)http://velocitylabs.io/blog/2011/12/20/presentation-jekyll-static-site-generator/http://ericlathrop.com/2013/05/introduction-to-blogging-with-jekyll/https://scotch.io/tutorials/getting-started-with-jekyll-plus-a-free-bootstrap-3-starter-themehttps://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

19

Page 20: Jekyll - sfd.fsug.irCMS (Ex. Wordpress, Joomla) Theme & Plugin Database (Ex. MySQL, SQL Server) Compile by the request + Support other services (Ex. Comments) Static site generator

20

THANKS!Any questions?

You can find me at

▸ @misamplus

[email protected]