From 4920cc4c56d412372f43fbc0e6c2955d3967f4bd Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 16 Mar 2022 23:43:31 +0100 Subject: Add content to README.md --- README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d83c326..728d347 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,70 @@ hyde - Static website generator -=============================== \ No newline at end of file +=============================== + +Introduction +------------ + +Hyde is a simple tool to generate static websites. Its strength lies in its ease of use. The wheel is not invented +again; hyde is written in Ruby and uses ERB templates. +Hyde works with a master page that defines a layout and multiple files are used as content. In this way is possible +to split down UI and content. + +Guide +----- + +Let's create a website with only two pages. First, let's create a `master.rhtml` file used as template. +``` + + + <%= @title %> + + +
+ <%= render @pageFileName %> +
+ + +``` +There are two variables: + +- `@title` is the page's title, it's defined inside config file; +- `@pageFileName` is the file name to render, in this example will be rendered `page1.rhtml` and `page2.rhtml`. + +`page1.rhtml`: +``` +

Page one

+

Content of page one.

+Page 2 &‍gt; +``` +`page2.rhtml` +``` +

Page two

+

Content of page 2.

+&‍lt; Page 1 +``` + +`page1.rhtml.config`: +``` +title: Page 1 +``` + +`page2.rhtml.config`: +``` +title: Page 2 +``` + +After creating the files, you'll see this: +``` +$ ls -1 +master.rhtml +page1.rhtml +page1.rhtml.config +page2.rhtml +page2.rhtml.config +``` +At this point, let's execute the following commands: +``` +hyde -f page1.rhtml > page1.html +hyde -f page2.rhtml > page2.html +``` +Open the two HTML files (page1.html and page2.html) on your browser. -- cgit v1.2.3