Commit graph

636 commits

Author SHA1 Message Date
Jasper Van der Jeugt
27c3942369 Merge pull request #300 from ohbadiah/master
matchMetadata for examining metadata when defining rules
2015-01-06 13:42:08 +01:00
Daniel P. Wright
b36232e05e Refactor match and matchMetadata code into matchInternal
As per jaspervdj's request in #300, refactor the common code from
match and matchMetadata into a single, unexported function.
2015-01-03 22:55:51 +09:00
Jasper Van der Jeugt
f498a43c64 Fix dependency handling bug
Closes #321
2014-12-28 15:28:45 +01:00
Jasper Van der Jeugt
6f4ccbdc49 Fix dependency handling for snapshots 2014-12-12 16:33:50 +01:00
Jasper Van der Jeugt
2e23f373ed Bump fsnotify, citeproc, poll changes 2014-11-03 11:38:51 +01:00
Jasper Van der Jeugt
76cfb53958 Add listFieldWith 2014-10-29 10:47:22 +01:00
Jasper Van der Jeugt
3c15d0fd34 Improve rulesExtraDependencies usage 2014-10-28 10:53:35 +01:00
Jasper Van der Jeugt
59b6f01218 Better functions in templates 2014-10-27 12:20:31 +01:00
Takayuki Muranushi
51b147bbe1 support parsing article date from directory names in addition to file name. 2014-10-07 11:26:48 +09:00
Nick McAvoy
d0af1024d0 matchMetadata for examining metadata when defining rules 2014-09-16 22:20:11 -04:00
Jan-Philip Loos
3008142e03 added binary instances for csl and pandoc, fix #174 2014-09-08 16:04:30 +02:00
Jasper Van der Jeugt
8d22340e7a Don't have TagSoup decode any HTML entities 2014-08-25 11:16:46 +02:00
Rickard Nilsson
ac9b3d7d93 Fix compilation errors with pandoc-citeproc 0.4 2014-08-20 18:05:20 +02:00
Simonas Kazlauskas
261277dfc5 Fix build failure introduced by 3ee6f28
Fixes #270
2014-06-26 19:48:58 +03:00
Jasper Van der Jeugt
e6918c7253 Merge pull request #269 from co-dan/demoteheaders
Fix #223: `demoteHeaders` should not modify anything in the document, apart from the headers
2014-06-13 19:35:55 +02:00
Simonas Kazlauskas
721bdc2950 Generate a cabal file for the initialised site
Fixes #267
2014-06-13 19:11:30 +03:00
Jasper Van der Jeugt
74daa49cd5 Draft pagination 2014-06-06 13:47:59 +02:00
Jasper Van der Jeugt
f9a0d37088 Fix issue in paginate dependencies 2014-05-20 09:29:56 +02:00
Albert Krewinkel
75b3bc0a16 Allow Emacs org-mode as markup-language in *.org files
This closes #231.
2014-05-10 12:32:34 +02:00
Jasper Van der Jeugt
12dc25de17 Merge pull request #252 from blaenk/mod-time
save modification time with sub-second granularity
2014-05-09 11:51:56 +02:00
Jasper Van der Jeugt
0639a73c24 Merge branch 'master' of github.com:jaspervdj/hakyll 2014-05-09 11:51:12 +02:00
Jorge Israel Peña
d86b4753d4 save modification time with sub-second granularity
Some systems can get the file modification time with sub-second
granularity. However, Hakyll shaves off the sub-seconds, as defined in
the Binary instance of BinaryTime, which poses a problem because when a
file is checked to see if it was modified in `resourceModified`, it
still contains the sub-seconds. This results in a file (almost) always
being considered as having been modified.

Example:

1. First go around, modification time is 3:45.325. This time is saved
   as 3:45.000 (i.e. sub-seconds are shaved off).
2. Second go around, modification time is again read as 3:45.325 and
   compared against the stored time, 3:45.000. 3:45.325 is more recent
   than 3:45.000, so the file is considered to have been modified.

This change prevents the shaving off of sub-seconds. This will naturally
work on systems that don't support sub-second granularity, as that
'field' will simply appear as all zeros.

Closes #250
2014-05-09 02:11:56 -07:00
Jorge Israel Peña
ca44e643a4 Minor refactor of PR #233
OS won't change mid-execution, so lets avoid the unnecessary
check each time `unixFilter` is run.
2014-04-27 15:55:33 -07:00
Izzy Cecil
19788ede4e FIX: toSiteRoot no considers "./" to not be relavent. 2014-04-19 17:24:27 -06:00
Jasper Van der Jeugt
8229765cbd Fix tag dependency issue, slightly improve caching 2014-04-11 21:12:01 +02:00
Jasper Van der Jeugt
889e6f59f7 Fix compilation when disabling preview server 2014-04-07 19:49:17 +02:00
Dacto
3bb0919d25 Added imports that are missing when compiling under Windows. 2014-03-31 23:07:40 -07:00
Jasper Van der Jeugt
0b705d7db0 Micro cleanup of pull request #233 2014-03-26 12:09:35 +01:00
Jasper Van der Jeugt
87eafc752f Revert "added gloabl metadata parsing"
This reverts commit e0f45b29b3.

Conflicts:
	src/Hakyll/Core/Provider/Metadata.hs
2014-03-26 12:05:38 +01:00
Jasper Van der Jeugt
157a81b413 Revert "Fix loadGlobalMetadata on Windows"
This reverts commit e71bbd90a8.
2014-03-26 12:05:38 +01:00
Jasper Van der Jeugt
bc1cfc8d5a Revert "Fix root directory in directory-wise metadata and beautify code"
This reverts commit a6ae4eb99d.
2014-03-26 12:05:38 +01:00
Jasper Van der Jeugt
6552dd5bc0 Revert "Track metadata dependencies"
This reverts commit 712ffa39b5.

Conflicts:
	src/Hakyll/Core/Metadata.hs
	src/Hakyll/Core/Rules/Default.hs
2014-03-26 12:05:38 +01:00
Jasper Van der Jeugt
e5446fd401 Revert "Added test case for global metadata"
This reverts commit 46b6f78da8.

Conflicts:
	tests/data/posts/metadata
2014-03-26 12:05:38 +01:00
Jasper Van der Jeugt
3db3933b0b Revert "set internalRules last, so that it can be overrided by rules"
This reverts commit d406db44e3.
2014-03-26 12:05:38 +01:00
Jasper Van der Jeugt
969f2351ef Merge pull request #233 from rekahsoft/master
Fix unixFilter on Windows
2014-03-26 12:05:24 +01:00
chrisdotcode
c922ab57ac "Serve on" should be "bind on". 2014-03-24 05:20:19 -04:00
chrisdotcode
5af08f807e Add flag to bind on selected host. 2014-03-24 04:50:17 -04:00
Collin J. Doering
da7ae99b12 Fix unixFilter on Windows
On windows, the 'unixFilter' function used window's 'createProcess'
function to create the external process that will filter some String
input. The problem with this is that it is unable to execute batch
stubs (eg. anything created using 'gem install ...') even if its in
$PATH. Anyways a solution to this issue is to execute the batch file
explicitly using 'cmd /c batchfile' but there is no rational way to know
where said batchfile is on the system. My solution is to detect windows
using the System.Info module and then instead of using 'proc' to create
the function, use 'shell' instead which will be able to execute
everything 'proc' can + batch files.

Inspired by: http://www.blaenkdenum.com/posts/the-switch-to-hakyll/#scss

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2014-03-23 17:30:29 -04:00
Simonas Kazlauskas
766060ed78 Use OS threads for watch on Windows 2014-03-04 21:22:35 +02:00
Daniil Frumin
3ee6f28c10 Fix #223: demoteHeaders should not modify anything in the document, apart from the headers 2014-02-16 15:43:52 +04:00
Andres Loeh
21585c18f3 hakyll check: return exit code of 0 on success
The old test returns an exit code of 1 whenever the number of
errors is >= 0, which should always be the case. The fix replaces
this with a test whether the number of errors is strictly > 0.
2014-02-11 11:07:43 +01:00
Jasper Van der Jeugt
251c019e9e Don't cache pandocCompilerWithTransform, refactor 2014-01-28 11:04:28 +01:00
Jasper Van der Jeugt
ca20400712 Merge pull request #215 from co-dan/pandoc-transf
Added the `pandocCompilerWithTransformM` function
2014-01-28 01:59:40 -08:00
Dan
84ba953ed3 Typo in Pandoc.hs 2014-01-26 10:14:04 +03:00
Daniil Frumin
8a29542ee6 Added the pandocCompilerWithTransformM function 2014-01-24 14:55:32 +04:00
Jasper Van der Jeugt
63107a6f75 Merge pull request #190 from krsch/master
Implemented per-directory metadata support
2014-01-23 01:29:01 -08:00
Alexey Kreshchuk
dbabe0325b Unified code for global and external metadata
Didn't clean up unused code though
2014-01-22 00:11:51 +04:00
Alexey Kreshchuk
d406db44e3 set internalRules last, so that it can be overrided by rules 2014-01-21 23:15:08 +04:00
Jasper Van der Jeugt
677cca0578 Add IsString instance for Template
Closes #150
2014-01-19 21:25:18 +01:00
Daniil Frumin
99c464d08f Fix escaped quotes + wording 2014-01-19 23:31:40 +04:00
Daniil Frumin
60f0043471 Documentation for the template macros 2014-01-19 23:20:47 +04:00
Daniil Frumin
52d49c4360 Haddocks for field, constField, bodyField, and titleField in Web.Template.Context 2014-01-12 23:56:49 +04:00
Daniil Frumin
cacac208ef Added documentation for 'Context' and 'defaultField' 2014-01-11 23:42:34 +04:00
Jasper Van der Jeugt
b61877bdaa Fix issue with metadataRoute for composed routes 2014-01-03 16:40:15 +01:00
Jasper Van der Jeugt
98d03dfe48 Revert "Throw an error in case of duplicate compilers"
This reverts commit ffbce96607.
2013-12-05 12:27:45 +01:00
Jasper Van der Jeugt
ffbce96607 Throw an error in case of duplicate compilers 2013-11-22 13:56:17 +01:00
Jasper Van der Jeugt
f9a8443d68 Detect change if metadata file is deleted
Closes #191
2013-11-18 12:42:21 +01:00
Alexey Kreshchuk
46b6f78da8 Added test case for global metadata 2013-10-18 01:23:14 +04:00
Alexey Kreshchuk
712ffa39b5 Track metadata dependencies
I had to prepend some Rules to global Rules set. This might be possible
to replaced by a correct Store.set call.
I also had to prepend some Compile rules.
2013-10-16 01:39:04 +04:00
Alexey Kreshchuk
a6ae4eb99d Fix root directory in directory-wise metadata and beautify code 2013-10-15 03:59:16 +04:00
Alexey Kreshchuk
e71bbd90a8 Fix loadGlobalMetadata on Windows 2013-10-12 23:57:17 +04:00
Alexey Kreshchuk
e0f45b29b3 added gloabl metadata parsing 2013-10-11 02:41:27 +04:00
Jasper Van der Jeugt
808353bce4 Enable Pandoc highlighting by default 2013-09-29 17:52:58 +02:00
Jorge Israel Peña
a590a9a57f updated to work with pandoc 1.12
Pandoc 1.12 decouples citeproc-hs from itself, so there is no longer a
Text.Pandoc.Biblio module in Pandoc. Further, citeproc-hs depends on
pandoc-types 1.10 but Pandoc 1.12 depends on pandoc-types 1.12. To
alleviate these issues, pandoc-citeproc was created which includes a
copy of the citeproc-hs source made to be compatible, since the
developer of citeproc-hs is apparently MIA.

pandoc-citeproc is a separate module that handles the mixture of
citeproc-hs and Pandoc. It includes `processCites` in Text.CSL.Pandoc,
which is the new name of what used to be `processBiblio` from
Text.Pandoc.Biblio

Most of these changes are seamless, consisting of simple name changes in
both functions and modules. However, a more direct change in the
Hakyll API itself is that `readPandocBiblio`'s second parameter, the
CSL, is now mandatory, i.e. not of type Maybe. This is to reflect the
same change in the underlying processing function from Text.CSL.Pandoc,
`processCites`, where the Style argument is now mandatory, and the style
is derived from the CSL.

See the old function:

    processBiblio :: Maybe Style -> [Reference] -> Pandoc -> Pandoc

Compared to the new one:

    processCites :: Style -> [Reference] -> Pandoc -> Pandoc

Sources:

* http://hackage.haskell.org/packages/archive/pandoc/1.11.1/doc/html/Text-Pandoc-Biblio.html
* http://hackage.haskell.org/packages/archive/pandoc-citeproc/0.1/doc/html/Text-CSL-Pandoc.html

Similarly, there is no longer a `readerReferences` field in the reader
options structure.
2013-09-18 22:38:54 +02:00
Saeid Al-Wazzan
a796988a16 Fix incorrect output of toSiteRoot on Windows.
toSiteRoot uses splitPath, joinPath, and takeDirectory from the
System.FilePath module. On Windows systems, the implementation of
joinPath will build up a path using the Windows path separator "\\".

We don't want this behavior since the paths we are working with
are always URLs, so we force POSIX behavior for System.FilePath.
2013-09-16 01:17:38 +03:00
Jorge Israel Peña
999252ece1 add preview port Configuration field
Make it possible to specify the default port to listen on when the
preview server is run. This is useful if another service on the system
already runs on port 8000 (the default), since it's a hassle to keep
providing the port overriding option. For example: ./site preview vs.
./site preview -p 4000
2013-08-29 22:43:57 -07:00
Eric Stolten
866a282f19 * Preview now shows the deprecation message and calls watch.
* Details on how to disable the server in the command description.
2013-08-28 13:11:44 -04:00
Eric Stolten
f01b641649 1. Added the WATCH_SERVER flag that is enabled by default
1. Added an argument to watch, --no-server which will disable the embedded server.
1. Added a deprecation message to the preview mode
2013-08-25 22:49:50 -04:00
Eric Stolten
fbc43b3a04 Merge branch 'upstream-master' 2013-08-20 22:03:04 -04:00
Eric Stolten
f14f52040a Added a watch command that will continually poll for changes and rebuild them. 2013-08-20 21:59:39 -04:00
Jasper Van der Jeugt
5679681ac1 Change type: metadataField :: Context a
Closes #175
2013-08-16 11:48:26 +02:00
Jasper Van der Jeugt
64569d7b72 Fix versions & metadata loading issue
Closes #171
2013-08-14 00:18:31 +02:00
Jasper Van der Jeugt
faa90283bf Explode when using mapContext over ListField 2013-08-13 01:38:18 +02:00
Jasper Van der Jeugt
fad9134fd4 Add functionField again 2013-08-10 16:19:23 +02:00
Jasper Van der Jeugt
ab0aebb3c3 Add mapContext again 2013-08-05 12:25:55 +02:00
Marc-Antoine Perennou
82a38a742a check: unescape internal uris
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-07-07 19:02:21 +02:00
uu1101
b5803bc7b6 Correct example code: parseGlob ==> fromGlob 2013-06-30 19:21:17 +02:00
Jasper Van der Jeugt
a3c4d06ff9 Merge pull request #162 from uu1101/seq-stderr
Deepseq stderr before closing the handle
2013-06-17 04:43:06 -07:00
Jasper Van der Jeugt
6814ff2e9b Only add teaser when <!--more--> is there 2013-06-17 12:01:22 +02:00
Simonas Kazlauskas
72ed15e174 Make toUri sanitise all characters needed 2013-06-16 15:11:04 +03:00
Jasper Van der Jeugt
537e72333f Sanitize URLs in toUrl
Closes #163
2013-06-15 20:15:33 +02:00
uu1101
a1e778d1e5 Set handle encoding as per locale 2013-06-14 01:02:14 +02:00
uu1101
cf501485b1 Deepseq stderr before closing the handle
Otherwise laziness allows for the handle to be closed withouth receiving the
input. This caused that no error messages were printed when `unixFilter`s
failed.
2013-06-14 00:32:45 +02:00
Jasper Van der Jeugt
e687662ba0 teaserContext -> teaserField 2013-06-06 10:21:18 +02:00
Jasper Van der Jeugt
0409d6110c Merge pull request #155 from blaenk/win32-preview-fix
fix preview functionality on windows
2013-05-24 00:47:06 -07:00
Jorge Israel Peña
294c48ea48 finish incomplete comment 2013-05-22 17:28:32 -07:00
Jorge Israel Peña
e987485e2d add max-retries to waitOpen and gracefully handle remove/delete events 2013-05-22 17:06:17 -07:00
Simonas Kazlauskas
0a818d0725 Deploy should propagate error code
And return 1 if neither deployCommand and deploySite is set.
2013-05-22 15:24:26 +03:00
Jorge Israel Peña
2fba64c5ad fix preview functionality on windows 2013-05-22 01:20:43 -07:00
Evan Cofsky
8c73820abc Clean up type declarations, use fst and <$>. 2013-05-21 09:01:00 -07:00
Evan Cofsky
c236cda401 Have Build and Rebuild exit with a status to the shell. 2013-05-20 21:17:31 -07:00
Jasper Van der Jeugt
d32307aa1c Add partials to template system 2013-05-07 09:28:09 +02:00
Jasper Van der Jeugt
cf138a415b Implement foreach structure 2013-05-06 23:32:25 +02:00
Jasper Van der Jeugt
738fd3d1ad Paginate simplification 2013-05-06 22:34:07 +02:00
Anton Dubovik
1966163c55 Added pagination support. 2013-05-05 17:05:15 +03:00
Ivan N. Veselov
946723dc9d Logged dependencies adding for debugging purposes. 2013-05-05 12:58:31 +03:00
Ivan N. Veselov
0e6441885c Changed the teaser separator to "more" to use the same format as WordPress does. 2013-05-04 17:57:51 +03:00
Ivan N. Veselov
9ad0d38f43 Added a comment explaining "teaserContext" function. 2013-05-04 17:48:51 +03:00
Ivan N. Veselov
2651627189 Added "teasers" support to be used in posts index.
Just add "<!-- teaser_end -->" to separate the teaser and the rest of the article and use "$teaser$" key in the template!

Closes issue #35.
2013-05-04 17:26:22 +03:00
Jasper Van der Jeugt
ca80171caf Minor style changes 2013-05-04 15:18:26 +02:00