Commit graph

21 commits

Author SHA1 Message Date
Steve Francia
9f3796a31d Read/reread individual source content files
next is incremental conversion
2016-01-26 14:26:23 -05:00
Bjørn Erik Pedersen
e445c35d6a Fix copyright headers in source files
Still need to add some missing headers and an AUTHORS file.

See #1646
2015-12-07 19:57:01 +01:00
Steve Francia
f045d7a611 Change the license to Apache 2.0 2015-11-23 22:16:36 -05:00
Tatsushi Demachi
0c98d8e9ed Use LazyFileReader for reading file contents
Simple ioutil.ReadFile is used for reading file contents but it reads
all of the file contents and copies them into the memory and is run in a
single goroutine. It causes much memory consumption at copying media
files in content directory to publish directory and it is not good at
performance.

This improves the both issue by replacing ReadFile with LazyFileReader.

It postpones reading the file contents until it is really needed. As the
result, actual file read is run in parallelized goroutine. It improves
performance especially in a really big site.

In addition, if this reader is called from io.Copy, it does not copy the
file contents into the memory but just copies them into destination
file. It improves much memory consumption issue when the site has many
media files.

Fix #1181
2015-08-22 19:43:15 +02:00
bep
beeae6ab69 Add some tests for IgnoreFiles
And log error on invalid regexp.

See #1189
2015-06-03 18:54:15 +02:00
bep
bec3f40359 Rename WatchIgnoreFiles to IgnoreFiles
Because this isn't just about server and watching.

See #1189
2015-06-03 13:45:52 +02:00
bep
bed227886b Add configurable list to ignore files in server watch
The following inside `config.toml` will ignore files ending with `.foo` and `.boo`.

```
watchIgnoreFiles = [ "\\.foo$", "\\.boo$" ]
```

The above is is a list of Reqular Expressions, but note the escaping of the `\` to make TOML happy.

Fixes #1189
2015-06-03 13:38:05 +02:00
bep
a91bcd85e2 source: apply some Golint rules 2015-03-07 12:58:39 +01:00
René Jochum
d2e022f2a7 Suppress errors for symbolic links witch point to a file. 2015-02-17 19:18:28 -08:00
bep
e6541c45ab ERROR-log on symbolic links
filepath.Walk does not follow symbolic links.
There's no easy fix for that outside of Go, so the best we can do for now is to give notice to the end user by ERROR log statements.

This commit also fixes a related panic situation in GenerateTemplateNameFrom when the layout dir was a symbolic link.

Fixes #283
2014-12-10 20:32:39 +01:00
spf13
5dfc1dedb8 Big refactor of how source files are used. Also added default destination extension option. 2014-10-16 20:20:09 -04:00
Christoph Burgdorf
f271faea06 Don't process dotfiles
This commit makes it so that not only files
but also folders which start with a dot
are ignored.

Fixes #239
2014-04-26 23:17:54 -06:00
Joe Kopena
d84f707da1 Also ignore Emacs lock & recovery files. 2014-03-04 22:07:40 -05:00
Ask Bjørn Hansen
e53bc948a5 Ignore content files ending in ~
Also add *~ to .gitignore
2014-02-28 23:23:59 -05:00
Egon Elbre
1979f7d9c7 Avoid locking the files for an extended amount of time. Sublime Text
doesn't like this and shows an error when modifying a file in rapid
succession.
2013-12-28 13:46:09 -05:00
Ruben
de670ced86 Fixes #141: Wrong section in multi level structure 2013-12-16 17:40:33 -05:00
Noah Campbell
94a3184ad0 Fixing up source code formatting. 2013-10-08 18:37:50 +02:00
windch
8ce4bc7ab8 Update filesystem.go
bugfix: .Files() called twice in line 253, 256 in site.go. thus source files captured twice.

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-09-29 19:43:38 -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
74b55fc7c8 Normalize paths within hugo
filepath was used inconsistently throughout the hugolib.  With the
introduction of source and target modules, all path are normalized to
"/".  This simplifies the processing of paths.  It does mean that
contributors need to be aware of using path/filepath in any module other
than source or target is not recommended.  The current exception is
hugolib/config.go
2013-09-12 10:48:59 -07:00
Noah Campbell
610c06e658 Introduce source.Filesystem
This provides an abstraction over how files are processed by Hugo.  This
allows for alternatives like CMS systems or Dropbox, etc.
2013-09-04 22:42:52 -07:00