Поиск по этому блогу

среда, 16 марта 2016 г.

Знакомство с файлами в дистрибутиве Bootstrap закончилось установкой Jekyll под Windows

В итоге я поднял локальный сервер на 9001 порту и опробовал пачку статических html-страниц, изучил прибамбасы Jecyll ... и подумал: "А зачем современному сайту-визитке все эти пхп и сикьюлы...?"

Run Jekyll on Windows
bootstrap
Jekyll по своей сути это движок трансформации текста. Его концепция состоит в следующем: вы передаете текст написанный в выбранном вами формате Markdown (Markdown, Textile и т.д.) или в чистом HTML, а Jekyll форматирует его в соответствии с файлами шаблонов. В ходе этого процесса вы можете настроить как будут выглядеть URL вашего сайта, какие данные будут отражаться в макете и многое другое. Все это делается путем редакции текстовых файлов , финальным продуктом является статический сайт.
jekyllrb.comFree hosting with GitHub Pages Sick of dealing with hosting companies? GitHub Pages are powered by Jekyll, so you can easily deploy your site using GitHub for free—custom domain name and all.
Learn more about GitHub Pages Hosted directly from your GitHub repository. Just edit, push, and your changes are live

What is EditorConfig? EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.
_config.yml Jekyll allows you to concoct your sites in any way you can dream up, and it’s thanks to the powerful and flexible configuration options that this is possible. These options can either be specified in a _config.yml file placed in your site’s root directory, or can be specified as flags for the jekyll executable in the terminal.
hound.yml Hound comments on style violations in GitHub pull requests, allowing you and your team to better review and maintain a clean codebase.
.travis.ymlTest and Deploy with Confidence Easily sync your GitHub projects with Travis CI and you’ll be testing your code in minutes!
Travis CI provides a default build environment and a default set of steps for each programming language. You can customize any step in this process in .travis.yml.
composer.json Dependency Manager for PHP
package.js package metadata file for Meteor.js The JavaScript App Platform
Build apps that are a delight to use, faster than you ever thought possible
meteor deploy работает, только если вы используете облачное решение Galaxy (от 0.035 $ в час) или бесплатный хостинг на Meteor.com (который закрывается уже 25 марта).
nuget What is NuGet? NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.
Your RSS feed Do you have a blog made out of static pages? Do you want to add search to it? Look no further and let Tapir handle it! Enter your feed url and you'll get a token you can use with our API to easily get search on your blog.
Prose is a content editor for GitHub designed for managing websites.
Практическое руководство по Jekyll Основная особенность: используется на Github Pages, что позволяет держать исходники сайта в репозитории на Github — а несколько кэширующих серверов его в пределах 10 минут после коммитов будут собирать и отображать посетителям.

The docs may also be run locally !!!

Bootstrap's documentation, included in this repo in the root directory, is built with Jekyll and publicly hosted on GitHub Pages at http://getbootstrap.com. The docs may also be run locally.

Running documentation locally
1.If necessary, install Jekyll and other Ruby dependencies with bundle install . Note for Windows users: Read this unofficial guide to get Jekyll up and running without problems.
2.From the root /bootstrap directory, run bundle exec jekyll serve in the command line.
3.Open http://localhost:9001 in your browser, and voilà.

In [ ]:
C:\DevKit-mingw64-32>ruby dk.rb init
[INFO] found RubyInstaller v2.2.4 at C:/Ruby22

Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

C:\DevKit-mingw64-32>
In [ ]:
C:\DevKit-mingw64-32>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby22'
[INFO] Installing 'C:/Ruby22/lib/ruby/site_ruby/devkit.rb'

C:\DevKit-mingw64-32>
In [ ]:
C:\DevKit-mingw64-32>gem install jekyll
Fetching: colorator-0.1.gem (100%)
Successfully installed colorator-0.1
Fetching: sass-3.4.21.gem (100%)
Successfully installed sass-3.4.21
Fetching: jekyll-sass-converter-1.4.0.gem (100%)
Successfully installed jekyll-sass-converter-1.4.0
Fetching: rb-fsevent-0.9.7.gem (100%)
Successfully installed rb-fsevent-0.9.7
Fetching: ffi-1.9.10-x86-mingw32.gem (100%)
Successfully installed ffi-1.9.10-x86-mingw32
Fetching: rb-inotify-0.9.7.gem (100%)
Successfully installed rb-inotify-0.9.7
Fetching: listen-3.0.6.gem (100%)
Successfully installed listen-3.0.6
Fetching: jekyll-watch-1.3.1.gem (100%)
Successfully installed jekyll-watch-1.3.1
Fetching: kramdown-1.10.0.gem (100%)
Successfully installed kramdown-1.10.0
Fetching: liquid-3.0.6.gem (100%)
Successfully installed liquid-3.0.6
Fetching: mercenary-0.3.5.gem (100%)
Successfully installed mercenary-0.3.5
Fetching: rouge-1.10.1.gem (100%)
Successfully installed rouge-1.10.1
Fetching: safe_yaml-1.0.4.gem (100%)
Successfully installed safe_yaml-1.0.4
Fetching: jekyll-3.1.2.gem (100%)
Successfully installed jekyll-3.1.2
Parsing documentation for colorator-0.1
Installing ri documentation for colorator-0.1
Parsing documentation for sass-3.4.21
Installing ri documentation for sass-3.4.21
Parsing documentation for jekyll-sass-converter-1.4.0
Installing ri documentation for jekyll-sass-converter-1.4.0
Parsing documentation for rb-fsevent-0.9.7
Installing ri documentation for rb-fsevent-0.9.7
Parsing documentation for ffi-1.9.10-x86-mingw32
Installing ri documentation for ffi-1.9.10-x86-mingw32
Parsing documentation for rb-inotify-0.9.7
Installing ri documentation for rb-inotify-0.9.7
Parsing documentation for listen-3.0.6
Installing ri documentation for listen-3.0.6
Parsing documentation for jekyll-watch-1.3.1
Installing ri documentation for jekyll-watch-1.3.1
Parsing documentation for kramdown-1.10.0
Installing ri documentation for kramdown-1.10.0
Parsing documentation for liquid-3.0.6
Installing ri documentation for liquid-3.0.6
Parsing documentation for mercenary-0.3.5
Installing ri documentation for mercenary-0.3.5
Parsing documentation for rouge-1.10.1
Installing ri documentation for rouge-1.10.1
Parsing documentation for safe_yaml-1.0.4
Installing ri documentation for safe_yaml-1.0.4
Parsing documentation for jekyll-3.1.2
Installing ri documentation for jekyll-3.1.2
Done installing documentation for colorator, sass, jekyll-sass-converter, rb-fsevent, ffi, rb-inotify, l
isten, jekyll-watch, kramdown, liquid, mercenary, rouge, safe_yaml, jekyll after 48 seconds
14 gems installed

C:\DevKit-mingw64-32>

Summary

Tada! You have successfully installed Jekyll. In fact, you can already build and serve sites without errors, unless there are blocks of code in there and you want to use syntax highlighting. To find out how to properly set up one of two syntax highlighters, click on the button below.

If it’s not set already, add the following to your _config.yml to set Pygments as your syntax highlighter.

In [ ]:
highlighter: pygments
In [ ]:
C:\DevKit-mingw64-32>python -m pip install Pygments
Requirement already satisfied (use --upgrade to upgrade): Pygments in c:\users\alter_000\anaconda\lib\si
te-packages

C:\DevKit-mingw64-32>

Поскольку Питон уже был установлен, то я начал с pygments, но решил попробовать и rouge (что это за ruby)

In [ ]:
C:\DevKit-mingw64-32>gem install rouge
Successfully installed rouge-1.10.1
Parsing documentation for rouge-1.10.1
Done installing documentation for rouge after 8 seconds
1 gem installed

C:\DevKit-mingw64-32>

Ну, и не забыть про изменения в _config.yml

In [ ]:
C:\DevKit-mingw64-32>gem install wdm
Fetching: wdm-0.1.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed wdm-0.1.1
Parsing documentation for wdm-0.1.1
Installing ri documentation for wdm-0.1.1
Done installing documentation for wdm after 1 seconds
1 gem installed

C:\DevKit-mingw64-32>
In [ ]:
highlighter: rouge

Запускаем сервер и осчастливливаемся

В бутсрапе уже есть готовый файл _config.yml ... но сначала запустим сервер и откроем 127.0.0.1:9001 ... и посмотрим, что получается.

In [ ]:
F:\stradorusite\bootstrap\bootstrap-3.3.6  (bootstrap@3.3.6)
λ jekyll serve
Configuration file: F:/stradorusite/bootstrap/bootstrap-3.3.6/_config.yml
            Source: docs
       Destination: _gh_pages
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 20.483 seconds.
 Auto-regeneration: enabled for 'docs'
Configuration file: F:/stradorusite/bootstrap/bootstrap-3.3.6/_config.yml
    Server address: http://0.0.0.0:9001/
  Server running... press ctrl-c to stop.

Вот он, готовый _config.yml из bootstrap

In [ ]:
# Dependencies
markdown:         kramdown
highlighter:      rouge

# Permalinks
permalink:        pretty

# Server
source:           docs
destination:      _gh_pages
host:             0.0.0.0
port:             9001
url:              http://getbootstrap.com
encoding:         UTF-8

# Custom vars
current_version:  3.3.6
repo:             https://github.com/twbs/bootstrap
sass_repo:        https://github.com/twbs/bootstrap-sass

download:
  source:         https://github.com/twbs/bootstrap/archive/v3.3.6.zip
  dist:           https://github.com/twbs/bootstrap/releases/download/v3.3.6/bootstrap-3.3.6-dist.zip
  sass:           https://github.com/twbs/bootstrap-sass/archive/v3.3.6.tar.gz

blog:             http://blog.getbootstrap.com
expo:             http://expo.getbootstrap.com

cdn:
  # See https://www.srihash.org for info on how to generate the hashes
  css:            https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
  css_hash:       "sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ=="
  css_theme:      https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css
  css_theme_hash: "sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX"
  js:             https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
  js_hash:        "sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ=="

Below is an example .editorconfig file setting end-of-line and indentation styles for Python and JavaScript files.

In [ ]:
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

Transform your plain text into static websites and blogs.

Ruby я уже установил, так что надо попробовать этот генератор статических сайтов

In [ ]:
C:\Users\alter_000>gem
RubyGems is a sophisticated package manager for Ruby.  This is a
basic help message containing pointers to more information.

  Usage:
    gem -h/--help
    gem -v/--version
    gem command [arguments...] [options...]

  Examples:
    gem install rake
    gem list --local
    gem build package.gemspec
    gem help install

  Further help:
    gem help commands            list all 'gem' commands
    gem help examples            show some examples of usage
    gem help gem_dependencies    gem dependencies file guide
    gem help platforms           gem platforms guide
    gem help <COMMAND>           show help on COMMAND
                                   (e.g. 'gem help install')
    gem server                   present a web page at
                                 http://localhost:8808/
                                 with info about installed gems
  Further information:
    http://guides.rubygems.org

C:\Users\alter_000>


Посты чуть ниже также могут вас заинтересовать

Комментариев нет: