Commit graph

175 commits

Author SHA1 Message Date
Ed Page
ed961701c4 tests: Use new frontmatter format 2018-11-27 13:06:09 -07:00
Ed Page
3534c5baea chore: Upgrade syntect 2018-11-21 13:52:57 -07:00
Geobert Quach
da6360d223 feat(pagination): core logic
feat(pagination): remove feature from default
2018-10-24 20:49:17 +01:00
Ed Page
d2b0671994 chore: Upgrade syntect
I ran `ldd` on cobalt to ensure static linking was still happening.
2018-09-03 19:01:54 -06:00
Ed Page
023e7879f2 refactor: Convert to assert_fs/assert_cmd
The tests are now operating in a more standard use case thanks to the
ability to easily setup. The are running in the CWD rather than all the
paths artifically being set.

Fixes #381
2018-08-02 06:12:52 -06:00
Ed Page
32bf4a42e2 chore: Upgrade dependencies 2018-06-25 10:00:39 -06:00
Ed Page
de7f246097 chore: Update CI 2018-06-25 09:03:48 -06:00
Tim Süberkrüb
8ca7cb819a feat(sass): add support for Sass's indented syntax 2018-04-02 20:44:34 +02:00
Ed Page
a380fd15fb fix(clean): Don't error on double-clean
The test was re-worked to better describe what its actually testing.
Later, when we have better file system test utilities (see the CLI WG),
we can actually make a test focused on what this test was meant to
cover.
2018-03-16 14:58:25 -06:00
Ed Page
0ed5247e89 chore: Upgrade dependencies
- More details available when logging with `--trace`
- liquid updated with existence check
- Some bug fixes with `ignore` configuration

Fixes #363
2018-03-16 10:12:23 -06:00
Ed Page
821c106dc3 style: Update rustfmt 2018-03-03 20:55:04 -07:00
Ed Page
373651b972 refactor(config): Remove dependence on config
Most of the code is decoupled from config.
- This will help in evolving
- This helps decouple other things, like `new` not needing to load
  layouts.
2018-03-03 12:58:37 -07:00
Ed Page
b2cbe13aaa perf(layouts): Switch from lazy to eager
No idea what impact this will have on performance actually.

BREAKING CHANGE: The paths used for layouts now must be clean (no
`//./file.liquid`).
2018-03-03 12:58:07 -07:00
Ed Page
b09c59b350 refactor(config): Use path for paths 2018-03-03 12:55:37 -07:00
Geobert Quach
bc97e4ef33 refactor(build()): renamed some functions according to comments 2018-01-27 21:03:31 +00:00
Ed Page
0aedcba5fb
Merge pull request #370 from Geobert/fix#241
Fix EOL issue with tests
2018-01-27 13:12:25 -06:00
Geobert Quach
ef16be08eb fix(tests): normalizing EOL management
Closes #241
add editorconfig
add gitattributes
2018-01-27 16:14:07 +00:00
Ed Page
8fca43406d feat: Upgrade liquid
Features
* Provide context on errors (good enough for #136)
* Implement basic `compact` support

Bug Fixes
* `date_in_tz` can't parse cobalt's dates
* Improve value coercion practices
  * Every `Value` is now treated as a string.
  * Whole numbers are now preserved.
  * Whole numbers can convert to fractional numbers but not the other way
    around.
  * You can convert a fractional number to a whole number using the
    filters `round`, `ceil`, or `floor`.
  * Operations on only whole numbers preserve their whole number nature.
  * for tag ranges, indexing, etc only accept whole numbers

Fixes #136

BREAKING CHANGES: There might be minor behavior changes form the coercion
changes.
2018-01-24 06:40:15 -07:00
Ed Page
d280a35329 feat(liquid): Generalize is_post / posts
`page.collection` contains the collection slug which is `posts` for,
well, the built-in posts collection.

`collections.posts.pages` is a sorted list of all of the pages that are
part of the posts collection.

Fixes #323

BREAKING CHANGES:

`page.is_post` is replaced by `page.collection`.  Generally, it'll look like
`{% if page.is_post %}`
and can be replaced by
`{% if page.collection == "posts" %}`

`posts` is replaced by `collections.posts.pages`.  Generally, it'll look
like
`{% for post in posts %}`
and can be replaced by
`{% for post in collections.posts.pages %}`

`cobalt migrate` should do this for you.
2018-01-03 21:01:34 -07:00
Ed Page
1e19ae070d feat(front): Change date to YYYY-MM-DD
Fixes #349

BREAKING CHANGE:

Frontmatter `published_date` switched from "29 December 2016 15:20:21
-0700" to "2016-12-29 15:20:21 -0700".

`cobalt migrate` should handle this for you.
2018-01-03 21:01:34 -07:00
Ed Page
c4ee83b3f5 feat(config): Change .cobalt.yml to _cobalt.yml
Why?
- Better aligns with other `_` prefixed files in cobalt
- The file is meant for humans
- This is what Jekyll does

Fixes #348
2018-01-03 21:01:34 -07:00
Ed Page
6f62dea856 feat(liquid): Make page variables future-proof
This is a part of #257

Attributes from a page are now under the `page` object
- `path` -> `page.permalink` to make it clear this is the equivelant of `permalink` in the frontmatter
- `source` -> `page.file.permalink`
  - Under `file` to make room for `page.file.parent`
  - `permalink for consitency with `page.permalink`
- `date` -> `page.published_date`
  - Consistency with the new `published_date` in the front matter
  - Both are renamed to make it clear the role of the date (versus a future `modified_date` that might exist)
- `draft` -> `page.is_draft`
- `previous` -> `page.previous`
- `next` -> `page.next`
- Custom fields have moved from `<field>` to `page.data.<field>`.

BREAKING CHANGE: Liquid `{{ variables }}` have been renamed.

`cobalt migrate` will fix some.  `cobalt build` will most likely fail on
variables missed by `cobalt migrate`.
2018-01-03 21:01:34 -07:00
Ed Page
c6c4d7aca4 feat(front): Change permalink to well-defined format
The original jekyll-inspired format is not well defined.  The only way
to parse a variable is to match it against all know variables because
there is no end-token.  This can also lead to ambiguity if one variable
name is a subset of another.

This switches the format to use liquid.  No filters, tags, or blocks are
made available at this time but that can be re-evaluated in the future.

Part of the fix for #198

BREAKING CHANGE: permalink substitutions like `:path:output_ext` need to
be changed to `{{path}}{{output_ext}}`.

`cobalt migrate` will take care of this.  It might include too much text
in the variable but this will be caught by `cobalt build` failing.
2018-01-03 21:01:34 -07:00
Ed Page
be2b8381c8 chore: Update to liquid 0.13
The primary motivation was to make it possible to create a liquid parser
that has no tags, blocks, or filters which we'll want when switching
permalinks to using liquid.

In micro-benchmarks, rendering speed has improved.

BREAKING CHANGES:
- liquid will now error on non-existent variables
- `for_loop` (duplicate of `forloop` variable) has been removed
2018-01-03 21:01:34 -07:00
Ed Page
6730eb686d feat(front): Standardize permalink behavior
Two main aspects
- Collections are now slugified
- Custom variables are now accessed as `:data.<VAR>` to avoid collisions
  with future built-in variables

The challenge with writing the conversion is we don't know where a
`:data.<VAR>` field ends.  Originally, it was written to ignore
`:data.<VAR>` variables.  Instead it consumes everything until the next
`:variable` as part of `:data.<VAR>`.  This isn't noticed in this change
but will become obvious when changing the format.

Part of the work for #198

BREAKING CHANGE:
- permalinks with `:collection` might move due to slugification
- Custom variables need to be switched to `:data.<VAR>`. `cobalt
  migrate` is unsufficient for this, instead it will remove the troubled
  permalink

To be clear, this was tested on 10 sites and broke none of them.
2018-01-03 21:01:34 -07:00
Ed Page
9089c721a2 feat(front): Stablize fronmatter format
The frontmatter is now a strictly defined format
- Custom data goes in the `data` field to avoid conflicts between user
  data and future cobalt data.
- `date` has been renamed to `published_date` to make it clear what role
  it plays and room for possibly adding a `modified_date`
- Error rather than ignore poorly formed fields
- `path` was a bit ambiguous.  The hope is that `permalink` will be more
  clear.

To help reduce noise when diffing an old site against a new site,
frontmatter fields that are default values are not written out to the
file.

Fixes #257

BREAKING CHANGES

frontmatter
- `date` renamed to `published_date` and will error on bad formatting
- `extends` renamted to `layout`
- `draft` renamed to `is_draft`
- `ext` now exposed as `format`
- `path` renamed to `permalink` and a leading `/` is needed unless a
  path alias is being used.

`cobalt migrate` has support to make these changes for you.
2018-01-03 21:01:34 -07:00
Ed Page
38f6aa40c5 style(tests): Reduce extra noise in converted files
Just removes the fields that match the default value.
2018-01-03 21:01:34 -07:00
Ed Page
34e9d545b0 feat(config): Stablize the format
The `.cobalt.yml` format should be more forward looking now, not
breaking users in the face of new featurs being added.

Features this uncovers
- Default the frontmatter for pages and posts

Fixes #199

BREAKING CHANGE: `.cobalt.yml` format change.  Run `cobalt migrate` to
convert your site to the new format.  Please backup first in case there
is an issue.
2018-01-03 21:01:34 -07:00
Ed Page
d81c1a08c8 refactor(legacy): Define the model for legacy support 2017-12-04 11:38:07 -07:00
Ed Page
d4d11277cd refactor(config): Move where legacy is handled
Originally, I hid the conversions as a hack.  This is making the
conversions to non-legacy harder, so removing it.

I temporarily disabled tests until #334
2017-12-04 11:38:07 -07:00
Ed Page
c74d109e3a refactor(tests): Stop uising deprecated include paths 2017-11-29 21:10:43 -07:00
Ed Page
1f0d2bc6b4 chore: Upgrade syntect 2017-11-07 20:37:19 -07:00
Ed Page
200458dc9b tests: Use correct date format 2017-11-04 17:40:09 -06:00
Ed Page
f9d2716704 refactor: Rename internal config.dest to destination 2017-10-25 05:44:04 -06:00
Ed Page
78bbfc3eb3 fix(clean): Better detect what we can't clean
This includes a more appropriate error message.
2017-10-24 19:12:50 -06:00
Ed Page
92ca0c60da fix: --destination is now relative to cwd (again)
A previous commit make the `dest` config flag relative to the config
file.  This also impacted `--destination`.  This would be unexpected, so
we now track separately the config's dest and the overridden dest so we
can properly track what they should be relative to.

This is a step towards #284.
2017-10-23 17:51:31 -06:00
Ed Page
ce95b39541 fix: source/dest are now relative to config
This is a step towards #284

BREAKING CHANGE: source/dest are now relative to your project root, as
defined by your config file.
2017-10-23 17:26:00 -06:00
Ed Page
c1cf01cd52 fix(error): Report file path on parse error 2017-10-23 17:25:59 -06:00
Ed Page
468b94f937 refactor(config): Use the builder pattern
When moving the post-processing into the builder, I went ahead and
implemented the link semantics talked about in #216.  This causes a
minor change to output.  RSS and jsonfeed's links to the main website
will not have a trailing slash which no one should notice.
2017-10-23 17:25:59 -06:00
Ed Page
137fb960ca feat: Remove layouts config setting
This is now hardcoded to `_layouts`, like data and scss import dir are
hard coded.  I cannot forsee why someone would have a need to customize
these.

BREAKING CHANGE: A config file with `layouts` will either error or be
ignored.
2017-10-23 17:25:36 -06:00
Ed Page
4e96a1fbee feat: Find config in parent rather than default
This is a stepping stone to #284.

BREAKING CHANGE: like git, cobalt will now search the parent dir for a
config file.  If non is found, the default will be used.  Previously, if
the config wasn't found in the CWD, cobalt used a default config.
2017-10-21 21:20:11 -06:00
Ed Page
1aa53d2459 fix(md): Add table/ref support
Fixes #303
2017-10-20 21:02:32 -06:00
Ed Page
ccdaef50aa fix(data,sass): Remove custom folder support
This is an attempt to try to simplify things until someone has a use
case for it.

What are the problems with custom folders?
- Less confusing to users.  When giving the user a choicem, we should be
  able to describe why they might want to make that choice.
- Less to test
- No semantic problems to worry about.
  - What should be the behavior for a non-`_`-prefixed folder
  - What should be the behavior for deeply nesting particularly with the
    above question mixed in at random points.
2017-10-20 18:18:09 -06:00
Ed Page
922f1e9b17 chore: Upgrade to rustfmt 0.8.6
The configuration was dumped to `.rustfmt.toml`, so hopefully people can
also use newer versions of rustfmt.

The config was not updated to also include the latest style RFCs just
out of laziness.
2017-10-19 21:18:31 -06:00
Benjamin Kampmann
bb2d7c0f3b feat(data-files): Add data file support
Add capability to read yaml, json and toml files from a configurable
folder within source (defaults to `_data`) and expose them to the
templates under the variable `site.data` for processing.

Fixes #256
2017-10-18 11:39:06 +02:00
Benjamin Kampmann
527a85f2cc test(data-files): Add test for data file reading and processing 2017-10-18 01:41:35 +02:00
Benjamin Kampmann
9dac0b24d4 fix(scss): Allow Configuration of SCSS Options 2017-10-12 16:58:29 +02:00
Benjamin Kampmann
57f3868e53 fix(scss): Put SCSS compiling behind a feature-gate 2017-10-12 16:58:16 +02:00
Benjamin Kampmann
4ec53211ca test(scss): Add tests for SCSS compiling 2017-10-12 16:58:09 +02:00
Ed Page
1e07708bad feat: Improve reporting to user
- Provide more error context (like which file failed to parse).
- Restored logging of command failures (removed in split)
- Restored logging of successful commands (removed in split)
2017-10-07 22:26:59 -06:00
Ed Page
026f2b6eeb tests: Test cobalt init 2017-09-30 22:05:57 -06:00
Ed Page
c76781703a refactor(tests): Show more information 2017-09-30 22:05:57 -06:00
Ed Page
e2979618d5 refactor(tests): Make dir diffing reusable. 2017-09-30 20:21:55 -06:00
Ed Page
a0bed12767 chore: Upgrade rss dependency 2017-09-23 21:54:23 -06:00
Ed Page
e5b5283593 chore: Upgrade dependencies 2017-09-23 21:49:17 -06:00
Ed Page
5f00e97f64 refactor: Use enum to describe post_order
In theory, this makes the checking more strict.  In practice, serde
isn't erroring out for invalid enum values as I'd expect.

BREAKING CHANGE: `post_order` now takes `Asc` and `Desc` instead of
`asc` and `desc`.
2017-07-26 20:54:32 -06:00
Ed Page
27c49c1f28 refactor: Load .cobalt.yml via serde
- This simplifies the config loading code.
- This is yet another stepping stone towards a revamped config.
- This allows the removal of a direct dependency.

BREAKING CHANGE:

Unknown fields are mostly not allowed now (for some reason, incorrect
syntax-highlight fields are).  There isn't really a use case for unknown
fields but room for a lot of confusion (typos in fields leading to odd
behavior).

`syntax-highlight` has been renamed to `syntax_highlight`.  This is more
consistent with the rest of the file.
2017-07-26 20:15:10 -06:00
Ed Page
be782b5d13 tests: Changing syntax theme 2017-07-26 20:04:53 -06:00
Ed Page
cafd42fa3c feat: Support nested frontmatter
This is the alternative implementation for #193, taking advantage of
serde rather than converting YAML->Liquid by hand.
2017-07-12 07:56:42 -06:00
Ed Page
7f571a8bd5 feat: Better define when to reference url or file of a document.
This is mostly a refactoring but with the impact that `page.path` now
returns a non-exploded path.

BREAKING CHANGES: `page.path` now returns the non-exploded path.
2017-07-12 07:56:42 -06:00
Ed Page
cb98b5d054 chore: Simplify the non-draft code ... I think 2017-07-12 07:52:40 -06:00
Uwe Arzt
8a42321765 Added test, run cargo fmt in version 0.8.3 2017-06-30 10:01:49 +02:00
Ed Page
a69b7bbb6b test(ignore): Provide examples of whitelisting 2017-06-15 20:07:28 -05:00
Ed Page
0a73edd0af fix(tests): Harden CLI tests
The new traces are not safe against re-running with an overlapping source
and dest dir.  Ideally, we'd generate to tempdir's anyways but then the paths are
different, breaking traces.  So, in the end, we'd just mirroring the same
test between `trace` and `trace_alias`.
2017-05-24 17:57:21 -05:00
Ed Page
334c4d2e3a fix(tests/cli/log_levels): Improve comparison error reporting 2017-05-24 17:25:38 -05:00
Ed Page
0d37993546 fix(tests): Improve error reporting 2017-05-24 16:46:59 -05:00
Ed Page
be05d963c7 feat: Increase control over files to process
The `ignore` field in `.cobalt.yml` is changing from a list of glob patterns to
a list `gitignore` patterns, allowing whitelisting and more advanced
whitelisting/blacklisting with well defined semantics.

Previuously, Cobalt processed all files except `.dot` and `_hidden`,
*dest* files/directories.

Considerations when designing this:
- User workflow: users need `.dot` asset files, like `.htaccess`, copied over.
- Implementation: Finding files for pages and posts is coupled together
  which will be a problem as we refactor them into more general
  collections or sections.
- Performance: Eventually we'll want to implement incremental rebuild
  (see issue #81) and to do so we'll need to know what collection a file
  notification is relevant to.

`gitignore` patterns were selected for the first item to ensure we had
well defined semantics for how blacklist and whitelist features would
interact, directory vs file patterns, etc.

The last two are the motivation for factoring out file detection.

A couple downsides, for now
- `cobalt watch` will now rebuild when hidden files are touched.  This is
  unfortunate but seems like an acceptable short term sacrifice until we
  have a better to expose what files cobal reads.
- Handling of overlapping source/dest is a bit ugly. In the future, we
  should just make these cases error
- Handling of hidden post folders is ugly.  In the future, we should
  generalize the concept of pages and posts into collections/sections at
  which point we'll walk each collection type independently.  This will
  make the non-hidden posts folders the ugly case.  We should consider
  requiring them to be hidden.
- There is a known bug where we enable all hidden folders that match the
  posts folders name rather than only some.

Fixes #221 by allowing the user to whitelist `.dot` and `_hidden` files.
See the added unit tests for examples.

BREAKING CHANGE: The format of `.cobalt.yml`'s `ignore` field has changed
from a list of glob patterns to gitignore patterns.
2017-05-24 16:46:54 -05:00
Ed Page
4a2e34e6b2 fix(CI): Upgrade rustfmt 2017-05-20 18:37:46 -05:00
Ed Page
eb9e0b0559 Merge pull request #217 from whostolemyhat/ignore-querystrings
Ignore querystrings
2017-05-12 09:02:36 -05:00
Ed Page
5c06950547 Merge branch 'master' into sort-order 2017-05-11 18:19:24 -05:00
James Tease
a39d6ed404 Ignore querystrings when serving locally 2017-05-11 09:19:40 +01:00
James Tease
8daadae2f9 Allow posts to be reverse sorted 2017-05-10 13:57:23 +01:00
James Tease
c2190c6ffc Add previous and next attributes to posts 2017-05-10 10:58:44 +01:00
Jan-Erik Rediger
0072eabbd1 Add minimal example without a frontmatter 2017-04-23 14:13:16 +02:00
Ed Page
5c41f8528d Merge pull request #212 from iovxw/master
Upgrade pulldown-cmark to 0.0.14
2017-04-20 18:44:11 -05:00
Ed Page
e523702e36 style: Address new clippy complaints 2017-04-20 15:20:31 -05:00
iovxw
8002ec811a
Fix syntax highlighting test 2017-04-21 01:21:44 +08:00
Ed Page
d9a4209e20 chore: Upgrade dependencies
Upgrade notes:
- notify: Debouncing was added but have not yet switched to it because of
  the extra work to extract the relevant path

Dependencies that were held back:
- assert_cli: See killercup/assert_cli#30 and killercup/assert_cli#31
- rss: Seems they turned off XML escaping.  Didn't have time to research
  this.
2017-03-24 09:24:14 -05:00
djwf
24637e8867 Ref style links in excerpts (#188) 2017-02-16 15:40:53 +01:00
Uwe Arzt
291229bffb Posts in subdirs (#185) 2017-02-09 23:50:09 +01:00
Johann Hofmann
a9ba60868a Fix random post order in custom_path tests 2017-01-13 22:09:54 +01:00
Johann Hofmann
2dc5ee6dfd Remove cross 2017-01-13 22:09:54 +01:00
Johann Hofmann
259dd60d66 Use rustfmt-bin instead of cargo 2017-01-13 22:09:54 +01:00
Johann Hofmann
cc142cdf80 Switch to a trust based CI config. 2017-01-13 14:58:58 +01:00
Kracekumar Ramaraj
f934b50930 Add warning message if the current directory is being deleted. (#166) 2017-01-06 00:02:35 +01:00
Benjamin Kampmann
382e5400f8 Adding syntax highlighting (#165) 2017-01-03 09:44:53 +01:00
benaryorg
53764f39fd
tests: incomplete_rss: distinct display and description
Signed-off-by: benaryorg <binary@benary.org>
2016-11-19 16:11:41 +01:00
Jake Goldsborough
f0ce63f1ac adding clean command (#150) 2016-11-07 20:32:20 +01:00
Stas Rudakou
f1f5dff60d Add excerpt to post description in rss if description attribute is not set 2016-11-06 09:10:36 +03:00
Stas Rudakou
375b5bf197 Add guid tag to rss feed
As suggested by [validator.w3.org](https://validator.w3.org/feed/docs/warning/MissingGuid.html).
2016-11-06 09:10:36 +03:00
Stas Rudakou
fa93df81fb Use content as description in RSS items 2016-11-06 09:05:58 +03:00
Stas Rudakou
bd120ee796 Refactor methods for rendering documents, add excerpts and fix content attributes (#147)
* Don't render documents without `extends` twice

`liquid_escaped` test case was red before the fix:
`tests/fixtures/liquid_escaped/not-extends.liquid` renders invalid
liquid markup, so cobalt used to panic when it rendered this document
twice.

* Move lines in `Document::as_html` to improve readability

* Reorganize the code for rendering documents

This doesn't change flow, that's just a prerequisite for adding
excerpts.

* Add excerpts test fixture based on a vanilla `cobalt new` project

* Add several posts with different kinds of excerpts to `excerpts` fixture/target

* Add .liquid posts to  fixture/target

* Split front matter using an improved regex

The default excerpt separator is \n\n. If the linefeed after "---" is a
part of content, a document starting from one blank line will have an
empty excerpt.

\r is there because they use both \r and \n on Windows.

* Add jekyll-like excerpts to posts

It doesn't make sense to add excerpts to other documents as they are not
injected to rendering context like "posts" is. So we won't do it to save
some CPU time.

* Cache layouts to avoid repeated fs calls and memory allocations

Fixes #120 (we don't need to use mutex here because crossbeam has been
removed in #146).
2016-11-04 21:44:03 +01:00
Stas Rudakou
d177767c3b Use tempdir crate instead of home-grown tests/tmp
Suggested by @johannhof, closes #65
2016-10-31 01:25:43 +03:00
Johann Hofmann
9be4635cfa
Add basic CLI tests 2016-08-22 23:06:08 +02:00
Johann Hofmann
4027605fe9 Draft support (#128)
* Add draft support (fixes #121)

* Add documentation for drafts

* Add support for draft front matter attributes

* Run rustfmt

* Draft related debug messages
2016-08-09 15:04:24 -06:00
Johann Hofmann
0986a82f09
Implement custom global post path. 2016-07-03 19:33:08 +02:00
Johann Hofmann
11a20ec666
Fix custom paths always generating into posts dir 2016-07-03 18:36:11 +02:00
Johann Hofmann
6d3b4a1f7d
Ignore underscored directories by default
This is something I've been meaning to do for a long time now.

I would like to add consistency in how we deal with files and folders
that have a leading dot or underscore. This commit makes it so that both
kinds are simply ignored by default when looking for documents to
generate or assets to copy. I like to see those filenames as
indication that the folders contain "meta" information.

My idea of a good site generator is that your source file structure is
not fundamentally different from the resulting file structure. You
basically end up with the same structure but "enhanced" by the site
generator (e.g. by turning .md and .liquid files into .html files).
It is very useful to have an easy indicator like an underscore to show
that this file will be used in the generation process but will not be
there in the resulting site. You can now simply have a file called _data.json
next to your template or blog file.

The default post path has been changed to "posts".
For compatibility it is still possible to set your default post path to
"_posts", however, you now have to do it explicitly in your .cobalt.yml.

This is good, as having _posts/blog-post.md generate to
_posts/blog-post.html was just laughable.

I will make PRs for that in all affected user pages.

_layouts obviously stays the same. I changed the layout handling a
bit, though. Layouts are now read from disk every time they are
required. This needs a bit of optmization in the future but allows for
better and more flexible layout specification.
2016-07-03 10:53:31 +02:00
Johann Hofmann
f7c73a9a72 Implement custom document paths (permalinks) (#107)
* Move parse_document code into Document

* Prevent race condition on deep post paths

fs::create_dir_all is racy and will not do well when run in parallel for
a number of sufficiently deep directories with same parents.

I fixed it by writing my own version that is thread-safe.

I also reorganized some of the document code, it seems more clean to me
now at least.

* Implement custom document paths

Some things still need to be finished, like proper slugification. But
that should be for follow up bugs.

Note that this also removes the automatically injected variable `name`
which used to be the file name without the extension. I think it never
really made sense to have it.
2016-05-21 11:34:55 -06:00
Jesús Espino
5942736f04 Add ignore config 2016-05-09 09:33:49 +02:00