1
0
Fork 0
forked from github/pelican
Commit graph

2,864 commits

Author SHA1 Message Date
Justin Mayer
72756a5c0d
Merge pull request #2072 from drounin/overrides_ref2021+merge_update
Add THEME_TEMPLATE_OVERRIDES. Refs #2021
2018-03-05 07:50:12 -08:00
Justin Mayer
f7681f7259
Merge pull request #2246 from mosra/theme-static-paths-files
Make THEME_STATIC_PATHS work for files as well
2018-02-10 11:29:06 -08:00
Justin Mayer
59fc1d02a7
Merge pull request #2235 from mosra/paginator-pattern-url
Allow using page URL in pagination patterns
2018-02-10 11:27:02 -08:00
Vladimír Vondruš
037d9aa11b Minimal documentation for the new *_ARCHIVE_URL settings. 2018-02-10 18:26:55 +01:00
Vladimír Vondruš
182fb11c80 Allow to use page URL in pagination pattern.
Currently it was only possible to use page "save as" name or part of it
for generating pagination links. That's not sufficient when page URLs
differ a lot from actual filenames. With this patch it's possible to use
the `{url}` placeholder in PAGINATION_PATTERNS setting. For example, the
paginated archives would be saved to:

    blog/index.html
    blog/2/index.html
    blog/3/index.html

while the actual URLs would be like this (with the help of Apache's
mod_rewrite):

    http://blog.my.site/
    http://blog.my.site/2/
    http://blog.my.site/3/

The configuration that corresponds to this is roughly the following:

    ARCHIVES_SAVE_AS = 'blog/index.html'
    ARCHIVES_URL = 'http://blog.my.site/'
    PAGINATION_PATTERNS = [
        (1, '/{url}', '{base_name}/index.html'),
        (2, '/{url}{number}/', '{base_name}/{number}/index.html')
    ]

Also added YEAR_ARCHIVE_URL, MONTH_ARCHIVE_URL and DAY_ARCHIVE_URL
settings, as they were missing and now they make sense.
2018-02-10 18:26:55 +01:00
Vladimír Vondruš
4995a5c641 test: explicitly verify that all static files are present. 2018-02-10 18:12:46 +01:00
Justin Mayer
e609641336
Merge pull request #2228 from skz169/page-generator-write-page-signal
Add a new signal: page_generator_write_page
2018-02-09 13:12:47 -08:00
Justin Mayer
2d24d6b997
Merge pull request #2288 from charlesfleche/fix-metadata-intrasite-links-squashed
Fix intrasite links for non-'summary' metadata

Metadata like `MyArticleBanner: ![alt text]({attach}banner.jpg)` would be properly parsed (as defined in `FORMATTED_FIELDS`), but the intrasite links would not be processed.

Only the summary gets its intrasite links processed, has its value is either generated from the content (calling self._update_content at some point) or self._update_content is explicitly called if summary is passed as metadata.

This PR expands the paths as soon as possible in (`Content.__init__`) for metadata defined in `FORMATTED_FIELDS`.
2018-02-09 11:41:30 -08:00
Charles Flèche
3de422b1ab Add test for parsed metadata 2018-02-09 10:43:23 +01:00
Charles Flèche
31dc9366f0 Initialize metadata with refresh_metadata_intersite_links 2018-02-09 10:41:32 +01:00
Charles Flèche
06fd9be1c2 Get Content._summary from metadata 2018-02-09 10:40:47 +01:00
Charles Flèche
65daa9e537 Extract refresh_metadata_intersite_links methods 2018-02-09 10:39:11 +01:00
Justin Mayer
98852a63c1
Merge pull request #2227 from JulienPalard/fix_links
FIX: replace freenode.org with freenode.net
2018-02-08 14:41:18 -08:00
Julien Palard
ba1c7f6095 FIX: freenode.org/freenode.net 2018-02-08 23:08:23 +01:00
Justin Mayer
598f9fbc83
Merge pull request #2234 from dwarvenhoard/feature/extension-setting
Add setting so template extensions are configurable
2018-02-08 09:02:05 -08:00
Justin Mayer
f776e56b34
Merge pull request #2122 from ix5/quickstart-jinja
pelican-quickstart: switch to jinja2
2018-02-08 08:49:45 -08:00
Justin Mayer
948b48bb8c
Merge pull request #2197 from jorgesumle/typofix
Correct typos in documentation
2018-02-08 08:45:33 -08:00
Justin Mayer
14aac3a0f4
Merge pull request #2204 from Lucas-C/logs_deduping_min_level
Add --log-dedup-min-level CLI option
2018-02-08 08:44:24 -08:00
Justin Mayer
3492dfe3c8
Merge pull request #2259 from ix5/docs_themes_fix_save_as
Fix documentation for *_SAVE_AS in themes.rst
2018-02-08 08:36:18 -08:00
Justin Mayer
e7ac0a9272
Merge pull request #2196 from mosra/absolute-url-merging
Make URL part joining aware of absolute URLs
2018-02-08 08:19:26 -08:00
Lucas Cimon
f5cc21df0e
Adding --logs-deduping-min-level CLI option 2017-12-15 14:59:47 +01:00
ix5
69bd9e01b6 Fix documentation for *_SAVE_AS in themes.rst:
Update to current defaults
2017-12-10 07:17:51 +01:00
ix5
6d46bf4257 pelican-quickstart: switch to jinja2
- Use the jinja2 templating language for Makefile, fabfile,
  pelicanconf, publishconf, and develop-server.sh
- Add logic in pelican_quickstart.py
- Let jinja2 handle opening and reading template files
- Remove thus unused functions for string.Template
2017-12-10 04:05:38 +01:00
Justin Mayer
34103cd5dd
Merge pull request #2251 from fgallaire/content
Change imported content directory name to "content". Fixes #2250
2017-11-12 08:10:23 -08:00
Florent Gallaire
a091a4b8b9 Change pelican-import output directory default name to "content" (fix #2250) 2017-11-09 19:23:38 +01:00
Justin Mayer
8ebc120f36 Align import style with flake8-import-order 0.15
Addresses: https://github.com/PyCQA/flake8-import-order/issues/120

Refs #2246
2017-11-07 04:18:03 -08:00
Vladimír Vondruš
430868e859 Make THEME_STATIC_PATHS work for files as well.
The test passes now.
2017-11-03 16:04:52 +01:00
Vladimír Vondruš
19a9eeb975 Test that THEME_STATIC_PATHS works for both dirs and files.
It's documented like that. Doesn't work for files, though.
2017-11-03 16:03:35 +01:00
Vladimír Vondruš
0b13aa9b46 Make URL part joining aware of absolute URLs.
Previously, with RELATIVE_URLS disabled, when both SITEURL and
STATIC_URL were absolute, the final generate data URLs looked wrong like
this (two absolute URLs joined by `/`):

    http://your.site/http://static.your.site/image.png

With this patch, the data URLs are correctly:

    http://static.your.site/image.png

This also applies to all *_URL configuration options (for example,
ability to have pages and articles on different domains) and behaves
like one expects even with URLs starting with just `//`, thanks to
making use of urllib.parse.urljoin().

However, when RELATIVE_URLS are enabled, urllib.parse.urljoin() doesn't
handle the relative base correctly. In that case, simple os.path.join()
is used. That, however, breaks the above case, but as RELATIVE_URLS are
meant for local development (thus no data scattered across multiple
domains), I don't see any problem.

Just to clarify, this is a fully backwards-compatible change, it only
enables new use cases that were impossible before.
2017-10-26 23:23:51 +02:00
Vladimír Vondruš
1f30306e23 Make the internal link replacer function public.
So it can be used from outside.
2017-10-26 23:23:51 +02:00
Justin Mayer
56a483475b PyCodeStyle fixes to keep Flake8 happy
Travis appears to be using new versions of underlying code style
analyzers, so these changes were necessary in order to keep tests green.
2017-10-26 13:53:32 -07:00
Dan Bate
88da1b89cb made template extensions configurable 2017-10-24 14:06:57 +01:00
Justin Mayer
71625af8a4 Merge pull request #2230 from jorgesumle/url-docs
Update virtualenv URL in documentation
2017-10-23 07:27:53 -07:00
Justin Mayer
aac005cd0f Merge pull request #2231 from jorgesumle/comma-missing-docs
Correct typo from documentation
2017-10-23 07:26:41 -07:00
Jorge Maldonado Ventura
fa70988421 Correct typo from documentation
Missing comma before etc.
2017-10-22 18:15:11 +02:00
Jorge Maldonado Ventura
e83c3d9796 Update URL from documentation.
The new URL saves us a redirection and uses HTTPS
2017-10-22 15:51:56 +02:00
Sergei K
17b37358e9 Add a new signal: page_generator_write_page 2017-10-17 07:38:18 +05:00
Justin Mayer
359ffcabb8 Merge pull request #2218 from stuaxo/patch-1
Check for 0 dates in pelican-import
2017-10-10 07:14:11 -07:00
Pedro H
50af2ed45d Add THEME_TEMPLATE_OVERRIDES. Refs 2021
Allow for overriding individual templates from the theme by configuring
the Jinja2 `Environment` loader to search for templates in the
`THEME_TEMPLATES_OVERRIDES` path before the theme's `templates/`
directory.
2017-10-10 14:33:20 +08:00
Justin Mayer
db027929b5 Merge pull request #2217 from hugovk/update-python-version-for-tox
Tell Travis to use Python 3.5 image when running Tox
2017-10-09 09:19:56 -07:00
Justin Mayer
da05657e13 Merge pull request #2216 from hugovk/rm-python3.3
Drop unsupported Python 3.3
2017-10-09 09:17:36 -07:00
Stuart Axon
012d034cba Check for 0 dates in pelican-import
Check for 0 dates.

For my own blog this means it doesn't break during import, but I don't know pelican well enough yet to say if this is correct or not.

Error that I was getting before applying this fix
```
Traceback (most recent call last):
  File "/mnt/data/home/stu/.virtualenvs/blog/bin/pelican-import", line 11, in <module>
    sys.exit(main())
  File "/mnt/data/home/stu/.virtualenvs/blog/local/lib/python2.7/site-packages/pelican/tools/pelican_import.py", line 896, in main
    attachments=attachments or None)
  File "/mnt/data/home/stu/.virtualenvs/blog/local/lib/python2.7/site-packages/pelican/tools/pelican_import.py", line 684, in fields2pelican
    kind, in_markup) in fields:
  File "/mnt/data/home/stu/.virtualenvs/blog/local/lib/python2.7/site-packages/pelican/tools/pelican_import.py", line 163, in wp2fields
    date_object = time.strptime(raw_date, '%Y-%m-%d %H:%M:%S')
  File "/usr/lib/python2.7/_strptime.py", line 478, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
    (data_string, format))
ValueError: time data u'0000-00-00 00:00:00' does not match format u'%Y-%m-%d %H:%M:%S'

```
2017-10-02 22:05:42 +01:00
Hugo
ebf31e85c4 Update Python version for Tox to create py35 2017-10-02 18:35:11 +03:00
Hugo
ce0787f0d3 Drop unsupported Python 3.3 2017-10-02 18:33:21 +03:00
Justin Mayer
f8da7077d8 Remove outdated Python versions in CONTRIBUTING
Refs #2139
2017-09-21 05:18:27 -07:00
Justin Mayer
0b8e243738 Merge pull request #2203 from jorgesumle/typo-documentation
Fix typo from documentation
2017-08-23 06:06:27 -07:00
Justin Mayer
5efdd1a778 Merge pull request #2190 from jorgesumle/notmyidea
Improve notmyidea theme
2017-08-23 06:02:24 -07:00
Jorge Maldonado Ventura
2013fc0ab2 Fix typo from documentation 2017-08-12 21:40:27 +02:00
Jorge Maldonado Ventura
d6dca3403d pelican/ is not necessary (documentation content.rst) 2017-08-08 23:45:31 +02:00
Jorge Maldonado Ventura
b1bc9a6f5f Typofix:
- paragraph missing stop
- Remove unnecessary colon
2017-08-08 01:16:19 +02:00