Commit graph

179 commits

Author SHA1 Message Date
Noah Campbell b22364570b Fix Test Name 2013-11-05 06:39:50 +00:00
spf13 1fbcaf9279 Buffers instead of pipes 2013-11-05 00:28:08 -05:00
Noah Campbell 9af47f07d3 Improve rendering time
50% speedup.  Fix #91

to run the benchmark:

		go test -test.run=NONE -bench=".*" -test.benchmem=true ./transform/ > new.txt

to compare the results:

		/usr/local/go/misc/benchcmp baseline.txt new.txt

Speedup and memory improvements

		benchmark             old ns/op    new ns/op    delta
		BenchmarkChain           101219        50453  -50.15%
		BenchmarkTransform        51625        45531  -11.80%

		benchmark            old allocs   new allocs    delta
		BenchmarkChain              222          103  -53.60%
		BenchmarkTransform          135          106  -21.48%

		benchmark             old bytes    new bytes    delta
		BenchmarkChain            23919        10998  -54.02%
		BenchmarkTransform        11858        10665  -10.06%
2013-11-01 09:59:57 -07:00
Noah Campbell 789aa6ad76 Removing check for directory: static, layouts
Removed these checks so a single file in content can generate a site.

For example, given a site with a content directory and an index.html,
running hugo -s dir will generate a project without any more input.
2013-10-31 16:06:24 -07:00
spf13 a7dae30a8f More work on indexes 2013-10-31 09:49:29 -04:00
spf13 df0523ff7f Flipping around weight order. higher weight at the bottom. use negative to pin to top. 2013-10-26 00:20:48 -04:00
spf13 d20b41a2cf Big index overhaul. Now supporting ordering tokens by count or alphabetically. Also made full indexes available to the Site variable. 2013-10-25 18:40:55 -04:00
spf13 9388f23606 Adding support for linkTitles 2013-10-25 18:37:53 -04:00
spf13 b580a25d1f Better error handling when rendering error found when in watch mode
In watch mode it should continue to watch for changes, in any other mode it should exit with a -1 error code so can check for success when scripting
2013-10-25 18:03:14 -04:00
spf13 a5606b06ca Adding support for ordering content in indexes by other than date (weighted indexes) 2013-10-24 15:24:47 -07:00
spf13 471fb1ff69 Adding support for date field in front matter as date (as TOML provides) 2013-10-24 15:18:57 -07:00
spf13 f3c816eabd Adding support for more front matter types (int, float & date) 2013-10-24 14:31:04 -07:00
spf13 3558e3d6f0 Add support for weighted pages
Now pages can be sorted by other than date
2013-10-18 11:01:31 -04:00
spf13 90090175f8 Adding preliminary support for weighted indexes (for ordering by other than date) 2013-10-17 23:57:25 -04:00
spf13 4263094d75 Adding support for MinRead. Closed #106 2013-10-15 09:32:21 -04:00
spf13 be5ace1588 Wordcount restored. fixed #92 2013-10-15 09:15:52 -04:00
spf13 e58d8fe791 fixed #95, fixed #93 2013-10-09 23:38:51 -04:00
spf13 f5fda80486 simplified buildSite & better error handling around it 2013-10-09 19:14:26 -04:00
Noah Campbell 4993152dda Permalink to include multiple directories levels 2013-10-08 18:44:15 +02:00
Noah Campbell 6e1268f45b Test case for permalink functionality 2013-10-08 18:44:15 +02:00
Noah Campbell 9500ec1b6b Refactor layout selection code
The render code path would use a fallback if there was an exception.
This change instead relies on explicit declaration of the layout to use
and includes a check to see if the layout indeed exists before
attempting to render it.
2013-10-08 18:44:15 +02:00
Noah Campbell 197aacb647 Add support for Relative Permalinks 2013-10-08 18:42:03 +02:00
Noah Campbell 06da609138 Refactor Permalink to private function
This will allow for reuse of this particular function.
2013-10-08 18:42:03 +02:00
Noah Campbell 6fa6f69a4a Change transformer order 2013-10-08 18:42:03 +02:00
Noah Campbell d712d6f331 Moving transformation on a per-page level 2013-10-08 18:42:03 +02:00
Noah Campbell 9032a228b0 Better handle missing layouts
Panic is too extreme.  Instead the library will write out a message in
verbose mode.
2013-10-08 18:42:02 +02:00
Noah Campbell 54a2790fce Use io.Pipe for chaning render tasks.
Also clean up logic for finding layouts.
2013-10-08 18:42:02 +02:00
Noah Campbell 19cb6c7819 Move writing next to rendering
All render(Thing) calls have a WritePublic call directly after it.  This
refactor creates one function that makes the specific call sequence.
2013-10-08 18:40:40 +02:00
Noah Campbell 2176d2c197 Reducing scope of RenderThing* 2013-10-08 18:37:50 +02:00
Noah Campbell ff8b52758d Move in memory target into target module. 2013-10-08 18:37:50 +02:00
Noah Campbell 80009b427f Change the order of Apply to be more Unixy
Typically the destination is on the left and the src is on the right.
2013-10-08 18:37:50 +02:00
Noah Campbell f0211b84a1 Rename Transform to AbsURL 2013-10-08 18:37:49 +02:00
spf13 5e14af957a Proper handling of 404 page return value 2013-10-07 09:24:13 -04:00
spf13 7468292c4e Fixing bug where RSS for site was rendered in wrong location 2013-10-07 09:23:42 -04:00
spf13 d829e05036 Fixing bug where only the first index list was created. 2013-10-07 09:07:14 -04:00
spf13 2aaf92b515 Summary can now contain short codes when using <!--more--> to define end of summary. 2013-10-04 16:07:24 -04:00
spf13 266f583a8c Restoring former snippet behavior & adding test to ensure future behavior 2013-10-04 12:28:28 -04:00
spf13 dcfcbac589 Enabling Nitro ('--stepAnalysis') again. Fix #58 2013-10-03 09:44:45 -04:00
spf13 18f2b82658 Switching to the rjson library which is more friendly to human generated json. 2013-10-01 22:45:24 -04:00
spf13 92cff05582 go fmt so code 2013-09-29 02:10:29 -04:00
spf13 ff2b98c9dd Better error message when no source content is found. 2013-09-29 02:10:29 -04:00
Noah Campbell db50154e75 Support index.html indexes in content directory
If a file named index.html exists in a directory, or root, it will be
rendered as if ugly urls are turned on.  This allows for top level
content to not need a supporting layout file and content in content.
This change should not affect anyone who is using the perscribed way.

I also cleaned up a bunch of one off functions in site.go.
2013-09-24 21:27:25 -07:00
Noah Campbell 4250bf8e30 Fixes #80 - Homepage now renders correctly
I mistakenly make RenderHomePage a NOP.  Bad programmer.
2013-09-24 14:41:21 -07:00
Noah Campbell bffe4baf42 Create a TargetPath() method that provides OutFile
Moved the generation of the target path to the page breaking all
dependecies on Site.
2013-09-20 17:24:25 -07:00
Noah Campbell 52e8c7a0ac Section is determined by the source, not the url
This change allows for top level html content to exists.
2013-09-20 17:03:43 -07:00
Noah Campbell 784077da4d Fix fragments being AbsUrlified in final html
Found that fragments were getting the BaseURL applied creating a proper
anchor url and redirecting off the page.
2013-09-18 15:48:36 -07:00
Noah Campbell 311e102223 Allow non-markdown content in content directory
Allow content that is not markdown and does not need to be rendered to
exists in the content directory.  Currently any valid html or xml
document can exist.  Templates are applied to these documents as well.
If you need to have content that doesn't have templates or AbsUrlify
like operations, then continue to put this content in static and it will
be copied over.
2013-09-18 14:21:27 -07:00
Noah Campbell 5374242ff7 More expressive --check output 2013-09-18 11:52:30 -07:00
Noah Campbell c510140c0c Add renderer information to --check
Now reports if the page will be rendered or not and by which render
engine.
2013-09-18 10:27:56 -07:00
Noah Campbell 67b2abaf09 Add IsRenderable to Page
As pages are read from the target, they will be assessed if they should
be rendered or not.  The logic for IsRenderable is in the parser/page.go
and looks for anything exception '<'.
2013-09-18 10:17:43 -07:00