Commit graph

320 commits

Author SHA1 Message Date
spf13
a45de56db1 adding support for shortcodes with opening and closing tags 2013-12-06 23:14:54 -05:00
spf13
db29f57cc4 Adding (source code) Highlight template helper 2013-12-05 09:43:49 -05:00
spf13
fa29e94edb Adding Pygments helper 2013-12-05 09:42:29 -05:00
spf13
44d57fdc0c Reorganize helpers 2013-12-05 09:29:41 -05:00
David Arroyo
10c7cf2942 Create directories in publishdir with mode 0777.
The previous permissions (0764), were unusable (directories must
be executable) when generating files for use by another uid. The
Right Thing™ is to use mode 0777. The OS will subtract the process
umask (usually 022) to the for the final permissions.

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-12-02 16:06:31 -08:00
David Gay
ba5dadff79 Typo fix in docs.
Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-23 20:41:54 -08:00
Valeri Karpov
32d9345bba Fix a minor typo in types.md
Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-23 08:49:08 -08:00
Javed Khan
b351731f72 quickstart docs - fix flag needs arg error
Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-23 08:47:25 -08:00
Tim Esselens
860f982cc4 fixed trailing dir slash when using slug
See testcase, dir + slug contained double slash when dir had a trailing
slash.

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-20 15:32:22 -08:00
Phil Pennock
e425226a28 Documentation updates, mostly for my bits
* extras/permalinks.md added, weighted to third in the extras menu
* examples added to layout/go-templates.md, using `.Site.Params`
* mention `.Site.Params` in layout/variables.md
* update meta/release-notes.md to mention `first` and the permalinks
* update overview/configuration.md to use reserved-for-documentation
  domains and with another example, nudging towards permalinks and site
  parameters, with three different data-types shown for the latter

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-18 15:51:31 -08:00
Phil Pennock
07978e4a49 configurable permalinks support
A sample config.yaml for a site might contain:

```yaml
permalinks:
  post: /:year/:month/:title/
```

Then, any article in the `post` section, will have the canonical URL
formed via the permalink specification given.

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-18 13:32:56 -08:00
spf13
4f335f0c7f Updated release notes. 2013-11-15 23:47:53 -05:00
spf13
445b7d23fb Updating docs to include ‘first’ functionality for the homepage 2013-11-15 21:45:52 -05:00
spf13
aedfa6a2c4 Version bump 0.9 2013-11-15 21:43:46 -05:00
spf13
ad2c0b5616 Homepage now has all content available, use sorting and first to control rendering 2013-11-14 09:37:58 -05:00
spf13
13fa7cb748 lowercase template function first to be consistent with all other template functions 2013-11-14 09:32:49 -05:00
Michael D. Johas Teener
50d9046b64 remove initialization loop error from compile
copied HugoCmd to a local var, initialize that variable in the init
func, and then use the local var in the InitializeConfig func.
2013-11-12 17:36:23 -06:00
Phil Pennock
40d05f12a7 Truncated; .Site.Params; First function
* Add `.Truncated` bool to each page; will be set true if the
  `.Summary` is truncated and it's worth showing a "more" link of some
  kind.
* Add `Params` to the site config, defining `.Site.Params` accessible
  to each page; this lets the site maintainer associate arbitrary data
  with names, on a site-wide basis.
* Provide a `First` function to templates:
  * Use-case: `{{range First 5 .Site.Recent}}` or anything else which
    is a simple iterable provided by hugolib
* Tests by me for `.Truncated` and `First`

Also @noahcampbell contributed towards this:

* Add UnitTest for `.Site.Params`:
> Digging into this test case a bit more, I'm realizing that we need
> to create a param test case to ensure that for each type we render
> (page, index, homepage, rss, etc.) that the proper fields are
> represented.  This will help us refactor without fear in the
> future.

Sample config.yaml:

```yaml
title: "Test site"
params:
  Subtitle: "More tests always good"
  AuthorName: "John Doe"
  SidebarRecentLimit: 5
```

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-12 22:49:54 +00:00
spf13
6017599a3c restored behavior of respecting config values unless set by command flags. fixed #116 2013-11-12 09:38:43 -05:00
Noah Campbell
ef595aedfc Handle schema-less urls when apply absurl
Fixes #114
2013-11-09 14:35:09 +00:00
spf13
90a902c843 fixing double slash during absurlify 2013-11-09 01:33:00 -05:00
spf13
b69694a3ae Merge branch 'master' of github.com:spf13/hugo 2013-11-09 01:17:40 -05:00
spf13
532e2e7b93 Some mobile and other fixes for docs 2013-11-09 01:16:34 -05:00
Steve Francia
0b6a11c9e3 Merge pull request #113 from oyvindsk/master
minor documentation fix
2013-11-07 16:33:06 -08:00
Øyvind Skaar
adc559b09f minor documentation fix 2013-11-07 19:47:42 +01:00
Noah Campbell
ad04f6c899 Adding baseline 2013-11-05 22:51:40 +00:00
Noah Campbell
86233c00a0 Remove the hugo-nav function
Remove the hugo-nav since it relied on a slow library.  The current
build reimplements the absurl functionality based on string replace.
Discovered that my prior implementation missed the requirement for
making absolute paths (/path) absolute with the host, whereas a relative
path is left untouched.  Updated the test cases to support this if this
is reimplemented.
2013-11-05 22:28:06 +00:00
Noah Campbell
1cebce12ad Adding RSS test case.
Checks to make sure the xml document starts with <?xml.  Previously, the
html translate package would write additional details into the document
that caused it to fail.
2013-11-05 07:03:02 +00:00
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
spf13
226bc8f59f Updated release notes 2013-11-05 00:24:04 -05:00
Noah Campbell
23a5711d26 Fix benchmark panic
Need to initialize the Config with InitializeConfig().
2013-11-01 20:36:11 -07:00
spf13
23a711a29a Hugo updated to work with latest cobra 2013-11-01 18:43:41 -04: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
f4cb8e1688 Adding benchmark for transformation module. 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
861472bea5 Small tweaks to Homepage and CSS 2013-10-31 09:51:42 -04:00
spf13
1d0d280e20 Addition of an indexes section to the docs. Updated most of the existing index content. 2013-10-31 09:51:13 -04:00
spf13
a7dae30a8f More work on indexes 2013-10-31 09:49:29 -04:00
spf13
bc7c9221f3 Better mobile support on docs site 2013-10-26 02:28:25 -04:00
spf13
90355eec79 Big visual overhaul of the docs. Docs now using indexes for all menu generation. 2013-10-26 02:18:14 -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
5003f7f7af Docs menu now powered by indexes.. converting some of the content to use this. 2013-10-25 18:42:46 -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
764abd2067 Update homepage 2013-10-24 16:49:17 -07:00
spf13
dde965a5cd Migrate docs to Bootstrap 3.0 2013-10-24 16:49:01 -07:00
spf13
cd71eb7389 Watching doesn't built site 2x on write (ignores rename events). Also ignores temporary files written by editors. 2013-10-24 16:45:24 -07:00
spf13
a5606b06ca Adding support for ordering content in indexes by other than date (weighted indexes) 2013-10-24 15:24:47 -07:00