mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
contents: Convert StaticContent to Static, a Page subclass
Static needs a lot of the same handling as other pages, so make it a subclass of Page. The rename from StaticContent to Static makes for cleaner configuration settings (STATIC_URL instead of STATICCONTENT_URL). All currently generated Static instances override the save_as attribute explicitly on initialization, but it isn't hard to imagine wanting to adjust STATIC file output based on metadata (e.g. extracted from their source filename). With this union, the framework for manipulating URLs and filenames is shared between all source file types.
This commit is contained in:
parent
9cbf5c0cbe
commit
49bf80ec39
3 changed files with 109 additions and 27 deletions
|
|
@ -52,6 +52,8 @@ _DEFAULT_CONFIG = {'PATH': '.',
|
|||
'PAGE_SAVE_AS': 'pages/{slug}.html',
|
||||
'PAGE_LANG_URL': 'pages/{slug}-{lang}.html',
|
||||
'PAGE_LANG_SAVE_AS': 'pages/{slug}-{lang}.html',
|
||||
'STATIC_URL': '{path}',
|
||||
'STATIC_SAVE_AS': '{path}',
|
||||
'CATEGORY_URL': 'category/{slug}.html',
|
||||
'CATEGORY_SAVE_AS': 'category/{slug}.html',
|
||||
'TAG_URL': 'tag/{slug}.html',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue