Fizzadar / Luapress

:newspaper: Static site/blog generator written in Lua.
MIT License
198 stars 32 forks source link

Add support for directory generated based on post date #48

Closed paragasu closed 5 years ago

paragasu commented 8 years ago

In jekyll, the post file like 2015-01-10-nodejs-tutorial.md will generate a post on url /2015/01/10/nodejs-tutorial.html.

Is it possible to add the same url scheme in Luapress? Is it possible to achieve this just by writing Luapress plugins?

Fizzadar commented 8 years ago

@paragasu Luapress uses the $date=YYYY/MM/DD format inside the post to manually control the date - otherwise the modification time of the file is used.

For generating the folder structure you desire I could add an option to the config like config.date_folder_posts?

Does jekyll also create archives for each year/month at /2015/01 & /2015 (I would like to also replicate that behavior).

paragasu commented 8 years ago

No, jekyll do not create archives at /year/month or /year. In jekyll, there is a configuration to specify how the post will be generated, here is an example of _config.yaml

title: Something to ponder
email:  myemail@gmail.com
description:  My jekyll website
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://mywebsite.github.io" # the base hostname & protocol for your site
twitter_username: mytwitter
github_username:  mygithub
permalink: /:year/:month/:day/:title

# Build settings
markdown: kramdown

kramdown: 
  input: GFM 
  syntax_highlighter: rouge

jekyll use permalink to control how the output dir will be as opposed to config.date_folder_posts

Fizzadar commented 8 years ago

@paragasu that's much nicer! I'll investigate using config.permalinks to define a link format.

Fizzadar commented 5 years ago

This should finally be possible by specifing get_post_permalink in config: https://github.com/Fizzadar/Luapress/commit/33f36d86b29db35ca0384f1e79d97a4ce149d5d4.