yuzu 0.2.1.pre → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,15 @@
1
1
  # ChangeLog
2
2
 
3
+ 2013-02-12 William Martin <william.martin@anomalus.com>
4
+
5
+ The initial release of the gem was faulted and failed critically. This change includes many fixes and additions to the project creation mechanism.
6
+
7
+ * Version bump to 0.2.1.pre
8
+ * Improved sample project handling
9
+ * Resolved missing requires
10
+ * Bug fixes
11
+
12
+
3
13
  2013-02-09 William Martin <william.martin@anomalus.com>
4
14
 
5
15
  Major refactoring work to update the project. It's a shame that I didn't keep this change under more fine-grained source control, but it was such a drastic re-architecting that it seemed ok to get the infrastructure in place then add features and bugfixes later.
data/README.md CHANGED
@@ -2,6 +2,18 @@ Yuzu is a blog-aware, static-website generator and publisher that builds an HTML
2
2
 
3
3
  For an example of a site rendered with Yuzu, see [Spatial Pixel](http://spatialpixel.com).
4
4
 
5
+
6
+ ## Quick Start (Mac)
7
+
8
+ 1. `mkdir ~/Documents/yuzu-project`
9
+ 2. `cd ~/Documents/yuzu-project`
10
+ 3. `yuzu create`
11
+ 4. `yuzu preview`
12
+ 5. Go go file:///Users/username/Sites/yuzu-project/index.html
13
+
14
+ For Linux, change `/Users` to `/home`
15
+
16
+
5
17
  ## Current Features
6
18
 
7
19
  * Website generation from a folder of text files (Markdown, plain text, HAML, and more) with minimal additional configuration.
@@ -11,8 +23,8 @@ For an example of a site rendered with Yuzu, see [Spatial Pixel](http://spatialp
11
23
  * Catalogs: A list of files can be gathered, rendered, and paginated on any page.
12
24
  * Widget-like components like photo galleries and breadcrumbs.
13
25
  * Uses Compass and Less for SASS (or SCSS) to CSS.
14
- * A blog folder for more blog-like content, supporting categories, recent posts, RSS feeds.
15
- * Automatic index.html file generation for folders.
26
+ * A blog folder for periodical content, supporting categories, recent posts, RSS feeds.
27
+ * Automatic index.html file generation for folders containing a rendered catalog of the folder's contents.
16
28
  * On Mac: image thumbnail generation.
17
29
 
18
30
 
@@ -32,11 +44,11 @@ Yuzu first came about from the need to publish lecture material for online cours
32
44
 
33
45
  ## Sample Workflow (Mac)
34
46
 
35
- 1. Edit your Markdown content files
47
+ 1. Edit your Markdown content files in your favorite text editor
36
48
  2. Open a terminal
37
- 3. `cd ~/Documents/yuzu-projects/project-folder`
49
+ 3. `cd ~/Documents/yuzu-project`
38
50
  4. `yuzu preview`
39
- 5. View in a web browser: `http://localhost/~username/project-folder`
51
+ 5. View in a web browser (with Web Sharing enabled): `http://localhost/~username/project-folder`
40
52
  6. Publish to the web: `yuzu publish`
41
53
 
42
54
 
@@ -15,6 +15,12 @@ Using yuzu requires some familiarity with using a terminal application. On a Mac
15
15
 
16
16
  yuzu create
17
17
 
18
+ 5. Render the site
19
+
20
+ yuzu preview
21
+
22
+ This last step renders the site and copies it to the default location, which in this case would be `~/Sites/my-yuzu-project`. To change this location, edit `config/yuzu.yml`.
23
+
18
24
 
19
25
  ## Edit yuzu.yml
20
26
 
@@ -37,6 +37,7 @@ module Uploader
37
37
 
38
38
  def copy_contents_to_file_system(remote_path, contents, binary=true)
39
39
  destination = Path.new(@config.destination) + remote_path.relative
40
+
40
41
  if @config.verbose?
41
42
  $stderr.puts %Q{Copying #{GREEN}#{remote_path}#{ENDC} to the file system
42
43
  --> #{destination}}
@@ -48,8 +49,8 @@ module Uploader
48
49
  f = File.open(destination.absolute, "w+")
49
50
 
50
51
  rescue => detail
51
- $stderr.puts detail.message
52
- $stderr.puts "Attempting to create the path."
52
+ $stderr.puts detail.message if @config.verbose?
53
+ $stderr.puts "Attempting to create the path." if @config.verbose?
53
54
 
54
55
  # Assume the directories leading to the file don't exist. Create them.
55
56
  FileUtils::mkdir_p(destination.dirname)
@@ -83,6 +83,7 @@ module Yuzu::Content
83
83
 
84
84
  config_contents.gsub!("HOME", user_home_folder)
85
85
  config_contents.gsub!("USERNAME", username)
86
+ config_contents.gsub!("PROJECTFOLDER", SampleProject.project_folder_name)
86
87
 
87
88
  File.open(destination_config, "w") do |config|
88
89
  config.puts(config_contents)
@@ -122,6 +123,10 @@ module Yuzu::Content
122
123
  Dir.pwd
123
124
  end
124
125
 
126
+ def self.project_folder_name
127
+ File.basename(destination_folder)
128
+ end
129
+
125
130
  def self.exists?(sample_project_name)
126
131
  registered_projects.has_key?(sample_project_name)
127
132
  end
@@ -109,7 +109,7 @@ module Yuzu::Core
109
109
  end
110
110
 
111
111
  def get_link_url
112
- folder? ? currentpath.full : (currentpath + output_filename).full
112
+ folder? ? (currentpath + "index.html") : (currentpath + output_filename).full
113
113
  end
114
114
 
115
115
  def remote_path
@@ -69,7 +69,11 @@ module Yuzu::Generators
69
69
 
70
70
  def get_raw_contents
71
71
  # Only becomes @raw_contents if it is still nil when raw_contents is first called.
72
- Yuzu::Generators.default_index_template(@path.dirname)
72
+ if @parent.is_blog?
73
+ Yuzu::Generators.default_blog_index_template(@parent.path.relative)
74
+ else
75
+ Yuzu::Generators.default_index_template(@parent.path.relative)
76
+ end
73
77
  end
74
78
 
75
79
  def created_at
@@ -97,6 +101,13 @@ INSERTCATALOG(path:#{relative_contents_path}, page:1, per_page:10, per_col:1, te
97
101
  end
98
102
  module_function :default_index_template
99
103
 
104
+ def default_blog_index_template(relative_contents_path)
105
+ "TEMPLATE(blog.haml)
106
+
107
+ INSERTCATALOG(path:#{relative_contents_path}, page:1, per_page:10, per_col:1, template:_blog.haml)"
108
+ end
109
+ module_function :default_blog_index_template
110
+
100
111
  def category_index_template(relative_contents_path, category_name)
101
112
  "TEMPLATE(blog.haml)
102
113
 
@@ -4,7 +4,7 @@ module Yuzu
4
4
  MAJOR = 0
5
5
  MINOR = 2
6
6
  PATCH = 1
7
- BUILD = "pre"
7
+ BUILD = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
10
10
  end
@@ -43,8 +43,10 @@ services:
43
43
  #
44
44
  # e.g. yuzu preview:all
45
45
  preview:
46
- destination: HOME/Sites/yuzu-preview
47
- link_root: file://HOME/Sites/yuzu-preview
46
+ # The folder into which the rendered site will be copied.
47
+ destination: HOME/Sites/PROJECTFOLDER
48
+ # The value LINKROOT and linkroot become in content and HAML templates, respectively.
49
+ link_root: file://HOME/Sites/PROJECTFOLDER
48
50
 
49
51
  # The stage is used to produce a copy of the actual site on the file system
50
52
  # for manual FTP-ing to a web server. This gives you the opportunity to get
@@ -1,6 +1,15 @@
1
1
  # About Yuzu
2
2
 
3
- Yuzu is a blog-aware, static-website generator and publisher that builds an HTML5 website from a folder of text files and images.
3
+ Yuzu is a blog-aware, extensible, static-website generator and publisher that builds an HTML5 website from a folder of text files and images.
4
4
 
5
- This is one of the sample websites that comes with Yuzu.
5
+ This is one of the sample websites that comes with Yuzu. If you're new to using Yuzu, I recommend that you browse this site in parallel with the site's source. Although Yuzu behaves like many other static website generators, it has some unique features that are revealed in the docs and this site.
6
6
 
7
+
8
+ ## Development
9
+
10
+ Yuzu is under development, so naturally some features may not work the way they're intended. If you find a bug, have an idea for a feature, or would like to contribute to development, please get in touch with me at the project's [Github page](http://github.com/awmartin/yuzu).
11
+
12
+
13
+ ## Getting Started
14
+
15
+ See the post on [Getting Started](LINKROOT/getting-started.html) for instructions on creating a Yuzu project.
@@ -6,8 +6,12 @@ Notice how the post is dated February 11, 2013. This is set by using the `DATE`
6
6
 
7
7
  Here we will insert some contents from a different file:
8
8
 
9
+ ---
10
+
9
11
  INSERTCONTENTS(_snippets/about_insert_contents.md)
10
12
 
13
+ ---
14
+
11
15
  If you look at the source, the directive is indented. I only do this because Markdown highlighters treat underscores as markup to italicize text. Indenting treats it as code with no markup applied.
12
16
 
13
17
  SIDEBAR{
@@ -0,0 +1,6 @@
1
+ # Autogenerated index.html files
2
+
3
+ CATEGORY(features)
4
+
5
+ You'll notice that the blog folder doesn't have an `index.md` file. That's Yuzu creates one automatically for all folders without a file named `index`. This consists of a single `INSERTCATALOG` directive that grabs all the content files in the folder and renders then with the `_block.haml` folder by default.
6
+
@@ -8,7 +8,20 @@ If you're reading this, you've successfully created your yuzu project, and you'r
8
8
  The front page is `index.md`, found in the folder you ran `yuzu create` in. If you look in it, you'll see a directive called `INSERTCATALOG`. Directives such as these are the mechanism that enables you to give Yuzu various instructions or information to aid in rendering your site.
9
9
 
10
10
 
11
+ ## Creating Your First Yuzu Project
12
+
13
+ The fastest way to get started is to generate the sample project. Create a folder first and `cd` into it.
14
+
15
+ 1. `mkdir ~/Documents/yuzu-sample`
16
+ 2. `cd ~/Documents/yuzu-sample`
17
+ 3. `yuzu create`
18
+ 4. `yuzu preview`
19
+
20
+ Then point your browser to `file:///your/home/folder/Sites/yuzu-sample/index.html`.
21
+
22
+
11
23
  ## Configuration
12
24
 
13
- You shoud edit `config/yuzu.yml` to update the path found under `preview` called `destination`. If you're on a Mac, simply run change `username` to your username.
25
+ You should edit `config/yuzu.yml` to update the path found under `preview` called `destination`. If you're on a Mac, simply run change `username` to your username.
14
26
 
27
+ If you have an local Apache server running, or a Mac with Web Sharing enabled, you can reset the `services: preview: link_root:` flag in `yuzu.yml` to the project folder's url. e.g. `http://localhost/~yourusername/yuzu-sample`
@@ -77,5 +77,13 @@ blockquote
77
77
 
78
78
  // Other
79
79
  hr
80
- display: none
80
+ clear: both
81
+ height: 0px
82
+ outline: none
83
+ border-top: 1px solid lightgray
84
+ border-left: none
85
+ border-right: none
86
+ border-bottom: none
87
+ margin: 1em 0
88
+
81
89
 
@@ -1,2 +1,2 @@
1
1
  %p= config.site_name
2
- %p by William Martin
2
+ %p Generated with [Yuzu](http://github.com/awmartin/yuzu), by [William Martin](http://spatialpixel.com)
@@ -129,5 +129,12 @@ blockquote {
129
129
 
130
130
  /* line 79, ../_sass/screen.sass */
131
131
  hr {
132
- display: none;
132
+ clear: both;
133
+ height: 0px;
134
+ outline: none;
135
+ border-top: 1px solid lightgray;
136
+ border-left: none;
137
+ border-right: none;
138
+ border-bottom: none;
139
+ margin: 1em 0;
133
140
  }
@@ -5,9 +5,9 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{yuzu}
8
- s.version = "0.2.1.pre"
8
+ s.version = "0.2.1"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["William Martin"]
12
12
  s.date = %q{2013-02-12}
13
13
  s.default_executable = %q{yuzu}
@@ -110,6 +110,7 @@ Gem::Specification.new do |s|
110
110
  "resources/sample_content/introduction/_snippets/about_insert_contents.md",
111
111
  "resources/sample_content/introduction/about.md",
112
112
  "resources/sample_content/introduction/advanced-posts.md",
113
+ "resources/sample_content/introduction/blog/autogenerated-index-files.md",
113
114
  "resources/sample_content/introduction/blog/blog-folder-is-special.md",
114
115
  "resources/sample_content/introduction/getting-started.md",
115
116
  "resources/sample_content/introduction/index.md",
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yuzu
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
8
  - 1
9
- - pre
10
- version: 0.2.1.pre
9
+ version: 0.2.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - William Martin
@@ -241,6 +240,7 @@ files:
241
240
  - resources/sample_content/introduction/_snippets/about_insert_contents.md
242
241
  - resources/sample_content/introduction/about.md
243
242
  - resources/sample_content/introduction/advanced-posts.md
243
+ - resources/sample_content/introduction/blog/autogenerated-index-files.md
244
244
  - resources/sample_content/introduction/blog/blog-folder-is-special.md
245
245
  - resources/sample_content/introduction/getting-started.md
246
246
  - resources/sample_content/introduction/index.md
@@ -284,13 +284,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
284
284
  version: "0"
285
285
  required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  requirements:
287
- - - ">"
287
+ - - ">="
288
288
  - !ruby/object:Gem::Version
289
289
  segments:
290
- - 1
291
- - 3
292
- - 1
293
- version: 1.3.1
290
+ - 0
291
+ version: "0"
294
292
  requirements: []
295
293
 
296
294
  rubyforge_project: