jasonbrooks / centos / centos.org

Forked from centos/centos.org 4 years ago
Clone

Blame _site/README.md

545090
545090
# a test converion of this site to jekyll
545090
545090
## test it in a container
545090
545090
```
545090
sudo podman run -d --name centos-jekyll -p 4000:4000 -v $(pwd):/srv/jekyll:Z jekyll/jekyll jekyll serve --watch
545090
```
545090
545090
## todo
545090
545090
* Need to figure out `media.erb`. 
545090
* Also, the layout is html, the jekyll-haml gem is handling haml conversion for a few haml-based pages, like the download page, but it wasn't working right for the layouts. I don't know if that's a problem.
545090
545090
545090
***
545090
545090
545090
545090
The site is built with *nanoc* and *Bootstrap 3*.
545090
545090
  * http://www.nanoc.ws
545090
  * http://getbootstrap.com
545090
545090
We use haml for templates where it makes sense and mostly markdown for
545090
content.
545090
545090
545090
Required Gems:
545090
545090
  * nanoc
545090
  * cri
545090
  * compass
545090
  * haml
545090
  * nokogiri // available from Fedora (EPEL?) repository
545090
  * kramdown 
545090
  * pry
545090
  * rainpress
545090
  * rubypants
545090
  * sass
545090
  * susy
545090
  * systemu
545090
  * asciidoc // also requires the asciidoc package
545090
  * adsf // if using 'nanoc view' command
545090
545090
May be in RPM:
545090
545090
  * ruby
545090
  * asciidoc
545090
  * nokogiri
545090
545090
## Installing on CentOS 7 as well as F19/20/21:
545090
545090
545090
sudo yum install ruby asciidoc rubygem-bundler make gcc ruby-devel zlib-devel zlib gcc-c++
545090
bundle install
545090
545090
545090
545090
## Using a built container (all platforms):
545090
Assuming that you have this git repository cloned under /opt/data/git/centos.org : 
545090
```
545090
sudo docker pull registry.centos.org/arrfab/nanoc:latest # Download the container
545090
sudo docker run --rm -v /opt/data/git/centos.org/:/nanoc/:Z registry.centos.org/arrfab/nanoc:latest
545090
```
545090
Please note that it also works with Podman, so no need to install Docker anymore ! :
545090
545090
```
545090
sudo yum install -y podman
545090
sudo podman run --rm -v /opt/data/git/centos.org/:/nanoc/:Z registry.centos.org/arrfab/nanoc:latest
545090
```
545090
545090
545090
#Site Layout
545090
  * Template and menu files live in /layouts
545090
  * Markdown, erb and processed text files live in /content
545090
  * Static site content such as images and javascript live in /static
545090
  * The /lib directory contains nanoc helper files used to process the site
545090
  * Compiled site content exists in /output
545090
545090
#Building the site
545090
  * Run 'nanoc' to compile assemble the static site. files from /static, /content, and /layouts will be combined.
545090
  * You may view the site with 'nanoc view' and then pointing your browser at http://127.0.0.1:3000
545090
545090
You may compile and view the site live as you make changes using the guard module. To do this, run 'guard init' at the root of the site. 
545090
This will create a watch file that will serve as list for what files the guard module will keep an eye on. Changes to these files will trigger an automatic rebuild of the site.
545090
Next run 'nanoc view &', followed by 'guard'
545090
Now in another terminal, you may make changes to the website content, and it will rebuild as you touch files. 
545090
545090
545090
#Deploying the site
545090
Simply run 'nanoc deploy --target=' where the target value is either prod1 or prod2. These targets are defined in the nanoc.yaml file.