Compare commits

...

3,754 commits

Author SHA1 Message Date
Justin Mayer
b7408cbfe9
Merge pull request #3491 from clockback/enable-flake8-unused-arguments 2025-07-22 19:18:09 +02:00
Justin Mayer
87e3b60da7 Update tests for dark mode & GitHub link changes 2025-07-22 17:41:50 +02:00
Jacki
f95466c8fe Implement dark mode for template
Signed-off-by: Jacki <jacki@thejackimonster.de>
2025-07-22 17:41:50 +02:00
Jacki
4cac1ab5f1 Drop loading external image from Github
Signed-off-by: Jacki <jacki@thejackimonster.de>
2025-07-22 17:41:50 +02:00
Ilya Simpson
6df3cfc6e3 Enable flake8-unused-arguments Ruff rule. 2025-07-22 15:39:30 +12:00
Justin Mayer
162d2b8318
Merge pull request #3477 from clockback/document-feed-domain-default 2025-07-21 20:25:08 +02:00
Ilya Simpson
595713b91a Fix default FEED_DOMAIN: None -> SITEURL.
This is similar to how `AUTHOR_REGEX_SUBSTITUTIONS` is described, for
instance.
2025-07-21 20:22:27 +02:00
Justin Mayer
7ef5eae639 Update feed functional tests for FeedGenerator 2.2 2025-07-21 20:14:15 +02:00
Justin Mayer
eb0d4deb01
Merge pull request #3488 from GeorgeHu6/chinese-translation 2025-07-13 13:06:21 +02:00
GeorgeHu6
f92b2a27ab Doc: update Chinese translation 2025-07-13 16:40:13 +08:00
Justin Mayer
95965459f2 docs: Fix linter errors with invoke lint --fix 2025-07-09 09:15:40 +02:00
Justin Mayer
3efb0817e3 Ignore Ruff 0.12 rule compliance in git blame 2025-07-08 08:13:44 +02:00
Justin Mayer
f4ee3b7946
Merge pull request #3483 from boxydog/ruff_0_12_2 2025-07-08 08:10:18 +02:00
Justin Mayer
939434b4ab
Merge pull request #3482 from getpelican/limit-dependabot 2025-07-07 08:25:47 +02:00
boxydog
4dedf17958 Move ruff to 0.12.2 and fix new complaints 2025-07-05 10:09:08 -05:00
Justin Mayer
a29857ac19
Merge pull request #3467 from nkr0/bump-pygments-version 2025-07-05 08:39:01 +02:00
Justin Mayer
bfd1068b82
Merge pull request #3474 from clockback/use-lists-not-tuples 2025-07-05 07:48:57 +02:00
Justin Mayer
0e358c611c
Merge pull request #3479 from clockback/fix-default-slug-regex-substitutions 2025-07-05 07:45:13 +02:00
Ilya Simpson
fca2fde2ed Change lists, not tuples, in config settings
In the documentation, both `SOCIAL` and `LINKS` are described as a list
of tuples, but all examples show them as tuples of tuples. It makes the
most sense for them to be lists, so the examples should match the docs
going forward.

Similarly, `LOCALE` is described as a list, but the examples show it as
a tuple. Likewise, the examples should be lists, in line with the
description.
2025-07-04 20:06:44 +12:00
Justin Mayer
ff4460c3d7 Limit Dependabot scope to GitHub Actions only
Sometimes we intentionally pin specific package versions -- such as for
Pygments, Jinja2, and Markdown -- and thus automated Dependabot PRs for
those packages are spurious and unwanted.
2025-07-01 09:31:01 +02:00
Ilya Simpson
b2ac0e93aa Fixing default SLUG_REGEX_SUBSTITUTIONS in docs.
Backslashes should not have been doubled, given the defaults are raw
strings.
2025-06-07 22:12:46 +12:00
Justin Mayer
9e3e1325c0
Merge pull request #3475 from clockback/enable-flake8-builtins 2025-06-02 15:11:00 +02:00
Ilya Simpson
f44ec52427 Enable flake8-builtins Ruff rule. 2025-06-02 17:22:50 +12:00
Justin Mayer
9f6cc9f0d7
Merge pull request #3473 from clockback/main 2025-05-30 09:42:26 +02:00
Ilya Simpson
ffe22e3c59 Fixing documented default for ARTICLE_SAVE_AS. 2025-05-29 22:29:33 +12:00
Justin Mayer
487486138f
Merge pull request #3470 from emmanuel-ferdman/main
fix: Resolve `datetime` warnings
2025-05-14 09:48:34 +02:00
Emmanuel Ferdman
07f32c1a09
fix: resolve datetime warnings
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-05-13 06:40:14 -07:00
n
ca32b1b77c bump pygments version to <2.20.0 2025-05-10 12:41:57 +02:00
Justin Mayer
f9711fa10a
Merge pull request #3462 from Kristinita/KiraValidPathMetadataValue
docs: Use raw string for the `PATH_METADATA` setting
2025-04-19 12:28:16 +02:00
Kristinita
7fd66d8a95
docs: Use raw string for the PATH_METADATA setting 2025-04-19 11:00:42 +03:00
Al Sweigart
9c7749a298
docs: Move default values to fix settings anchor links (#3458)
* Fix anchor links for settings by moving default value text down.
* Fix typos in default values.

---------

Co-authored-by: Justin Mayer <entroP@gmail.com>
2025-04-12 12:38:30 +02:00
Justin Mayer
88a6f57940 Upgrade Beautiful Soup & adjust tests to conform 2025-04-11 21:13:41 +02:00
Justin Mayer
5338f4fac2
Merge pull request #3447 from ceyusa/update-docs
docs: Update install from sources using setuptools
2025-03-25 09:51:00 -07:00
Víctor Manuel Jáquez Leal
b71159a11e docs: Update install from sources using setuptools 2025-01-27 06:18:55 +01:00
botpub
69e24fa82f Release Pelican 4.11.0 2025-01-15 17:01:09 +00:00
Justin Mayer
ec95a2c855 Prepare release 2025-01-15 17:53:09 +01:00
Yashas Lokesh
543424aa41
fix: Fix auto-reload with globs in IGNORE_FILES (#3441)
The default `IGNORE_FILES` value of `'.*'` was being compiled to a regular expression and then passed into `watchfiles.DefaultFilter` to filter out files when auto-reload is enabled.

This commit compares the patterns from `IGNORE_FILES` directly with the filename to match the usage of `fnmatch` elsewhere in the codebase. The new filtering class will continue working as expected for custom `IGNORE_FILES` settings.
2025-01-15 17:40:27 +01:00
Vincent Cheng
5be013d9d2
Make build reproducible by reading envvar SOURCE_DATE_EPOCH if set (#3430)
Co-authored-by: Justin Mayer <entroP@gmail.com>
2025-01-15 17:36:52 +01:00
Justin Mayer
64be147463
Merge pull request #3405 from frederik-elwert/improve-simple-theme
Add more blocks to Simple theme's base template
2025-01-15 12:32:12 +01:00
Frederik Elwert
4fcc24ddfe Add test for simple theme and inheritance 2025-01-15 12:00:16 +01:00
Frederik Elwert
af3c2ed0cf Add block name in endblock 2025-01-15 11:58:05 +01:00
Frederik Elwert
d813c5148e Add more blocks to simple base template
This change makes it easier to create new themes by inheriting from the
simple theme. It allows customization of the whole body (while still
making use of the theme’s head), or individual parts of the body like
header, menu, or footer.
2025-01-15 11:58:05 +01:00
Alvin Mites
4878fc82a7
chore: Update link to re-directed example settings file (#3445) 2025-01-15 11:43:52 +01:00
Justin Mayer
8a1c55ed07 docs: Clarify namespace plugin loading order 2025-01-14 12:49:34 +01:00
David Lesieur
9207e1ff62
feat: Add setting to omit selected Typogrify filters. Fixes #3436 (#3439) 2025-01-14 12:48:39 +01:00
Justin Mayer
fa0af6d221
Merge pull request #3438 from davidlesieur/typogrify-test-ignore-tags
test:  Fix `test_typogrify_ignore_tags` due to Typogrify 2.1 changes
2025-01-14 12:41:17 +01:00
Justin Mayer
b3ef32bcf1 test: Require Typogrify 2.1+ to pass updated test 2025-01-14 12:35:17 +01:00
David Lesieur
b4fcb7f4e3 Remove obsolete comment regarding widont. 2025-01-14 12:30:06 +01:00
David Lesieur
7a4c89f64a Adjust test following changes in Typogrify.
Typogrify's 'widont' filter used to ignore the list of 'ignore_tags', but this got fixed in Typogrify.
2025-01-14 12:30:06 +01:00
Justin Mayer
74d76ca0da Pin Pygments due to indentation changes in 2.19 2025-01-14 12:26:35 +01:00
Justin Mayer
a17521b6f7
Merge pull request #3435 from hugovk/add-3.13 2024-12-22 11:45:12 +01:00
Hugo van Kemenade
5bb39c4f6f Replace deprecated logger.warn with logger.warning 2024-12-21 15:53:56 +02:00
Hugo van Kemenade
714a3d53a1 Drop support for EOL Python 3.8 2024-12-21 15:53:13 +02:00
Hugo van Kemenade
7d4adfce3f Add support for Python 3.13 2024-12-21 15:45:35 +02:00
botpub
07c7eacab9 Release Pelican 4.10.2
Some checks failed
build / Test - 3.10 - macos (push) Has been cancelled
build / Test - 3.11 - macos (push) Has been cancelled
build / Test - 3.12 - macos (push) Has been cancelled
build / Test - 3.10 - ubuntu (push) Has been cancelled
build / Test - 3.11 - ubuntu (push) Has been cancelled
build / Test - 3.12 - ubuntu (push) Has been cancelled
build / Test - 3.8 - ubuntu (push) Has been cancelled
build / Test - 3.9 - ubuntu (push) Has been cancelled
build / Test - 3.10 - windows (push) Has been cancelled
build / Test - 3.11 - windows (push) Has been cancelled
build / Test - 3.12 - windows (push) Has been cancelled
build / Lint (push) Has been cancelled
build / Test build (push) Has been cancelled
build / Build docs (push) Has been cancelled
build / Deploy (push) Has been cancelled
2024-11-27 19:53:23 +00:00
Scott Colby
d9652ef109
fix: SUMMARY_MAX_PARAGRAPHS not respected in some combinations with SUMMARY_MAX_LENGTH (#3427) 2024-11-27 20:51:03 +01:00
Justin Mayer
7096b0a168
Merge pull request #3424 from projectgus/settings/ignore_files 2024-11-27 20:37:49 +01:00
Justin Mayer
ac28ddb9bf
Merge pull request #3425 from mart-e/replacement-indicator-log-full 2024-11-27 20:30:00 +01:00
Martin
31538d1578 [IMP] add information in error message
Not always clear what was the issue with only the keyword
2024-11-11 14:54:48 +01:00
Angus Gratton
1edca55253 settings: Change the default IGNORE_FILES to all "hidden" files.
This is to avoid subtle behaviour that contributed to root cause of
https://github.com/pelican-plugins/sitemap/issues/36

Specifically: if installing Pelican into a local virtualenv with the pdm or uv
default name ".venv", then subdirectories of .venv will contain all of the test
.rst and .md files.

If you then run Pelican in that same root directory using the default PATH
value (".") then it will add those content files to the site.
2024-11-10 12:05:02 +11:00
Justin Mayer
882cd16e11
Merge pull request #3423 from GeorgeHu6/chinese-translation
Some checks failed
build / Test - 3.10 - macos (push) Has been cancelled
build / Test - 3.11 - macos (push) Has been cancelled
build / Test - 3.12 - macos (push) Has been cancelled
build / Test - 3.10 - ubuntu (push) Has been cancelled
build / Test - 3.11 - ubuntu (push) Has been cancelled
build / Test - 3.12 - ubuntu (push) Has been cancelled
build / Test - 3.8 - ubuntu (push) Has been cancelled
build / Test - 3.9 - ubuntu (push) Has been cancelled
build / Test - 3.10 - windows (push) Has been cancelled
build / Test - 3.11 - windows (push) Has been cancelled
build / Test - 3.12 - windows (push) Has been cancelled
build / Lint (push) Has been cancelled
build / Test build (push) Has been cancelled
build / Build docs (push) Has been cancelled
build / Deploy (push) Has been cancelled
Docs: Update Chinese translation
2024-11-08 10:57:37 +01:00
GeorgeHu6
60261b8c99 Doc: update Chinese translation 2024-11-07 16:31:32 +08:00
Justin Mayer
4ca1454293
Merge pull request #3421 from boxydog/precommit_update_202411
Some checks failed
build / Test - 3.10 - macos (push) Has been cancelled
build / Test - 3.11 - macos (push) Has been cancelled
build / Test - 3.12 - macos (push) Has been cancelled
build / Test - 3.10 - ubuntu (push) Has been cancelled
build / Test - 3.11 - ubuntu (push) Has been cancelled
build / Test - 3.12 - ubuntu (push) Has been cancelled
build / Test - 3.8 - ubuntu (push) Has been cancelled
build / Test - 3.9 - ubuntu (push) Has been cancelled
build / Test - 3.10 - windows (push) Has been cancelled
build / Test - 3.11 - windows (push) Has been cancelled
build / Test - 3.12 - windows (push) Has been cancelled
build / Lint (push) Has been cancelled
build / Test build (push) Has been cancelled
build / Build docs (push) Has been cancelled
build / Deploy (push) Has been cancelled
2024-11-03 20:57:55 +01:00
boxydog
075542721c pre-commit autoupdate and fix new issues pointed out by ruff 2024-11-03 13:32:32 -06:00
Noel Miller
0da2530d9b
De-couple build workflow from GitHub Pages publication (#3404)
Some checks failed
build / Test - 3.10 - macos (push) Has been cancelled
build / Test - 3.11 - macos (push) Has been cancelled
build / Test - 3.12 - macos (push) Has been cancelled
build / Test - 3.10 - ubuntu (push) Has been cancelled
build / Test - 3.11 - ubuntu (push) Has been cancelled
build / Test - 3.12 - ubuntu (push) Has been cancelled
build / Test - 3.8 - ubuntu (push) Has been cancelled
build / Test - 3.9 - ubuntu (push) Has been cancelled
build / Test - 3.10 - windows (push) Has been cancelled
build / Test - 3.11 - windows (push) Has been cancelled
build / Test - 3.12 - windows (push) Has been cancelled
build / Lint (push) Has been cancelled
build / Test build (push) Has been cancelled
build / Build docs (push) Has been cancelled
build / Deploy (push) Has been cancelled
2024-10-22 09:59:19 -07:00
Justin Mayer
31264498e1
Add FAQ entry about theme overrides (#3406)
Some checks failed
build / Test - 3.10 - macos (push) Has been cancelled
build / Test - 3.11 - macos (push) Has been cancelled
build / Test - 3.12 - macos (push) Has been cancelled
build / Test - 3.10 - ubuntu (push) Has been cancelled
build / Test - 3.11 - ubuntu (push) Has been cancelled
build / Test - 3.12 - ubuntu (push) Has been cancelled
build / Test - 3.8 - ubuntu (push) Has been cancelled
build / Test - 3.9 - ubuntu (push) Has been cancelled
build / Test - 3.10 - windows (push) Has been cancelled
build / Test - 3.11 - windows (push) Has been cancelled
build / Test - 3.12 - windows (push) Has been cancelled
build / Lint (push) Has been cancelled
build / Test build (push) Has been cancelled
build / Build docs (push) Has been cancelled
build / Deploy (push) Has been cancelled
2024-10-17 09:13:39 -07:00
Frederik Elwert
92050d90bc Add FAQ regarding theme overrides
Currently, the documentation refers to creating new themes a lot.
It is much less apparent how one can customize an existing theme by
overriding individual templates or adding new ones. This commit adds
an FAQ for this, and also mentions the mechanism in the FAQ on custom
templates.
2024-10-10 14:35:07 +02:00
Justin Mayer
b02abf0220 Improve GitHub issue templates
Some checks failed
build / Test - 3.10 - macos (push) Has been cancelled
build / Test - 3.11 - macos (push) Has been cancelled
build / Test - 3.12 - macos (push) Has been cancelled
build / Test - 3.10 - ubuntu (push) Has been cancelled
build / Test - 3.11 - ubuntu (push) Has been cancelled
build / Test - 3.12 - ubuntu (push) Has been cancelled
build / Test - 3.8 - ubuntu (push) Has been cancelled
build / Test - 3.9 - ubuntu (push) Has been cancelled
build / Test - 3.10 - windows (push) Has been cancelled
build / Test - 3.11 - windows (push) Has been cancelled
build / Test - 3.12 - windows (push) Has been cancelled
build / Lint (push) Has been cancelled
build / Test build (push) Has been cancelled
build / Build docs (push) Has been cancelled
build / Deploy (push) Has been cancelled
2024-10-04 15:06:11 +02:00
Justin Mayer
f5dc4d4b96 Disable blank GitHub issues
Existing issue template categories should cover most any case.
2024-10-04 15:04:13 +02:00
Justin Mayer
478012e0d0 Clarify _include_path() parameter docstring 2024-10-02 19:08:26 +02:00
botpub
b86383fb28 Release Pelican 4.10.1 2024-09-28 17:02:04 +00:00
Justin Mayer
fe45094545 Prepare release 2024-09-28 18:59:03 +02:00
Frederik Elwert
08283b4915
Fix symbolic link handling in pelican-themes -s/-c (#3392) 2024-09-28 18:55:22 +02:00
Justin Mayer
0cb445c813
Don't store a RichHandler object in the argparse namespace (#3394) (#3398) 2024-09-28 18:50:54 +02:00
Clément Pit-Claudel
6c6b940ffc Don't store a RichHandler object in the argparse namespace (#3394) 2024-09-20 18:49:23 +02:00
Lioman
84db21c724
Match actual version instead of regex in build CI job (#3396) 2024-09-20 14:46:29 +02:00
Justin Mayer
2f9d382c56
Fix build job failure in GitHub CI workflow (#3395) 2024-09-20 14:35:07 +02:00
Lioman
86bf9230b4 test: fix build test
the regex, searching for the builded files was not stable to changes for two digit versions.

fixes: Build test failures in GitHub CI workflow #3393
2024-09-19 14:25:01 +02:00
botpub
a5db130e1d Release Pelican 4.10.0 2024-09-16 13:23:38 +00:00
Justin Mayer
9e8af627b5 Prepare release 2024-09-16 15:16:43 +02:00
Justin Mayer
44db258f59 Adjust list of Git-ignored files 2024-09-16 15:11:14 +02:00
GeorgeHu
e609b4d78a
Translate documentation into Simplified Chinese (#3346) 2024-09-15 14:29:01 +02:00
Egbert
5687883d4b
Bump Pygments to 2.16.1 in test requirements; fixes #3385 (#3386) 2024-09-12 14:21:12 +02:00
Justin Mayer
84f2995b38
Merge pull request #3387 from gagath/optimize-taskspy-template 2024-09-12 13:33:38 +02:00
GiovanH
4201256a5b
Add disabled status for #3304 (#3305) 2024-09-12 13:28:51 +02:00
Agathe Porte
2d375bc135 tasks.py.jinja2: optimize imports
When opening the generated tasks.py file with a Python linter enabled,
some imports will be marked as unecessary depending on the options
passed to pelican-quickstart.

Add if statements around the optional imports so they are used
only when necessary.
2024-08-04 22:39:50 +09:00
Justin Mayer
bb0ed26fdd Document how to have same source & output hierarchy 2024-07-30 10:00:36 +02:00
Justin Mayer
d85f493ee3 Add initial configuration for Vale prose linter
Vale: <https://github.com/errata-ai/vale>
2024-07-30 09:56:27 +02:00
Agathe
513abbfdc6
Introduce paragraph count summary (#2761)
Co-authored-by: Justin Mayer <entroP@gmail.com>
2024-06-25 15:07:41 +02:00
Justin Mayer
ef501a3d89
Merge pull request #3345 from getpelican/main-default-branch 2024-06-25 11:40:03 +02:00
Justin Mayer
36ebe91af7 Rename default branch to main 2024-06-25 11:33:28 +02:00
Justin Mayer
28e54106f2 Update Ruff linter 2024-06-25 11:00:41 +02:00
Justin Mayer
bdd4e45628 Enforce 75% code coverage in CI via Tox 2024-06-25 10:54:24 +02:00
Justin Mayer
6a50191728 Tweak Markdown-not-installed console warnings
Adding single-quotation marks should cause 'markdown' to be highlighted
in green, presumably via Rich.
2024-06-25 10:49:07 +02:00
Justin Mayer
f89f8894cc
Merge pull request #3321 from boxydog/warn_about_markdown 2024-06-25 10:10:34 +02:00
Justin Mayer
6fec5786d0
Merge pull request #3339 from tpwo/patch-1 2024-06-19 22:52:20 +02:00
Tomasz Wojdat
5171631dec
chore: update URLs of GitHub Ribbons
Old URLs are no longer active. New ones were taken from GitHub blog:
https://github.blog/2008-12-19-github-ribbons/

Also update output in functional tests.
2024-06-19 19:11:41 +02:00
Justin Mayer
8d63d1ced8
Merge pull request #3338 from getpelican/remove-sphinx-ifconfig 2024-06-18 09:27:03 +02:00
Justin Mayer
49723e6daf Docs: Remove ifconfig Sphinx extension
Originally added in #815, something about this seems to be causing an
obscure ReadTheDocs build error.
2024-06-18 09:08:45 +02:00
Justin Mayer
993c75103b Generate social cards in Sphinx documentation
Without `matplotlib` installed, Sphinx output says that social cards
cannot be generated.
2024-06-18 09:04:59 +02:00
Justin Mayer
7a2c72e604
Merge pull request #3337 from getpelican/document-feed-domain-optional 2024-06-17 22:22:59 +02:00
Justin Mayer
05535c7d6c Docs: GitHub Pages workflow is now supported 2024-06-17 22:19:21 +02:00
Sean Hammond
853e9e6b8a
Document that feed_domain is not required 2024-06-17 20:46:28 +01:00
dependabot[bot]
617aba077f Bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 21:14:49 +02:00
dependabot[bot]
487877f206 Bump actions/deploy-pages from 2 to 4
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 2 to 4.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](https://github.com/actions/deploy-pages/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/deploy-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 21:14:31 +02:00
dependabot[bot]
750a1f8bfa Bump actions/configure-pages from 3 to 5
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 3 to 5.
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](https://github.com/actions/configure-pages/compare/v3...v5)

---
updated-dependencies:
- dependency-name: actions/configure-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 21:14:18 +02:00
dependabot[bot]
d03ae2a41f Bump actions/upload-pages-artifact from 2 to 3
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 21:13:54 +02:00
Justin Mayer
b17182ece1
Merge pull request #3330 from seanh/gha-theme-support 2024-06-17 20:43:09 +02:00
Justin Mayer
50f77b42b2 Add CODEOWNERS file to project 2024-06-17 20:36:18 +02:00
Sean Hammond
135c61f769
Add Dependabot to GitHub Actions workflow docs 2024-06-17 16:38:10 +01:00
boxydog
f19de98b9e Log warnings about files that would have been processed by disabled readers 2024-06-17 09:30:55 -05:00
Sean Hammond
e46595cdac
Add theme, Python version, siteurl and feed_domain to GitHub Pages deployment workflow
Add theme, Python version, siteurl and feed_domain support to the
reusable GitHub Actions workflow for deploying a Pelican site to GitHub
Pages:

1. Add a new `theme` option to the workflow that callers can use to
   specify an external theme to be checked out and used

2. Add a new `python` option to the workflow that callers can use to
   specify the Python version, in case they need to build their site
   with a particular version of Python

3. Pass `--extra-settings FEED_DOMAIN='"${{ steps.pages.outputs.base_url }}"'`
   to the `pelican` command to set the value of Pelican's `FEED_DOMAIN`
   setting for feed URLs.

4. Add a `feed_domain` input to the workflow so that users can override
   the feed domain if they need to.

5. Add a `siteurl` input to the workflow so that users can override the
   site URL if they need to.

6. Add a note to the docs about GitHub Pages generating http:// URLs for
   https:// sites, and how to fix it

7. Some light editing of the docs for the workflow
2024-06-17 13:57:10 +01:00
Justin Mayer
79d37ba491
Merge pull request #3328 from seanh/gha-dependabot 2024-06-17 13:43:27 +02:00
Sean Hammond
dc40474e29
Use Dependabot to keep GitHub Actions up to date
Configure Dependabot to send automated PRs to update the version numbers
in `.github/workflows/*.yml` when new versions of actions are released.

See:

https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
2024-06-17 12:39:07 +01:00
Justin Mayer
5c7e4bbac4
Merge pull request #3325 from boxydog/master 2024-06-16 20:22:59 +02:00
Justin Mayer
b80a592d30 Lower minimum coverage required in invoke coverage 2024-06-16 19:37:23 +02:00
Justin Mayer
d83c5029b8
Merge pull request #3323 from boxydog/coverage 2024-06-16 19:30:10 +02:00
Justin Mayer
e262990c68 Tweak docs about test coverage and git blame 2024-06-16 19:23:46 +02:00
Justin Mayer
fd955ba054 Show missing line numbers via invoke coverage
Also includes a change that causes this command to return a failing
status when coverage drops below its current value of 74.8%.
2024-06-16 19:16:58 +02:00
boxydog
8c7c29e4f2
Add dependabot checking (#5) 2024-06-02 14:03:56 -05:00
Justin Mayer
657ad64f49
Merge pull request #3322 from boxydog/more_ruff5 2024-06-02 09:05:29 +02:00
Justin Mayer
af9865d317 Ignore Ruff UP031 fixes in git blame 2024-06-02 09:01:21 +02:00
boxydog
b77bb690e2 Improve test coverage, docs, and .gitignore 2024-06-01 18:51:46 -05:00
boxydog
30bde3823f ruff UP031 in files: use format specifiers instead of percent format 2024-06-01 16:00:17 -05:00
boxydog
3e81af966a ruff UP031: use format specifiers instead of percent format 2024-06-01 16:00:07 -05:00
Justin Mayer
8fd94ea025
Merge pull request #3320 from boxydog/d_more_ruff4 2024-05-31 18:35:59 +02:00
boxydog
82b48fcfa1 Fixes in files for ruff T201, RUF001, PLR2004, B904, SLOT000, PYI024, PIE800 2024-05-31 10:41:24 -05:00
boxydog
fc45791da4 Fix or ignore ruff T201, RUF001, PLR2004, B904, SLOT000, PYI024, PIE800 2024-05-31 10:41:09 -05:00
Justin Mayer
2687475fba
Merge pull request #3318 from boxydog/more_ruff_fixes3 2024-05-31 16:56:47 +02:00
boxydog
9b77a9027b File fixes for ruff B007, RUF015, PLR1722 2024-05-31 08:48:44 -05:00
boxydog
cbe6c08f44 Don't ignore ruff B007, RUF015, PLR1722 2024-05-31 08:48:32 -05:00
Justin Mayer
ccb4e58882
Merge pull request #3315 from boxydog/jinja_precommit 2024-05-31 14:50:46 +02:00
Justin Mayer
37ba4fc21a Ignore DjHTML indentation changes in git blame 2024-05-31 14:46:06 +02:00
boxydog
4af40e8077 pre-commit filter auto-indents templates, css, js 2024-05-31 07:34:01 -05:00
boxydog
7f07c220de Add pre-commit djhtml, djcss, djjs to indent templates 2024-05-31 07:33:03 -05:00
Justin Mayer
270fd4edcc
Merge pull request #3316 from boxydog/apply_filters_to_test_output 2024-05-31 14:28:47 +02:00
boxydog
98bdd87dae Apply pre-commit filters to the files in pelican/tests/output 2024-05-31 07:21:40 -05:00
boxydog
308af1912e Apply pre-commit filters to pelican/tests/output 2024-05-31 07:21:13 -05:00
Justin Mayer
59756f8faf
Merge pull request #3314 from boxydog/more_ruff_fixes2 2024-05-30 21:45:55 +02:00
Justin Mayer
3569dede01 Ignore more Ruff fixes in git blame 2024-05-30 21:40:27 +02:00
boxydog
7577dd7603 More ruff fixes in files: stop ignoring C408, UP007, PLR5501, B006 2024-05-30 13:21:12 -05:00
boxydog
3624bcdbf4 More ruff fixes: stop ignoring C408, UP007, PLR5501, B006 2024-05-30 13:20:51 -05:00
Justin Mayer
880e9769e8
Merge pull request #3312 from boxydog/more_ruff_fixes 2024-05-30 19:46:58 +02:00
Justin Mayer
144b2edf88 Ignore more Ruff fixes in git blame 2024-05-30 19:40:45 +02:00
boxydog
9d30c5608a Code changes for more ruff checks 2024-05-30 12:21:52 -05:00
boxydog
b6d3b65899 More ruff checks 2024-05-30 12:21:52 -05:00
Justin Mayer
425f302880
Merge pull request #3313 from boxydog/upgrade_ruff 2024-05-30 19:20:32 +02:00
Justin Mayer
9d46a94d6d Ignore Ruff 0.4.x fixes in git blame 2024-05-30 19:15:56 +02:00
boxydog
54ac03fca6 change ruff version in pyproject.toml 2024-05-30 10:56:06 -05:00
boxydog
0bd02c00c0 Ruff v0.4.6 auto-fixes 2024-05-30 10:53:38 -05:00
boxydog
800f22b3ba Upgrade ruff to v0.4.6, pre-commit-hooks to v4.6.0 2024-05-30 10:49:57 -05:00
Clément Pit-Claudel
39c964450c
Choose logging handler via --log-handler CLI option (#3293) 2024-05-30 17:13:27 +02:00
Justin Mayer
c46063cfc3 Ignore latest Ruff fixes in git blame 2024-05-30 16:42:09 +02:00
Justin Mayer
8d8feb6341
Merge pull request #3311 from boxydog/fix_3216_two_commits 2024-05-30 16:33:57 +02:00
boxydog
6d8597addb The ruff and ruff-format fixes 2024-05-30 09:08:16 -05:00
boxydog
4f46fedd73 More Ruff checks, and make it fix 2024-05-30 09:04:58 -05:00
Justin Mayer
f0b6e8732f
Merge pull request #3310 from boxydog/fix_3309
Fix collection error with `test_deprecated_attribute` test
2024-05-30 07:34:08 +02:00
boxydog
1001dcb609 Fix test_deprecated_attribute failures in github tests 2024-05-29 16:36:20 -05:00
Justin Mayer
e4d7f0a9d9 Docs: GitHub Pages workflow not officially supported 2024-05-29 07:29:33 +02:00
GiovanH
0b5934a1fa
Feature: Add setting to append ref parameter to links in feeds (#3249) 2024-04-19 20:54:27 +02:00
Justin Mayer
0f5179b816
Merge pull request #3301 from avaris/gha-windows 2024-04-19 20:38:59 +02:00
Deniz Turgut
666b962eb6
workaround Turkish locale issue 2024-04-19 21:08:26 +03:00
Justin Mayer
94bcd41f27 Ignore Sphinx 7.2.x package install warnings
Sphinx 7.2+ requires Python 3.9+, which results in annoying warnings
since we still support Python 3.8.x.
2024-03-27 08:26:55 +01:00
Justin Mayer
b87308cfaa Update Ruff dependency version 2024-03-27 08:26:24 +01:00
Justin Mayer
fabc409277 Update more GitHub Actions to resolve warnings 2024-03-12 12:18:11 +01:00
Justin Mayer
7454138184 Update setup-python & setup-pdm GitHub Actions 2024-03-12 12:07:53 +01:00
Justin Mayer
7c7c9355b6 Pin Ruff to major semantic version 0.1.x
Upgrading to 0.3.0+ requires code style changes to the code base.
2024-03-12 11:57:46 +01:00
Justin Mayer
960aee5907
Merge pull request #3280 from MinchinWeb/summary-links 2024-01-29 15:06:18 +01:00
Justin Mayer
8a01cb11e1
Merge pull request #3276 from MinchinWeb/plugin-error-loading 2024-01-29 15:03:51 +01:00
MinchinWeb
1f14606f83 On failing to load a plugin, show the stacktrace is pelican is run in debug mode 2024-01-27 10:51:35 -07:00
MinchinWeb
f1f2ceccc7 Warning/error logging: be explicit in how the stacklevel variable is handled 2024-01-27 10:47:54 -07:00
MinchinWeb
c36ab07526 write back to ._summary 2024-01-26 16:31:22 -07:00
Justin Mayer
ff35d26cbc
Merge pull request #3264 from boxydog/medium_importer 2024-01-26 10:02:54 +01:00
Justin Mayer
dbf90a4821
Merge pull request #3278 from bjoernricks/contents-types 2024-01-24 22:54:01 +01:00
Björn Ricks
e4807316ae
Add type hints for utils module
Types make it easier to understand the code and improve autocompletion
in IDEs.
2024-01-24 16:15:50 +01:00
Björn Ricks
3a662ace03
Add type hints for contents module
Types make it easier to understand the code and improve autocompletion
in IDEs.
2024-01-23 11:33:24 +01:00
namori
2fa5c515b0
Feeds - Update generators.py to fix a bug with slugs (#3279) 2024-01-23 09:43:07 +01:00
MinchinWeb
d39dd9b85f Resolve inter-site links in summaries.
c.f. https://github.com/getpelican/pelican/issues/3265
c.f. https://github.com/MinchinWeb/minchin.pelican.plugins.summary/issues/5
2024-01-21 23:13:21 -07:00
Justin Mayer
f2ab4a1dc1
Merge pull request #3251 from snosratiershad/support/new-line-at-end-of-scripts 2024-01-17 12:10:45 +01:00
Justin Mayer
fbe81a971a
Delete RELEASE.md 2024-01-17 09:48:05 +01:00
Justin Mayer
def0899f10
Merge pull request #3267 from bjoernricks/setting-types 2024-01-17 09:44:42 +01:00
boxydog
d6a33f1d21 Medium post importer (from medium export) 2024-01-16 16:56:07 -06:00
Salar Nosrati-Ershad
b1cb6c7326
Use --no-jekyll flag when invoking ghp-import (#3259) 2024-01-15 11:10:12 +01:00
Salar Nosrati-Ershad
5e6dba73ac
Add Github Pages commit message variable (#3250) 2024-01-15 11:03:54 +01:00
boxydog
bf4fd679a5
Document how to import posts from Medium (#3262) 2024-01-15 10:43:19 +01:00
Björn Ricks
f69e2cca6b
Add type hints for settings module
Types make it easier to understand the code and improve autocompletion
in IDEs.
2024-01-15 09:05:14 +01:00
MinchinWeb
f0beb81a97 Better error logging if a plugin refuses to load 2024-01-14 13:45:51 -07:00
Justin Mayer
5d3e87b50b
Merge pull request #3269 from das-g/patch-1 2024-01-12 20:00:53 +01:00
Justin Mayer
af37f0656f
Merge pull request #3257 from MinchinWeb/real-logging 2024-01-09 21:51:58 +01:00
Raphael Das Gupta
8626d5bd85
docs: update URL to AsciiDoc website
https://www.methods.co.nz/asciidoc/
gives a SSL certificate warning
and a 404 (page not found) error.
https://asciidoc.org is the new official website
for the AsciiDoc file format.
(It's also what https://en.wikipedia.org/wiki/AsciiDoc links to.)
2023-12-22 15:56:57 +01:00
Justin Mayer
2d75ca8391
Merge pull request #3260 from pauloxnet/update_pipeline_settings 2023-11-29 08:22:44 +01:00
Paolo Melchiorre
61eacffa90
Update tox and GitHub pipeline 2023-11-28 21:38:26 +01:00
MinchinWeb
4ed5c0d5b8 Log the original calling location, rather than the wrapper function 2023-11-25 20:57:40 -07:00
Salar Nosrati-Ershad
7466b13e0a fix: keep newline at the end of the file in tools
As referenced in Jinja documentation about whitespace control:
<https://jinja.palletsprojects.com/en/3.1.x/templates/#whitespace-control>
>  To keep single trailing newlines, configure Jinja to
>  `keep_trailing_newline`
I added this to our Jinja environment to keep EOL new line in tools
scripts
2023-11-22 22:54:42 +03:30
Vivek Bharadwaj
d9b2bc3a4e
Add GH pages action to fix file permissions (#3248) 2023-11-19 10:48:13 +01:00
botpub
7194cf5795 Release Pelican 4.9.1 2023-11-15 17:16:23 +00:00
Justin Mayer
a1d475fb22
Merge pull request #3246 from MinchinWeb/tz-windows 2023-11-15 18:13:19 +01:00
Justin Mayer
6fd2c0d8e6
Merge branch 'master' into tz-windows 2023-11-15 18:08:49 +01:00
Justin Mayer
76f7343b61 Prepare release 2023-11-15 18:08:10 +01:00
Justin Mayer
f510b4b21f Remove reference to non-existent requirements file 2023-11-15 17:52:41 +01:00
MinchinWeb
a2525f7db4 Remove tzdata from testing requirements.
Should be installed by pelican directly, if needed, based on OS.
2023-11-13 14:42:29 -07:00
MinchinWeb
1d0fd456e8 Add tzdata requirement on Windows 2023-11-13 12:18:41 -07:00
botpub
6cd707a668 Release Pelican 4.9.0 2023-11-12 17:44:45 +00:00
Justin Mayer
7ca66ee9d0 Prepare release 2023-11-12 18:03:36 +01:00
Justin Mayer
9525583ccd
Merge pull request #3243 from avaris/remove-write-selected 2023-11-12 17:56:34 +01:00
Deniz Turgut
86d6898517
remove WRITE_SELECTED
Implementation is buggy and unreliable. Therefore, it is better to
remove the functionality until a robust implementation is added.
2023-11-12 19:43:26 +03:00
Justin Mayer
0c5d63c69e Update documentation related to contributing 2023-11-12 17:11:23 +01:00
Justin Mayer
eca501ac1e
Merge pull request #3242 from pauloxnet/issues/2888 2023-11-12 16:04:28 +01:00
Justin Mayer
e92ccb8a46
Merge pull request #3241 from getpelican/pyupgrade-py38-plus 2023-11-12 16:02:38 +01:00
Justin Mayer
2238dcab07 Ignore code format commits from git blame 2023-11-12 15:53:13 +01:00
Paolo Melchiorre
db241feaa4
Fix #2888 -- Apply ruff and pyupgrade to templates 2023-11-12 15:06:02 +01:00
Justin Mayer
ecd598f293 Update code base for Python 3.8 and above
Result of: pipx run pyupgrade --py38-plus pelican/**/*.py
2023-11-12 13:53:02 +01:00
Justin Mayer
903ce3ce33 Pin Furo doc theme version
We override its page.html template with our own, so it is better to
manually and explicity upgrade rather than have a future version
of the Furo theme potentially break the documentation build.
2023-11-12 13:41:38 +01:00
Justin Mayer
39ff56a082 Update development dependencies 2023-11-12 13:38:30 +01:00
Justin Mayer
be5afa3175
Merge pull request #3234 from pauloxnet/feature/3233-simple-classless-semantic-html 2023-11-12 07:58:12 +01:00
Paolo Melchiorre
6059675d55
Fix #3233 -- Simple theme classless semantic HTML 2023-11-11 14:10:08 +01:00
Justin Mayer
d7015db9e4
Merge pull request #3240 from avaris/remove-icons 2023-11-09 09:06:53 +01:00
Deniz Turgut
e014e5b55b
add notmyidea font license 2023-11-04 01:00:51 +03:00
Deniz Turgut
451b094a94
remove social icons from notmyidea theme
redistribution of these icons may not be compatible with AGPL
2023-11-04 00:54:21 +03:00
Justin Mayer
dc1b6ab14d
Merge pull request #3238 from avaris/ordered-blinker 2023-11-02 23:27:15 +01:00
Deniz Turgut
8a8b952ecb
preserve connection order in blinker 2023-11-03 01:13:12 +03:00
Justin Mayer
14f19474df
Merge pull request #3235 from avaris/plugin-enabled 2023-11-02 16:58:42 +01:00
Justin Mayer
32b72123f0
Modify wording slightly 2023-11-02 14:09:51 +01:00
Justin Mayer
ee10d6995a
Merge pull request #3236 from avaris/missing-dependency 2023-11-01 23:10:34 +01:00
Deniz Turgut
49aef30dab
add sphinxext-opengraph to pyproject dev requirements 2023-11-01 23:19:26 +03:00
Deniz Turgut
feae8ef41c
Provide a plugin_enabled Jinja test for themes 2023-11-01 22:49:15 +03:00
Justin Mayer
76650898a6 Update to Markdown 3.5.1 in test requirements 2023-11-01 09:43:21 +01:00
Justin Mayer
e6a5e2a665 Update pre-commit hook versions 2023-11-01 09:07:48 +01:00
Justin Mayer
abae21494d Adjust line length to 88 in EditorConfig 2023-10-31 16:50:48 +01:00
Justin Mayer
a20cd8dda5
Merge pull request #3231 from getpelican/enforce-code-style 2023-10-30 19:49:58 +01:00
Justin Mayer
3c57996945 Ignore Ruff format commit in the blame view 2023-10-30 19:45:42 +01:00
Justin Mayer
08785f714f Remove obsolete linters: Flake8, Black, isort 2023-10-30 19:35:59 +01:00
Lioman
4e438ffe60
Enable tests to validate dist build contents (#3229) 2023-10-30 16:04:44 +01:00
Justin Mayer
6f467fefdc
Merge pull request #3232 from avaris/git-test-fix 2023-10-29 23:25:26 +01:00
Deniz Turgut
f0aab11a2d
Force git subprocess in tests to use utf-8 2023-10-30 00:53:15 +03:00
boxydog
805ca9b4a9 Run pre-commit on all files during CI test job 2023-10-29 22:21:04 +01:00
Chris Rose
271f4dd68f Strip trailing whitespace 2023-10-29 22:19:44 +01:00
Chris Rose
cabdb26cee Apply code style to project via: ruff format . 2023-10-29 22:18:29 +01:00
Chris Rose
8ea27b82f6 Bump all of the dev dependencies
- remove upper version caps
- updated the minimum version of most of Pelican's runtime deps
- replaced black with ruff as a formatter for pelican
- added a cache step to the docs CI task so that the docs can be
  downloaded and inspected.
2023-10-29 22:11:28 +01:00
Justin Mayer
bfb2587697
Merge pull request #3228 from boxydog/fix_1463 2023-10-29 20:03:37 +01:00
boxydog
dbe0b1125f Don't copy file ownership, permissions and metadata 2023-10-29 12:55:37 -05:00
Justin Mayer
a23a4e14cf
Merge pull request #3189 from seanh/publish-to-ghp-using-gha 2023-10-29 18:29:52 +01:00
Deniz Turgut
6f1605edf9
Extend GHA documentation to specify requirements file 2023-10-29 18:30:25 +03:00
Justin Mayer
842c6537f1
Merge pull request #3226 from getpelican/manifest 2023-10-29 16:16:40 +01:00
Justin Mayer
9437de6341 Include more files in PDM sdist builds
This was previously the job of directives in MANIFEST.in, which should
be covered by this PDM-specific configuration.
2023-10-29 16:12:09 +01:00
Justin Mayer
cce1570135 Fix some comments in wheel-related test 2023-10-29 15:53:11 +01:00
Justin Mayer
73599f44f2
Merge pull request #3220 from lioman/centralize-python-information 2023-10-29 15:43:41 +01:00
Lioman
8a0f335e2b only install dev dependencies during lint step 2023-10-29 15:23:14 +01:00
Justin Mayer
165d57eff5
Merge pull request #3127 from mart-e/no-inifinite-feed 2023-10-29 14:23:28 +01:00
Lioman
eb052cae09 Capitalize PDM in docs 2023-10-29 12:41:55 +01:00
Lioman
00d26fc068 remove old setup files 2023-10-29 12:01:42 +01:00
Lioman
8b6d215934 migrate configuration to PEP621 compatible config
- adapt documentation
- add wheel tests to check wheel contents.
- adapt pipeline to use pdm
- adapt autopub config
- add scripts as shortcuts to invoke tasks
2023-10-29 11:59:58 +01:00
Justin Mayer
c18f1a7308 Re-order pyproject items, with other small fixes 2023-10-29 08:48:37 +01:00
Lioman
a76a419585 migrate configuration to PEP621 compatible one 2023-10-29 08:48:37 +01:00
boxydog
fad2ff7ae3
Add unit test utilities temporary_locale and TestCaseWithCLocale (#3224) 2023-10-29 00:40:40 +02:00
Justin Mayer
fec78ebf33
Merge pull request #3225 from boxydog/test_coverage 2023-10-29 00:36:29 +02:00
boxydog
3a6ae72333 Add a "coverage" task to generate a coverage report
Add a one-liner about "invoke" in docs.
2023-10-28 17:35:00 -05:00
Justin Mayer
84795c701c
Merge pull request #3222 from offbyone/test-on-macos 2023-10-28 23:26:24 +02:00
Justin Mayer
3dce25ab23
Merge pull request #3151 from RealOrangeOne/feature/watchfiles 2023-10-28 23:23:44 +02:00
Justin Mayer
269751b033
Merge pull request #3223 from offbyone/switch-to-ruff 2023-10-28 22:38:26 +02:00
Justin Mayer
85bf98232d
Merge pull request #3148 from djramones/period-archives-context 2023-10-28 22:22:11 +02:00
Will Thong
8a7e01646b
Add rel='nofollow' to all external hardcoded links in templates (#3162) 2023-10-28 22:11:44 +02:00
Yasser Tahiri
b812f2ad1c
chore: Simplify boolean if expression (#2944) 2023-10-28 22:06:24 +02:00
Justin Mayer
e14f20bb99
Merge pull request #2758 from MinchinWeb/settings-pathlib-2 2023-10-28 21:56:34 +02:00
Deniz Turgut
b8d5919cd2
expand period tests to be more specific 2023-10-28 22:11:11 +03:00
Chris Rose
33d6712e8b
Don't install pelican's dependencies to lint 2023-10-28 11:18:24 -07:00
Chris Rose
29b10ef6e6
Use poetry directly in lints 2023-10-28 11:05:15 -07:00
Chris Rose
6cf6a1ffe9
Ruff lint fixes 2023-10-28 11:05:15 -07:00
Chris Rose
58fd855385
inv task now uses ruff 2023-10-28 11:05:15 -07:00
Chris Rose
19c797af5e
Add support to verify windows, too 2023-10-28 10:55:01 -07:00
Chris Rose
7dfc799f25
Use ruff in pre-commit 2023-10-28 10:44:47 -07:00
Chris Rose
f342dc3097
Add macOS testing for 3.11/3.12 2023-10-28 08:00:27 -07:00
Deniz Turgut
43e513f218
run pelican first before waiting for changes 2023-10-28 17:37:56 +03:00
Deniz Turgut
b289dcea82
don't watch not existing paths 2023-10-28 17:30:45 +03:00
Jake Howard
631ac1bdb3
Cleanup imports 2023-10-28 17:17:14 +03:00
Jake Howard
b388057d66
Remove unused extensions list 2023-10-28 17:15:56 +03:00
Jake Howard
5519efef2e
Log watching files which don't exist 2023-10-28 17:15:55 +03:00
Jake Howard
7643e0e92b
Make sure the package depends on watchfiles 2023-10-28 17:15:54 +03:00
Jake Howard
61ca47c519
Use watchfiles as a file watching backend
This doesn't use polling unless absolutely necessarily, making it more efficient. It also reduces the amount of first-party code required, and simplifies working out which files are being watched.
2023-10-28 17:15:54 +03:00
Justin Mayer
6ed7395812
Merge pull request #3221 from avaris/importer-fixes 2023-10-28 16:10:47 +02:00
Deniz Turgut
11c13ceae1
use a tempfile for intermediate html file for pandoc in importer 2023-10-28 16:50:34 +03:00
Deniz Turgut
83a8059d02
force timestamp conversion in tumblr importer to be UTC with offset and adjust tests 2023-10-28 16:50:34 +03:00
Justin Mayer
a20bbb55d6
Merge pull request #3044 from copperchin/fix-3042 2023-10-28 14:28:42 +02:00
Gullumluvl
dc427ad9d6
Strip HTML tags from SITENAME inside title tags. Fixes #3147 (#3149) 2023-10-28 14:24:16 +02:00
Deniz Turgut
b6a9a8333b
skip tests that require git if git is not installed
and minor tweaks to subprocess handling
2023-10-28 14:57:33 +03:00
boxydog
9c87d8f3a3
Deal with broken embedded video links when importing from Tumblr (#3218)
Co-authored-by: boxydog <boxydog@users.noreply.github.com>
Co-authored-by: Will Thong <will@willthong.com>
2023-10-28 12:56:00 +02:00
Justin Mayer
6a623ba10a
Merge pull request #3119 from getpelican/remove-pkg_resources 2023-10-28 11:34:47 +02:00
Justin Mayer
865f7b10dd Replace deprecated pkg_resources
importlib.metadata.version() appears to be the anointed replacement.
2023-10-28 11:29:50 +02:00
Justin Mayer
91d9ef7a70 Add tzdata as dependency in test requirements
Otherwise yields the following error with Python 3.10 on Windows:

zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key UTC'
2023-10-28 11:17:48 +02:00
Lioman
58e70082e0 Remove python 3.7 build configuration 2023-10-28 11:05:29 +02:00
Justin Mayer
8fd5d6f51b Fix IRC server in new GitHub issue template 2023-10-28 09:55:16 +02:00
boxydog
1404a2dbc3
Remove newline when importing Tumblr post photos (#3215)
Co-authored-by: Dan Frankowski <dfrankow@gmail.com>
2023-10-27 21:56:34 +02:00
Justin Mayer
fab6e1a2c5 Fix warning re: future dates setting. Fixes #3184 2023-10-24 11:07:25 +02:00
Justin Mayer
777a708ef7
Merge pull request #3198 from mart-e/remove-posterous 2023-10-24 10:22:19 +02:00
Justin Mayer
620139cdaf
Merge pull request #3141 from mart-e/wp-caption-to-figure 2023-10-24 10:20:22 +02:00
Justin Mayer
0282c1d6eb
Merge pull request #3200 from lioman/don't-run-deploy-on-fork 2023-10-24 10:15:03 +02:00
Justin Mayer
4caf9a88a2
Merge pull request #3204 from FriedrichFroebel/dataclass-in-settings 2023-10-24 10:12:38 +02:00
Justin Mayer
36b4c6dc08
Merge pull request #3205 from getpelican/sphinx-opengraph 2023-10-18 08:36:48 +02:00
Justin Mayer
a8fefad331 Add OpenGraph metadata to docs via Sphinx extension 2023-10-13 08:01:29 +02:00
FriedrichFroebel
ab9e55b398
Allow dataclasses in settings 2023-10-11 19:29:17 +02:00
Martin Trigaux
5d8c03108b Remove Posterous integration
Posterous closed down in 2013.
The API is no longer accessible and the code did not work in python 3
(base64.encodestring was expecting bytes, not string)
2023-10-06 09:34:26 +02:00
Lioman
5c36cfbb9b Only run 'Deploy' action on main repository
Deploy action will always fail on forks as the token is not there.
2023-10-04 10:58:18 +02:00
Justin Mayer
82e2571754
Merge pull request #3199 from lioman/add-pythen-3.12-to-tests 2023-10-03 18:04:38 +02:00
Lioman
de0fae8182 Add python 3.12 to test matrix 2023-10-03 16:59:57 +02:00
Martin (mart-e)
48166bd687 Convert Wordpress caption to figure
In Wordpress, inserting image with a caption can look like:

[caption id="attachment_42" caption="Image Description"]<a ...><img ... /></a>[/caption]
[caption id="attachment_42"]<a ...><img ... /></a> Image Description[/caption]
[caption id="attachment_42"]<img ... > Image Description[/caption]

Replace by an HTML figure tag
2023-10-03 11:45:31 +02:00
Sean Hammond
29185e4ad7
Add GitHub Actions workflow for GitHub Pages
Add a GitHub Actions workflow that users can use to publish their
Pelican sites to GitHub Pages by running `pelican` on GitHub Actions,
without having to run `pelican` locally and push the output directory to
a branch.

See: https://github.com/getpelican/pelican/discussions/3174
2023-09-03 15:15:39 +01:00
Justin Mayer
3be0703b14 Tell GitHub-Linguist to ignore HTML files
Refs #3188
2023-08-27 16:47:45 +02:00
Justin Mayer
e724de9ffe Improve GitHub-Linguist language breakdown
Refs #3188
2023-08-27 16:39:27 +02:00
DJ Ramones
30adfba1ca
Revert *_ARCHIVE_URL default settings to blank 2023-08-17 02:35:39 +08:00
DJ Ramones
8a5f02ac60
Move _build_period_archives out of generate_context
So that we don't contribute to further clutter in generate_context.
2023-08-17 02:04:06 +08:00
Will Thong
2eeff62fd7
Replace pytz dependency in tests (#3165) 2023-08-15 20:07:39 +02:00
Moritz Meier
0d1bcd4b11
Pelican QuickStart: Address tzlocal API change (#3155) 2023-08-08 09:21:10 +02:00
Justin Mayer
63b60da919 Build docs in zipped HTML and PDF formats 2023-08-03 14:44:13 +02:00
Justin Mayer
48a0484d15 Improve ReadTheDocs configuration 2023-08-03 14:37:39 +02:00
Justin Mayer
9384e7cb0b Add ReadTheDocs configuration file 2023-08-03 14:29:18 +02:00
Justin Mayer
639173da6b Generalize analytics support in default theme
As the number of privacy-preserving analytics options proliferates,
it no longer makes sense to support specific solutions provided by
ad-tracking corporations.
2023-08-03 14:10:37 +02:00
Justin Mayer
5435dd0d81 Document _update_context(dict) --> list of tuples
Fix #3024
2023-08-03 11:34:05 +02:00
Justin Mayer
dcd3045f32 Docs: Escape extra setting environment variables. Fix #3016 2023-08-03 10:21:54 +02:00
Justin Mayer
0989ed29be
Merge pull request #2980 from pauloxnet/patch-1 2023-08-03 09:44:48 +02:00
Paolo Melchiorre
5d1dcd8ed3
Remove useless url 2023-08-03 08:49:16 +02:00
Paolo Melchiorre
bf0860ee86
Try to fix documentation build 2023-08-03 08:49:13 +02:00
Paolo Melchiorre
7acc9ac554
Fix documentations errors 2023-08-03 08:48:51 +02:00
Paolo Melchiorre
413c6a1c71
Order codes in themes.rst 2023-08-03 08:48:32 +02:00
Justin Mayer
44d9754466 Add monthly downloads badge to README 2023-08-02 11:01:40 +02:00
Justin Mayer
e8076bfe03
Merge pull request #3164 from marcusdesai/fix/issue-3163 2023-07-27 22:11:28 +02:00
Will Thong
1d2bf8e96e
Replace pytz dependency with zoneinfo. Fix #2958 (#3161) 2023-07-26 17:29:43 +02:00
Justin Mayer
715c056cd4 Update Pygments dev dependency version 2023-07-26 11:24:20 +02:00
Marcus Desai
7f1ecdec8b Fixes #3163; cleanup child processes on kill 2023-07-25 20:27:40 +01:00
(GalaxyMaster)
b8bf5950b6
Adding missing tests for truncate_html_words() (#2918) 2023-07-12 11:28:26 +02:00
Justin Mayer
ef7e26329c Change botpub email address for Git commits 2023-06-29 11:15:41 +02:00
Jorge Maldonado Ventura
0533e2da9f
Small documentation fixes to docs/content.rst (#3156) 2023-06-27 20:35:04 +02:00
Justin Mayer
69d2b5b9af
Merge pull request #3154 from jorgesumle/master 2023-06-24 16:58:54 +02:00
Jorge Maldonado Ventura
b260b3838e Fix grammar errors/typos from docs/faq.rst 2023-06-24 13:29:02 +02:00
Justin Mayer
410f60d6b3 Publish package via PyPI trusted publisher system 2023-06-23 15:54:39 +02:00
Justin Mayer
d3daa4d794 Update Furo theme & pytest-cov dependency versions 2023-06-23 15:53:21 +02:00
Justin Mayer
33220695d1
Merge pull request #3153 from jorgesumle/master 2023-06-23 15:22:19 +02:00
Jorge Maldonado Ventura
7d6accac4d Code should be between backquotes () 2023-06-23 09:27:51 +02:00
Jorge Maldonado Ventura
7877376153 More corrections to pelican-themes.rst 2023-06-23 09:20:32 +02:00
Jorge Maldonado Ventura
168093a750 Fix typo in pelican-themes.rst 2023-06-23 09:05:34 +02:00
DJ Ramones
6ba7a0926d
Clarify docs on ordering in period_archives var 2023-06-19 12:25:32 +08:00
DJ Ramones
5214248344
Implement period_archives common context variable
Also, set default patterns for time-period *_ARCHIVE_URL settings.
2023-06-18 11:07:39 +08:00
Deniz Turgut
1f6b344f7d Add sftp_upload Makefile target to .phony
Signed-off-by: Deniz Turgut <dturgut@gmail.com>
2023-06-04 10:44:00 +02:00
Matthew Pounsett
418a9191b0 Add devserver-global Makefile target to .phony, fixes #3065 2023-06-04 10:44:00 +02:00
Justin Mayer
23c50ea885
Merge pull request #3115 from mart-e/import-config-file 2023-06-04 10:36:55 +02:00
Justin Mayer
1b360acafa
Merge pull request #3114 from mart-e/import-markdown-wp 2023-06-04 10:35:44 +02:00
Matthew Pounsett
bbbc96cf83
Add quoting to devserver-global target in Makefile, fixes #3072 (#3073) 2023-06-04 10:34:09 +02:00
Justin Mayer
043ab617b8
Merge pull request #3124 from FriedrichFroebel/issue3110 2023-06-04 10:32:49 +02:00
Justin Mayer
8b6b7dac2d
Merge pull request #3139 from nikolausschueler/patch-1 2023-05-31 19:58:31 +02:00
Nikolaus Schüler
0a42b5f250
Fix typo in pelican-themes.rst
The least change would be to just say "suffixed", but I don't think that's a correct english word, so I choose "followed by"
2023-05-30 15:58:09 +02:00
Justin Mayer
6f93202e60 Add new Pelican Plugins org link to content docs 2023-05-22 15:12:09 +02:00
Martin (mart-e)
ef844dbe0a Use the default configuration
When importing a blog, a error is logged: 'No timezone information
specified in the settings'.
This is because the code calls read_settings() but no configuration
file is provided.
Instead of providing one (users may not already have one if they are
at the import step), use the default settings.
2023-05-14 08:50:06 +02:00
Martin (mart-e)
bb682973fb Don't specify unlimited feed size by default
Having a feed with hundreds of articles, making a very large file, is
rarely expected.

Set a high fallback value of 100 so it does not change for small sites.

Still allow to have infinite feed by setting FEED_MAX_ITEM = None
2023-05-13 06:53:51 +02:00
FriedrichFroebel
7adcfc7938 Allow resetting memoized cache. Fixes #3110. 2023-04-24 18:44:50 +02:00
Justin Mayer
86f62d0a92
Merge pull request #2963 from geoffff/master 2023-04-20 11:41:00 +02:00
geoffff
8bb9e0da48 Update paginator.py
Use str.startswith('/') to check whether 'ret' starts with a slash. The original code fails when 'ret' is an empty string, such as when INDEX_URL is set to "".
2023-04-20 11:34:38 +02:00
Justin Mayer
208332c0e6
Merge pull request #3112 from getpelican/update-functional-test-output 2023-04-20 08:38:04 +02:00
Justin Mayer
4db5c7ca4b Update to Invoke 2.0 for Python 3.11 compatibility 2023-04-16 09:08:31 +02:00
Justin Mayer
6ac497922f Update pre-commit hooks 2023-04-16 09:07:44 +02:00
Martin (mart-e)
219c01afb0 [IMP] pelican_import with gmf instead of markdown
The markdown import of pandoc is their own flavour of markdown. It for
instance uses fenced divs[1] which are not supported by
python-markdown.  When importing content from Wordpress, there is
several issues as explained in discussion 3113[2]
This change follows a discussion with pandoc developer[3]

[1] https://pandoc.org/MANUAL.html#divs-and-spans
[2] https://github.com/getpelican/pelican/discussions/3113
[3] https://fosstodon.org/@pandoc/110105559949588768

Take the following Wordpress blog post sample:
```html
<p><!-- wp:paragraph --></p>
<p>Paragraph content</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:image {"align":"center","id":3747,"sizeSlug":"full"} --></p>
<div class="wp-block-image">
<figure class="aligncenter size-full"><img src="https://test.com/test.jpg" alt="" class="wp-image-3747" title="Some title"/><br />
<figcaption><em>Some caption</em></figcaption>
</figure>
</div>
<p><!-- /wp:image --></p>
```
Before this commit:
was imported as

```md
`<!-- wp:paragraph -->`{=html}

Paragraph content

`<!-- /wp:paragraph -->`{=html}

`<!-- wp:image {"align":"center","id":3747,"sizeSlug":"full"} -->`{=html}

::: wp-block-image
<figure class="aligncenter size-full">
<img src="https://test.com/test.jpg" title="Some title"
class="wp-image-3747" /><br />

<figcaption><em>Some caption</em></figcaption>
</figure>
:::

`<!-- /wp:image -->`{=html}
```

After this change:
```md
<!-- wp:paragraph -->

Paragraph content

<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":3747,"sizeSlug":"full"} -->

<div class="wp-block-image">

<figure class="aligncenter size-full">
<img src="https://test.com/test.jpg" title="Some title"
class="wp-image-3747" /><br />

<figcaption><em>Some caption</em></figcaption>
</figure>

</div>

<!-- /wp:image -->
```

Fixes #3113
2023-03-29 14:07:23 +02:00
Justin Mayer
a2852942ea Update Pygments and Markdown dependency versions 2023-03-27 10:44:01 +02:00
Justin Mayer
06c9e0fb80 Pin Flake8 to 3.9.* in requirements/style.pip 2023-03-27 10:36:00 +02:00
Justin Mayer
385d5bf75e Update functional test output 2023-03-27 10:02:07 +02:00
Boluwatife Victor
b473280eac
Add better description of what Pelican does to README (#3102)
Co-authored-by: Justin Mayer <entroP@gmail.com>
2023-02-23 18:22:56 -08:00
Justin Mayer
95ff3b8e62
Merge pull request #3094 from kurtmckee/fix-readme-link-on-pypi-issue-3093
Fixes https://github.com/getpelican/pelican/issues/3093
2023-01-30 18:00:38 +01:00
Kurt McKee
f50bf26466
Use absolute URL's in the package long_description for PyPI
Fixes #3093
2023-01-30 08:20:12 -06:00
Justin Mayer
7850153c54
Merge pull request #3085 from jorgesumle/deprecate-36 2023-01-30 00:23:56 +01:00
Justin Mayer
504bfcf703
Merge pull request #3091 from EFord36/patch-1 2023-01-20 15:48:15 +01:00
Elliot Ford
b777bedce3
Update Github actions badge
See the linked GitHub issue from the previous version of the badge: badges/shields#8671

In summary, these badges were changed in a breaking fashion such that the badges were just linking to the github issue rather than showing the data. Updating the url resolves this.

Also updated the link added to the badge image, so that it shows exactly the history of actions that the badge shows the most recent one of.
2023-01-20 14:28:44 +00:00
Justin Mayer
4d82a42229 Upgrade Furo theme to 2022.12.07. Refs #3077
Should fix "Previous" and "Next" arrow styling issue.
2023-01-06 10:31:01 +01:00
Justin Mayer
ff665de3ca Tweak README slightly 2023-01-06 10:23:14 +01:00
Jorge Maldonado Ventura
5e986580e8 Change reference to Python version 3.6 from documentation (now 3.7) 2023-01-03 21:29:02 +01:00
Ryan de Kleer
b10c7c699b Fix false-positive in content gen. test failures
Assert equal dirs by return value of diff subprocess, rather than its output.

This prevents tests from failing when file contents are the same but the
file modes are different.

Fix #3042
2022-11-27 22:53:49 -08:00
Justin Mayer
f015ab89d9
Merge pull request #3055 from avaris/python-3.11 2022-10-26 11:12:53 -10:00
Deniz Turgut
3937028c00
update unit test to avoid using deprecated locale.getdefaultlocale() 2022-10-26 23:52:38 +03:00
Deniz Turgut
6ddbc83f43
add python 3.11 to CI and use setup-python pip cache 2022-10-26 23:50:36 +03:00
Justin Mayer
a51d75c8ed
Merge pull request #3043 from copperchin/use-tmp-in-testutils 2022-10-25 14:11:33 -10:00
Justin Mayer
1f6f4a3626
Merge pull request #3054 from renyuneyun/refactor/python-regex 2022-10-24 15:48:40 -10:00
renyuneyun (Rui Zhao)
cbddac44e4 Use (?P=) to replace \2 for intrasite link 2022-10-24 18:05:40 -07:00
Justin Mayer
66408d611f
Merge pull request #3051 from avaris/gh-actions-update 2022-10-24 18:00:17 -07:00
Deniz Turgut
cdc90d5d07
unpin flake8 and do not install pelican while checking
installing pelican brings in markdown. flake8 and markdown have
incompatible requirements for importlib-metadata. installing pelican
is not required to run flake8.
2022-10-23 18:25:25 +03:00
Deniz Turgut
6d11c6f2e5
use python 3.9 for lint, docs and deploy actions
3.7 is old and will soon be EOLed
this also fixes flake8 + importlib-metadata issues
2022-10-20 04:17:11 +03:00
Deniz Turgut
9d509253c3
update github actions
see:
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2022-10-20 04:09:48 +03:00
Ryan de Kleer
27f2c678cb Use tmp dir for test output
`shutil.rmtree` would fail in `TestUtils.test_clean_output_dir` on some
filesystems if an application with a filewatcher had the pelican project
open while the test ran.

Using `tempfile.mkdtmp` for test directories circumvents this.
2022-09-16 22:59:54 -07:00
Justin Mayer
2a7e691000 Document switch from IRC to GitHub Discussions 2022-09-15 16:33:19 +02:00
Саша Черных
5d4cb5619b
Docs: Hidden posts also excluded from author index (#3025) 2022-09-13 14:30:43 +02:00
Justin Mayer
6af939e096
Merge pull request #3030 from lioman/master 2022-08-31 23:28:54 +02:00
Lioman
5103aa9a38 Remove python 3.6 from supported language versions 2022-08-23 13:07:19 +02:00
Justin Mayer
09d434d87b Docs: Contact plugin/theme maintainers for those issues 2022-08-21 08:57:07 +02:00
Justin Mayer
062144a875
Merge pull request #3020 from timgates42/bugfix_typos 2022-08-04 15:09:53 +02:00
Justin Mayer
e265deb094
Merge pull request #2976 from pieqq/simple-theme-fixes 2022-08-04 15:08:09 +02:00
Justin Mayer
73c0320f62
Merge pull request #3014 from Lx/static-content-docs 2022-08-04 15:04:35 +02:00
Justin Mayer
083fb357bd
Merge pull request #3013 from Lx/mtime-docs 2022-08-04 15:03:20 +02:00
Anton Mosich
23f3804c96
Fix and update pre-commit hooks (#3011)
Co-authored-by: Justin Mayer <entroP@gmail.com>
2022-08-04 15:01:17 +02:00
Justin Mayer
1bcd6c5f56
Merge pull request #3023 from getpelican/furo-sphinx-theme
Use Furo as Sphinx documentation theme
2022-08-01 15:42:37 +02:00
Justin Mayer
21e855a29f Adjust code style for Flake8 5.0+
We are pinned to Flake8 <4.0, but at least we'll be compliant if we ever
upgrade to Flake8 5.0+.
2022-08-01 13:24:21 +02:00
Justin Mayer
9c0c5b4929 Pin Flake8 due to upper bound on importlib-metadata
See: https://github.com/PyCQA/flake8/pull/1438
2022-08-01 13:23:01 +02:00
Justin Mayer
6487735efb Update Pytest and plugin versions
Also remove pytest-pythonpath as Pytest 7+ includes comparable
functionality. Don't believe we were using it anyway.
2022-08-01 12:56:58 +02:00
Justin Mayer
09c420f40c Update Jinja & Markdown dev dependency versions 2022-08-01 12:55:02 +02:00
Justin Mayer
fcfb39b8f2 Improve copyright year logic in Sphinx configuration 2022-08-01 12:53:09 +02:00
Justin Mayer
81b5fbe174 Add custom Furo page.html template for Sphinx docs 2022-08-01 12:53:09 +02:00
Justin Mayer
33aca76d78 Adjust extlinks configuration for Sphinx 5.0+ 2022-08-01 12:53:09 +02:00
Justin Mayer
961909a149 Update Sphinx and Furo theme dependency versions 2022-08-01 12:53:09 +02:00
Paolo Melchiorre
ac416d7df2 Add Furo as requirement for docs 2022-08-01 10:25:36 +02:00
Paolo Melchiorre
494b418dda Use Furo as Sphinx documentation theme 2022-08-01 10:25:36 +02:00
Tim Gates
6cac8237cc
docs: Fix a few typos
There are small typos in:
- docs/tips.rst
- pelican/tests/__init__.py

Fixes:
- Should read `module` rather than `modulole`.
- Should read `console` rather than `cosole`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2022-07-24 07:55:18 +10:00
Justin Mayer
84dfbcf3dc
Update PR links in changelog 2022-07-11 19:54:13 +02:00
botpub
9685e4b594 Release Pelican 4.8.0 2022-07-11 17:51:01 +00:00
manhhomienbienthuy
d5d792060c
Fix #2982: Improve _HTMLWordTruncator (#3002) 2022-07-11 19:47:37 +02:00
Justin Mayer
5c222ef41b
Merge pull request #3001 from canyon289/content_expansion 2022-07-11 19:36:54 +02:00
Justin Mayer
c46554ae70
Merge pull request #3000 from canyon289/typo_fix 2022-07-11 19:35:52 +02:00
Alex Peters
7006016121 Add note about unintended static page processing
Fixes #2990.
2022-06-16 14:18:52 +10:00
Alex Peters
39e5edde9c Describe all CHECK_MODIFIED_METHOD options
Fixes #2991.
2022-06-16 13:36:59 +10:00
Ravin Kumar
392bf98118 Add content tag static expansion 2022-04-28 19:53:03 -07:00
Ravin Kumar
595f3be988 Add content expansion 2022-04-28 19:31:21 -07:00
Ravin Kumar
d89c6f6ed2 Fix small typo 2022-04-28 19:28:26 -07:00
Justin Mayer
e8d6318e93
Merge pull request #2989 from chadmando/fix-typo-in-docs
Fix missing word in Automation section
2022-04-03 08:11:00 +02:00
Justin Mayer
f94ba0ef3d
Merge pull request #2994 from avaris/2992
Use JSON values for extra settings in Invoke template
2022-04-03 08:06:26 +02:00
Deniz Turgut
eca0ee04b7
use JSON values for extra settings in invoke template
Signed-off-by: Deniz Turgut <dturgut@gmail.com>
2022-03-23 22:33:57 +03:00
chadmando
433453924b
fix missing word in Automation section 2022-03-11 11:09:59 -06:00
Pierre Equoy
16b8a03ad9 Remove unnecessary ids and classes in simple theme
All of the modified HTML tags can be accessed in CSS without the need
for a dedicated id or an additional class.
2022-02-20 10:29:46 +08:00
Pierre
34ca2e1de2
Merge branch 'getpelican:master' into master 2022-02-20 10:29:06 +08:00
Justin Mayer
77e5381be7
Update CHANGELOG 2022-02-09 09:07:42 -07:00
botpub
5823412085 Release Pelican 4.7.2 2022-02-09 13:25:50 +00:00
Ikko Ashimine
f3613af155
Fix typo in cache.py (#2978)
sublcass -> subclass
2022-02-09 06:15:59 -07:00
Justin Mayer
21c331e789
Merge pull request #2940 from r4victor/fix-issue-2938-attempt-2
Fix parsing of settings passed to `--extra-settings`
2022-02-09 06:12:00 -07:00
Victor Skvortsov
5c178a1ccb Fix #2938
Get rid of the coerce_overrides() function.
Add the ParseOverrides argparse.Action to parse overrides.
Treat all extra settings values strictly as json values.
Test overrides.
Edit docs and cli help.
2022-02-09 06:05:50 -07:00
Victor Skvortsov
ab81f183c6 Add failing tests 2022-02-09 06:05:50 -07:00
Justin Mayer
fe19f1abb6 Pin Sphinx to avoid aggressive extlinks warning
See: https://github.com/sphinx-doc/sphinx/issues/10112
2022-02-01 12:10:20 -07:00
Paolo Melchiorre
2f5fc10614
Add categories.html template to default theme 2022-02-01 11:07:23 -07:00
Pierre Equoy
4794752dd9 Add a viewport meta tag in simple theme for better mobile support
See MDN article about this:

https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag
2022-01-17 16:22:02 +08:00
Pierre Equoy
7b9a859e5e Use <main> and <article> tags in simple theme
Add a <main> tag to surround all the content blocks, so that it's easier
to target the main part of a page (be it an article, the list of posts
or the different categories) using CSS.

Because of this, the <section> part of the article.html template is made
redundant, so it is removed.

Finally, the generic <div> is replaced by an <article> tag to surround
the article's content.
2022-01-17 16:21:59 +08:00
Pierre Equoy
fe4f1ec4ea Uniformize headers in simple theme
In the simple theme, some templates are using `h1`, others are using
`h2` for the main title of the page (other than the one in the header).
This commit changes that so all of the pages are using `h1`.
2022-01-17 16:21:44 +08:00
Gunung P. Wibisono
0384c9bc07
Update Poetry install script to install-poetry.py (#2965) 2022-01-06 16:26:41 -08:00
Justin Mayer
11633992a0
Merge pull request #2952 from ingwinlu/bugfix/2951
Clean up quickstart script
2021-11-27 08:00:39 -07:00
Justin Mayer
4c8572e85d
Merge pull request #2950 from ingwinlu/bugfix/2941
Change spaces to tab as required by Makefile
2021-11-27 07:19:31 -07:00
Justin Mayer
1a321102a1
Merge pull request #2948 from ingwinlu/bugfix/#2845
Extend docstring of slugify util
2021-11-27 07:18:54 -07:00
Lukas Winkler
8f6a61439d Add helper method for rendering jinja templates 2021-11-27 14:04:36 +01:00
Lukas Winkler
59f7f4beb8 Remove unneeded explicit close stmts
Closes #2951
2021-11-27 13:56:33 +01:00
Lukas Winkler
2e35bc90a6 Change spaces to tab as required by Makefile
Closes #2941
2021-11-27 10:31:14 +01:00
Lukas Winkler
fa31a7e279 Extend docstring
We want to hint at the location of our default set of substitutions.
This should allow easier reuse for plugin authors who need to access
this utility as well.

Closes #2845
2021-11-27 09:33:42 +01:00
Justin Mayer
57c5296a44
Merge pull request #2949 from avaris/docutils-update
Use docutils.Node.findall instead of traverse
2021-11-26 18:33:20 -07:00
Deniz Turgut
8eb4be521f
use docutils.Node.findall instead of traverse
docutils.Node.traverse is being deprecated as of docutils==0.18.1
2021-11-25 23:57:09 +03:00
Justin Mayer
1b87ef6a7b Add funding link 2021-11-15 15:39:10 -06:00
iUnknwn
9ec1750709 Document how to inject articles with a plugin
Add to the plugin documentation a recipe for injecting articles
programmatically when Pelican is running.
2021-11-12 15:33:45 -06:00
botpub
bb10d286a6 Release Pelican 4.7.1 2021-10-12 14:45:30 +00:00
Justin Mayer
de2e9b7e41 Prepare release 2021-10-12 15:59:59 +02:00
Justin Mayer
17089aefc9 Add more contributors to THANKS 2021-10-12 15:58:53 +02:00
Ben Sturmfels
99c935df8f Omit __pycache__ and *.pyc/pyo files in packages 2021-10-12 14:50:58 +02:00
Ben Sturmfels
aeec09b397 Distribute sample data used to run tests 2021-10-12 14:49:05 +02:00
Justin Mayer
9bd54b7b60 All roads lead to Rome 2021-10-08 14:52:55 +02:00
Justin Mayer
eab67f7634 PTY all the tasks 2021-10-08 14:52:55 +02:00
Justin Mayer
d1a874e580
Merge pull request #2936 from BenSturmfels/no-pager
Use `git --no-pager` rather than override all environment variables
2021-10-08 14:52:38 +02:00
Ben Sturmfels
793b93bd34
Use --no-pager option rather than override all environment variables
Currently the `assertDirsEqual` test utility uses the `env` argument to `subprocess.Popen` to make git run non-interactively, but this overwrites all environment variables causing test failures on Guix. The `--no-pager` option is a more targeted way to achieve the same thing.
2021-10-08 18:47:40 +11:00
Justin Mayer
33ef2c5356
Merge pull request #2929 from MinchinWeb/mimetypes-webfonts
Add MIME types for web fonts
2021-10-08 08:45:09 +02:00
MinchinWeb
98372c9869 server: for extension_map, refer to upstream version rather than only overwriting it 2021-10-07 14:44:36 -06:00
Jonas Borges
8849721913
Ensure _DISCARDED is not being cached. Fix #2825 (#2926)
Filtration is now being applied before caching the metadata, solving the issue where _DISCARD objects from previous runs were being retrieved from cache.
2021-10-06 10:19:17 +02:00
Justin Mayer
0da8659d0e Add Python 3.10 to test matrix & classifier list 2021-10-06 10:12:34 +02:00
Justin Mayer
30597b70f0 Quote version numbers in GitHub Actions workflow
Otherwise, YAML treats `python: 3.10` as a float, yielding Python 3.1.
2021-10-06 10:12:34 +02:00
Justin Mayer
735d93c7b6
Merge pull request #2933 from getpelican/theme-docs
Add Pelican Themes repo link to docs
2021-10-06 09:53:12 +02:00
MinchinWeb
5803052bb7 server: return proper MIME-types for webfonts 2021-10-05 19:23:52 -06:00
disk0x
31b282f3e2 Add SFTP upload to Makefile
Some managed web hosts do not allow uploads via scp or rsync, so the
sftp command is a necessary alternative.
2021-10-05 07:51:34 +02:00
Justin Mayer
76cf879414 Add Pelican theme repo link to docs 2021-10-05 07:38:24 +02:00
Justin Mayer
b5426fb0bb
Merge pull request #2927 from MinchinWeb/rich-server
Use rich logging for Pelican server
2021-10-05 06:45:03 +02:00
MinchinWeb
2b631ab4d3 Listen: set minimum logging level to INFO
This way we can see the server requests.
2021-10-04 22:40:31 -06:00
MinchinWeb
0b9a488c26 Use rich logging for Pelican server 2021-10-04 22:40:31 -06:00
Justin Mayer
e2c73a0a16
Merge pull request #2932 from BenSturmfels/master
Remove shebang lines from generated pelicanconf.py and publishconf.py
2021-10-05 06:17:48 +02:00
Justin Mayer
324fcefae7
Merge pull request #2931 from avaris/server-list-files
Adjust suffix in server to allow redirection when needed
2021-10-05 06:12:04 +02:00
Ben Sturmfels
c5c7483268
Remove shebang lines from generated pelicanconf.py and publishconf.py.
These configuration files do not need a #! line as they are not intended to be
executed directly and are not marked as executable. (In practise this doesn't
cause any problems - it just came up in a Guix bug report because Guix
transforms the #! lines.)

The "coding: utf-8" lines are also no longer required now that Pelican is Python
3 only.
2021-10-05 10:00:48 +11:00
Deniz Turgut
2d97a45902
Adjust suffix in server to allow redirection when needed
Folders without index.html has to be redirected (/foo -> /foo/) for
directory listing to work properly. Skip '/' suffix if original path
does not have it so that base class can return a redirect.
2021-10-05 01:44:12 +03:00
botpub
f862d64b7a Release Pelican 4.7.0 2021-10-01 14:10:26 +00:00
Justin Mayer
7dec2660fb Prepare release 2021-10-01 16:04:47 +02:00
Justin Mayer
f9238269d7 Tweak changelog 2021-10-01 15:35:41 +02:00
Justin Mayer
492ed61c9f Update changelog 2021-10-01 15:30:03 +02:00
Justin Mayer
eacd6435ef Minor README tweaks 2021-10-01 15:04:58 +02:00
Justin Mayer
24aefd3b1b
Merge pull request #2904 from GiovanH/pickle-typeerror
Pickle.dump can raise TypeError (e.g. generators)
2021-09-29 12:58:46 +02:00
Justin Mayer
7ccaa9a6b6
Merge pull request #2897 from MinchinWeb/rich-logging
Rich logging
2021-09-29 12:56:48 +02:00
ImBearChild
22192c148a Improve word count behavior when generating summary
Improve _HTMLWordTruncator by using more than one unicode block in
_word_regex, making word count function behave properly with CJK,
Cyrillic, and more Latin characters when generating summary.
2021-09-29 12:41:00 +02:00
Ben Sturmfels
a088f8bb9e Update tests for other locales 2021-09-28 14:05:32 +02:00
Ben Sturmfels
62a878ded3 Update tests to match theme changes 2021-09-28 14:05:08 +02:00
Ben Sturmfels
991cebf95d Update notmyidea theme to scale down to smaller screens
The aim here is to make the theme work respectably on mobile devices
with only modest changes. Providing different layouts at multiple
breakpoints is beyond the scope of this change.

The changes here are:

1. `base.html`: Add a `<meta name="viewport"` element

2. `main.css`:
  * Use "max-width" instead of "width"
  * Set "line-height" on the banner and adjust vertical spacing to match
  * Remove fixed height on the nav bar and force it to contain its
    child elements
2021-09-28 14:03:05 +02:00
Gio
438938819e Pickle.dump can raise TypeError (e.g. generators) 2021-08-01 17:06:34 -05:00
MinchinWeb
332be6e5c8
Support date format codes G, V, and u (used by ISO dates) (#2902) 2021-07-13 09:35:22 +02:00
Justin Mayer
0919507ae7
Merge pull request #2901 from MinchinWeb/writer-docs
Document how to add a new writer
2021-07-13 09:33:34 +02:00
MinchinWeb
a168470f29 Use rich.console with printing settings 2021-07-09 09:56:11 -06:00
MinchinWeb
1cd7dd6a28 Print to the (rich) console, rather than directly 2021-07-09 09:55:48 -06:00
MinchinWeb
bc21922cf2 Don't preformat log messages
as per review notes
2021-07-09 09:51:06 -06:00
MinchinWeb
58e3770b80 Document how to add a new writer
c.f. #2899
2021-07-09 08:28:15 -06:00
MinchinWeb
7eb730af78 Nicer logging of found writer
matches generator format
2021-07-08 23:26:33 -06:00
MinchinWeb
a52922bfb5 Move rich's console to log.py 2021-07-08 21:33:22 -06:00
Tristan Miller
82098a634f
Fix formatting of Jinja example code. Fixes #2884 (#2886) 2021-07-07 08:48:10 +02:00
MinchinWeb
7d492bad67 Remove log format test
as *rich* is now doing this
2021-06-30 23:29:20 -06:00
MinchinWeb
4bfcedb8a5 Share rich handler between spinner and logging 2021-06-30 23:03:22 -06:00
MinchinWeb
80f44c494a Switch to rich logging 2021-06-30 22:47:32 -06:00
Justin Mayer
ee8fb6998c
Merge pull request #2892 from MinchinWeb/typo-fix
Fix typo in docstring
2021-06-30 08:56:28 +02:00
Justin Mayer
7dfac1c0c0
Merge pull request #2882 from MinchinWeb/patch-1
Allow easy subclassing of Writer
2021-06-30 08:54:04 +02:00
MinchinWeb
2cafe926fa typo fix
"current" only has two "r"s
2021-06-15 22:41:38 -06:00
Tristan Miller
e800b23b4d
Update links to Jinja docs. Fixes #2883 (#2885) 2021-06-12 08:48:32 -05:00
Justin Mayer
c10792c679
Merge pull request #2878 from jzc/filename-metadata-typo
Fix FILENAME_METADATA doc to render correctly
2021-06-12 08:45:58 -05:00
MinchinWeb
845acfe1ac Allow easy subclassing of Writer
When you write a custom Writer, it gets called with `settings=None`. If you writer is simply a subclass of the built-in Writer, Pelican will through the error `CRITICAL: 'RELATIVE_URLS'`.

The source of the error is from `Pelican._get_writer()` in `__init__.py`.
2021-06-08 14:01:32 -06:00
Justin Mayer
c041bf2192 Fix failing tests on Jinja 3+ 2021-06-08 11:40:27 -05:00
jzc
c41b8abb13 Fix FILENAME_METADATA doc to render correctly 2021-05-20 00:11:58 -06:00
Gio
add3628a64 Add support for hidden articles 2021-05-04 13:54:32 -05:00
Petr Viktorin
487da3550b Add period_num var for period_archives template
This makes it easier to create templates that are language-agnostic
or need extra processing for the date period.
2021-05-04 12:41:17 -05:00
Justin Mayer
7893455b43
Merge pull request #2838 from namn/patch-2
Use a top (instead of bottom) border in hentry
2021-04-27 20:14:10 +02:00
Justin Mayer
fb9df68477
Merge pull request #2869 from getpelican/rich
Add progress spinner animation during generation
2021-04-27 14:42:22 +02:00
Justin Mayer
40f3d2df91 Add progress spinner animation during generation
This is a first step at enriching console output via the `rich` project.
2021-04-21 10:16:59 +02:00
Justin Mayer
14afc6c54a Update Pelican feature documentation 2021-04-21 10:16:28 +02:00
Justin Mayer
fd3ad0c16e Update contributing docs and Poetry repository URL 2021-04-21 10:05:28 +02:00
Justin Mayer
c461def10a Update to v2 of cache GitHub Action 2021-04-21 09:57:08 +02:00
Justin Mayer
dac01831f2
Merge pull request #2868 from MinchinWeb/patch-1
Fix `invoke tests` task problem on Windows
2021-04-19 16:44:29 +02:00
Romain Porte
a00284f744
Automatically open browser when Invoke task starts web server (#2764)
When the `serve` and `livereload` targets are invoked, a web browser will be
automatically opened, pointing to the locally-served website.

If no web browser can be found by the module, the `open()` call returns
`False`, but no exception is raised. This means that it is still possible
to call livereload on a remote machine and access it without any error
being triggered.

Signed-off-by: Romain Porte <microjoe@microjoe.org>
2021-04-19 15:59:41 +02:00
Justin Mayer
88953d45d5 Strip HTML tags from notmyidea page template's title
Fixes #2843
2021-04-19 10:25:59 +02:00
MinchinWeb
cf4e8d527d
Update tasks.py
PTY is not supported on Windows.
2021-04-18 22:20:54 -06:00
botpub
1219bcd029 Release Pelican 4.6.0 2021-03-23 10:31:21 +00:00
Justin Mayer
9a9dbcf523 Prepare release 2021-03-23 09:24:07 +01:00
Justin Mayer
1449840199 Make Tox & GitHub CI jobs' Python versions match
Otherwise results in InterpreterNotFound errors
2021-03-23 08:23:07 +01:00
Justin Mayer
2b08497c32 Relax dependency minimum versions
Specifying a floor, but not a ceiling, for core dependencies should help
prevent dependency resolution conflicts. Dependencies that affect
functional test output are pinned more tightly.
2021-03-23 08:06:58 +01:00
Justin Mayer
ce4994bec8 [Docs] Fix link to More Categories plugin 2021-03-19 12:58:58 +01:00
Justin Mayer
4b6b5f0461 Clarify ARTICLE_ORDER_BY documentation 2021-02-19 09:31:04 +01:00
Justin Mayer
31398d4247 Improve consistency between Makefile targets & help 2021-02-19 08:22:16 +01:00
Justin Mayer
d44821b733
Merge pull request #2852 from getpelican/pygments-2.8
Update Pygments dev dependency to v2.8
2021-02-18 18:13:44 +01:00
Justin Mayer
eaa801f14a
Merge pull request #2850 from avaris/less_noisy_logging
ignore None return value from get_generators signal
2021-02-18 18:11:02 +01:00
Justin Mayer
0db5afb920 Update functional test output for Pygments 2.8 2021-02-18 15:33:30 +01:00
Justin Mayer
872c4dbd30 Update Pygments dev dependency to v2.8 2021-02-18 15:33:30 +01:00
Justin Mayer
cdec530572 Add .yaml file extension to EditorConfig 2021-02-18 15:06:29 +01:00
Justin Mayer
68817845b0 Change FAQ entry to new Tag Cloud plugin repo 2021-02-18 12:30:44 +01:00
Justin Mayer
27762d2cf7 Make PKG_PATH var in Invoke tasks.py more DRY 2021-02-18 12:29:18 +01:00
Deniz Turgut
aa7c821c70
ignore None return value from get_generators signal 2021-02-12 21:17:42 +03:00
Justin Mayer
7a26f509df
Merge pull request #2847 from mirekdlugosz/livereload-cleanup
livereload task improvements
2021-02-09 21:28:54 +01:00
Mirek Długosz
f846191edd livereload task improvements
- use custom build command, with caching turned on - this reduces site
  build time by around 40% on my testing machines
- collect all glob patterns in a list and then call `server.watch`
  on each item - this allows to have single place where callback
  function must be specified
- use '**/*.html' as glob in template, to track changes in
  subdirectories
2021-02-09 20:49:48 +01:00
Justin Mayer
8bb5f1b786 Drop unsupported Python 3.5 from test matrix 2021-01-15 13:19:19 +01:00
Justin Mayer
ce5d063513 Allow latest Python-Markdown to be installed
Pinning dependencies to specific versions creates conflicts when other
packages require more recent versions. We can do our part by allowing
for a wider range of dependency versions, specifying only the oldest
version that will still work. Meanwhile, we ensure that test
environments use a specific pinned dependency in order to match the
expected functional test output.
2021-01-15 13:04:07 +01:00
Justin Mayer
e01cde7fcb Adjust functional test output for Pygments 2.7.x
Class `lineno` was changed to `linenos`.
2021-01-15 12:55:57 +01:00
Nam Nguyen
34fc7f2a84 Allow latest Pygments to be installed
Otherwise, installation conflicts can result when plugins/themes require
more recent Pygments versions.
2021-01-15 12:54:02 +01:00
Justin Mayer
ab3001391e Match test output line endings with current rendering 2021-01-15 12:51:04 +01:00
Justin Mayer
f9abcb30e3
Merge pull request #2826 from someone-somenet-org/patch-1
Add "http://" prefix to `pelican --listen` output
2021-01-14 10:54:57 +01:00
Justin Mayer
5971c5ad90
Merge pull request #1401 from arty-name/PAGINATION_FIXED
Support last page pattern in PAGINATION_PATTERNS
2021-01-14 10:51:00 +01:00
Tom Adler
89a31141ff Support last page pattern in PAGINATION_PATTERNS 2021-01-13 11:19:36 +01:00
Nam Nguyen
507d68e5c6 Update functional tests. 2021-01-07 14:10:50 -08:00
Justin Mayer
659c4cbf0f
Merge pull request #2836 from namn/patch-1
Fix typo in the FAQ: steamline --> streamline.
2021-01-07 17:17:14 +01:00
Justin Mayer
b17e4a5ffa Add FAQ re: Atom full-post vs. summary-only feeds
Replaces a FAQ about upgrading from a very old version of Pelican, which
isn't relevant to most folks at this point.
2021-01-06 07:36:21 +01:00
Nam Nguyen
b12443f48a
Use a top (instead of bottom) border in hentry.
`hentry` uses `clear: both` with the intention of placing a separator line (1px border) between each entry. However, it is wrongly using `border-bottom` instead of `border-top` to make that separator. CSS `clear` makes space to clear the **preceding** floats. Hence a `border-bottom` won't enjoy that `clear` effect.
2021-01-05 10:40:31 -08:00
botpub
9e72b29fc1 Release Pelican 4.5.4 2021-01-04 16:16:16 +00:00
Frederik Ring
dc60105926
Stringify plugin definitions so they can be pickled during caching (#2835) 2021-01-04 17:13:32 +01:00
Nam Nguyen
783a70da46
Fix typo in the FAQ: steamline --> streamline. 2021-01-03 21:24:10 -08:00
Someone
049bb2e1b3
add "http://" prefix to ip+port 2020-12-09 22:52:42 +01:00
botpub
8033162ba4 Release Pelican 4.5.3 2020-12-01 20:36:51 +00:00
Leonardo Giordani
9435a6c045
Fix code indented incorrectly in generators logging (#2823) 2020-12-01 19:07:51 +01:00
botpub
246da3b4d8 Release Pelican 4.5.2 2020-11-22 16:16:28 +00:00
Leonardo Giordani
afdf0fb3cf
Improve logging of generators and writer loaders (#2821) 2020-11-22 17:13:51 +01:00
Justin Mayer
a9d9ccb583 Improve docs for plugin code style compliance 2020-11-20 16:30:18 +01:00
Justin Mayer
f21969a016 Ensure invoke lint task & its docs are in sync
Someday the entire Pelican code base will perhaps have Black and isort
formatting applied to it, but it doesn't make sense for the linter to
check that until it's actually done. This changes the `lint` Invoke task
to run Flake8 on changed lines only, which should bring it into line
with both the current Pre-commit and CI configurations.

Also, the docs erroneously stated that `invoke tests` would also check
for code style compliance, which has herein been fixed.
2020-11-20 16:22:39 +01:00
Justin Mayer
4b79d6dae6 Update PyPI URLs to new equivalents 2020-11-20 15:46:05 +01:00
Justin Mayer
67e27ca7cd pelican-plugins only shows auto-discovered plugins
Document and clarify that only Pip-installed namespace plugins will be
shown when running the `pelican-plugins` command.
2020-11-20 15:39:52 +01:00
Justin Mayer
e3c7a915e5 Fix changelog entry formatting and issue links 2020-11-02 17:18:38 +01:00
botpub
06d4eff4a5 Release Pelican 4.5.1 2020-11-02 13:15:26 +00:00
Justin Mayer
98b1a46362 Prepare release 2020-11-02 14:10:02 +01:00
Justin Mayer
09822c16a7
Merge pull request #2794 from farseerfc/include-jinja2-templates
Include Jinja2 templates in MANIFEST.in
2020-11-02 14:08:30 +01:00
Justin Mayer
b454f76f72 Count CPU cores via psutil for parallel testing
psutil does a much better job at accurately counting CPU cores,
of which pytest-xdist takes advantage for the purposes of running
tests concurrently.
2020-11-02 13:17:53 +01:00
Justin Mayer
c345268de6
Merge pull request #2818 from shniubobo/issue-2817
Fix plugins running twice in autoreload mode
2020-11-02 12:40:13 +01:00
shniubobo
587e1a4ad8
Fix plugins running twice in autoreload mode
Fixes #2817
2020-10-31 20:34:45 +08:00
Justin Mayer
e4d9c41a77
Merge pull request #2799 from kdeldycke/trove-classifiers-cleanup
Trove classifiers tweaks
2020-10-19 21:02:01 +02:00
Justin Mayer
f4bb0d8933
Merge pull request #2813 from avaris/2805
Fix legacy plugin loading for packages
2020-10-19 20:53:05 +02:00
Justin Mayer
197cd1e12e
Merge pull request #2812 from avaris/2646
Try unescaped paths in intrasite link discovery
2020-10-19 20:43:18 +02:00
Justin Mayer
20a1ac0e6f
Merge pull request #2811 from avaris/python39
Add Python 3.9 to CI
2020-10-19 20:36:28 +02:00
Deniz Turgut
fd0923d2f2
Try unescaped paths in intrasite link discovery
Some content parsers escape link paths in their html output
(i.e. docutils uses HTML escaping and markdown uses URL encoding.
Intrasite link discovery is refactored to also attempt HTML or URL
unescaped versions of the path in order to match more permissively.
2020-10-19 20:43:11 +03:00
Deniz Turgut
8b8a0147e8
add python3.9 to CI 2020-10-12 18:47:08 +03:00
Deniz Turgut
6da975fc73
restore pelican.signals with an explicit ImportError mentioning move 2020-10-12 14:53:18 +03:00
Deniz Turgut
991c00af95
resolve packages for legacy plugins
Updated legacy plugin loader to handle pakcages if the PLUGINS entry
contains `.`. Also adds a test for it.
2020-10-12 14:50:42 +03:00
Kevin Deldycke
8fffcbef7a
Add new reStructuredText classifier.
Just been added to the canonical list in: https://github.com/pypa/trove-classifiers/pull/46
2020-09-04 13:04:50 +02:00
Kevin Deldycke
30c9f6bb52
Refine classification. 2020-09-03 11:30:11 +02:00
Kevin Deldycke
aed71c30f8
No need to maintain License and Python version classifiers.
Poetry takes care of it: https://python-poetry.org/docs/pyproject/#classifiers
2020-09-03 11:21:52 +02:00
Justin Mayer
7a6686f467 Fix SUMMARY_END_SUFFIX variable name in changelog 2020-08-29 12:46:44 +02:00
Jiachen Yang
3565094b10
MANIFEST.in include jinja2 templates 2020-08-24 22:34:02 +09:00
Justin Mayer
0ab6ac9798 Fix PyPI-related reST/README issues 2020-08-20 19:20:51 +02:00
Justin Mayer
4bda2745ac Prepare to release Pelican 4.5 2020-08-20 17:57:21 +02:00
Justin Mayer
e11a7de051 Add missing Pelican entry points to pyproject.toml 2020-08-20 13:51:23 +02:00
Justin Mayer
94bdcb7f18 Remove Travis since we've switched to GitHub Actions CI 2020-08-20 13:46:09 +02:00
Jason K. Moore
fafe0207ca Include the tests package in the source distribution
Fixes #2635
2020-08-20 10:52:13 +02:00
kernc
64fcdb5172
Rename setting SUMMARY_END_MARKER → SUMMARY_END_SUFFIX (#2792)
Avoids clash with 'summary' plugin.

Refs: https://github.com/getpelican/pelican-plugins/pull/1284#issuecomment-660715086
2020-08-19 20:25:19 +02:00
Justin Mayer
ade70cb2e2 Rename branch for GitHub Pages repo quickstart 2020-08-17 09:47:57 +02:00
Justin Mayer
145cd4be92 Minor improvements to installation docs 2020-08-17 07:21:57 +02:00
Justin Mayer
a0335711af Remove outdated references to Python 2.7 in docs 2020-08-17 07:14:29 +02:00
Justin Mayer
16975bc3a2 Prefix Pip commands with python -m in docs
This ensures Pip commands will be executed for the current Python
interpreter and not, say, whichever Python interpreter happens to be
associated with `/usr/local/bin/pip`.
2020-08-17 07:04:00 +02:00
Justin Mayer
863421b1b8 Use more reliable installation command in docs
Some shell environments may interpret brackets as glob patterns.
Wrapping the argument in quotation marks should help ensure correct
behavior in those environments. Refs #2786
2020-08-17 06:45:38 +02:00
Justin Mayer
26a8909580
Merge pull request #2785 from jwodder/lower-rst-summary
Lowercase metadata field name when comparing with FORMATTED_FIELDS in rST reader
2020-08-16 20:03:35 +02:00
Justin Mayer
64bb392fef Auto-detect physical CPU cores via pytest-xdist 2020-08-16 07:23:13 +02:00
Justin Mayer
adbefe8363 Upgrade pytest-xdist dev dependency to v2.0
Also, stop pinning pytest version, since older version combined with
pytest-xdist 2.0 caused CI test errors.
2020-08-16 07:19:47 +02:00
Justin Mayer
b769144a63 Support Booleans in --extra-settings. Refs #2789 2020-08-15 08:36:56 +02:00
Justin Mayer
45c5cb9029 Fix error in --extra-settings feature. Refs #2789 2020-08-13 12:07:58 +02:00
Justin Mayer
74692a37a6
Merge pull request #2779 from shakram02/docs-fix-custom-reader-example
fix usage of pelican_open in pelican_internals doc page
2020-08-11 19:12:08 +02:00
Justin Mayer
449a8e6ac4
Merge pull request #2766 from davidjb/patch-1
Fix port 0 & remove duplicate port arguments in Makefile
2020-08-11 13:04:19 +02:00
Justin Mayer
b0cdae78d2
Merge pull request #2788 from elboulangero/makefile-sync-tags-directory
Makefile: Include tags directory in rsync command
2020-08-11 13:02:29 +02:00
Justin Mayer
04c0ea53e6 Document -e / --extra-settings option flags 2020-08-11 12:51:08 +02:00
Justin Mayer
d728cd2696 Rename CLI flag syntax for settings override feature 2020-08-11 12:51:08 +02:00
Peter Sabaini
1c50a18d0a Override settings from the command line
Add a --setting-overrides KEY=VAL command line option to override
default settings or those defined in settings files. This adds
flexibility in running Pelican and helps reduce sprawl of settings
files. Cast int and str setting overrides to their respective types.
Support other setting types by treating them as JSON. Fall back to JSON
when an override typecast errors. This should make it possible to set
int values to None, resp. to JSON 'none'
2020-08-11 12:51:08 +02:00
Arnaud Rebillout
40d09875e6 Makefile, include tags directory in rsync command
By default, the rsync option '--cvs-exclude' excludes the 'tags'
directory. For a blog, it's a bit unfortunate, as it's quite common to
have a `tags` directory in a blog, either for the tag pages or the tag
feeds.

With this commit, we force rsync to include this directory, and save a
little headache to users who wonder why their tags are present in the
output directory, but are not present on the server.
2020-08-11 16:29:44 +07:00
Justin Mayer
f80bf187a9 Update PyPI classifiers; add funding & tracker links 2020-08-11 09:14:55 +02:00
Justin Mayer
18a2720ea7 Adjust isort task: v5.2+ is now recursive by default 2020-08-11 09:13:00 +02:00
Justin Mayer
d2bbfd967e Remove self-referential Template Pages link in docs 2020-08-02 10:58:32 +02:00
John T. Wodder II
18b626aa8b Lowercase metadata field name when comparing with FORMATTED_FIELDS in rST reader 2020-07-30 14:59:53 -04:00
Justin Mayer
dc6fb57c41 Update & re-order dependencies in pyproject 2020-07-29 09:38:14 +02:00
Justin Mayer
6289452e95 Document inability to control plugin execution order 2020-07-29 06:41:28 +02:00
Justin Mayer
2372e8e574
Merge pull request #2767 from Lucas-C/invoke-template-minor-improvement 2020-07-23 22:31:34 +02:00
shakram02
f05a806164
fix usage of pelican_open in docs 2020-07-11 17:39:30 +02:00
Justin Mayer
b7cfe0c4f9
Merge pull request #2768 from magicbrothers/patch-1
Fix sentence in docs
2020-06-12 14:33:18 +02:00
magicbrothers
d200c4363c
Fix sentence in docs 2020-06-12 11:24:42 +00:00
Lucas Cimon
ee80399be1
Fixups post-review 2020-06-09 18:12:24 +02:00
Lucas Cimon
d3c4bcc254
Invoke template : avoiding to spawn unnecessary process + passing-through CLI args to pelican 2020-06-09 16:01:46 +02:00
Justin Mayer
4d70447a5a
Merge pull request #2763 from kernc/root-logger
Force root logger to be of FatalLogger class
2020-06-07 06:58:22 +02:00
David Beitey
d3aa4f7c7c
Remove duplicate port arguments in Makefile
The PORT variable check earlier in the Makefile sets up the `-p` argument as part of PELICANOPTS so prior to this change `-p` was duplicated on each of the serve targets.
2020-06-07 01:46:16 +00:00
Kernc
d6623c642f
Docs: minor fix code block indent 2020-06-05 14:28:11 +02:00
Kernc
20067da9f5
Document how to logging in plugins 2020-06-05 14:24:55 +02:00
Kernc
cd3048d4cf
Force root logger to be of FatalLogger class
This enforces FatalLogger policy upon pelican plugins
that might contain codes such as:

    import logging
    log = logging.getLogger()

    log.warning(...)
    # or
    logging.warning(...)
2020-06-05 01:50:00 +02:00
Justin Mayer
78edd878a3 Improve namespace plugin documentation 2020-06-04 11:14:37 +02:00
Justin Mayer
9db937e581 Document the pelican-plugins command 2020-05-26 15:18:24 +02:00
MinchinWeb
a133716709 flake8 fixes 2020-05-21 21:43:06 -06:00
MinchinWeb
cfba3d72be fix testing failures
when settings could be pathlib.Path
2020-05-21 21:13:02 -06:00
MinchinWeb
d817231836 Allow generators to deal with settings that are pathlib.Paths 2020-05-21 21:10:37 -06:00
Justin Mayer
d0457dcfb8 Build settings paths as strings
… instead of `posix_join`. Fixes #2431
2020-05-18 06:35:33 +02:00
Justin Mayer
0ed7d6641e Add pull request template 2020-05-17 07:32:28 +02:00
Justin Mayer
7c9c1c63cc Add issue templates 2020-05-17 07:04:26 +02:00
Justin Mayer
f0841dc454 Add FAQ entry about Markdown syntax variants 2020-05-17 06:28:04 +02:00
Justin Mayer
f6ee00f877
Merge pull request #2755 from avaris/lint
fix linting errors
2020-05-14 22:12:35 +02:00
Deniz Turgut
873df9094a
fix linting errors 2020-05-12 23:30:03 +03:00
Justin Mayer
21242e3a47 Switch README CI badge from Travis to GitHub Actions 2020-05-10 08:11:00 +02:00
Justin Mayer
ca1c58e201
Merge pull request #2753 from avaris/log-dict
Fix dictionary logging in formatter
2020-05-10 07:32:54 +02:00
Justin Mayer
2eb9c26cdb
Merge pull request #2750 from avaris/autoreload
Refactor file/folder watchers and autoreload
2020-05-10 07:29:27 +02:00
Justin Mayer
177bc2262c
Merge pull request #2747 from avaris/github-actions
Add GitHub Actions workflow
2020-05-10 07:16:47 +02:00
Deniz Turgut
50281c42e5
Fix dictionary logging in formatter
Python special cases single Mapping arguments to logging. This
adjusts BaseFormatter to skip "fancy" formatting if argument
is of type Mapping. Also adds various formatted log outputs.
2020-05-09 21:25:38 +03:00
Deniz Turgut
c19075816b
use context manager for log testing 2020-05-09 19:30:21 +03:00
Deniz Turgut
48d842faa7
Refactor file/folder watchers and autoreload
Combined file and folder watchers under a class and refactored
common watcher related code from __init__.py to the class.
This simplifies the main and autoreload functions in __init__
as well as fix the problem with crashes related to multiprocessing
on systems where default spawn mode is "spawn" instead of "fork".
2020-05-09 16:22:36 +03:00
Deniz Turgut
2e482b207b
Fix Windows tests
* Unskip passable tests
* Fix broken tests
2020-05-09 16:17:14 +03:00
Deniz Turgut
839629b102
Cleanup test environment and requirements
- pytest: verbose isn't needed but show skipped tests
- mock is not needed anymore. it is part of stdlib
- Unpin Sphinx and fix warning about lexer
- Mirror tox command for doc build in tasks.py
2020-05-09 16:17:14 +03:00
Deniz Turgut
125dec493e
Modify tox envs to simplify CI and add Python 3.8 2020-05-09 16:17:13 +03:00
Deniz Turgut
ffc960df5c
Add Github Actions workflow 2020-05-09 16:17:13 +03:00
(GalaxyMaster)
e6df353302
Set "modified:" from "date:" when the latter was set from the filesystem (#2748)
Sets the `modified:` metadata from `date:` if the user asked us
to use the filesystem for determining timestamps. Fixes #2497

* Added tests (ab)using the HTML reader a bit

There seems to be no way to test this generically since we need
to produce a valid document with meta information to be able to
compare, hence I used the lightest reader out there to do the
parsing of the samples.

* Fixed tests for generators since there were 4 more articles
introduced to the test content directory.
2020-05-03 17:45:25 +02:00
Justin Mayer
c8639fe547 Only run Flake8 on changed lines 2020-04-30 21:43:31 +02:00
Justin Mayer
51b873b42e Add Flake8 pre-commit hook 2020-04-30 21:26:02 +02:00
Justin Mayer
e83a8032e8 Flake8 fix 2020-04-30 21:21:14 +02:00
Justin Mayer
a15f2aba76 Ensure path & output path comparisons are absolute
Otherwise, the following error could be returned:
"ValueError: Can't mix absolute and relative paths"
2020-04-30 21:05:47 +02:00
Joachim Lusiardi
82ff563f6f
Expose first and last page of pagination (#2618) 2020-04-30 19:05:48 +02:00
Justin Mayer
2a6b7d9e7c
Merge pull request #2693 from luzpaz/README
Add Repology badge to README
2020-04-30 17:02:06 +02:00
Justin Mayer
d9809c34fc Allow setting host in Invoke serve & livereload tasks
Instead of serving on localhost by default with no way to override, the
host can now be configured, allowing both `serve` and `livereload` tasks
to serve output on non-localhost addresses such as `0.0.0.0`.
2020-04-30 15:21:04 +02:00
Justin Mayer
df2ec7ea14
Merge pull request #2746 from kernc/fix-strings
Fix error strings whitespace
2020-04-30 06:51:45 +02:00
Kernc
b8f7c584c5
Fix error strings whitespace 2020-04-29 18:08:38 +02:00
Justin Mayer
e87717d27c
Merge pull request #2742 from getpelican/remove-legacy
Modernize code base to Python 3+ syntax
2020-04-27 13:12:10 +02:00
Justin Mayer
d43b786b30 Modernize code base to Python 3+ syntax
Replaces syntax that was relevant in earlier Python versions but that
now has modernized equivalents.
2020-04-27 09:45:31 +02:00
Justin Mayer
2cd1d44576 Relax hard/enforced line length to 88 characters 2020-04-27 09:45:30 +02:00
Justin Mayer
1ac4abcb67 Add Windows support to Invoke tasks 2020-04-24 15:21:05 +02:00
MinchinWeb
13e138aacd Add dev dependencies expected by tasks.py
Black requires at least Python 3.6
2020-04-24 14:48:34 +02:00
Justin Mayer
19e0f28c64
Merge pull request #2735 from avaris/redundant-tests
Remove duplicate tests in test_contents
2020-04-22 15:57:55 +02:00
Deniz Turgut
82fcfbcbfc Remove duplicate tests in test_contents
TestArticle was a subclass of TestPage and therefore included all
the tests TestPage already had. Effectively tests from TestPage
were run twice. This splits the common parts of TestPage to a
base class called TestBase and TestPage/TestArticle will both
inherit from it.
2020-04-21 23:45:55 +03:00
Justin Mayer
021ef45f75 Tidy SLUGIFY_* settings documentation 2020-04-21 05:36:28 +02:00
Justin Mayer
7e24886190
Merge pull request #2731 from avaris/unicode-slugify
Add support for Unicode slugs
2020-04-21 05:31:51 +02:00
Deniz Turgut
bd699d34e8 Expose preserve_case option from slugify 2020-04-21 00:26:00 +03:00
Justin Mayer
3031ca64c8 Fix Python 2/3 cache pickle format incompatibility 2020-04-20 11:40:51 +02:00
Justin Mayer
4a7cff7688 Fix anchor link to TIMEZONE settings documentation 2020-04-20 11:32:02 +02:00
Justin Mayer
3b5cdef7f9 Update dev docs to reflect Poetry behavior change
Otherwise, `poetry install` replaces the editable installation with the
current PyPI version.
2020-04-20 09:00:38 +02:00
Deniz Turgut
97fe235e60 Expose use_unicode setting of slugify in settings and use it 2020-04-19 20:21:00 +03:00
Deniz Turgut
03d9c38871 Rewrite pelican.utils.slugify to use unicode and add tests
Adds a use_unicode kwarg to slugify to keep unicode
characters as is (no ASCII-fying) and add tests for
it. Also reworks how slugification logic.

slugify started with the Django method for slugiying:
 - Normalize to compatibility decomposed from (NFKD)
 - Encode and decode with 'ascii'

This works fine if the decomposed form contains ASCII
characters (i.e. ç can be changed in to c+CEDILLA and
ASCII would keep c only), but fails when decomposition
doesn't result in ASCII characters (i.e. Chinese). To
solve that 'unidecode' was added, which works fine for
both cases. However, old method is now redundant but
was kept. This commit removes the old method and
adjusts logic slightly.

Now slugify will normalize all text with composition
mode (NFKC) to unify format for regex substitutions.
And then if use_unicode is False, uses unidecode to
convert it to ASCII.
2020-04-19 20:10:46 +03:00
Justin Mayer
075ca53bd2
Merge pull request #2593 from sharmaeklavya2/relative-static-paths
Use relative paths only in StaticGenerator
2020-04-18 18:58:46 +02:00
Justin Mayer
59462ad415
Merge pull request #2730 from avaris/namespace-redux
Fix legacy plugin loading
2020-04-17 20:21:25 +02:00
Deniz Turgut
46e1ec4f99 Fix legacy plugin loading 2020-04-17 21:15:25 +03:00
fancsali
f610801ee8
Add Typogrify/SmartyPants dashes config parameter (#2615) 2020-04-16 13:32:19 +02:00
Justin Mayer
cb3bb4ad69
Merge pull request #2727 from avaris/cleanup-after-tests
Reset global state set by tests in test_pelican
2020-04-16 10:17:54 +02:00
Deniz Turgut
d13108b03a Reset global state set by tests in test_pelican
Calling read_settings to clear the options put into
pelican.settings.PYGMENTS_RST_OPTIONS in tearDown so
that tests that are run after are not affected
2020-04-16 11:11:24 +03:00
Justin Mayer
e18c9d2c60 Remove Piwik from theme and settings docs
Name has been changed, and rather than fix it, it makes more sense to
deprecate analytics in Pelican core and relegate them to plugins/themes.
2020-04-16 08:26:09 +02:00
Justin Mayer
fc031174bb Flake8 fix 2020-04-16 08:10:30 +02:00
Justin Mayer
86ff02541f Fix building asciidoc headers in importer & add docs 2020-04-16 08:01:10 +02:00
Tim Janik
5365a1cdb3 PELICAN: pelican_import.py: add support for pelican-import -m asciidoc
Signed-off-by: Tim Janik <timj@gnu.org>
2020-04-16 07:48:04 +02:00
Justin Mayer
adf12505ab
Merge pull request #2724 from getpelican/theme-metadata
Put article summary in notmyidea "description" HTML metadata tag
2020-04-16 07:03:57 +02:00
Justin Mayer
592517dea9
Merge pull request #2725 from getpelican/slugify-preserve-case
Preserve category case in importer
2020-04-15 21:43:15 +02:00
Justin Mayer
8ba00dd9f1 Preserve category case in importer
Adds a `preserve_case` parameter to the `slugify()` function and uses it
to preserve capital letters in category names when using the Pelican
importer.
2020-04-15 20:42:21 +02:00
Justin Mayer
79095f7bd3
Merge pull request #2723 from getpelican/fix-delete-output-logic
Fix output directory deletion logic
2020-04-15 20:01:51 +02:00
Justin Mayer
540c06b2b8 Update test output with "description" metadata tag 2020-04-15 16:58:03 +02:00
Justin Mayer
d536cd2239 Put summary in notmyidea "description" HTML metadata 2020-04-15 16:54:17 +02:00
Justin Mayer
9d10abaed4 Fix output directory deletion logic
The intention was to prevent accidental source content data loss by
skipping output directory deletion if the output directory is a parent
of the source content directory. But the previous implementation did so
by checking path *strings*, resulting in scenarios where the following
settings would erroneously skip deletion of the output directory:

PATH = "/repo/docs-src/content"
OUTPUT_PATH = "/repo/docs"

The output directory should have been deleted but wasn't because the
PATH string contains "/repo/docs". This change eschews string comparison
and instead compares actual paths to ensure that the output path is not
a parent of the source content directory.
2020-04-15 15:19:41 +02:00
Cropse
7e52b61934
Enhance JINJA_FILTERS setting docs (#2126) 2020-04-15 10:42:21 +02:00
David Zaslavsky
9eb259af82
Wrong path for attached static content urls (#2158)
* Document _URL/_SAVE_AS path matching req. Fix #2158

This commit addresses the fact that some URLs (primarily {attach}) are based
on the *_SAVE_AS path instead of the *_URL path. It updates the documentation
to point out that the paths of corresponding _URL and _SAVE_AS settings should
match, and that the OUTPUT directory should correspond to the web server's
document root, in order to avoid producing these incorrect URLs.

* Clarify {attach} and *_URL / *_SAVE_AS caveat

Co-authored-by: Justin Mayer <entroP@gmail.com>
2020-04-15 10:35:04 +02:00
Justin Mayer
cefe984c7e
Merge pull request #2721 from avaris/fix-test-plugins
Test updates
2020-04-14 23:00:23 +02:00
Deniz Turgut
eb05aa8ce5 Add a draft without date for #2488 2020-04-14 23:52:46 +03:00
Deniz Turgut
aa176b7939 Account for existing namespace plugins in plugin tests 2020-04-14 23:52:46 +03:00
Justin Mayer
e10dcfc5e7
Merge pull request #2720 from getpelican/fix-sample-content
Reduce warnings and errors in sample content
2020-04-14 22:06:57 +02:00
Justin Mayer
7eae9b1abc Reduce warnings and errors in sample content
This reduces the warnings and errors when generating the sample content
from twelve to one (intentional) warning. The latter is expected by
assertLogCountEqual() in the "test_basic_generation_works" test.
2020-04-14 21:39:47 +02:00
Justin Mayer
2d590bb8c1 Add HTML meta generator tag to functional test output 2020-04-14 17:47:08 +02:00
Justin Mayer
c8bf3ec5a4 Add HTML meta generator tag to theme base templates 2020-04-14 17:47:07 +02:00
Justin Mayer
3f4166e7b6 Put pre-commit excludes where they actually belong 2020-04-14 17:47:07 +02:00
Justin Mayer
863176040f Don't run pre-commit on functional test output
Otherwise, it will apply EOF and trailing whitespace fixes, which may
lead to test failures.
2020-04-14 14:14:56 +02:00
Justin Mayer
cff6a829c2 Set timezone when assigning max datetime to drafts 2020-04-14 13:48:03 +02:00
Boian Berberov
bf85991ee6
Quote Makefile paths so it handles spaces 2020-04-13 11:17:39 +02:00
Justin Mayer
1a6d66f395 Run tests in parallel on multi-core systems
Uses pytest-xdist to run tests on two cores simultaneously, speeding up
test runs by nearly 40%.
2020-04-13 08:55:29 +02:00
Boian Berberov
fc8a3c719f
Add missing <ul> element to index.html template in notmyidea theme (#2545) 2020-04-12 22:03:48 +02:00
Justin Mayer
276a14ae05
Merge pull request #2687 from LouisJackman/add-devserver-global-make-target
Add a devserver-global Make task for non-local dev testing
2020-04-12 21:49:15 +02:00
Justin Mayer
07c2526c08
Merge pull request #2716 from avaris/limit-filter
Fix LOG_FILTER to act on exact messages
2020-04-12 20:51:33 +02:00
Deniz Turgut
97dbafcb89 Fix LOG_FILTER to act on exact messages
* Adds the ability to filter templated messages by exact message,
as well as templates.
* Adds a test for LimitFilter.

Fixes #2552,  #2682
2020-04-12 21:00:27 +03:00
Justin Mayer
e7ef546661 Add PORT to serve-global Makefile task 2020-04-12 19:43:09 +02:00
Justin Mayer
0bc6869879
Merge pull request #2713 from getpelican/pin-pygments
Pin Pygments & Jinja to specific versions
2020-04-12 17:07:28 +02:00
Justin Mayer
7d19bcf5d4
Add settings for custom Jinja globals and tests (#2715)
Pelican has a setting for custom Jinja filters but not custom tests or
custom environment namespace globals. This adds both of the latter.
2020-04-12 17:03:53 +02:00
Justin Mayer
9a0a08f460 Update functional test output 2020-04-12 17:02:07 +02:00
Justin Mayer
6cef4ead88 Increase Jinja version minimum to 2.11+
This newer version slightly changes rendered output; upgrading our
dependency means our functional test output will match it more
consistently.
2020-04-12 17:02:06 +02:00
Justin Mayer
e2bbfcb088 Pin Pygments to 2.6.1 2020-04-12 17:02:06 +02:00
Justin Mayer
212742a56f Ensure consistent title spacing in themes
Moving the space between the title and sub-title inside the "if"
statement eliminates a spurious trailing space when there is no
sub-title defined.
2020-04-12 17:02:06 +02:00
Kurt McKee
7bbd3dc6fb
Update links to HTTPS and current 301 redirects in docs/templates/themes (#2661)
This also updates the Tumblr API to use HTTPS as documented in the
current Tumblr API docs.
2020-04-12 16:38:35 +02:00
Justin Mayer
18c7a9c3a1 Pin pytest in pyproject also 2020-04-12 15:38:17 +02:00
Justin Mayer
b6dc55f96c Add poetry.lock to list of files for Git to ignore 2020-04-12 15:21:17 +02:00
Justin Mayer
88100484e0 Move more test deps from CI config to requirements 2020-04-12 15:16:12 +02:00
Justin Mayer
2a5bb109ba Pin pytest until 5.4.x series has stabilized
Version 5.4.1 is currently incompatible with pytest-sugar.
2020-04-12 15:04:22 +02:00
Justin Mayer
0f97f6d488
Merge pull request #2714 from getpelican/skip-md-metadata-parse
Skip Markdown metadata parsing within metadata fields
2020-04-12 14:53:59 +02:00
Justin Mayer
e618becfc0 Skip MD metadata parsing in latest Python-Markdown
The syntax for unloading Python-Markdown extensions has changed to a
"deregister" method on Registry objects.
2020-04-12 11:40:58 +02:00
Annika Backstrom
5d6513c36c Skip Markdown metadata parsing within metadata 2020-04-12 11:40:43 +02:00
Kurt McKee
4db9b944a2 Remove CSS references to the non-existent digg.png icon 2020-04-12 10:19:27 +02:00
Justin Mayer
50808f644f Remove poetry.lock file
This seems to be causing problems for some folks, without adding any
noticeable benefit.
2020-04-12 09:36:20 +02:00
Justin Mayer
e8760646f7
Merge pull request #2643 from mxjeff/simple-theme-missing-striptags
Add missing striptags filter to simple theme
2020-04-12 08:56:29 +02:00
Justin Mayer
5b238d189c
Merge pull request #2666 from xuhdev/doc/themes
doc: Add cross links between theme settings and pelican-themes
2020-04-12 08:53:54 +02:00
Justin Mayer
9d8a143ce8
Merge pull request #2660 from kurtmckee/fix-pagination-docs-typo
Fix a typo in the pagination settings docs
2020-04-12 07:17:32 +02:00
Justin Mayer
0fabbb6a60
Merge pull request #2711 from galaxy4public/summary-end-marker
Add custom summary end marker
2020-04-12 06:55:45 +02:00
Justin Mayer
e06934a003 Update documentation copyright & attribution info 2020-04-12 06:07:37 +02:00
(GalaxyMaster)
7f8726929b Added an additional assert as requested 2020-04-12 05:18:29 +10:00
(GalaxyMaster)
56c2abe613 Added a test for the emd marker 2020-04-11 17:30:50 +10:00
(GalaxyMaster)
4833a27243 Provided the settings documentation snippet 2020-04-11 15:42:18 +10:00
(GalaxyMaster)
e412657581 Added support for the summary end marker configuration 2020-04-11 15:35:26 +10:00
Justin Mayer
a9a651ce4d
Merge pull request #2706 from nikolausschueler/makefix
Handle case of missing port in target "serve-global"
2020-03-25 09:03:00 +01:00
Justin Mayer
6b6ef5f18f
Merge pull request #2705 from nikolausschueler/encodingfix
Make encoding a named parameter
2020-03-25 09:00:52 +01:00
Nik
ab5e78db2a Handle case of missing port in target "serve-global"
Also factor out the check for the SERVER variable to avoid nested
ifdefs.

Fixes #2696
2020-03-14 08:47:57 +01:00
Nik
bae37a7ae4 Make encoding a named parameter
Without the name, the parameters are used in sequence and the "encoding"
param is used in place of the "buffering" param, which leads to
problems.
2020-03-13 15:47:48 +01:00
Carlos Pereira Atencio
f2dbfbfcec
Docs: Add info about pelican-quickstart command path flag. (#2675) 2020-02-26 19:54:05 +01:00
luz.paz
652ec971d4 Add Repology badge to README
Closes #2633
2020-02-20 07:55:20 -05:00
LouisJackman
bd1ab74031 Add a devserver-global task for non-local dev testing
The devserver target recently acquired a sane default of restricting
access only to localhost. This is good for security. However, it can
frustrate some usages like testing on phones on a local network or
hosting the dev server within VMs (e.g. Docker for Mac) which see host
OS browsers as not being 127.0.0.1.

Add a new target called `devserver-global` for this case. As it's longer
to type, the more svelte `devserver` will retain the more secure
defaults that will suffice for most users; they can use the
longer-to-type `devserver-global` target to relax the localhost-only
restriction.
2020-01-23 21:29:13 +00:00
Justin Mayer
cf96c113e1
Improve UI when pelican --listen web server is quit (#2684)
Improve UI when `pelican --listen` web server is quit
2020-01-20 08:09:39 +01:00
Justin Mayer
fa71931503 Exit web server gracefully when user taps CTRL-C
Users were previously met with an ugly traceback. Now `pelican --listen`
invocations, when quit via CTRL-C, are followed instead by a more
user-friendly message.
2020-01-19 09:07:02 +01:00
Justin Mayer
569f8a080e Tell users they can use CTRL-C to stop web server
This knowledge was heretofore assumed but is better made explicit.
2020-01-19 09:07:02 +01:00
Justin Mayer
70c8d2a474 Docs: Ensure plugin developers create new branch 2019-12-28 10:20:19 +01:00
Justin Mayer
b8f2326fa6 Document mirroring content & output path hierarchies 2019-12-28 10:02:48 +01:00
Justin Mayer
d7795b8afd Move Python datetime note further down Settings docs 2019-12-28 09:57:41 +01:00
Justin Mayer
d2c857883f Update Python documentation links to Python 3 2019-12-28 09:52:33 +01:00
Justin Mayer
6a9aa1dca8 Remove duplicate datetime URL in Settings docs 2019-12-28 09:48:07 +01:00
Hong Xu
b149a23507 Add cross links between theme settings and pelican-themes 2019-12-25 18:29:45 +08:00
Kurt McKee
3f1d4edea3 Fix a typo in the pagination settings docs 2019-12-05 13:37:41 -06:00
Justin Mayer
48f6275134
Merge pull request #2644 from avaris/namespace
Namespace plugin implementation
2019-12-01 09:36:57 -08:00
Deniz Turgut
8a56e1f1fa Update namespace docs to address review 2019-12-01 20:29:42 +03:00
Deniz Turgut
87a5c82197 Documentation update for namespace plugins 2019-12-01 19:29:41 +03:00
Deniz Turgut
ed1eca160e Remove py2-isms and avoid sys.path hacks 2019-12-01 18:33:11 +03:00
Deniz Turgut
58edad6897 remove pelican.signals in favor of pelican.plugins.signals 2019-12-01 18:14:13 +03:00
Deniz Turgut
a2053c34c3 Namespace plugin implementation
* Creates pelican.plugins
* Moves plugin related code under pelican.plugins
  * pelican.plugins.signals is now the location for signals, pelican.signals is kept
    for backwards compatibility
  * pelican.plugins._utils contains necessary bits for plugin discovery and loading.
    Logic from Pelican class is moved here. Pelican class now just asks for plugins
    and registers them
* Contains tests for old and new plugin loading
2019-12-01 17:55:19 +03:00
Justin Mayer
772005f431
Merge pull request #2649 from iKevinY/py2-sunset
Remove Python 2 support
2019-11-26 14:03:13 -08:00
Deniz Turgut
16968834ce Convert super() calls to py3 style 2019-11-26 06:17:04 +09:00
Deniz Turgut
3cc430b418 Update docutils and remove docutils workaround 2019-11-26 06:17:04 +09:00
Deniz Turgut
49bc6ed47f Further remove python2-isms 2019-11-26 06:17:04 +09:00
Kevin Yap
1e0e541b57 Initial pass of removing Python 2 support
This commit removes Six as a dependency for Pelican, replacing the
relevant aliases with the proper Python 3 imports. It also removes
references to Python 2 logic that did not require Six.
2019-11-26 06:16:41 +09:00
Justin Mayer
bae6de5d26 Remove pytest-emoji from dev dependencies 2019-11-16 07:37:01 -08:00
Justin Mayer
993c214d94
Merge pull request #2642 from getpelican/Lucas-C-patch-1
Extend stale bot issue closure window
2019-11-14 06:44:08 -08:00
Justin Mayer
4821ad3ce7 Remove Bumpr 2019-11-13 06:48:09 -08:00
Justin Mayer
74815af6e2 Minor CONTRIBUTING fixes 2019-11-12 14:20:50 -08:00
Justin Mayer
4dc30dabab Update hub pull-request docs in CONTRIBUTING 2019-11-12 14:13:43 -08:00
Justin Mayer
2e9833986d
Merge pull request #2651 from getpelican/drop_py2_docs
Remove Python 2.x references from docs
2019-11-12 13:25:40 -08:00
Justin Mayer
535df9cd9c Add Invoke tasks for building and serving docs 2019-11-12 08:36:22 -08:00
Justin Mayer
f18429f23a Add Pytest as development dependency 2019-11-12 07:45:36 -08:00
Justin Mayer
b7368f919f Add Invoke task for updating functional test output 2019-11-12 07:40:05 -08:00
Justin Mayer
703c281089 Add missing colon in Contribute docs 2019-11-12 07:28:55 -08:00
Justin Mayer
c0df11ecb8 Remove Coveralls from Tox configuration 2019-11-11 13:53:14 -08:00
Justin Mayer
dad376e0db Switch Tox test runner from Nose to Pytest 2019-11-11 13:51:25 -08:00
Justin Mayer
2d232d15aa Switch invoke tests test runner to Pytest 2019-11-10 20:10:59 -08:00
Justin Mayer
e713407f89 Add Pytest filterwarnings config section
Fixes #2650
2019-11-10 20:08:47 -08:00
Justin Mayer
68c9ef76b2 Update CONTRIBUTING docs for Python 2.x removal
This also updates the Contributing documentation with information on new
development tooling.
2019-11-09 09:43:55 -08:00
Justin Mayer
04a602e381 Add Invoke as dependency in pyproject 2019-11-09 08:40:26 -08:00
Justin Mayer
272778bc67 Add initial EditorConfig configuration 2019-11-09 08:37:54 -08:00
Justin Mayer
d859f93c7b Add initial Pre-commit configuration file 2019-11-09 08:37:11 -08:00
Justin Mayer
e46b623254 Add initial Invoke tasks.py file 2019-11-09 08:36:45 -08:00
Paolo Melchiorre
ae73d06301 Remove Python 2.7 support from settings 2019-11-05 21:04:56 +01:00
kaliko
0806df6068 Fixed simple theme, add missing striptags filter
page.title are missing striptags in title block
2019-10-25 09:20:14 +02:00
Lucas Cimon
1c1640634f
Update stale.yml 2019-10-21 20:12:39 +02:00
botpub
01eb08c42b Release Pelican 4.2.0 2019-10-17 17:50:30 +00:00
Justin Mayer
67781f63af
Support inline SVG images (#2634)
Support inline SVG images
2019-10-17 10:47:05 -07:00
Justin Mayer
3be0006016
Update RELEASE.md 2019-10-17 10:42:59 -07:00
Justin Mayer
7bfc70c153 Update functional test output for category in feed 2019-10-17 10:34:03 -07:00
Maurício Gardini
f72d06a4a5 Adds the category to the feed item. Fix #2556.
Adds the article category as a feed item category.
2019-10-17 10:29:32 -07:00
Justin Mayer
b6514dcb47
Add docs on how to include other files - fix #1902 (#2638)
Add docs on how to include other files - fix #1902
2019-10-17 10:09:13 -07:00
Justin Mayer
c81e68e895
Improve content metadata field docs (#2620)
Improve content metadata field docs
2019-10-17 10:02:22 -07:00
Lucas Cimon
e5b94d7248
Adding docs on how to include other files - fix #1902 2019-10-17 17:55:14 +02:00
Lucas Cimon
e092f7ca75
Adding missing call to topdown=True in Generator.get_files 2019-10-17 13:05:53 +02:00
Justin Mayer
f0617a53dc Follow-up changes to metadata field docs 2019-10-16 15:52:50 -07:00
Justin Mayer
bcac6e80b9 Improve content metadata field docs. Fixes #2347 2019-10-16 15:29:03 -07:00
Stuart Axon
eaccca52dd Support inline SVGs (don't break on title in inline SVG). 2019-10-15 22:41:44 +01:00
botpub
643bccc497 Release Pelican 4.1.3 2019-10-09 18:45:18 +00:00
Justin Mayer
619c9015cb
Merge pull request #2609 from MinchinWeb/windows-tests-4
Skip some non-Windows tests on Windows
2019-10-09 11:41:27 -07:00
Justin Mayer
f9975ed47e
Update RELEASE.md 2019-10-09 11:28:53 -07:00
Justin Mayer
f52f276f2e Separate SSH user/host/path vars in tasks.py
Refs #2623
2019-10-09 11:17:44 -07:00
Justin Mayer
761f2e34e7
Merge pull request #2624 from MicroJoe/fix-invoke-publish-ssh-port
Use correct SSH port syntax for rsync in tasks.py. Fixes #2623
2019-10-09 11:11:04 -07:00
Justin Mayer
7aa30c7335
Merge pull request #2632 from davidag/extra-setuptools-markdown
Add extra/optional Markdown dependency to setup.py
2019-10-09 10:56:32 -07:00
David Alfonso
bc450b3339 Add extra/optional Markdown dependency to setup.py
- Modify documentation to use the extra dependency in order to install
the recommended markdown package version.
2019-10-09 16:25:59 +02:00
Justin Mayer
7aa2f6c142
Merge pull request #2630 from andreagrandi/fix-default-bind-address
Set default listening address to 127.0.0.1
2019-10-05 10:29:46 -07:00
Justin Mayer
7b7d54c7bd
Merge pull request #2629 from oulenz/deprecated_settings
Place all deprecated settings handling together
2019-10-05 10:28:44 -07:00
Andrea Grandi
b88b5f7b36 Set default binding addres to 127.0.0.1 2019-10-05 15:25:31 +02:00
Oliver Urs Lenz
2c8e7b3e6b place all deprecated settings handling together 2019-10-04 22:39:57 +02:00
Justin Mayer
047d884323 Fix quick-start docs regarding pelican --listen
Reverts 2ab91bbaaa and resolves #2626
2019-09-28 13:51:20 -07:00
Justin Mayer
db04f01297 Add related project URLs for display on PyPI
Adding `project_urls` and `keywords` to setup.py ensures they will be
available for the PyPI package page and any other place/service that
may look for these fields.
2019-09-28 13:45:58 -07:00
Romain Porte
8734bd1a6f
templates: tasks.py: introduce "production_port" to fix #2623
The syntax passed to rsync for specifying the port is incorrect. In the
Makefile template, the -e option is correctly used to pass the port. We
use the same syntax here to pass the SSH port.

This fix issue #2623.

Signed-off-by: Romain Porte <microjoe@microjoe.org>
2019-09-24 22:19:10 +02:00
botpub
3f96cb8a4a Release Pelican 4.1.2 2019-09-23 18:21:15 +00:00
Justin Mayer
ce87857104
Merge pull request #2621 from Lucas-C/fix_module_import_caching_bug
Fix pelican.settings.load_source to avoid caching issues
2019-09-23 11:17:09 -07:00
Lucas Cimon
367245cc47
Fix pelican.settings.load_source to avoid caching issues 2019-09-23 20:06:41 +02:00
Justin Mayer
ac1e07a3cd
Merge pull request #2622 from Lucas-C/patch-1
Clarify Python 3.5+ requirement in QuickStart docs
2019-09-23 10:41:29 -07:00
Lucas Cimon
589a31ddd0
Pushing Python compatibility to Python 3.5+ 2019-09-23 19:38:18 +02:00
Justin Mayer
7f4e614bb8 Fix formatting, etc in Settings documentation 2019-09-21 10:57:35 -06:00
Justin Mayer
60e80ad634
Merge pull request #2612 from jorgesumle/documentation-fix
[Documentation] Add comma after 'for instance'
2019-08-26 13:18:23 +02:00
Jorge Maldonado Ventura
41fbf3adb2 [Documentation] Add comma after 'for instance' 2019-08-26 00:35:53 +02:00
botpub
e44aa294b0 Release Pelican 4.1.1 2019-08-23 17:06:52 +00:00
Justin Mayer
f6ef027014 Tidy and shorten a comment 2019-08-23 19:02:48 +02:00
Justin Mayer
9db42658e5 Prevent Travis IRC spam from forks
See: https://github.com/travis-ci/travis-ci/issues/5063
2019-08-23 17:02:47 +02:00
MinchinWeb
2ee423017b Skip some non-Windows tests on Windows
Some tests will never pass on Windows due to differences in filesystems between
Windows and Linux.
2019-08-21 11:27:31 -06:00
Justin Mayer
8353cea6b6 Add changelog entries to prepare for release 2019-08-21 14:38:17 +02:00
Justin Mayer
f1430472b8 Configure AutoPub for Pelican changelog path & format 2019-08-21 14:31:51 +02:00
Justin Mayer
00159b7999
Merge pull request #2600 from Lucas-C/allow_argv_passing
Allowing to pass `argv` to pelican `main` entrypoint
2019-08-21 14:25:06 +02:00
Justin Mayer
99ea502102
Merge pull request #2610 from MinchinWeb/default-status
Set default content status to blank string instead of `None`
2019-08-21 14:16:32 +02:00
MinchinWeb
b2da535fec Set default content status to a blank string rather than None.
Fixes
#2558.
Fixes issues encountered by comment plugins among others

c.f. [1](https://github.com/bstpierre/pelican-comments/pull/4),
[2](https://github.com/Scheirle/pelican_comment_system/issues/8),
[3](https://github.com/Scheirle/pelican_comment_system/pull/7)
2019-08-20 19:39:14 -06:00
Justin Mayer
7c2a7478d7 Consolidate duplicate Travis env definitions 2019-08-02 14:53:51 +02:00
Lucas Cimon
360ff420d3
Allowing to pass argv to pelican main entrypoint 2019-08-01 13:53:56 +02:00
Justin Mayer
67b5ca5e1c
Merge pull request #2598 from getpelican/autopub
Add AutoPub to auto-publish releases on PR merge
2019-07-30 20:05:41 +02:00
Justin Mayer
06dee4de58 Add AutoPub to auto-publish releases on PR merge
Contributors will henceforth be asked to include a `RELEASE.md` file
containing the release type and summary of changes, which will be used
by the continuous integration (CI) system to automatically publish a new
release to PyPI when the pull request is merged.

For more details, see: https://github.com/autopub/autopub
2019-07-28 18:34:33 +02:00
Justin Mayer
a7e58ac3a3 Keep building packages via setuptools for now
While it may make sense to switch to an alternate build system (such as
Poetry) at some point, at this early stage it seems prudent to designate
setuptools as the build system in pyproject.toml until the more modern
build system tooling matures.
2019-07-28 07:09:40 +02:00
Justin Mayer
daee3c2336 Add Stale bot 2019-07-23 18:44:55 +02:00
Justin Mayer
021f15256a Add CSS classes for reStructuredText figures
Fixes #2113
2019-07-23 16:37:09 +02:00
Justin Mayer
f61bd2ceba Update changelog for Pelican 4.1.0 2019-07-14 17:32:12 +02:00
Justin Mayer
d9e58f3096 Increment version in preparation for imminent release 2019-07-14 17:21:54 +02:00
Justin Mayer
5bb4bab718 Add pyproject.toml to MANIFEST.in 2019-07-14 17:09:11 +02:00
Justin Mayer
3aacc114fd Add Pelican entry point to pyproject.toml
Otherwise, the `pelican` CLI command may not be available when installing
via Poetry.
2019-07-14 17:05:40 +02:00
Justin Mayer
a52c67d42c Revert setup.py portion of "version-in-one-place"
Defining the version string in a single place is a nice goal to have,
but since we are currently straddling the fence as it relates to
setuptools and pyproject.toml, mingling them together results in some
unexpected behavior and is thus not advisable. We can revisit this if
and when we make a full switch away from setuptools.
2019-07-14 16:55:32 +02:00
Eklavya Sharma
126f72e1cd Only use relative paths in StaticGenerator
Previously some paths were relative and some were absolute,
which lead to multiple Content objects for the same static file
in self.staticfiles.
2019-07-09 23:50:17 +05:30
Justin Mayer
f7e0f7bbe0
Merge pull request #2590 from justinmayer/version_in_one_place
Consolidate version strings in pyproject.toml
2019-07-05 12:10:42 +02:00
Justin Mayer
54911fff39 Consolidate version strings in pyproject.toml
Storing the current version in a single place greatly simplifies
issuing new package releases.
2019-07-05 08:08:08 +02:00
Justin Mayer
7c63cb5231
Merge pull request #2589 from oulenz/test_server
Replace `os.mknod` with `open` for macOS and Windows compatibility
2019-07-03 23:36:39 +02:00
Oliver Urs Lenz
c988d6aaa2 replace os.mknod with open for macos and windows compatibility 2019-07-03 22:55:44 +02:00
Justin Mayer
7b123d8e6c
Merge pull request #2586 from justinmayer/pyproject
Add pyproject.toml and poetry.lock to project
2019-07-03 19:59:04 +02:00
Justin Mayer
b5c7e6fbe8 Make Markdown an optional dependency in pyproject
Refs #2585
2019-07-03 19:48:58 +02:00
Justin Mayer
216eec50fc Add pyproject.toml and poetry.lock to project
This could facilitate publishing new versions of Pelican as well as make
it easier for Poetry users to install Pelican via: `poetry install`

Closes #2450
2019-06-28 17:44:42 +02:00
Justin Mayer
80540281bc Add Python 3.5 env back to Travis tests. Refs #2571
Previous change resulted in Python 3.5 missing from the test
environment, as well as a duplicate Python 3.6 test run.
2019-06-24 20:21:19 +02:00
Justin Mayer
9154d8f42e
Merge pull request #2584 from justinmayer/reload
Enhance Invoke livereload task
2019-06-24 14:13:17 +02:00
Justin Mayer
a4cecd2d0c Add theme templates, CSS, JS to Invoke livereload task 2019-06-20 08:30:04 +02:00
Justin Mayer
cf2275c3be Add settings file to Invoke livereload watch list 2019-06-20 08:18:00 +02:00
Justin Mayer
c8b0b52d4e Use port settings in Invoke livereload task
Instead of using LiveReload's default port 5500, use the existing `port`
value from the task's CONFIG dictionary, which defaults to 8000.
2019-06-20 08:12:14 +02:00
Justin Mayer
ae7af1d696 Remove redundant vars in Invoke livereload task 2019-06-20 08:08:48 +02:00
Justin Mayer
8b4c46d74b Invoke serve task docstring: port is configurable 2019-06-20 07:49:48 +02:00
Justin Mayer
4b5610175f Invoke: Make settings file name handling more DRY
Instead of repeating hard-coded 'pelicanconf.py' values throughout
Invoke's task.py template, assign default settings file names to
variables, and use those variables where applicable.
2019-06-19 16:11:16 +02:00
Justin Mayer
5525a9021e Use OUTPUT_PATH setting in Invoke tasks.py template
The default setting for OUTPUT_PATH is already 'output', so it would be
more DRY to use the existing default value instead of a hardcoded
'output' string.
2019-06-19 15:45:32 +02:00
Justin Mayer
c61665b85d
Merge pull request #2526 from johnfraney/livereload
Add livereload invoke task. Fixes #1326
2019-06-19 09:49:24 +02:00
Justin Mayer
86777b9ce8
Merge pull request #2571 from johnfraney/tox-python-versions
Update CI config and fix failing CI envs
2019-06-19 09:40:07 +02:00
John Franey
ca012bd288 Update livereload Invoke task and add docs
Removes the `livereload` dependency from `setup.py`.

Updates the `invoke livereload` task by moving the `livereload` import
into the task function since it is now an optional dependency.

Updates the Invoke section of the documentaion with instructions on
using the `livereload` Invoke task.
2019-06-18 22:59:34 -04:00
John Franey
28383a6355 Add livereload invoke task. Fixes #1326
Adds a `livereload` invoke task that builds the project and reloads the
browser window when content files are updated.

Usage:

```console
$ invoke livereload
[I 190202 16:28:30 server:298] Serving on http://127.0.0.1:5500
[I 190202 16:28:30 handlers:59] Start watching changes
[I 190202 16:28:30 handlers:61] Start detecting changes
[I 190202 16:28:32 handlers:132] Browser Connected: http://127.0.0.1:5500/
```

See: https://livereload.readthedocs.io/en/latest/
2019-06-18 22:49:09 -04:00
John Franey
9e07234bae Update Tox config and fix failing CI envs
Updates base Python version for Travis CI from 2.7 to 3.6 and fixes a
linting error.
2019-06-18 22:44:46 -04:00
Justin Mayer
2e82a53cdf Document automatic titles from content file names
Closes #2107
2019-06-17 17:40:52 +02:00
Justin Mayer
98071fab94 Docs: MARKDOWN var replaces, not updates, default
Closes #2100
2019-06-17 16:50:54 +02:00
Justin Mayer
bbee493961
Merge pull request #2473 from bryanbrattlof/issue/2467
List files missing tag needed to order content
2019-06-17 16:18:14 +02:00
Justin Mayer
c25906d7c7
Merge pull request #2501 from jorgesumle/warning-fix
Remove spurious space character from warning message
2019-06-17 15:55:36 +02:00
Justin Mayer
b40282d566
Merge pull request #2580 from getpelican/funding
Add FUNDING.yml to project
2019-06-17 15:52:28 +02:00
Justin Mayer
a343b166e0 Add FUNDING.yml to project
This adds multiple methods for financially supporting Pelican's development. Primary motivations are to defray expenses for servers and domain name registration, as well to support and encourage Pelican's on-going maintenance and enhancement.
2019-06-17 15:36:07 +02:00
Justin Mayer
577d18a778
Merge pull request #2582 from timgates42/feature/python_main_support
Support for python -m pelican
2019-06-17 15:13:59 +02:00
Justin Mayer
9fdcb901f3 Both --autoreload and --listen can be combined
But not on Windows. Refs #2400
2019-06-16 18:56:08 +02:00
Justin Mayer
2ab91bbaaa Clarify that pelican --listen operates on output 2019-06-16 18:51:10 +02:00
Tim Gates
4bae94834e
Support for python -m pelican
Addresses https://github.com/getpelican/pelican/issues/2523

Note: @avaris made a good point that there is no need to replace the existing
module runner for pelican quickstart or the other tools as this can be run
via:

> python -m pelican.tools.pelican_quickstart
2019-06-14 09:41:49 +10:00
Justin Mayer
d8d230b554 PyCodeStyle fix 2019-06-10 21:44:13 +02:00
Justin Mayer
7f77106c1b Configure footnote test to keep hyphen as separator
Closes #2493
2019-06-10 21:36:02 +02:00
Justin Mayer
7e859c277f Pin Python-Markdown to >= 3.1 in test requirements
Closes #2493
2019-06-10 21:12:12 +02:00
Justin Mayer
8ed686136a Un-pin Python-Markdown version in test requirements
Refs #2493 #2569
2019-05-13 09:59:31 +02:00
Justin Mayer
e6ecefb594 Update http:// links to https:// where appropriate 2019-04-25 15:08:04 +02:00
Justin Mayer
90fc604d2d
Merge pull request #2544 from bberberov/redundant-and-reorder
Docs: Remove redundant text and reorder settings for consistency
2019-04-25 14:44:32 +02:00
Justin Mayer
4700fc89bd
Merge pull request #2520 from askpatrickw/askpatrickw-2386
Move FeedBurner config to wiki
2019-04-25 14:33:34 +02:00
Justin Mayer
21a4169169 Clarify copyright continues through to present day
This obviates the need to manually update the copyright every year.
2019-04-25 14:25:39 +02:00
Justin Mayer
24515c2cf0
Merge pull request #2476 from oulenz/collections
Try importing from collections.abc for compatibility with Python 3.8
2019-04-25 14:05:31 +02:00
Justin Mayer
8a76981137
Merge pull request #2559 from hrw/add-all_articles-to-period-pages
Provide 'all_articles' variable to period pages
2019-04-19 21:04:19 +02:00
Marcin Juszkiewicz
8520840be6 Provide 'all_articles' variable to period pages
This allows 'recent posts' functionality to work properly.
2019-04-19 19:45:23 +02:00
Boian Berberov
4f49428961 Documentation changes based on pull request comments.
- Settings -> Template pages: DIRECT_TEMPLATES example
- Creating Themes -> Common variables: authors and tags descriptions
2019-04-04 17:11:58 -06:00
Boian Berberov
86c1db1c63 Adding authors to Common variables
- Adding `authors` to Common variables in the documentation
- Reordering the `authors`, `categories`, `tags` variables in the table
2019-03-26 17:42:59 -06:00
Boian Berberov
3d5cdad473 Updating DIRECT_TEMPLATES documentation to match default configuration 2019-03-23 15:34:47 -06:00
Boian Berberov
de237e365a Remove redundant text and reorder settings for consistency
- Remove redundant `YEAR`, `MONTH`, and `DAY` `_ARCHIVE_SAVE_AS` sections
- Move `AUTHOR_URL` and `AUTHOR_SAVE_AS` to match `AUTHOR`, `CATEGORY`, `TAG` order throughout the rest of the document
- Move `YEAR`, `MONTH`, and `DAY` `_ARCHIVE_URL` and `_ARCHIVE_SAVE_AS` sections below paragraph describing them; and match ( `_URL`, `_SAVE_AS` ) order throughout the rest of the document

Recommend viewing with `--diff-algorithm=patience`
2019-03-19 20:56:44 -06:00
Justin Mayer
de71f39232
Merge pull request #2543 from bberberov/TEMPLATE_EXTENSIONS
Change TEMPLATE_EXTENSION to TEMPLATE_EXTENSIONS in documentation
2019-03-15 18:10:07 +01:00
Boian Berberov
583c0d4e17 Change TEMPLATE_EXTENSION to TEMPLATE_EXTENSIONS in documentation 2019-03-13 17:00:21 -06:00
Justin Mayer
396b679976
Merge pull request #2535 from oulenz/translations_ids
Fix bug in process_translations warning message generation that caused error with empty slugs
2019-03-07 21:19:08 +01:00
Justin Mayer
dde374651a
Merge pull request #2515 from bryanbrattlof/issue/2506
Update 'simple' theme to use new Atom/RSS settings
2019-03-07 21:16:51 +01:00
Justin Mayer
d9e98a5a39
Merge pull request #2514 from rask004/fix-2487
Fix pelican-import error regarding wp-attach and Unicode
2019-03-07 21:13:37 +01:00
Justin Mayer
6fa80ce37d
Merge pull request #2181 from andrew-vant/recursive_epm
Allow directory entries in EXTRA_PATH_METADATA
2019-03-07 21:11:04 +01:00
Andrew Vant
ce9f3d55a3 Allow directories in EXTRA_PATH_METADATA
Metadata applied to a directory will apply to all files under
it. In case of conflicts, child paths beat parent paths, so metadata
applied to `dir/subdir/file.md` will take precedence over that applied
to `dir/subdir`, which will take precedence over just `dir`.
2019-03-06 16:21:27 -05:00
Oliver Urs Lenz
c9dc3223eb Fix bug in process_translations warning message generation that caused error with empty slugs 2019-02-24 11:19:12 +01:00
Justin Mayer
e967988eff
Merge pull request #2528 from johnfraney/fix-failing-ci
Remove Python 3.4
2019-02-16 17:00:01 +01:00
John Franey
63a72fc619 Remove Python 3.4 references
This PR removes the Python 3.4 tox task and updates references in the
code to Python 3.5+.

tox complains about Python 3.4, which is EOL after next month:

> py34 installed: DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).
2019-02-06 10:23:27 -04:00
John Franey
3395e71570 Fix linting issues
Fixes linting issues that caused the `flake8` CI stage to fail.
2019-02-06 10:22:57 -04:00
Justin Mayer
95a6486a8b
Merge pull request #2521 from monadnoc/quickstart_en_fix
Fix _DEFAULT_LANGUAGE in pelican-quickstart
2019-01-27 10:36:18 +01:00
Justin Mayer
5517e0dece
Merge pull request #2508 from oulenz/feed_importer
Reverts bug involving strftime accidentally introduced in feed importer
2019-01-27 10:34:38 +01:00
Justin Mayer
d5947b53a8
Merge pull request #2504 from mosra/docs-escaped-backslash
Docs: properly show escaped chars in SLUG_REGEX_SUBSTITUTIONS
2019-01-27 10:33:56 +01:00
Justin Mayer
f490618b9f
Merge pull request #2503 from mosra/paginator-broken-again
Pagination: the lstrip() was way too hungry, eating absolute URLs
2019-01-27 10:32:39 +01:00
Justin Mayer
e8c7756875
Merge pull request #2486 from bryanbrattlof/feature/1
Add relative_source_path attribute to content
2019-01-27 10:24:29 +01:00
Bryan Brattlof
42c27594ab
Add relative_source_path attribute to content 2019-01-26 18:47:56 -06:00
Justin Mayer
071f4756c9
Merge pull request #2522 from cclauss/patch-1
Simplify _input_compat and str_compat
2019-01-24 17:35:40 +01:00
cclauss
f6724cb960
Simplify _input_compat and str_compat
The __six__ module provides us these same constructs using different names.
2019-01-23 19:41:44 +01:00
Jordan Nelson
15f5e81552 fixed _DEFAULT_LANGUAGE in pelican-quickstart 2019-01-22 19:59:20 -06:00
Patrick
9ffaaa16f8
Move feedburner config to wiki
Fixes #2386

https://github.com/getpelican/pelican/wiki/FeedBurner-Configuration
2019-01-21 17:45:13 -08:00
Bryan Brattlof
0153f55016
Update 'simple' theme to use new Atom/RSS settings 2019-01-15 10:59:40 -06:00
Roland Askew
2aebfd1cdc fix pelican-import error regarding wp-attach and Uncode 2019-01-12 12:44:04 +13:00
Oliver Urs Lenz
3cdf4fd410 reverts bug involving strftime accidentally introduced in feed importer 2019-01-05 19:19:46 +01:00
Justin Mayer
ac90104103
Merge pull request #2507 from jorgesumle/update-changelog
Fix incorrect update note in changelog
2019-01-05 07:15:02 -08:00
Jorge Maldonado Ventura
cc9598299d Fix incorrect update note in changelog 2019-01-05 15:52:05 +01:00
Vladimír Vondruš
ec2a1bd42a pagination: this lstrip() was way too hungry, eating absolute URLs.
Reverts back to how pagination worked for the {url} placeholder as I did
it in 182fb11c80. Absolute URLs with
one or two leading slashes were eaten by lstrip() and became relative,
which then caused broken links in my case.

Added extra comments to this piece of code (*and* the test) to make it
less likely that someone breaks this again in the future.
2019-01-04 22:10:53 +01:00
Vladimír Vondruš
94db14e801 docs: properly show escaped chars in SLUG_REGEX_SUBSTITUTIONS. 2019-01-04 17:08:32 +01:00
Jorge Maldonado Ventura
58be4f0e04 Fix warning message
Add space between words 'static' and 'content'
2019-01-02 13:13:16 +01:00
Justin Mayer
b6d423d2b8
Merge pull request #2415 from NicolasLM/remove-unnecessary-atom-summaries
Remove Atom summaries when they are unnecessary
2018-12-19 11:01:58 -08:00
Nicolas Le Manchet
1b8a7826c4 Remove Atom summaries when they are unnecessary
Do not include a summary tag to Atom entries when:
- the summary is empty
- the summary and the full content are the same

Fixes #2403
2018-12-18 21:57:16 +01:00
Justin Mayer
6f0743b340
Merge pull request #2492 from ixjlyons/patch-3
Remove stopserver from .PHONY prereqs in Makefile template
2018-12-12 16:58:34 -08:00
Kenneth Lyons
4a3a06af8a
Remove stopserver from .PHONY prereqs in Makefile template 2018-12-12 13:25:14 -08:00
Justin Mayer
2f077037ba Prepare for next version 2018-11-30 09:00:11 -08:00
Justin Mayer
24d6efa9fd Prepare to release Pelican 4.0.1 2018-11-30 08:31:43 -08:00
Justin Mayer
49c77d7412 Add upgrade notes for slug-related settings
Refs #2442
2018-11-29 08:27:34 -08:00
Justin Mayer
f7e005cd0f Add bug fixes to changelog 2018-11-29 07:55:59 -08:00
Justin Mayer
0e3c8cede7
Merge pull request #2480 from avaris/serve-log
Refactor pelican.server logging
2018-11-28 21:07:45 -08:00
Justin Mayer
6aa2ad1808
Merge pull request #2449 from stuaxo/patch-5
Make importer work again. Fixes #2448
2018-11-28 21:01:16 -08:00
Justin Mayer
227c33a57d
Merge pull request #2483 from bryanbrattlof/issue/2482
Remove unnecessary whitespace stripping in Makefile template
2018-11-28 20:46:41 -08:00
Bryan Brattlof
59cca7adb5
Remove unnecessary whitespace stripping 2018-11-28 10:31:21 -06:00
Deniz Turgut
8aeed9b7bd Refactor pelican.server logging
* Use pelican.log instead of default loggers
* Remove excessive logging (report failures if nothing matches, don't report successes)
2018-11-27 19:55:31 +03:00
Stuart Axon
a597a31dad Make the blogger tests consistant with the wp ones - cast
to list in test if needed.
2018-11-26 16:58:12 +00:00
Stuart Axon
942e462241 Don't convert posts to lists for wp importer. 2018-11-26 16:37:10 +00:00
Stuart Axon
ded234467d Update pelican_import.py
pelican-import: Move pandoc check inside loop, fixing #2448
2018-11-26 16:37:10 +00:00
Justin Mayer
3596e04639
Merge pull request #2452 from stuaxo/patch-6
Importer: Avoid downloading duplicate post attachments
2018-11-26 08:12:54 -08:00
Justin Mayer
2bef2e83cf
Merge pull request #2479 from avaris/2475
Use language_code if it is supported
2018-11-26 07:52:04 -08:00
Justin Mayer
c4eda992d5
Merge pull request #2477 from oulenz/tag_attribute
Remove non-existent tag attribute handling from Content.url_format
2018-11-25 23:34:41 -07:00
Justin Mayer
64d1a78373
Merge pull request #2478 from avaris/2474
Use pelican.server class in Invoke template
2018-11-25 23:29:45 -07:00
Deniz Turgut
2afef16008 Use language_code if it is supported 2018-11-26 03:45:20 +03:00
Bryan Brattlof
497271ea7e
List files missing tag needed to order content 2018-11-25 13:11:48 -06:00
Deniz Turgut
a3b256db1e Use pelican.server class in invoke template 2018-11-25 21:43:40 +03:00
Oliver Urs Lenz
6923a7bca0 Remove non-existent tag attribute handling from Content.url_format 2018-11-25 13:27:18 +01:00
Oliver Urs Lenz
9ae32b8ff9 Try importing from collections.abc for compatibility with Python 3.8 2018-11-24 21:59:40 +01:00
Justin Mayer
45c884cba5
Merge pull request #2447 from stuaxo/patch-4
pelican_import: Fix post titles that are entirely made of spaces
2018-11-20 15:56:23 -06:00
Justin Mayer
a0c0816191
Merge pull request #2455 from oulenz/static_content
Disinherit Page from Static so default draft status does not affect save_as
2018-11-20 15:34:27 -06:00
Stuart Axon
4d1869002e Update pelican_import.py
Use a set to avoid downloading duplicate attachments on a post more than once.
2018-11-17 15:02:31 +00:00
Oliver Urs Lenz
70b8ededa6 Disinherit Page from Static so default draft status does not affect save_as 2018-11-16 18:09:22 +01:00
Stuart Axon
033d6ac4d6 pelican_import wordpress import
get_filename:
   use "post_name", where the parameter is the postname.
   fixup names that are entirely made up of spaces.
2018-11-15 14:02:10 +00:00
Justin Mayer
940d4534a1 Prepare to release Pelican 4.0 2018-11-13 14:55:25 +01:00
Justin Mayer
36293da1e0 Add more changelog entries 2018-11-13 08:40:56 +01:00
Justin Mayer
a00bd6ec8b
Merge pull request #2374 from jorgesumle/hreflang
Add hreflang attribute to default themes
2018-11-12 08:15:08 +01:00
Justin Mayer
71650b408c
Merge pull request #2437 from ajorg/gentle-s-deprecation
Replace %s rather than fall back to defaults
2018-11-12 00:17:52 +01:00
Andrew Jorgensen
b1d44c1c87 Replace %s rather than fallback to defaults
3a0add4b6e caused existing configs to fall
back to defaults. But since we know exactly how to fix the user config
so that the behavior doesn't change, we should do so, while still
warning that use of %s is deprecated.

Also fixes a bug where we tried to look for %s in None.
2018-11-11 14:54:14 -08:00
Justin Mayer
9768c6ead3
Merge pull request #2440 from avaris/urlwrapper-slug
Make URLWrapper.slug settable again
2018-11-11 23:10:42 +01:00
Deniz Turgut
bc84075ded Make URLWrapper.slug settable again
Fixes #2242, Supersedes #2243
2018-11-11 21:35:51 +03:00
Justin Mayer
db586a4c59
Merge pull request #2406 from mosra/metadata-intrasite-links-process-only-once
Don't process metadata links before all files are present
2018-11-11 18:18:54 +01:00
Justin Mayer
7f7448ef76
Merge pull request #2439 from mosra/settings-paginated-templates-deprecation-fix
Fix PAGINATED_DIRECT_TEMPLATES backward compatibility handling to not crash
2018-11-11 17:40:09 +01:00
Deniz Turgut
74a2481bf3 settings: set backward-compatible PAGINATED_TEMPLATES if not present. 2018-11-11 13:59:48 +01:00
Vladimír Vondruš
4c3b6ac383 settings: add another consistency test for SLUG_SUBSTITUTIONS. 2018-11-11 13:58:55 +01:00
Vladimír Vondruš
d01614495f settings: test reading PAGINATED_DIRECT_TEMPLATES from pelicanconf.py.
At the moment aborts with the following:

      File "/usr/lib/python3.7/site-packages/pelican/settings.py", line 327, in handle_deprecated_settings
        if t not in settings['PAGINATED_TEMPLATES']:
    KeyError: 'PAGINATED_TEMPLATES'
2018-11-11 13:58:55 +01:00
Oliver Urs Lenz
dc7579582a Add more changes to changelog 2018-11-11 13:29:26 +01:00
Justin Mayer
c2e19df4c1
Merge pull request #2434 from oulenz/importer_doc
Importer docs: Warn about multiple categories in Wordpress
2018-11-11 13:04:38 +01:00
Justin Mayer
af9859d7cc Merge branch '{slug}-indent' 2018-11-11 12:55:40 +01:00
Justin Mayer
4d0de58409 Fix PyCodeStyle violations 2018-11-11 12:54:42 +01:00
Justin Mayer
686206161b Fix example sites in metadata tags list test 2018-11-11 12:00:59 +01:00
Justin Mayer
d974ba898c
Merge branch 'master' into html_list_tags 2018-11-11 11:30:28 +01:00
Justin Mayer
2c2706b715
Merge pull request #2438 from mosra/graceful-rst-parse-errors
Gracefully handle reST parse errors
2018-11-11 11:05:54 +01:00
Vladimír Vondruš
4df3b5156f Bring back Content._summary.
It's now just a (mutable) copy of metadata["summary"] and changes to it
are integrated back to the original.
2018-11-11 01:30:14 +01:00
Vladimír Vondruš
673e33840d Don't process metadata links before all files are present.
The refresh_metadata_intersite_links() is called again later, so this
bit was only causing everything to be processed twice. Besides
that, it makes the processing dependent on file order -- in particular,
when metadata references a file that was not parsed yet, it reported an
"Unable to find" warning. But everything is found in the second pass, so
this only causes a superflous false warning and no change to the output.

The related test now needs to call the
refresh_metadata_intersite_links() explicitly. That function is called
from Pelican.run() and all generators but the test processes just one
page so it has no chance of being called implicitly.

Related discussion: https://github.com/getpelican/pelican/pull/2288/files#r204337359
2018-11-11 01:19:20 +01:00
Vladimír Vondruš
c793e5c394 Add a test for false-positive warnings about intersite links.
With the current implementation, links to articles/pages that have not
been processed yet are reported with a warning, yet later replaced with
a correct value. That's not wanted.
2018-11-11 01:18:53 +01:00
Deniz Turgut
dd76c7158f Improve the looks of reST parser error output. 2018-11-10 23:08:10 +01:00
Deniz Turgut
015eefe7de Let's handle reST errors in a simple and nice way, finally. 2018-11-10 23:08:10 +01:00
Vladimír Vondruš
5ff553f6f3 Add tests verifying graceful handling on reST errors.
Currently all fail.
2018-11-10 23:08:10 +01:00
Oliver Urs Lenz
cbf4c3cae2 importer docs: warn about multiple categories in wordpress 2018-11-06 09:10:00 +01:00
Justin Mayer
b6b3724ed2
Merge pull request #2427 from MinchinWeb/tox-py37
Add Python 3.7 support to Travis and Tox
2018-11-06 08:31:29 +01:00
MinchinWeb
a06fd61ffc fix indent
The indent appears to have been messed up on the merge.
2018-11-03 11:09:17 -06:00
Justin Mayer
e9b6174157
Merge pull request #2429 from MinchinWeb/line-limit
Docs: Reflow to 79 char line limit
2018-11-03 16:22:57 +01:00
Justin Mayer
e35120faa8
Merge branch 'master' into line-limit 2018-11-03 16:18:25 +01:00
MinchinWeb
3a0add4b6e Convert FEED settings from %s to {slug} redux (#2432)
* Convert FEED settings from `%s` to `{slug}` redux

Closes #2106, Closes #2383
2018-11-03 16:12:20 +01:00
Justin Mayer
682b0b6711
Merge pull request #2430 from MinchinWeb/ghp-import-update
Docs: ghp-import works on Windows now
2018-11-03 15:33:13 +01:00
MinchinWeb
f9c3ac73e0 Docs: ghp-import works on Windows now
see https://github.com/davisp/ghp-import/pull/25
2018-11-02 20:55:33 -06:00
MinchinWeb
f595741b8e Docs: Reflow to 79 char line limit 2018-11-02 20:53:15 -06:00
MinchinWeb
dbdbd43511 Add Python 3.7 support to Travis and Tox 2018-11-02 16:11:45 -06:00
Justin Mayer
0da7ac677a
Merge pull request #2381 from oulenz/static_links
Automatically copy linked static files
2018-11-02 22:41:30 +01:00
Oliver Urs Lenz
048ea4dc0c automatically copy linked static files 2018-11-01 18:08:11 +01:00
Justin Mayer
1873200a4f
Merge pull request #2424 from greeder59/greeder59-patch_2404
Enable both pages & categories on Simple theme menu. Fixes #2404
2018-11-01 15:50:40 +01:00
Justin Mayer
11de7b2e47
Merge branch 'master' into html_list_tags 2018-11-01 15:43:14 +01:00
Justin Mayer
5c08af8f80
Merge pull request #2309 from oulenz/translations
Control translation identification scope with new translation_id settings
2018-11-01 13:11:19 +01:00
Oliver Urs Lenz
77c967f1db control scope of identification of translations with new settings 2018-11-01 10:12:47 +01:00
Justin Mayer
c97c128d16
Merge pull request #2375 from oulenz/page_save_as
Tweak paginator to accommodate {slug}.html patterns
2018-11-01 09:53:19 +01:00
Oliver Urs Lenz
a78950bce7 tweak paginator to accomodate {slug}.html patterns 2018-11-01 00:14:22 +01:00
Justin Mayer
461f535d04
Merge pull request #2326 from oulenz/slug_substitutions
Control slug substitutions from settings with regex
2018-10-31 20:08:01 +01:00
Oliver Urs Lenz
5199fa51ea control slug substitutions from settings with regex 2018-10-31 16:20:21 +01:00
Justin Mayer
96a689eaef
Merge pull request #2324 from oulenz/get_suffixes
correct suffix order in ComplexHTTPRequestHandler
2018-10-31 15:23:22 +01:00
Justin Mayer
6af825eae6
Merge pull request #2426 from jagmoreira/ghp-commit-msg-task
Add current date when publishing via ghp and Invoke
2018-10-31 10:32:40 +01:00
Justin Mayer
cdc999dd28
Merge pull request #2414 from jfbaillette/patch-1
Resolve mtime truncation. Fixes #2412
2018-10-31 10:25:13 +01:00
Joao Moreira
d965575f4a Add current date when publishing with ghp tool.
Re-submission of #2083 based on Invoke's task.py.
2018-10-30 19:05:31 -05:00
Gordon Reeder
a247354db8
Updated base.html to fix issue #2404. 2018-10-28 20:08:41 -07:00
Justin Mayer
f2b429b7b7
Merge pull request #2422 from justinmayer/print-settings
Add CLI argument to print current settings
2018-10-26 18:04:21 +02:00
Justin Mayer
ab9b21c03d Move --print-settings logic out of main() 2018-10-26 12:00:40 +02:00
Justin Mayer
b27153fe9b Conform to changes in Flake8 v3.6 code style 2018-10-25 09:36:26 +02:00
Justin Mayer
08ae2ef361 Pin Python-Markdown until fixed v3.1 is released 2018-10-25 09:28:42 +02:00
Justin Mayer
f130695bbf Support multiple --print-settings arguments 2018-10-24 11:49:03 +02:00
Justin Mayer
ddb5f4ed71
Merge pull request #2389 from farseerfc/master
Fix DeprecationWarning in tests about collections.abc
2018-10-24 09:19:09 +02:00
Justin Mayer
6224f95ea3
Merge pull request #2147 from outlace/patch-1
Enhance GitHub User Pages docs in tips.rst
2018-10-24 08:42:36 +02:00
Justin Mayer
e81a284c39 Add CLI argument to print current settings
Fixes #2275
Refs #1762
2018-10-23 19:57:26 +02:00
Baillette
00a14a02a6
Resolving mtime truncation issue #2412
Issue #2412 : python copy instruction doesn't preserve mtime under Debian/stretch (up to date).
This results in lot of files are copied to output even if not changed (and a lot of wasted time).

Proposed solution in pelican/pelican/generators.py, line 823:
#return s_mtime > d_mtime
return s_mtime - d_mtime > 0.000001
2018-10-03 19:13:39 +02:00
Justin Mayer
9e526a825e
Merge pull request #2384 from oulenz/pagination_per_template
Control pagination per template
2018-09-15 08:57:31 +02:00
Justin Mayer
8f68551454
Merge pull request #2397 from oulenz/pelican_server
Fix pelican.server __main__ code, add deprecation warning
2018-08-08 18:08:48 +02:00
Oliver Urs Lenz
8c433616bf fix pelican.server __main__ code, add deprecation warning 2018-08-08 18:00:15 +02:00
Oliver Urs Lenz
5cc40ee3ba correct suffix order in ComplexHTTPRequestHandler 2018-08-08 16:37:39 +02:00
Justin Mayer
e9b654bbaa
Merge pull request #2395 from oulenz/import_from_blogger
Add Blogger XML backup importer
2018-08-08 09:45:52 +02:00
Justin Mayer
6a717469d9
Merge pull request #2396 from oulenz/wrap_none
importer: don't wrap, because it breaks HTML attributes
2018-08-08 09:43:37 +02:00
Oliver Urs Lenz
f3e95cf473 importer: don't wrap, because it breaks html attributes 2018-08-07 17:16:23 +02:00
Oliver Urs Lenz
c388f14d3e add blogger importer 2018-08-07 14:33:10 +02:00
Justin Mayer
f2c3136921
Merge pull request #2366 from davidag/pandoc2-import-support
Add pandoc2 support to pelican-import. Fix #2255
2018-08-04 11:26:32 +02:00
David Alfonso
150d1f05d0 Add pandoc2 support to pelican-import. Fix #2255
Specific options passed to pandoc2 in order to get similar results than
with pandoc1:

- Disable smart quotes from the markdown output.

- Enable raw parsing from html.
2018-08-03 19:44:50 +02:00
Justin Mayer
d2eb32c910 Remove *.in files from MANIFEST.in
There no longer appear to be any *.in files in this project, presumably
because we switched to Jinja2 templates instead. Refs #1155
2018-08-03 14:57:22 +02:00
Justin Mayer
998de87fba
Merge pull request #2393 from ryanfox/server_error_message
Clarify error message for deprecated dev server command
2018-08-03 09:42:52 +02:00
Ryan Fox
36d61438c1 clarify error message when running deprecated command for dev server. Fixes #2390 2018-08-02 20:59:19 -05:00
Justin Mayer
4f861245a6
Merge pull request #2392 from Bernardoow/gh-import-update-file-in-gh-page-branch
Document GitHub Pages import to gh-pages branch
2018-07-30 09:44:22 +02:00
Bernardo Gomes
31fd6c6da6 ghp-import ouput update the branch gh-pages 2018-07-29 19:26:03 -03:00
Jiachen YANG
500c556974 fix travis tests for py27 by try import collections.abc 2018-07-25 16:27:36 +09:00
Jiachen YANG
6d4fcedacc fix DeprecationWarnning about collections.abc 2018-07-25 15:47:35 +09:00
Oliver Urs Lenz
62128fb948 control pagination per template 2018-07-12 17:39:51 +02:00
Justin Mayer
76eebfe539
Merge pull request #2380 from oulenz/attachment_links
importer: update links to attachments if --wp-attach
2018-07-09 12:54:59 +02:00
Oliver Urs Lenz
a5571ba1d5 importer: update links to attachments if --wp-attach 2018-07-09 11:26:50 +02:00
Justin Mayer
a6600e2fca
Merge pull request #2378 from davidag/fix-makefile-template
Avoid escaping dollar signs in Makefile template
2018-07-09 10:42:58 +02:00
Kevin Deldycke
c04a4701b8 Replace Fabric by Invoke. 2018-07-08 21:33:10 +02:00
Justin Mayer
dc465d5c5f Merge fix for broken symlink test on macOS 2018-07-08 21:29:17 +02:00
Thomas Fan
6e0ed07446 Resolve symlinks before comparison test
Fixes #2358
2018-07-08 21:27:42 +02:00
David Alfonso
7d18a4f3b8 Avoid escaping dollars in Makefile template
If dollars are escaped, the commands don't work as expected (i.e. doing
variable substitution).
2018-07-07 19:48:52 +02:00
Justin Mayer
9ac35ed47a
Merge pull request #2376 from strburst/simple_theme_categories_title
Tweaks to simple theme on listing pages
2018-07-06 21:45:14 +02:00
Justin Mayer
d84757fae5
Merge pull request #2377 from strburst/simple_no_authors
Show article category/tags even if no authors (in the simple theme)
2018-07-06 21:43:01 +02:00
Allen Zheng
a3d76a0fd8 Remove bad whitespace stripping in simple theme
This joins the contents of the block to the previous line, which messes
up the output formatting in this case.

Old vs new output:
- <ul>        <li>...
+ <ul>
+     <li>...

This change is already in the 'notmyidea' theme.
2018-07-06 09:13:39 -04:00
Allen Zheng
bf16faf1e2 Add missing ul tag in tags list in simple theme
There are some li elements generated without a ul/ol around them.
Besides being malformed html, this results in there being no margin that
lists normally have.
2018-07-06 09:13:39 -04:00
Allen Zheng
10f70db9a6 Add h1 to the categories list in simple/notmyidea
The authors.html and tags.html templates both have this. Add it here as
well for consistency.

This also affects the notmyidea theme because it inherits the categories
template from simple.

While we're here, also make indentation consistent with other files (4
spaces within a block).
2018-07-06 09:13:39 -04:00
Allen Zheng
6ec5a984ad Show article category/tags even if no authors
Before this commit, the behavior of the simple theme is to hide the
category and tags if there is no author defined, even if the
category/tags are present. This appears to be unintentional, due to a
misplaced `endif`.

Fix this by moving the endif to the right place, so that the other if
blocks aren't nested.
2018-07-05 15:34:49 -04:00
Jorge Maldonado Ventura
d1d1cccdad Add hreflang attribute to default themes 2018-07-05 00:50:18 +02:00
Justin Mayer
b30270190a
Merge pull request #2359 from davidag/update-importer-doc
Add missing Wordpress options to importer doc
2018-07-04 18:30:50 +02:00
Justin Mayer
b4d5e4285e
Merge pull request #2285 from andreacorbellini/2263-handle-invalid-refs
Fix utils.truncate_html_words() to work with invalid HTML references
2018-07-04 18:28:17 +02:00
Justin Mayer
ec1914d3bd
Merge pull request #2371 from oulenz/draft_pages
Allow pages to have draft status, like articles
2018-07-04 18:20:57 +02:00
Justin Mayer
2577555737
Merge pull request #2370 from jorgesumle/themes
Support translation of lang attribute in default themes
2018-07-04 17:31:26 +02:00
Justin Mayer
0b8d5bdaaa
Merge pull request #2372 from jorgesumle/quickstart
Remove extra endif from Makefile template
2018-07-03 21:25:33 +02:00
Jorge Maldonado Ventura
63dfe70850 Import readline in pelican_quickstart.py if available (#2129) 2018-07-03 21:20:02 +02:00
Jorge Maldonado Ventura
ec15105c2f Remove extra endif from Makefile template 2018-07-03 20:57:12 +02:00
Oliver Urs Lenz
576229ad19 allows pages to have draft status, like articles 2018-07-03 12:53:46 +02:00
Jorge Maldonado Ventura
71af410285 Support translation of lang attribute in default themes 2018-07-02 23:42:03 +02:00
Justin Mayer
668663684c
Merge pull request #2351 from Lucas-C/rm_develop_server.sh
Remove develop_server.sh in favour of pelican serving static files itself - close #2176
2018-07-02 16:55:34 +02:00
Justin Mayer
29b93366cf
Merge pull request #2368 from jorgesumle/typo
Fix typo
2018-06-27 21:38:23 +02:00
Jorge Maldonado Ventura
bdeb84adb9 Fix typo 2018-06-27 20:40:52 +02:00
David Alfonso
e44c4aba36 Add missing wordpress options to importer doc 2018-06-22 22:36:43 +02:00
Johannes 'josch' Schauer
a5edbf8546 Remove develop_server.sh in favour of pelican serving static files itself
Competing static site generators integrate the functionality of regenerating
content and serving it into their main executable. In pelican this
functionality used to be in an external script `develop_server.sh` which
resides in the blog base directory. This has the disadvantage that changes in
pelican can break the `develop_server.sh` scripts which will not automatically
be upgraded together with pelican by package managers. Thus, pelican should
integrate this functionality into its main executable.

To this end, this commit removes `develop_server.sh` and adds three command
line options to the pelican executable:

 * `-l/--listen` starts the HTTP server (`-s/--serve` was already taken)
 * `-p/--port` specifies the port to listen at
 * `-b/--bind` specifies the IP to bind to

`--listen` and `--autoreload` can be used together to achieve the same
effect that other static site generators offer: Serve files via HTTP
while at the same time auto-generating the content.

Since the `develop_server.sh` script was removed, pelican-quickstart looses the
`develop` option.

Since the `develop_server.sh` script was removed, the Makefile looses the
`stopserver` target and the `devserver` target is replaced by running `pelican
-l` in the foreground.

Since pelican now offers the `--listen` option, the fabfile uses that instead
of starting the socketserver itself.
2018-06-22 19:22:38 +02:00
Adrin Jalali
ee24ad1821 Elaborate the warning message when no files are processed by readers. (#2310)
Elaborate warning message when no files are processed by readers
2018-06-22 15:00:21 +02:00
Justin Mayer
20b39dc761 Fix code-in-bold-text rendering in Contribute docs 2018-06-21 17:40:58 +02:00
Oliver Urs Lenz
8ef9d11bc4 Clarify contribution guidelines 2018-06-21 17:30:18 +02:00
Justin Mayer
80f212cc60
Merge pull request #2352 from Shir0kamii/clean-simple-theme
Add enhancements to Simple theme
2018-06-19 21:17:17 +02:00
Alexandre Bonnetain
80027bc714 Clean simple theme 2018-06-19 19:07:20 +00:00
Justin Mayer
3656df50a5
Merge pull request #2327 from jorgesumle/setup
Update setup.py
2018-04-11 10:59:47 -07:00
Jorge Maldonado Ventura
544b35fba5 Update setup.py
- Add license metadata
- Add `Programming Language :: Python :: 3.7` classifier
- Use HTTPS in the website link
2018-04-11 19:14:47 +02:00
Justin Mayer
583c840579
Merge pull request #2269 from tonymet/feature/https-server
Support SSL with pelican.server by adding --ssl , --cert and --key options
2018-04-10 14:09:07 -07:00
Anthony Metzidis
12db9ba0e1 support ssl in pelican.server with --ssl, --cert & --key 2018-04-07 15:06:38 -07:00
Justin Mayer
5ca1cabe78
Merge pull request #2292 from oulenz/article_order
Remove hardcoded sorting of articles within categories, tags, authors, feeds
2018-04-06 12:08:29 -07:00
Justin Mayer
25045e8fb8
Merge pull request #2311 from gwax/warn_rst_no_document_title
Multiple reST headers yields "could not find information about 'date'"
2018-04-06 11:51:22 -07:00
Justin Mayer
5fed5d9118
Merge pull request #2317 from Siltaar/master
Allow develop_server.sh to work with paths containing spaces
2018-04-06 11:39:14 -07:00
Justin Mayer
5330453579
Merge pull request #2017 from JulienPalard/master
Explicitly disallow duplications of URL and save_as
2018-04-06 11:29:37 -07:00
Justin Mayer
5be4dab713
Merge pull request #2321 from gDelgado14/patch-1
List reserved metadata keywords
2018-04-06 11:25:04 -07:00
Justin Mayer
c16fdd997c
Merge pull request #1441 from eliben/server-try-stripping
Server script should try to rstrip '/' when serving pages
2018-04-05 08:23:15 -07:00
Eli Bendersky
16d5236e62 Try to rstrip '/' from the address in the server script when serving pages. 2018-04-05 05:50:50 -07:00
Giorgio
859e7af8c7
Add template, save_as and url to list 2018-04-02 20:45:27 -04:00
Giorgio
3f8af1ab76
List reserved metadata keywords
Addresses https://github.com/getpelican/pelican/issues/2279
2018-04-01 21:25:41 -04:00
Justin Mayer
04b0cfe50c
Merge pull request #2319 from NicolasLM/patch-1
Replace deprecated "PAGES" variable by "pages"
2018-03-29 12:34:59 -07:00
Nicolas Le Manchet
557e614083
Replace deprecated "PAGES" variable by "pages" 2018-03-29 21:28:16 +02:00
Siltaar
9e035ed727 fix ""DIR 2018-03-29 15:20:10 +02:00
Siltaar
e9c2409eab Allow develop_server.sh to work with paths containing spaces 2018-03-29 15:05:00 +02:00
George Leslie-Waksman
fb6d44712b Warn on missing rst document title. Fixes #2311. 2018-03-27 10:16:29 -07:00
Justin Mayer
81b7e7481f
Merge pull request #2238 from mosra/feed-urls
Feed URL settings, making feeds aware of absolute URLs
2018-03-23 13:36:51 +01:00
Justin Mayer
36f00b3afd
Merge pull request #2240 from mosra/atom-feed-subtitle
Make use of SITESUBTITLE setting also in Atom feeds
2018-03-23 13:34:37 +01:00
Justin Mayer
f761f95288
Merge pull request #2265 from bward/publish-docs-redundancy
Remove redundancy from publish docs. Fixes #2233.
2018-03-23 12:45:41 +01:00
Justin Mayer
d973a7d097
Merge pull request #2304 from peterdesmet/patch-1
Indicate that logging needs to be imported for LOG_FILTER
2018-03-23 12:22:28 +01:00
Oliver Urs Lenz
c160cb73cc remove hardcoded sorting of articles within categories, tags, authors, feeds 2018-03-18 12:21:56 +01:00
Justin Mayer
0a49609f82
Merge pull request #2302 from jorgesumle/link-fix
Fix broken links from documentation
2018-03-18 00:26:37 +01:00
Justin Mayer
8cb88e91ee
Merge pull request #2290 from benjaminabel/patch-1
Register function missing in docs
2018-03-18 00:25:29 +01:00
Justin Mayer
a51a487533
Merge pull request #2306 from avaris/static-follow-symlink
Fixes #2305: Follow symlinks while copying in static generator
2018-03-18 00:14:10 +01:00
Justin Mayer
9cf05fb2ae
Merge pull request #2256 from mosra/default-lang-to-docutils
Propagate value of DEFAULT_LANG to Docutils reST parser
2018-03-18 00:05:43 +01:00
Justin Mayer
97d79f1b56
Merge pull request #2267 from PeterDaveHelloKitchen/png-image-optimization
Optimize PNG images losslessly using Google zopflipng
2018-03-18 00:04:43 +01:00
Justin Mayer
a521bb6e87
Merge pull request #2278 from lqez/lqez-patch-1
No need to mention SimpleHTTPServer in quickstart script
2018-03-18 00:03:26 +01:00
Justin Mayer
aaac64618a
Merge pull request #2298 from manelclos/fix-2297
Don't fail on macOS: "unknown locale: UTF-8"
2018-03-18 00:00:12 +01:00
Peter Desmet
15c069d411 Import logging in LOG_FILTER examples 2018-03-16 10:37:23 +01:00
Deniz Turgut
beef062bb8 Fixes #2305: Follow symlinks while copying in static generator 2018-03-16 00:36:19 +03:00
Jorge Maldonado Ventura
4c0c2a5893 Documentation: Fix broken links 2018-03-12 14:35:40 +01:00
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
Manel Clos
b6b9f2af40
Don't fail on macosx: "unknown locale: UTF-8" 2018-02-26 07:29:55 +01:00
Benjamin ABEL
30a472a8a3
[DOC] register function missing 2018-02-12 15:14:27 +01: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
Andrea Corbellini
01480a539f more accurate code and tests 2018-02-08 20:10:08 +01:00
Andrea Corbellini
fc7af9e1c3 flake8 fixes 2018-02-08 18:39:29 +01:00
Andrea Corbellini
b573576b00 Fix utils.truncate_html_words() to work with invalid HTML references
Invalid references like those missing semicolons (e.g. `&mdash`) or
those causing overflows (e.g. `&#9999999999;`) are now gracefully
handled and no exception is thrown.

This commit also adds tests and comments where needed.
2018-02-08 18:30:09 +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
Hyunwoo Park
b888a4589e
Make it simpler again 2018-02-02 17:16:09 +09:00
Hyunwoo Park
d496e81f2b
We're not using SimpleHTTPServer anymore. 2018-01-22 19:26:57 +09:00
Peter Dave Hello
0dc175434f Optimize PNG images losslessly using Google zopflipng 2017-12-25 01:43:34 +08:00
Ben Ward
4f96966020 Remove redundancy from publish docs. Fixes #2233. 2017-12-18 11:39:57 +00: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
Mr. Senko
f62217f38e Make HTMLReader parse multiple occurences of metadata tags as list
this means you can now specify:
<meta name="custom_field" content="value_1" />
<meta name="custom_field" content="value_2" />

and the resulting object.custom_field will be ['value_1', 'value_2']
2017-12-02 13:21:46 +02:00
Vladimír Vondruš
abb91fc3be Propagate value of DEFAULT_LANG to docutils reST parser.
That way the parsed node tree gets proper information about the
language, which can be then used for e.g. language-aware smart quotes or
hyphenation.
2017-11-29 22:42:54 +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š
a8b594f9d9 Make feed generator aware of absolute URLs.
So for example in case both SITEURL and ARTICLE_URL is absolute, the
generated URLs are not improperly

    http://your.site/http://blog.your.site/the-article/

but rather

    http://blog.your.site/the-article/
2017-10-29 21:35:23 +01:00
Vladimír Vondruš
e5110edcca Use FEED_*_URL settings in the builtin themes. 2017-10-29 21:35:23 +01:00
Vladimír Vondruš
343e24a26f Make it possible to specify custom URLs for feeds.
With this patch, there are new FEED_*_URL configuration options that
allow to specify custom URLs for feeds, which is helpful in case the
feed filename and the actual URL differ a lot -- for example if a feed
is saved to

    blog/feeds/all.atom.xml

but the actual URL from the user PoV is

    http://blog.your.site/feeds/all.atom.xml

This setting currently affects only the generated feed XML. This change
is also fully backwards compatible, so if the FEED_*_URL setting is not
present, the value of FEED_* is used for both file location and URL.
2017-10-29 21:35:23 +01:00
Vladimír Vondruš
d04b777159 Test for SITESUBTITLE in feeds.
It's now present in both RSS and Atom feeds.
2017-10-29 21:28:11 +01:00
Vladimír Vondruš
fc4b3e44d8 Make use of SITESUBTITLE setting also in Atom feeds.
For some reason, feedgenerator.py uses the `description` argument only
for RSS and the `subtitle` argument only for Atom. So setting both to
the same value.

In order to avoid unnecessary changes, if SITESUBTITLE is not present,
the subtitle is set to None instead of '', so the generated Atom feed
doesn't contain an empty <subtitle></subtitle> tag (in contrast, the RSS
feed contains an empty <description></description> tag now, though).
2017-10-29 21:23:56 +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
Jorge Maldonado Ventura
9d8d555708 Regenerate tests' output 2017-08-06 13:55:34 +02:00
Jorge Maldonado Ventura
a2d0705987 Remove Internet Explorer script, as it wasn't being used: 404 HTTP error 2017-07-30 17:49:43 +02:00
Jorge Maldonado Ventura
9ce09c0715 Store fonts of notmyidea theme locally
Used google-font-download ((commit ecc521e894c55e83773351264fe5bbef99ae70ad))
to download the fonts.
  font-download -f 'woff woff2' -l 'latin' 'Yanone Kaffeesatz:400'
2017-07-30 17:47:47 +02:00
Jorge Maldonado Ventura
9495a6c3df Remove trailing whitespaces from notmyidea 2017-07-30 17:41:32 +02:00
Justin Mayer
68724e9682 Encourage use of https:// in SITEURL
Refs #2183 #2186
2017-07-25 09:00:41 -07:00
winlu
089b46b7eb Consolidate validation of content (#2128)
* Consolidate validation of content

Previously we validated content outside of the content class via
calls to `is_valid_content` and some additional checks in page /
article generators (valid status).
This commit moves those checks all into content.valid() resulting
in a cleaner code structure.
This allows us to restructure how generators interact with content,
removing several old bugs in pelican (#1748, #1356, #2098).

- move verification function into content class
- move generator verifying content to contents class
- remove unused quote class
- remove draft class (no more rereading drafts)
- move auto draft status setter into Article.__init__
- add now parsing draft to basic test output
- remove problematic DEFAULT_STATUS setting
- add setter/getter for content.status
  removes need for lower() calls when verifying status

* expand c4b184fa32

Mostly implement feedback by @iKevinY.

* rename content.valid to content.is_valid
* rename valid_* functions to has_valid_*
* update tests and function calls in code accordingly
2017-07-24 10:01:14 -07:00
Justin Mayer
706c6f6f2f Merge pull request #2184 from jonaslb/fabfilefix
Correct import of socketserver on Python 3
2017-07-24 09:09:01 -07:00
Jonas Lundholm Bertelsen
1c96d8c933 Correct import of socketserver on Python 3 2017-07-24 12:25:21 +02:00
Justin Mayer
42b205d75c Merge pull request #2142 from MinchinWeb/patch-1
Pelican trove classifier now on PyPI
2017-07-21 10:34:18 -07:00
Justin Mayer
fbb1f32a06 Merge pull request #2165 from pananormalny/fix_rsync_makefile
Fix rsync_upload in Makefile template
2017-07-20 14:54:03 -07:00
Justin Mayer
f9a778fcae Merge pull request #2163 from mosra/override-docutils-html-translator
Ability to override docutils HTML translator
2017-07-20 14:14:43 -07:00
Justin Mayer
43ec3c4f7d Fix copyright year to date of first publication 2017-07-19 13:29:04 -07:00
Vladimír Vondruš
7336de45cb Ability to override docutils HTML writer/translator.
The RstReader class can now use user-specified writer/translator classes
instead of the hardcoded ones from docutils. This allows for far easier
overriding of the default HTML output -- in the past one would need to
override the internal _parse_metadata() and _get_publisher() functions.
With hypothetical Html5Writer and Html5FieldBodyTranslator classes,
based for example on docutils.writers.html5_polyglot.Writer and
docutils.writers.html5_polyglot.HTMLTranslator, a plugin that overrides
the default behavior would now look just like this:

    # (definition of Writer / Translator classes omitted)

    class Html5RstReader(RstReader):
        writer_class = Html5Writer
        field_body_translator_class = Html5FieldBodyTranslator

    def add_reader(readers):
        readers.reader_classes['rst'] = Html5RstReader

    def register():
        pelican.signals.readers_init.connect(add_reader)
2017-06-30 22:59:42 +02:00
Justin Mayer
d4435ea874 Merge pull request #1982 from adeverteuil/feature_check_static_modified
Add static file options: hard/symlink & only-when-modified
2017-06-22 12:49:26 -07:00
evilroot
fdf355c377 Fix rsync_upload in Makefile template 2017-06-08 22:59:12 +01:00
Justin Mayer
fa1d4d937c Merge pull request #2130 from ingwinlu/more_py36_regex_warnings
Fix more Python 3.6 regex warnings
2017-05-31 09:10:22 -07:00
Justin Mayer
1d556c78b6 Merge pull request #2149 from ingwinlu/fixup_ec5c77b25145f7c20fee24c6b85b478295dbc956
Fix forgotten PAGES -> pages in default theme
2017-05-23 12:58:59 -07:00
derwinlu
c68958e6b8 Fixup ec5c77b251
fix forgotten PAGES -> pages
2017-05-05 16:02:48 +02:00
Brandon B
32c154be95 Update tips.rst
I found that one of the easiest ways to publish to GitHub User Pages is to make Pelican a subdirectory within the ``<username>.github.io`` project, then generate the output files in the root level of ``<username>.github.io`` and push the entire project to GitHub.
2017-04-28 19:18:44 -07:00
MinchinWeb
24c41195a6 Use 4-space indentation 2017-04-26 10:34:47 -06:00
MinchinWeb
651ccbcddf Pelican trove classifier now on PyPI
https://github.com/pypa/warehouse/issues/1650
(now sorted alphabetically)
2017-04-26 10:29:00 -06:00
Justin Mayer
c2b2def1c8 Merge pull request #2115 from jvoisin/_update_content_regexp_simplification
Improve the regexp used in _update_content
2017-04-20 12:18:11 -07:00
Justin Mayer
5f1d5c4b88 Merge pull request #2136 from jorgesumle/setup
Add Python 3.6 classifier to setup.py
2017-04-16 12:38:09 -07:00
Jorge Maldonado Ventura
77faffa6f7 Add Python 3.6 classifier to setup.py 2017-04-16 13:46:04 +02:00
jvoisin
ad38d602c7 Improve the regexp used in _update_content
a html tag always starts with <[a-z], < [a-z] is invalid
a space can be found after the = in href='bleh'

This function is taking 10% of the compilation time, with caching enabled,
maybe it's worth optimising the regexp a bit more, I don't know.
2017-03-31 11:39:05 +02:00
derwinlu
f49037e0ca Fixup 89b28fd
We need to mark the whole doctest string as raw as it contains
regular expressions.
2017-03-29 10:46:51 +02:00
derwinlu
623eb0a4c0 Fix more python 3.6 regex DeprecationWarning's 2017-03-29 10:19:47 +02:00
Justin Mayer
cfcf40f1f8 Merge pull request #2127 from ingwinlu/fix_py36_warnings
Fix warnings originating from bad regexes
2017-03-27 13:04:26 -07:00
derwinlu
89b28fd36b Fix warnings originating from bad regexes
Starting with python 3.6 warnings are issued for invalid escape
sequences in regular expressions. This commit corrects all
DeprecationWarning's via properly declaring the offending
regular expressions as raw strings.

Resolves #2095.
2017-03-27 16:09:08 +02:00
Justin Mayer
fb07f4d513 Merge pull request #2117 from timwienk/fix-none-filename-metadata
Optional items in FILENAME_METADATA expression.
2017-03-20 15:40:35 -07:00
Justin Mayer
30df8e3558 Merge pull request #2085 from Scheirle/feed_signal
Add new signal: feed_generated
2017-03-19 15:04:07 -04:00
Tim Wienk
4917b8618a Fix setting None metadata from FILENAME_METADATA matches.
This is relevant when using optional items in the expression. E.g. if an
optional captured group is not matched, the result of
`match.groupdict()` contains the captured group with value `None`.
2017-03-15 17:07:31 +01:00
Justin Mayer
753da77e08 Merge pull request #2118 from fxfitz/switch_to_awscli
Use awscli instead of s3cmd for S3 in Makefile
2017-03-14 18:20:25 -07:00
fxfitz
b65a790b50 Switch over to use awscli 2017-03-13 17:59:43 -05:00
Justin Mayer
ee643d47d7 Merge pull request #2099 from horazont/feature/stop-save_as-from-breaking-out-of-output
Try to prevent writing outside of the output directory
2017-02-28 11:17:44 -08:00
Justin Mayer
f4bce91837 Merge pull request #2086 from Sjord/better-headers-in-tips-doc
Use better headers in tips docs
2017-02-28 11:15:49 -08:00
Justin Mayer
5569338fbd Merge pull request #2094 from ingwinlu/add_test_unknown_file
Add Python 3.6 test environment
2017-02-28 11:04:07 -08:00
derwinlu
490e3646ba Implement review feedback
* improve wording on testing with fox (contribute.rst)
* fix whitespace (.travis.xml)
2017-02-28 07:39:47 +01:00
Jonas Wielicki
018f4468cc Check safety of save_as earlier if possible
The check in the writer still serves as a safety net.
2017-02-27 21:49:17 +01:00
Jonas Wielicki
4006554a49 Prevent to write outside the output directory
This is crude and simply raises RuntimeError. We would generally
want to have earlier checks which log a warning and do not call
write at all.
2017-02-02 20:40:51 +01:00
derwinlu
22208a9471 Add test checking url replcmnt of unkn. file
There was no test case checking the behaviour of what happens when
trying to {filename} an unknown file.

Also changed the braces to `'` chars that we use elseware.
2017-01-24 09:12:16 +01:00
derwinlu
dcb6882fbc Update tox to 2.5.0 2017-01-24 09:12:16 +01:00
derwinlu
5a19887a22 Correct new flake8 warnings 2017-01-24 09:12:16 +01:00
derwinlu
a982e0c4f4 Add py36 to travis builds 2017-01-24 09:12:16 +01:00
derwinlu
9cca567bed Add python3.6 test environment
* Add py36 environment to tox
* Unify dependencies across manual installation and tox
* Mention tox in the docs
2017-01-23 23:50:51 +01:00
Bernhard Scheirle
927d9c7ea5 Add new signal: feed_generated
This signal gets emitted before a feed gets written to disk.
Therefore it allows plugins to do arbitrary changes to the feed.
2017-01-16 11:33:13 +01:00
Sjoerd
d61e2ccd6b Use better headers in tips docs
Instead of "Tip 1", "Tip 2" under "Extra tips", use headers describing
the content.

Also, remove the "hint" pointer as it is not really a hint and the
document consists of tips anyway.
2017-01-14 13:51:10 +01:00
Justin Mayer
25732f7be6 Prepare version 3.7.2.dev0 for next development cycle 2017-01-10 13:51:37 -08:00
Justin Mayer
ce38e318bd Bump version 3.7.1 2017-01-10 13:34:09 -08:00
Justin Mayer
f4baa43040 Merge pull request #2082 from avaris/setup
Specify encoding for README and CHANGELOG in setup.py
2017-01-03 11:25:37 -08:00
Deniz Turgut
6fe2fecb13 Specify encoding for README and CHANGELOG in setup.py 2017-01-03 21:51:23 +03:00
Justin Mayer
01d536d7c9 Replace m-dash with semi-colon in changelog
Stop-gap measure to address:
e3ab685a26 (commitcomment-20333961)
2016-12-31 15:10:46 -08:00
Justin Mayer
213976ca11 Merge pull request #2068 from lucasplus/master
Set locale to LC_ALL in Quickstart script. Fixes #2043
2016-12-30 17:38:02 -08:00
Alexandre de Verteuil
b46fbb7879 Add two STATIC_ settings. Fix #1982
STATIC_CREATE_LINKS = False

Create links instead of copying files. If the content and output
directories are on the same device, then create hard links. Falls
back to symbolic links if the output directory is on a different
filesystem. If symlinks are created, don’t forget to add the -L or
--copy-links option to rsync when uploading your site.

STATIC_CHECK_IF_MODIFIED = False

If set to True, and STATIC_CREATE_LINKS is False, compare mtimes of
content and output files, and only copy content files that are newer
than existing output files.
2016-12-30 02:45:37 -05:00
Lucas Chavez
84920e8fdf Set locale to LC_ALL in Quickstart script. Fixes #2043 2016-12-27 16:25:17 -07:00
Justin Mayer
98d1d4e338 Add missing .gitattributes attributes. Refs #2069 2016-12-23 08:03:57 -08:00
Justin Mayer
fc9227215b Ignore test content & output in language analysis
Refs #2069
2016-12-23 08:00:45 -08:00
Justin Mayer
c96edef571 Ignore samples for GitHub language stats analysis
Fixes #2069
2016-12-23 07:41:52 -08:00
Justin Mayer
82ada44aa8 Merge pull request #2065 from amyspark/master
Initialize locale for Python 2+ in quickstart script. Fixes #2043
2016-12-16 14:44:01 -08:00
L. E. Segovia
5c6ae32f99 For python 2+, initialize locale. Fixes #2043 2016-12-16 23:10:53 +01:00
Justin Mayer
0936d5f6ee Prepare version 3.7.1.dev0 for next development cycle 2016-12-14 13:56:47 -08:00
Justin Mayer
d13d57eaa6 Bump version 3.7.0 2016-12-12 14:05:20 -08:00
Justin Mayer
f4460a4449 Update package metadata 2016-12-12 14:00:11 -08:00
Justin Mayer
e3ab685a26 Update changelog for 3.7 release 2016-12-12 13:39:31 -08:00
Justin Mayer
97c058e94f Remove download statistics badge from README
PyPI download statistics have been broken for a long time and appear to
have been officially disabled in May 2016. See GitHub issue for details:
https://github.com/pypa/pypi-legacy/issues/396
2016-12-12 11:07:13 -08:00
Justin Mayer
3518713ac6 Merge pull request #2022 from rjames86/query_strings
Prevent server from dying when query strings present
2016-12-12 10:18:04 -08:00
Justin Mayer
44bc69b320 Merge pull request #2058 from avaris/fix_generator_caching
Fix generator caching
2016-12-10 10:56:36 -08:00
Justin Mayer
8850beb828 Merge pull request #2060 from avaris/fix_markdown_lexer
Pin Sphinx version to 1.4.9 for docs tests. Fixes #2059
2016-12-10 10:06:28 -08:00
Ryan M
90025818ed prevent server from dying when query strings present
split on first ?
2016-12-10 10:05:50 -08:00
Deniz Turgut
976a9efcc2 Fixes 2059: Fix sphinx version to 1.4.9 for docs tests 2016-12-10 12:42:35 -05:00
Deniz Turgut
1c09741280 Add tests to make sure cached content is properly added to generators 2016-12-10 05:18:35 -05:00
Deniz Turgut
fc52234986 Fix generator caching
With generator level caching, cached files weren't added to the
collections. Only new files were processed. This fixes the issue.
2016-12-10 02:05:35 -05:00
Justin Mayer
550ffe4599 Remove spurious whitespace in documentation source 2016-12-03 14:53:26 -08:00
Michael Lissner
4aa60a0905 Add more docs for --write-selected option
Refs #1495
2016-12-03 14:23:45 -08:00
Justin Mayer
f17f3068e3 Merge pull request #2051 from Totktonada/feature/rss_full_content_opt
Add option to include full content into RSS feeds
2016-12-03 12:48:58 -08:00
Justin Mayer
9fc5890886 Merge pull request #1999 from rjames86/jinja_environment
Allow setting Jinja environment arguments from settings
2016-12-03 12:41:50 -08:00
Ryan M
335c40d23e Allow setting Jinja environment arguments from settings
fix flake8 warnings

Set jinja environment defaults within settings

updating docs to remove JINJA_EXTENSIONS

update logger warning and defaults documentation

better way to grab jinja environment

updating settings after refactor
2016-12-03 10:27:27 -08:00
Justin Mayer
7039668669 Merge pull request #2053 from kevin-brotcke/master
Fix missing word typo in settings.rst
2016-12-01 09:45:43 -08:00
Justin Mayer
44704c8396 Merge pull request #2052 from Rogdham/fix-translation_metadata
Fix translation metadata support
2016-12-01 09:44:26 -08:00
Kevin Brotcke
76709c672a Fix missing word typo in settings.rst
Also convert to a note directive.
2016-11-23 14:55:11 -08:00
Rogdham
6cc053b920 Improve logging in translation detection 2016-11-21 23:21:34 +01:00
Rogdham
4645def789 Fix translation metadata support 2016-11-20 20:01:56 +01:00
Alexander Turenko
d3b22c6e21 Add option to include full content into RSS feeds
Include only summary by default.

This follow ups pull [1], where RSS feeds become summary-only.

[1]: https://github.com/getpelican/pelican/pull/1989
2016-11-20 00:06:27 +03:00
Justin Mayer
c413bcdb94 Merge pull request #2038 from omiday/gh2037
Convert documentation tables to 'data::' records. Fixes #2037
2016-11-18 09:30:15 -07:00
Justin Mayer
ca10933082 Merge pull request #1354 from storeyio/1325
Add test_find_empty_alt. Fixes #1325
2016-11-18 09:22:56 -07:00
John
6f9f0def0f Fix #1325 and add test_find_empty_alt 2016-11-17 23:29:19 +00:00
Viorel Tabara
f30f4fe66b Fix #2037. Major overhaul of settings page.
Convert all tables to 'data::' directives.

Replace inline literals with code blocks for better readability.

Per suggestion from Avaris on IRC:
- Section rename: "Path metadata" to "Metadata" and move over AUTHOR and
  all *_METADATA options.
- Merge "Date format and locale" and "Timezone" into a new section "Time
  and Date" and move over TIMEZONE, DEFAULT_DATE, DATE_FORMATS,
  DEFAULT_DATE_FORMAT.
- Move RELATIVE_URL under 'URL settings'. Here, convert URL settings
  example from a 4-bullet inline literal to a single code block for
  better readability in both source and output.
- Move *_TEMPLATE options under "Templates".

Cosmetic and wording updates to accommodate the above changes and
provide a consistent layout.
2016-11-17 13:38:22 -07:00
Justin Mayer
6008f7e2ed Merge pull request #2050 from Scheirle/markdown_options2
Make Markdown extensions order non-arbitrary
2016-11-15 10:45:42 -07:00
Bernhard Scheirle
a445e81ae6 Make markdown extensions order non-arbitrary 2016-11-15 17:05:12 +01:00
Justin Mayer
4fc2c6c633 Merge pull request #2035 from omiday/pep8
Fix PEP8 violations. Fixes #2032
2016-11-14 11:33:07 -07:00
Justin Mayer
a07c0e6e04 Merge pull request #1927 from Scheirle/markdown_options
Replaces MD_EXTENSIONS with MARKDOWN; Fixes #1024
2016-11-02 16:57:25 -06:00
Bernhard Scheirle
27d67f04cb Update unittest to match the new Markdown output format 2016-11-02 21:19:41 +01:00
Bernhard Scheirle
a80a707321 Set the Markdown output format to html5 by default 2016-11-02 21:11:42 +01:00
Bernhard Scheirle
114e64dcf7 doc: updates MARKDOWN 2016-11-02 21:11:42 +01:00
Bernhard Scheirle
9e399e7a05 Updates test cases to use MARKDOWN 2016-11-02 21:11:42 +01:00
Bernhard Scheirle
35dba138e0 Replaces MD_EXTENSIONS with MARKDOWN
MARKDOWN allows to configure the python markdown module

fixes #1024
2016-11-02 21:11:42 +01:00
Justin Mayer
594b9c9633 Merge pull request #2040 from avaris/exception_logging_fixes
Fixes Exception name related bugs
2016-10-29 12:57:46 -06:00
Justin Mayer
bdb0265378 Merge pull request #2023 from iKevinY/fix-1946
Fix extension-matching bug in generators.py
2016-10-29 12:54:18 -06:00
Deniz Turgut
a8be1b562e Fixes Exception name related bugs
Fixes two bugs that was introduced by #1743:

 - First was the unnecessary exception name output when skipping
content files if a required metadata wasn't available.
It was
`ERROR: Skipping ./demo.rst: could not find information about 'NameError: date'`
and now should be
`ERROR: Skipping ./demo.rst: could not find information about 'date'`

 - Second was a more serious issue. Improper string formatting in the logger
resulted in implicit decoding and would break for non-ascii error messages.
2016-10-29 14:10:54 -04:00
Justin Mayer
c361246eaa Merge pull request #1972 from nstinus/localize_quickstart
Localize default lang and timezone in pelican-quickstart
2016-10-29 10:45:57 -06:00
Julien Palard
e07c53a09d FIX: Those keys are looked up lowercased. 2016-10-26 08:34:52 +02:00
Eevee (Lexy Munroe)
eac8fa2abd Use the summary as the feed's description, and put content in content
This adheres more closely to the specs, especially Atom, where the
'description' arg becomes <summary>.

Note that this means full article content will no longer appear in RSS
feeds.
2016-10-22 16:36:09 -06:00
Justin Mayer
de0b6dc6aa Merge pull request #1978 from bnice5000/patch-1
Respect OUTPUT_RETENTION for Fabric "rebuild" task
2016-10-22 15:45:29 -06:00
Justin Mayer
270817c022 Clarify error message when LOCALE cannot be set
Fixes #1906
2016-10-22 15:35:01 -06:00
Justin Mayer
ecc5d0b953 Add link to sample contect in docs. Refs #1741 2016-10-22 15:00:52 -06:00
Viorel Tabara
aa2c84a59c Fixes #2032
When following the steps in the Github contributor wiki flake8 reports
PEP8 violation against setup.py and docs/conf.py.
2016-10-22 14:39:31 -06:00
Kevin Yap
6cadbdf354 Fix extension-matching bug in generators.py
Addresses #1946.
2016-10-12 23:33:29 -07:00
Julien Palard
e8a87e5d3c As not allowing duplicates in processed items is counter intuitive, let's allow it.
Also it may be allowed in the future (to process multiple values).

Also @avaris think it's bad to test something twice (see
https://github.com/getpelican/pelican/pull/2017), but for me confusion
lies in the "Why is list processing forbidden?", so, in a way, our
ideas converges in "let's not disallow processed items to be lists".

This reverts commit 9e574e9d8c.
2016-10-10 12:23:26 +02:00
Julien Palard
13ac28b6d4 Merge remote-tracking branch 'upstream/master' 2016-10-10 12:23:01 +02:00
Justin Mayer
b2231c40f7 Merge pull request #2016 from jerryasher/copy_file_metadata
Python's shutil.copy2 fails on Android
2016-10-07 12:28:10 -06:00
Jerry Asher
f8031203d2 Python's shutil.copy2 fails on Android
Python's shutil.copy2 fails on Android when copying a file's meta data (perm bits, access times) onto certain filesystems. This is documented as python issue28141 https://bugs.python.org/issue28141

These commits workaround that bug by

+ creating a new function copy_file_metadata in utils.py
+ wrapping calls to copy2 in a try/except clause that logs any errors that occur but keep execution going
+ changing the calls to shutil.copy2 to calls to the new function
2016-10-07 11:10:09 -07:00
Justin Mayer
0942fcb9ec Use flake8-import-order packaged release
Packaged releases weren't available previously, which required us to
install the master branch version. Now that releases are being published
to PyPI, we should use those.
2016-10-07 09:03:18 -06:00
Justin Mayer
22861aa1c1 Merge pull request #2015 from jpli/improve_path_metadata_processing
Improve path metadata processing
2016-10-06 11:30:27 -06:00
Justin Mayer
5a332ed726 Merge pull request #1306 from Scheirle/master
Simplify feed ID generation and support URL fragments
2016-10-04 10:49:02 -06:00
Nicolas Stinus
c1a5279da9 Localize default lang and timezone in pelican-quickstart
Fixes #1971.
2016-10-02 13:22:26 -04:00
Julien Palard
9e574e9d8c Just in case someone forgot the DUPLICATES_DEFINITIONS_ALLOWED but add in METADATA_PROCESSORS. 2016-09-30 15:33:05 +02:00
Julien Palard
24a1254f03 Explicitly disallow duplications of URL and save_as. 2016-09-30 15:29:14 +02:00
Justin Mayer
83afc5e214 Merge pull request #1961 from MrSenko/pin_pygments
Pin Pygments version to 2.1.3. Fixes #1916
2016-09-27 10:05:46 -06:00
Justin Mayer
937f366b80 Merge pull request #2004 from Scheirle/unittest_py2
Fixes unit test test_period_in_timeperiod_archive (TestArticlesGenerator)
2016-09-27 09:40:36 -06:00
Bernhard Scheirle
eb435dc065 Update feed test output to match the new feed id 2016-09-25 10:59:44 +02:00
Bernhard Scheirle
1eee6f0211 Simplified feed id generation and added support for url fragments 2016-09-25 10:54:20 +02:00
Bernhard Scheirle
577b748f5f Fixes unit test test_period_in_timeperiod_archive (TestArticlesGenerator)
On systems with a none english default locale this test failed because the
period is a tuple of year and month name and the month name depends on the
locale.
2016-09-25 10:31:56 +02:00
Justin Mayer
98398e0420 Merge pull request #1594 from Totktonada/feature/log-filter-by-templates
LOG_FILTER cannot be used with '%s'ed messages
2016-09-23 14:06:28 -06:00
Alexander Turenko
30b8955134 Don't suppress LOG_FILTER messages when --debug passed 2016-09-23 02:13:23 +03:00
Alexander Turenko
1b1d1fd9f7 Allow to filter out log messages by templates
Fixes #1594.
2016-09-23 02:13:23 +03:00
Justin Mayer
5cc4c9f4ab Merge pull request #1880 from allanman/patch-1
Ensure DEFAULT_DATE = 'fs' actually uses modified time
2016-09-22 16:12:46 -06:00
Justin Mayer
9d4c140c49 Merge pull request #1947 from magul/tuple-fix
Fix issue with one-element tuple
2016-09-22 16:10:12 -06:00
Justin Mayer
ed9e15e3c0 Merge pull request #1881 from kdeldycke/upgrade-ga-tracking-code
Upgrade legacy GA tracking code
2016-09-21 10:20:22 -06:00
Kevin Deldycke
e8a964fd57
Upgrade legacy GA tracking code. 2016-09-21 18:05:04 +02:00
Li Jiapeng
0f6b98506e Revert to the old category processing order
If no category is specified in PATH_METADATA or FILENAME_METADATA,
fall back to USE_FOLDER_AS_CATEGORY, which defaults to True.
2016-09-19 18:29:58 +08:00
Li Jiapeng
9185e0b7a8 Avoid circumvention of metadata name checking
See https://github.com/getpelican/pelican/issues/2011
2016-09-19 18:28:43 +08:00
Justin Mayer
f0c05686e5 Merge pull request #2005 from avaris/1966
Fixes #1966: Track default settings file for changes in autoreload mode
2016-09-17 09:25:07 -06:00
Justin Mayer
994758aa07 Merge pull request #2007 from avaris/update_contributing_guidelines
Add warnings override for unittest in the docs
2016-09-16 20:25:47 -06:00
Justin Mayer
d5fbd3be93 Merge pull request #1991 from wjt/empty-md-file
Handle empty Markdown files more gracefully.
2016-09-16 20:22:43 -06:00
Deniz Turgut
77d8160dab Add warnings override for unittest in the docs
Unittest supresses warning filters unless `-Wd` flag is supplied and
this will result in test failures in python 3.5+.
2016-09-16 15:22:46 -04:00
Deniz Turgut
9d1a1d428b Fixes #1966: Track default settings file for changes in autoreload mode 2016-09-16 10:56:20 -04:00
Justin Mayer
09fb6a1393 Merge pull request #1958 from MrSenko/pip_requirements
Separate pip requirements. Fixes #1808
2016-09-16 08:15:06 -06:00
Justin Mayer
6aa05ace19 Update functional test output for FeedGenerator 1.9
Refs https://github.com/getpelican/feedgenerator/pull/7
2016-09-15 11:58:43 -06:00
Justin Mayer
5cdd2645fd Pelican now requires FeedGenerator 1.9+ 2016-09-15 11:57:30 -06:00
Justin Mayer
ac08cd5eb1 Docs: Custom 404 pages are pages -- not articles 2016-09-15 06:55:25 -06:00
Justin Mayer
d6ac93a470 Merge pull request #1967 from NathanHarrington/config_reload
Add default settings file name to argparse. Fixes #1966
2016-09-11 09:14:46 -06:00
Justin Mayer
d83a261290 Merge pull request #1993 from stevepiercy/patch-1
Compare Pelican hl_lines to Sphinx emphasize-lines
2016-08-16 18:03:08 -06:00
Will Thompson
85a860d5dd test_readers: test reading empty Markdown files 2016-08-16 07:13:41 +01:00
Will Thompson
129b144852 test_cache: fix comment listing uncached files
This file was added in d333ed1; the number '3' in code was incremented
to '4' but the comment wasn't updated.
2016-08-16 07:13:41 +01:00
Steve Piercy
36f93af275 Compare Pelican hl_lines to Sphinx emphasize-lines
See #1510
2016-08-14 11:52:21 -07:00
Will Thompson
904f57d9c3 MarkdownReader: don't raise AttributeError on empty files
Markdown.convert() returns early, without running any preprocessors, if
source.strip() is empty.

Before, Pelican would raise AttributeError in this case; now, it logs a
more friendly error:

ERROR: Skipping ./foo.md: could not find information about 'NameError: title'

which is more consistent with the error from empty .rst files:

ERROR: Skipping ./foo.rst: could not find information about 'NameError: date'
2016-08-11 07:51:39 +01:00
Will Thompson
5d860471ac pelican_open: don't raise IndexError on empty files
If the file is empty, content[0] raises IndexError.
2016-08-11 07:46:53 +01:00
Justin Mayer
6232241ef1 Merge pull request #1964 from rr-/patch-1
Fix typogrifying objects without title
2016-07-18 09:14:30 -06:00
bnice5000
c11b8ceb09 Update rebuild to respect OUTPUT_RETENTION
Fixes #1955
2016-06-14 08:42:48 -04:00
Nathan Harrington
76dcd64a82 Fixes #1966 2016-05-30 09:09:53 -04:00
Marcin Kurczewski
12c72d3e19 Fix typogrifying objects without title
This fixes my use case where I use `readers.read_file` from within plugin to load something that is neither a page nor an article.
2016-05-29 10:53:56 +02:00
Mr. Senko
090694dba7 Pin Pygments version to 2.1.3. Fixes #1916 2016-05-26 17:32:21 +03:00
Justin Mayer
d9605d005d Merge pull request #1959 from MrSenko/default-date
Accept string dates in DEFAULT_DATE. Fixes #1464; fixes #1476
2016-05-24 17:21:32 +02:00
Robert Utter
3f2d89c9d6 Makes DEFAULT_DATE accept string dates; fixes #1464 2016-05-24 17:22:27 +03:00
Mr. Senko
ed92d959b2 Separate pip requirements. Fixes #1808 2016-05-24 16:42:46 +03:00
Justin Mayer
2ceeb88c63 Merge pull request #1945 from chriskrycho/fix-1291-feed-titles
Disambiguate feed titles on sites with multiple categories. Fixes #1291
2016-05-24 12:51:44 +02:00
Tomasz Magulski
3d2eb1d45e fixing issue with one-element tuple 2016-05-04 20:28:03 +02:00
Justin Mayer
515f2fb5b2 Merge pull request #1926 from MrSenko/tag_slugs
More granular control of tags and categories slugs. Fixes #1873
2016-05-02 09:12:07 -07:00
davidlesieur
e48365c329 Fix titles in feed tests. 2016-04-17 11:07:28 -04:00
davidlesieur
3b6d059eac Fix #1291: Feeds have ambiguous titles on sites with multiple categories. 2016-04-17 10:42:52 -04:00
Justin Mayer
9cff2efb62 Merge pull request #1942 from muellermartin/fix-contribution-doc
Fix description of the search bar's positon
2016-04-13 13:18:39 -07:00
Martin Müller
de2a5286eb Fix description of the search bar's positon
The search bar in the currently used Read the Docs Sphinx Theme is
located at the top-left instead of top-right.
2016-04-12 22:48:04 +02:00
Justin Mayer
28e79b7a38 Merge pull request #1939 from torypages/patch-1
Minor typo in docs
2016-04-09 09:31:20 -07:00
Tory Law
d81c53a748 Minor typo in docs 2016-04-09 09:05:17 -04:00
Justin Mayer
afd46e1618 Merge pull request #1937 from karlcow/1933/1
Add updated date to feed using modified. Fix #1933
2016-04-08 09:13:53 -07:00
Karl Dubost
f91ea06cc5 Bump feedgenerator version number to 1.8 #1933 2016-04-07 10:27:46 +09:00
Karl Dubost
66410b9396 Fix typo for updated and failure for None. #1933 2016-04-05 10:25:21 +09:00
Karl Dubost
e0769fe2a3 Add updated date to feed using modified. Fix #1933 2016-04-04 16:53:54 +09:00
Justin Mayer
132fe9a4fa Merge pull request #1923 from Jangsea/use_ghp_import_push_option
Use 'ghp-import -p' to push instead of 'git push origin {branch}'
2016-04-03 18:51:23 -07:00
Mr. Senko
fcd4f9aa0d Add AUTHOR_SUBSTITUTIONS 2016-04-01 23:01:57 +03:00
Mr. Senko
648165b839 More granular control of tags and categories slugs. Fixes #1873
- add TAG_SUBSTITUTIONS AND CATEGORY_SUBSTITURIONS settings
- make slugify keep non-alphanumeric characters if configured
2016-04-01 23:00:08 +03:00
Justin Mayer
70665ea0fa Merge pull request #1917 from ploxiln/fix_install_doc_headings
Fix "Kickstart your site" heading level in docs
2016-03-24 22:08:37 -07:00
Justin Mayer
a3a0b6c1b2 Merge pull request #1931 from iKevinY/coveralls-badge
Remove Coveralls badge from README
2016-03-20 17:15:58 -07:00
Kevin Yap
23c3a7c7f6 Remove Coveralls badge from README
Coveralls integration was removed in #1919.
2016-03-20 16:46:14 -07:00
Justin Mayer
58904af92c Merge pull request #1922 from Jangsea/fix_github_pages_branch
Import env.github_pages_branch in fabfile from quickstart question
2016-03-15 16:17:45 -07:00
Jangsea Park
23ab0f1ae1 Delete 'git push origin' and use 'ghp-import -p', push option 2016-03-03 15:11:58 +09:00
Jangsea Park
3857145754 Import env.github_pages_branch from quickstart question 2016-03-02 20:48:11 +09:00
Justin Mayer
945b8384ed Merge pull request #1915 from dhimmel/patch-1
Change periods (...) to ellipsis (…) in post summaries
2016-02-23 11:31:35 -08:00
Daniel Himmelstein
f864dd832c Change ... (periods) to … (ellipsis) in summary
Also update HTML output by running (after making sure to have the fr_FR.utf8
locale installed):

```sh
LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ -s samples/pelican.conf.py samples/content/
LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ -s samples/pelican.conf_FR.py samples/content/
LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ samples/content/
```
as described at
http://docs.getpelican.com/en/3.6.3/contribute.html#running-the-test-suite
2016-02-22 13:03:47 -08:00
Pierce Lopez
c360aebec3 fix Installing/"Kickstart your site" heading level
"Kickstart your site" should not be a sub-heading of "Upgrading"
2016-02-19 18:26:23 -05:00
Justin Mayer
14694c8357 Make Flake8 happy
Note to self: pre-commit hooks really are helpful
2016-02-19 13:29:41 -08:00
Justin Mayer
123fd0b65a Fix Typogrify test issue caused by Pygments update 2016-02-19 13:21:26 -08:00
Justin Mayer
cff4db6e7c English and French locales must be installed
Clarifies our Contributing docs to ensure these two locales are present,
since they are required when updating functional test output.
2016-02-19 13:00:12 -08:00
Justin Mayer
e4532eb8e0 Update test output for French locale 2016-02-19 12:48:30 -08:00
Justin Mayer
2dcc4ccf80 Update functional test output for Pygments 2.1.1 2016-02-19 12:03:48 -08:00
Justin Mayer
985840178a Merge pull request #1893 from kernc/fix-1891
Don't fail if --fatal not provided
2016-02-19 11:32:19 -08:00
Justin Mayer
034e2e19f3 Note explicit Python 3 support in install docs
Refs #1850
2016-02-19 09:56:17 -08:00
Justin Mayer
f62198aeab Merge pull request #1901 from nckx/master
tests: fix failures with Pygments 2.1
2016-02-08 14:28:43 -08:00
Tobias Geerinckx-Rice
6c5183486f tests: fix failures with Pygments 2.1 2016-02-08 17:48:33 +01:00
Kernc
d7407eabab Don't fail if --fatal not provided
Fixes https://github.com/getpelican/pelican/issues/1891
2016-01-18 13:04:52 +01:00
Justin Mayer
3437592c48 Merge pull request #1862 from kernc/warnings-fatal
Add --fatal=errors|warnings program option
2016-01-08 21:46:12 -08:00
Kernc
ac48dc22c6 Wrap code that can cause a fatal warning in try-except 2016-01-09 02:42:02 +01:00
Kernc
9a04ce660c Add --fatal=errors|warnings program option 2016-01-09 02:42:02 +01:00
Justin Mayer
24b7bca37d Merge pull request #1885 from andreaso/phony-target-stopserver
Add missing Makefile PHONY target stopserver
2016-01-04 19:56:43 -08:00
Andreas Olsson
23a84e9b82 Adding missing Makefile PHONY target stopserver 2016-01-03 11:03:10 +01:00
Justin Mayer
4750137642 Merge pull request #1883 from Natim/add-missing-link
Link date format and locale section of settings docs
2015-12-29 09:35:01 -08:00
Rémy HUBSCHER
eee2aa339d Link the documentation section. 2015-12-29 11:17:47 +01:00
A Björck
749f85e468 Update readers.py
change so that DEFAULT_DATE = 'fs' makes pelican actually uses file mtime as stated in the manual (was ctime)
2015-12-26 19:07:41 +01:00
Justin Mayer
959f96ff53 Merge pull request #1638 from kernc/markdown2.6-deprecations
Avoid Markdown 2.6 deprecations
2015-11-30 09:32:12 -08:00
Kernc
510961bbb9 Avoid Markdown 2.6 deprecations; make MD_EXTENSIONS a dict
* Make MD_EXTENSIONS setting a dict and add tests for this change;
* Short extension names ('extra', 'meta') are deprecated
  https://pythonhosted.org/Markdown/release-2.6.html#shortened-extension-names-deprecated
* Extension config as part of extension name is deprecated
  https://pythonhosted.org/Markdown/release-2.6.html#extension-configuration-as-part-of-extension-name-deprecated
2015-11-30 18:12:28 +01:00
Justin Mayer
a2852da3e7 Merge pull request #1859 from HiPhish/fix-devserver-wrong-dir
Generate output directory before 'CD'ing into it
2015-11-15 14:25:23 -05:00
HiPhish
1fe40db3cb Generate output directory before 'CD'ing into it.
If the output directory does not exist the 'cd' will fail, but the
script will resume, starting the server in the base directory. Therefore
we first make sure the output directory actually exists.
2015-11-14 00:17:09 +01:00
Justin Mayer
2b51c0e499 Merge pull request #1852 from xenithorb/master
Add '--no-mime-magic --no-preserve' to s3_upload
2015-11-09 12:38:21 -05:00
Justin Mayer
365d12cbea Merge pull request #1858 from meisterluk/abbr-to-time-element
Use <time> instead of <abbr>
2015-11-07 21:39:45 -08:00
Lukas Prokop
2170ca4cd5 Use <time> instead of <abbr>.
The pubdate given is in no way an abbreviation. Hence the semantics of
<abbr> do not justify its usage in this context.

<time> was introduced in HTML5. It's datetime attribute can override the
textContent. Anyway it specifies a date+time of a given event.

http://www.w3.org/TR/html5/text-level-semantics.html#the-time-element

Originally the pubdate attribute was meant to annotate that the
publication date of the closest section unit is specified, but this was
dropped and is not part of the official specification.

https://www.w3.org/wiki/HTML/Elements/time
2015-11-05 22:28:46 +01:00
Justin Mayer
d3f306505e Merge pull request #1854 from ingwinlu/summary_replacer
Test if summary is parsed by replacer
2015-11-03 08:09:51 -08:00
Justin Mayer
e067e019f9 Merge pull request #1856 from ingwinlu/logger_warn
Fix DeprecationWarning in _get_summary
2015-11-03 08:08:07 -08:00
derwinlu
9255ab22f9 Fix DeprecationWarning in _get_summary
logging.warn is deprecated, should be replaced with .warning.
2015-11-03 16:56:54 +01:00
Justin Mayer
880ba20a98 Merge pull request #1850 from ingwinlu/deprecation_warnings
Make Pelican Python 3.5 compatible
2015-11-03 07:22:12 -08:00
Ondrej Grover
6bb743cb22 Test if summary is parsed by replacer 2015-11-03 10:23:10 +01:00
Justin Mayer
1bbffad7b9 Merge pull request #1837 from SimonStJG/fix-quote-escaping-in-html-attributes
Fix quote escaping in HTML attributes. Fixes issue #1260.
2015-11-02 13:44:56 -08:00
Michael Goodwin
5e7eb91808 add '--no-mime-magic --no-preserve' to s3_upload 2015-10-29 11:36:41 -04:00
Justin Mayer
ef2c62ab82 Merge pull request #1842 from ingwinlu/md_metadata_formatted
Rename summary references to formatted_fields
2015-10-24 09:30:12 -07:00
Justin Mayer
437bcdbd66 Merge pull request #1844 from ingwinlu/get_summary_sideeffects
Replace get_summary with _get_summary
2015-10-23 10:42:21 -07:00
derwinlu
ab2eec854d Redo ANSI support detection
When using nose to directly run the test suite it 'steals' stdout per
default. This causes the old implementation of ANSI detection to error
as stdout does not have a fileno function anymore.
2015-10-22 09:45:54 +02:00
derwinlu
22ec94ee56 Do not fail tox run if coveralls push fails
When tox environments are run locally, coveralls exits with an error
code as it is not authenticated to push to coveralls. Adding the - in
front allows tox to ignore a fail on this command and not mark the test
case as failed.
2015-10-22 09:45:49 +02:00
derwinlu
c3f2e888a5 Add 3.5 to setup.py tags 2015-10-22 09:45:44 +02:00
derwinlu
bfafb3a492 Add python 3.5 testing environment
Python 3.5 is not yet fully integrated in travis. Include
workaround to enable it for now.
2015-10-22 09:45:21 +02:00
derwinlu
2d84c04add Make ReaderTest py2 and py3 compatible 2015-10-22 09:45:17 +02:00
derwinlu
8b299098c9 Make HTMLParser Python 3.5 ready 2015-10-22 09:45:10 +02:00
derwinlu
e50abb20b3 Add logging for warnings during test suite run
The default configuration for the warnings module changed some time ago
so we lost the ability to detect deprecation warnings and such early.

This commit sets up the test suite to redirect all warnings through our
logging system. Additionally we enable DeprecationWarnings as a default
and throw exceptions on all warnings related to pelican modules.

This enables output of warnings related to dependencies, while letting
tests only fail if the warnings are originating from pelican's source.

Also adding a test to detect if warnings cause an Exception as expected.
2015-10-22 09:45:04 +02:00
derwinlu
2cb2bf05df replace get_summary with _get_summary
When memoizing summary a dummy get_summary function was introduced to
properly work. This has multiple problems:
* The siteurl argument is actually not used in the function, it is only
  used so it properly memoizes.
* It differs from how content is accessed and memoized.

This commit brings summary inline with how content is accessed and
processed. It also removes the old get_summary function with the unused
siteurl argument.

Additionally _get_summary is marked as deprecated and calls .summary
instead while also issueing a warning.
2015-10-19 16:38:07 +02:00
derwinlu
a69f4294bc Add ability to toggle log filter
To test the output of warning functions it can be useful to disable the
log filter, producing the expected output instead of the limited output
that is used during normal operation.
2015-10-19 16:28:47 +02:00
Justin Mayer
e16ca36fe0 Merge pull request #1846 from ingwinlu/add_faq_article_static
Add FAQ about static files parsed as content
2015-10-18 14:36:53 -07:00
derwinlu
65f0f31b7b Add FAQ about static files parsed as content
Since #1509 got merged this pops up again and again (latest #1845). This
PR addresses the issue by adding a FAQ about it that explains why it is
necessary to add `*_EXCLUDES`.
2015-10-17 17:00:16 +02:00
derwinlu
43a872c98a add missing linebreak 2015-10-17 16:48:41 +02:00
Simon StJG
d333ed12c6 Fix quote escaping in read html attributes.
* Wrap HTML attributes in quotes according to their content.  If it contains a double quote use single quotes, otherwise escape with double quotes.
* Add escape_html utility to ensure quote entities are converted identically across Python versions.

Fixes #1260
2015-10-14 21:03:01 +01:00
derwinlu
554cde1a22 rename summary references to formatted_fields
Since FORMATTED_FIELDS was introduced the variables are not specific to
summary and contain other data as well.
2015-10-13 10:26:52 +02:00
Justin Mayer
661ee49eda Merge pull request #1827 from TC01/blogroll_override
Make name of blogroll/social widgets configurable
2015-10-12 08:32:20 +09:00
Ben Rosser
a670a3e040 Made name of blogroll/social widgets configurable.
The BLOGROLL_WIDGET_NAME and SOCIAL_WIDGET_NAME settings are now
respected by notmyidea if they are specified in your config file.
They override the default names of "blogroll" and "links" in the
notmyidea theme.

Used default() in template to simplify template code.

Renaming BLOGROLL setting to LINKS, changed default also.

Updated tests to check 'links' instead of 'blogroll'.

Whoops; links, not link.
2015-10-11 14:14:14 -04:00
Justin Mayer
44ae54fc42 Merge pull request #1793 from koobs/patch-2
Add missing *.markdown files to PyPI sdist
2015-10-11 06:50:00 +09:00
Justin Mayer
72ee73f886 Merge pull request #1828 from andreacorbellini/chr-to-unichr
Use unichr() instead of chr() with Python 2.
2015-09-23 09:00:09 -07:00
Justin Mayer
b152aba6c6 Merge pull request #1813 from andreacorbellini/faster-truncation
When truncating, stop parsing the document immediately after finding the last word
2015-09-23 08:58:55 -07:00
Andrea Corbellini
c255a35800 Use unichr() instead of chr() with Python 2. 2015-09-22 23:25:24 +02:00
Andrea Corbellini
d583efb861 When truncating, stop parsing the document immediately after finding the last word. 2015-09-20 11:19:41 +02:00
Justin Mayer
178902a692 Merge pull request #1823 from onur/add-index-and-author-replacement-indicators
Add index and author replacement indicators
2015-09-19 12:27:32 -07:00
Onur Aslan
a6c258eb7f Add index and author replacement indicators 2015-09-19 13:49:19 +03:00
Justin Mayer
6465a91b65 Merge pull request #1819 from ingwinlu/version_in_debug_log
Add versioning information to debug output
2015-09-13 07:40:30 -07:00
derwinlu
6afa7704b1 Add versioning information to debug output 2015-09-11 22:06:58 +02:00
Justin Mayer
8519ccf18c Merge pull request #1814 from ingwinlu/fix_simple_keywords
Remove article.keywords from simple theme
2015-09-05 08:36:19 -06:00
derwinlu
b0d41f081b remove article.keywords from simple theme
We don't process 'keywords' metadata specially, so it never gets
processed into a list.

This prevents issues like #1733.
2015-09-05 10:53:44 +02:00
Justin Mayer
f16ae07d78 Merge pull request #1797 from TC01/feeds_override
Add optional override_output to write_feed
2015-08-31 20:17:59 -07:00
Justin Mayer
ac151ef867 Merge pull request #1802 from andreacorbellini/better-word-recognition
When truncating, consider hyphens, apostrophes and HTML entities.
2015-08-28 10:18:44 -07:00
Andrea Corbellini
9d0804de7a When truncating, consider hypens, apostrophes and HTML entities. 2015-08-28 13:22:54 +02:00
Justin Mayer
d30ffcf52f Merge pull request #1807 from fernandezcuesta/remove_duplicate_tags
Remove duplicate tags and authors in metadata
2015-08-27 09:16:46 -07:00
Jesús Fernández
7f795ed558 Remove duplicate tags and authors in metadata 2015-08-26 12:07:38 +02:00
Justin Mayer
ad72287b4c Revert dev requirement additions
Tox uses dev_requirements.txt to install things. That wasn't the
original purpose of the dev_requirements.txt file, but for now these
additions will have to remain a documentation issue until this can be
sorted out properly.
2015-08-25 11:25:57 -07:00
Justin Mayer
170a429c52 Add flake8, sphinx, and tox to dev requirements 2015-08-25 10:05:15 -07:00
Justin Mayer
ca389e70e1 Merge pull request #1753 from ingwinlu/flake8
Make Pelican codebase compliant with PEP8
2015-08-24 19:27:25 -07:00
Justin Mayer
39f74280b3 Merge pull request #1803 from jvehent/patch-1
Fix tag count calculation in Dotclear import
2015-08-19 12:50:13 -07:00
Julien Vehent
9d57dcf020 Fix calculation of tag count in dotclear import
Upon import of a dotclear backup, `pelican-import` returned this stacktrace:

```
  File "/usr/bin/pelican-import", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python3.4/site-packages/pelican/tools/pelican_import.py", line 809, in main
    attachments = attachments or None)
  File "/usr/lib/python3.4/site-packages/pelican/tools/pelican_import.py", line 621, in fields2pelican
    kind, in_markup) in fields:
  File "/usr/lib/python3.4/site-packages/pelican/tools/pelican_import.py", line 262, in dc2fields
    if int(tag[:1]) == 1:
ValueError: invalid literal for int() with base 10: 'a'
```
2015-08-19 12:28:14 -04:00
derwinlu
8993c55e6e fulfil pep8 standard 2015-08-17 13:34:32 +02:00
derwinlu
44f9cfaaf1 add flake8 testing environment 2015-08-17 13:33:23 +02:00
Justin Mayer
de6bd537b5 Fix FAQ header underlines 2015-08-16 10:37:43 -07:00
Justin Mayer
bd3bec493e Fix reST error in docs 2015-08-16 10:14:49 -07:00
Justin Mayer
5dc6d2914e Minor tweaks to FAQ docs 2015-08-16 09:57:55 -07:00
Justin Mayer
3580478dc9 Merge pull request #1788 from andreacorbellini/truncate-with-html-parser
Truncate words using a HTML instead of regular expressions
2015-08-15 08:21:28 -07:00
Justin Mayer
e06d0046b1 Prepare version 3.6.4.dev0 for next development cycle 2015-08-14 17:24:29 -07:00
Justin Mayer
f0a6725a74 Merge branch 'v3.6.3'
Conflicts:
	docs/changelog.rst
	pelican/__init__.py
	setup.py
2015-08-14 17:16:38 -07:00
Justin Mayer
ed83ad75a9 Bump version 3.6.3 2015-08-14 16:34:25 -07:00
Kyle Fuller
06190f1518 Merge pull request #1798 from boite/master
Correct render of article description meta
2015-08-11 23:14:48 +01:00
jah
ed34ee1808 Correct render of article description meta
in the simple theme: the template incorrectly assumed that the source
metadata is made available as a list of strings. Fixes #1792.
2015-08-11 20:03:43 +01:00
Your Name
45ff578f69 Added optional override_output to write_feed.
The write_feed function now takes an override_output parameter that
does the same thing as override_output does to write_file. Implemented
for custom generators.
2015-08-10 15:44:13 -04:00
Justin Mayer
a55217ef36 Merge pull request #1795 from ingwinlu/add_warning_to_replacer
Add warning for unknown replacement indicators
2015-08-08 09:12:36 -07:00
winlu
657ffdd75f add warning for unknown replacement indicators
If an unknown replacement indicator {bla} was used, it was ignored
silently. This commit adds a warning when an unmatched indicator occurs
to help identify the issue.

closes #1794
2015-08-08 14:40:51 +02:00
Kubilay Kocak
2ca7aa8c80 Add missing *.markdown files to PyPI sdist
The following file is missing from the PyPI source distribution (sdist) due to *.markdown not being referenced in MANIFEST.in:

pelican/tests/content/article_with_markdown_extension.markdown

This missing file appears to cause a number of errors running the test suite. An alternative to this change would be to rename the file to .md so that the file is covered by the existing *.md entry.
2015-08-07 14:46:12 +10:00
Justin Mayer
ed71ad0d3a Merge pull request #1767 from ingwinlu/rm_PAGES
Remove PAGES; use pages instead
2015-08-02 08:59:08 -07:00
Justin Mayer
7181cc36d5 Prepare version 3.6.3.dev for next development cycle 2015-08-01 13:39:24 -07:00
Justin Mayer
96b23e03bd Bump version 3.6.2 2015-08-01 13:39:10 -07:00
Justin Mayer
5e36a87916 Update changelog 2015-08-01 13:20:04 -07:00
Andrea Corbellini
379f8666c1 Rewrite pelican.utils.truncate_html_words() to use an HTML parser instead of regular expressions. 2015-07-30 21:04:28 +02:00
Justin Mayer
10315944d3 Merge pull request #1768 from jo-tham/patch-1
Add S3 404 custom page to Tips documentation
2015-07-11 10:42:44 -07:00
Justin Mayer
d88f846599 Merge pull request #1778 from ionelmc/manual-package-data
Avoid adding tests in bdists (like wheel bdist)
2015-07-10 11:34:44 -07:00
Ionel Cristian Mărieș
bd5dfa0b3e Avoid adding the tests in bdists (like wheel bdist). Supersedes and closes #1618. 2015-07-10 00:48:41 +03:00
Jotham Apaloo
aa318a1366 Update tips.rst
add 404 page instructions for amazon s3.
2015-07-06 21:52:19 -04:00
Justin Mayer
2332563bda Merge pull request #1776 from guanidene/master
Watch for changes in mtime of symlinked folders and files too
2015-07-04 07:56:43 -07:00
guanidene
ba9b4a1d9b Watch for changes in mtime of symlinked folders and files too 2015-06-30 20:56:21 +05:30
Justin Mayer
2a183281fa Merge pull request #1764 from ingwinlu/urlwrappers_comp
Improve URLWrapper comparison
2015-06-28 13:29:23 -07:00
derwinlu
5389543a39 improve URLWrapper comparison
* speed up via reduced slugify calls (only call when needed)
* fix __repr__ to not contain str, should call repr on name
* add test_urlwrappers and move URLWrappers tests there
  * add new equality test
* cleanup header

additionally:
* Content is now decorated with python_2_unicode_compatible
  instead of treating __str__ differently
* better formatting for test_article_metadata_key_lowercase
  to actually output the conflict instead of a non descriptive
  error
2015-06-27 19:13:50 +02:00
derwinlu
ec5c77b251 remove PAGES; use pages instead
* remove PAGES from context as pages is available
* add section to FAQ to provide guidance
2015-06-27 19:11:55 +02:00
Justin Mayer
3f69a1fb62 Merge pull request #1760 from jml/export-hidden-pages
Export hidden pages in context
2015-06-27 08:58:37 -07:00
Justin Mayer
ff88c4bb34 Document enabling per-block Markdown line numbers
Since users frequently ask how to enable line numbers in
Markdown-formatted code blocks, adding instructions to the docs will
allow us to point users there.

Fixes #1773
2015-06-26 09:44:45 -07:00
Justin Mayer
8eebf19627 Merge pull request #1766 from ingwinlu/keep_docs
Tox: keep docs output
2015-06-23 09:35:45 -07:00
Justin Mayer
4b74896a4d Merge pull request #1770 from ehashman/issue1572
Fixes #1068, #1572: template page navigation bugs
2015-06-22 10:07:10 -07:00
Elana Hashman
21544a404c Update simple theme to fix #1068 2015-06-21 13:35:41 -06:00
Elana Hashman
22bc56ddf1 Fixes #1068, #1572: template page navigation bugs
Updates the template logic for when page navigation is included in the
generated HTML in the notmyidea theme, fixing:

* Issue #1068: useless pagination controls should not be displayed when a
  single page is generated (i.e. "Page 1/1"). New logic prevents the
  generation of these superfluous page navigation controls. Tests updated
  accordingly.

* Issue #1572: when multiple pages are generated and the last page contains
  only one item, the closing </ol> and </section> tags are not generated,
  resulting in page breakage. We need to check if
  articles_page.has_other_pages(); if it does, a list has been generated per
  line 19 or 25 and the tags must be closed.
2015-06-21 13:24:49 -06:00
Jonathan Lange
108b67282a Export hidden pages in context
The `PageGenerator` was building hidden pages, but was not making them
available in the context. This makes it difficult for other plugins to
operate on hidden pages.

This patch updates `PageGenerator` to export the hidden pages it finds
in the context as `hidden_pages`.

It also updates the article generator to export `drafts`.
2015-06-20 11:21:39 +01:00
derwinlu
f588c565e2 keep docs output 2015-06-19 19:30:53 +02:00
Justin Mayer
780ccfe137 Prepare version 3.6.1.dev for next development cycle 2015-06-15 13:46:17 -07:00
Justin Mayer
fba2826b70 Bump version 3.6.0 2015-06-15 13:45:50 -07:00
Justin Mayer
68354eb94e Minor fixes to 3.6 release changelog 2015-06-15 13:07:49 -07:00
Justin Mayer
c7ec93466d Update changelog for imminent 3.6 release 2015-06-15 07:53:52 -07:00
Justin Mayer
d19854f4dc Remove references to easy_install in documentation 2015-06-15 07:08:05 -07:00
Justin Mayer
1461197826 Match space with POSIX sed when bumping via bumpr
`\s` will match a space via GNU sed but not the version of sed that
ships with Mac OS X or BSD.
2015-06-14 10:12:52 -07:00
Justin Mayer
0c9e4764ea Include setup.py when bumping version number 2015-06-14 09:57:57 -07:00
Justin Mayer
3c8a7c9fd7 Merge pull request #1756 from avaris/articles_order_by
Fix #1647: Fix ARTICLE_ORDER_BY and add the ability to reverse order
2015-06-13 12:55:28 -07:00
Deniz Turgut
da8b469ab8 Fix #1647: Fix ARTICLE_ORDER_BY and add the ability to reverse order
ARTICLE_ORDER_BY wasn't doing anything because the ArticlesGenerator
was sorting articles after ARTICLE_ORDER_BY was applied. This fixes
that by adding the ability to reverse metadata order by adding the
option prefix 'reversed-' to metadata and changing the default value
to 'reversed-date'.

Relevant documentation is also updated and moved into a more appropriate
place ('Ordering Content' instead of 'URL settings').
2015-06-12 18:14:54 -04:00
Justin Mayer
33d9157929 Merge pull request #1755 from ingwinlu/cleanup_content_object_init
fix outdated content_object_init refs
2015-06-12 11:31:06 -07:00
derwinlu
e3f5e39e17 fix outdated content_object_init refs
* remove content_object_init section from docs
* improve content_object_init test

The content_object_init signal used to set its class as sender and pass
the instance as additional arg in 6100773. Commit ed907b4 removed this
behaviour to bring it inline with other signals, on the basis that
you can test for the class of the object anyway.
We also had a test in place, checking this behaviour, but it was poorly
implemented, not actually checking if the function ever got called.

closes #1711
2015-06-12 19:23:17 +02:00
Justin Mayer
e17c4377da Merge pull request #1740 from ingwinlu/count_hidden_pages
Improve pluralization, fixing display count of hidden pages
2015-06-11 07:27:41 -07:00
Justin Mayer
1da84349c4 Merge pull request #1693 from zackw/static-honor-ignore-files
Honor 'IGNORE_FILES' in StaticGenerator._copy_paths (#1692).
2015-06-10 11:54:29 -07:00
Justin Mayer
b7e8af5977 Merge pull request #1747 from ingwinlu/fix_cache
Fix caching and disable by default
2015-06-09 08:42:51 -07:00
Justin Mayer
1352d2638a Merge pull request #1743 from avaris/1718
Fix exception logging
2015-06-08 06:50:08 -07:00
derwinlu
db59c16f42 set default for caching to false
ref #1689

* set default settigns in settings.py to False for
  - LOAD_CONTENT_CACHE
  - CACHE_CONTENT
* remove AUTORELOAD_IGNORE_CACHE and add deprecation warning
* update settings.rst to reflect the new default values
* update test_cache to enable caching options
2015-06-08 09:35:00 +02:00
derwinlu
b7e6390f04 fix caching
*  break out cache into cache.py
*  break out cache-tests into test_cache.py
*  fix broken cache tests
   *  replace non existing assert calls with self.assertEqual
   *  fix path for page caching test (was invalid)
   *  cleanup test code
*  restructure generate_context in Article and Path Generator
   * destinguish between valid/invalid files correctly and cache accordingly
*  use cPickle if available for increased performance
2015-06-08 09:34:30 +02:00
Justin Mayer
f7e2d5b817 Merge pull request #1746 from abrahamvarricatt/more_badges
Badges for downloads & version from PyPI
2015-06-07 11:00:20 -07:00
abrahamvarricatt
d082d94f25 Add download+PyPI banners to README 2015-06-07 09:19:46 +05:30
Justin Mayer
a8d41e0c57 Merge pull request #1669 from zackw/semicolon-separated-author-lists
Support semicolon-separated author/tag lists
2015-06-06 09:17:52 -07:00
Justin Mayer
69b8a2d8cc Merge pull request #1726 from StevenMaude/add-settings-details-to-publish-docs
Add publishconf.py, "make publish" details to docs
2015-06-04 15:27:22 -07:00
Zack Weinberg
1aac19caaf Honor 'IGNORE_FILES' in the static generator (issue 1692)
This means, for instance, that editor backups and similar will no
longer be copied out of a theme static directory into the built
website.
2015-06-04 17:58:14 -04:00
Zack Weinberg
c7b9a339eb Apply 'IGNORE_FILES' globs to directories as well (issue 1692)
This adjusts the only piece of code that currently looks at IGNORE_FILES.
A subsequent commit will add a new use, with the same semantics.
2015-06-04 17:57:06 -04:00
Zack Weinberg
0a48371985 Give utils.copy the ability to ignore files (issue 1692)
This requires a significant overhaul because we want to be able to have
IGNORE_FILES apply at every level of a recursively copied directory
(e.g. the theme static directory).  Since I was overhauling it anyway
I changed it to use os.walk, which should be more efficient.
2015-06-04 17:57:06 -04:00
Zack Weinberg
c918380802 Support semicolon-separated author/tag lists.
Idea borrowed from Docutils.  This allows one to write author lists in
lastname,firstname format.  The code change also means that readers with
fancy metadata that can natively represent lists (e.g. Docutils itself,
or MD-Yaml) don't have to merge 'em back together for process_metadata's
sake.
2015-06-04 17:31:20 -04:00
Deniz Turgut
735a4452df Fix exception logging
Adds exception type to the exception logging.
Removes the extra logging for autoreload in debug mode, since `raise`
will make it caught by the global `try/except` below and it'll be
logged there.

This replaces #1723 and also removes extra exception logging caused
in #1718.
2015-06-03 17:07:38 -04:00
Steven Maude
b6f391d8e9 Document make publish
Also clarify the distinction between make html and make publish.
2015-06-03 09:35:13 +01:00
Steven Maude
551909893e Document how to use a publish configuration
Explain how to import settings from pelicanconf.py into publishconf.py.
2015-06-03 09:35:05 +01:00
derwinlu
39fd4936b5 improve result output of a pelican run
*  display count of hidden pages
*  pluralize only if necessary
*  add maybe_pluralize to utils
*  add tests for maybe_pluralize
2015-06-03 08:58:59 +02:00
Justin Mayer
940eb76b7f Load external resources via HTTPS when available
This replaces all `http://` and `//:` links with `https:`. The protocol-
relative URL scheme is now deemed to be an anti-pattern. There are
security advantages to using HTTPS, and there are no significant
performance concerns.

In short, if the asset we need is available via HTTPS, then that asset
should always be loaded via HTTPS.

Fixes #1736
2015-06-02 08:35:12 -07:00
Justin Mayer
389d0cec52 Merge pull request #1453 from arty-name/period-archives-syntax-errors
Fix #1405: No error message for invalid syntax in period_archives.html
2015-05-30 09:29:53 -07:00
Justin Mayer
3a03aef3e2 Merge pull request #1728 from jonathan-s/stop-server
Fix for stopping devserver
2015-05-27 08:13:21 -07:00
Justin Mayer
1f3c6c5dca Merge pull request #1727 from alexwlchan/master
Small spelling corrections
2015-05-25 08:53:45 +02:00
Jonathan Sundqvist
77ebd05fce Actually stopping server
When running `make devserver` and then running `make stopserver` it doesn't stop the server. This patch fixes that.
2015-05-24 16:59:23 +01:00
Alex Chan
641b3ffa71 Fix capitalisation of WordPress 2015-05-24 13:08:30 +01:00
Alex Chan
f8f89a8476 Fix spelling mistakes in docs 2015-05-24 13:08:23 +01:00
Justin Mayer
72a0e626dd Merge pull request #1530 from Sethathi/settings_unit_tests
Unit tests for settings.py
2015-05-21 10:10:37 +02:00
Justin Mayer
8786732044 Merge pull request #1703 from ingwinlu/remove_tag_cloud
Remove tag_cloud from Pelican core
2015-05-13 23:19:24 +02:00
Justin Mayer
42d2c4d26a Merge pull request #1720 from ingwinlu/fix_tox_2
make tox 2 compatible
2015-05-13 23:15:04 +02:00
derwinlu
e10ae8a187 make tox 2 compatible 2015-05-13 21:08:39 +02:00
Justin Mayer
47e468cebe Merge pull request #1690 from ingwinlu/build_docs_travis
Test docs via Travis
2015-05-13 18:37:19 +02:00
Justin Mayer
5946313b2e Merge pull request #1718 from ionelmc/patch-2
Improve internal error reporting. Fixes #1717.
2015-05-12 09:51:40 +02:00
Ionel Cristian Mărieș
ab2dc71d34 Improve internal error reporting. Fixes #1717. 2015-05-12 02:55:45 +03:00
Justin Mayer
aae0f6c484 Merge pull request #1716 from foresto/add-missing-backtick
Add backtick missing from last doc commit
2015-05-10 16:35:49 +02:00
Forest
2f048d3652 Add backtick missing from my last docs commit. 2015-05-09 21:20:07 -07:00
Justin Mayer
8292d35ea8 Merge pull request #1715 from foresto/static-exclude-sources-doc
Clarify STATIC_EXCLUDE_SOURCES documentation
2015-05-09 23:42:09 +02:00
Forest
264d75b9e0 Clarify STATIC_EXCLUDE_SOURCES documentatoin. 2015-05-08 13:39:59 -07:00
Justin Mayer
807b3bced3 Merge pull request #1471 from roidelapluie/master
Add a new signal: page_writer_finalized
2015-05-06 13:13:48 +02:00
Justin Mayer
ac844eacf4 Merge pull request #1705 from 11craft/allow-path
Allow `--path` even when using a virtualenv project
2015-05-01 23:59:27 +02:00
Justin Mayer
3f6315fe26 Merge pull request #1683 from alb-i986/fix-meta-tags
Fix the meta tags added in #1057
2015-04-30 23:51:07 +02:00
Justin Mayer
9a38f61e4d Merge pull request #1700 from avaris/1686
Fixes #1686: posixize paths in context['filenames'] to fix windows issues
2015-04-29 16:06:19 +02:00
Justin Mayer
a571ec4cd9 Merge pull request #1708 from iksteen/fix-draft-intra-site-links
Fix intra-site links to drafts
2015-04-29 16:01:38 +02:00
Justin Mayer
222c6e4c03 Merge pull request #1701 from avaris/urlwrapper_slug_property
Change URLWrapper.slug to a property
2015-04-29 15:58:50 +02:00
Ingmar Steen
df54953032 Fix intra-site links to drafts.
Overwrite an article's source path registration when it is
'upgraded' to a draft.

Fixes #865
2015-04-29 15:13:08 +02:00
Justin Mayer
5cf3481483 Merge pull request #1691 from ingwinlu/add_skippable_tests
add skips for tests relying on dev_requirements modules
2015-04-28 07:08:01 +02:00
Matthew Scott
d6ebf772e3 Allow --path even when using a virtualenv project 2015-04-23 13:30:24 -05:00
winlu
3effe464c6 add faq entry about tag-cloud outsourcing 2015-04-20 16:36:18 +02:00
winlu
9dd4080fe6 remove tag_cloud from core 2015-04-20 12:16:05 +02:00
Justin Mayer
d0c15d5a0c Merge pull request #1696 from dmd/patch-1
Clarify phrasing in quickstart documentation
2015-04-18 10:12:46 +02:00
Justin Mayer
44bd308dd2 Merge pull request #1681 from ingwinlu/fix_test_readers
Maintain test_readers
2015-04-17 14:40:31 +02:00
Deniz Turgut
dceea3aabe Change URLWrapper.slug to a property
Main goal is to delay `slugify` call until `slug` is needed. `slugify`
can be expensive depending on the input string (see #1172). Changing it
to a property gives plugins time to place custom `slug`s before `name`
is unnecessarily slugified.

With this change, default behavior is same except the time slugification
happens. But if you set custom slug, `slugify` won't be used at all.

So, this is a partial solution to #1172. The rest, setting a custom slug,
would best be handled by a plugin.
2015-04-16 19:16:23 -04:00
Deniz Turgut
90a283bc44 Fixes #1686: posixize paths in context['filenames'] to fix windows issues 2015-04-16 19:05:15 -04:00
Justin Mayer
f19ea17d0a Merge pull request #1698 from avaris/1695
Fixes #1695: replace `map` with list comprehension for py3 compatibility
2015-04-15 09:07:33 +01:00
Deniz Turgut
2e84e30ad3 Fixes #1695: replace with list comprehension for py3 compatibility 2015-04-14 15:19:16 -04:00
winlu
a45a917766 test docs via travis
* move build environment into tox
* add new environment installing sphinx and testing for doc errors
* reorganize dependency installs for easier management
2015-04-13 18:20:13 +02:00
Daniel M. Drucker
f864418b9e make the quickstart work
The quickstart was worded confusingly - it said "from your project directory", which implied doing a `cd ..` down to the `projects` dir, which would cause `pelican content` to fail. In fact, you need to be in the `yoursite` directory, which is the directory that has the `content` directory in it.
2015-04-13 11:12:52 -04:00
winlu
bf7d113caa add skips for tests relying on dev_requirements modules 2015-04-11 22:45:31 +02:00
Justin Mayer
249a919c59 Merge pull request #1687 from ingwinlu/fix_refs_themes
[DOCS] fix broken refs
2015-04-11 09:28:55 +01:00
winlu
adc5c4b572 fix broken refs 2015-04-10 09:02:12 +02:00
Justin Mayer
d0e2e3e63f Merge pull request #1680 from ingwinlu/fix_internal_metadata_link
[DOCS] fix broken internal metadata link
2015-04-09 10:01:56 +09:00
Alberto Scotto
0f7938ccb7 fix the meta tags added in #1028
The attribute 'contents' should be 'content'.
See http://www.w3schools.com/tags/att_meta_content.asp
2015-04-08 03:32:48 +02:00
winlu
2e590d0e86 maintain test_readers
* move all metadata tests to use a single function call (assertDictHasSubset)
* add tests for assertDictHasSubset
* correct some tests that iterated over metadata instead of expected metadata, resulting in metadata that was expected to be there but was not
* correct resulting broken tests
* add additional tests for EXTRA_PATH_METADATA
* make MdReaderTest fail if Markdown is not available instead of skipping each method individually
2015-04-07 12:06:18 +02:00
winlu
5ca808ed59 fix broken internal metadata link 2015-04-06 09:52:16 +02:00
Justin Mayer
b295163142 Merge pull request #1679 from avaris/fix_fab_serve
Make `pelican.server` importable and use it in `fab serve`
2015-04-05 10:32:05 +09:00
Deniz Turgut
946e95172f Use pelican.server in Quickstart docs 2015-04-04 15:17:59 -04:00
Deniz Turgut
7b4ceb2974 Make pelican.server importable and use it in fab serve
`fab serve` and `make devserver` use different HTTP Handlers and as a
result they behave differently. This makes sure `fab serve` also uses
the Handler defined in `pelican.server` in order to get rid of the
inconsistency.
2015-04-03 18:58:52 -04:00
Justin Mayer
cc8f835f07 Merge pull request #1602 from ltiao/patch-1
Removed `PDF_GENERATOR=False`
2015-04-01 08:05:40 +09:00
Justin Mayer
8a479733f0 Merge pull request #1515 from foresto/serve-mime-type
Guess mime type with python-magic if available. Fixes #1514.
2015-03-27 17:14:16 +09:00
Justin Mayer
9acaa25164 Merge pull request #1491 from foresto/ignore-empty-metadata
Ignore empty metadata. Fixes #1469. Fixes #1398.
2015-03-25 08:38:05 -07:00
Forest
7ad649e3b7 Guess mime type with python-magic if available. Fixes #1514. 2015-03-24 11:38:38 -07:00
Forest
db2e517450 Ignore empty metadata. Fixes #1469. Fixes #1398.
Some metadata values cause problems when empty.  For example, a markdown file
containing a Slug: line with no additional text causing Pelican to produce a
file named ".html" instead of generating a proper file name.  Others, like
those created by a PATH_METADATA regex, must be preserved even if empty,
so things like PAGE_URL="filename{customvalue}.html" will always work.
Essentially, we want to discard empty metadata that we know will be useless
or problematic.  This is better than raising an exception because (a) it
allows users to deliberately keep empty metadata in their source files for
filling in later, and (b) users shouldn't be forced to fix empty metadata
created by blog migration tools (see #1398).

The metadata processors are the ideal place to do this, because they know
the type of data they are handling and whether an empty value is wanted.
Unfortunately, they can't discard items, and neither can process_metadata(),
because their return values are always saved by calling code.  We can't
safely change the calling code, because some of it lives in custom reader
classes out in the field, and we don't want to break those working systems.
Discarding empty values at the time of use isn't good enough, because that
still allows useless empty values in a source file to override configured
defaults.

My solution:
- When processing a list of values, a metadata processor will omit any
  unwanted empty ones from the list it returns.
- When processing an entirely unwanted value, it will return something easily
  identifiable that will pass through the reader code.
- When collecting the processed metadata, read_file() will filter out items
  identified as unwanted.

These metadata are affected by this change:
author, authors, category, slug, status, tags.

I also removed a bit of now-superfluous code from generators.py that was
discarding empty authors at the time of use.
2015-03-24 11:37:07 -07:00
Justin Mayer
ebf5fca520 Merge pull request #1481 from hrbonz/template_context_docs
Add object details to theme docs
2015-03-24 09:57:32 -07:00
Justin Mayer
5bf21abc66 Merge pull request #1664 from syndbg/patch-1
Nitpick Content decorators
2015-03-23 10:31:03 -07:00
Anton Antonov
875c4a5e05 Nitpick Content decorators
A bit more readable this way.
2015-03-22 12:21:58 +02:00
Justin Mayer
aa9ff632ca Merge pull request #1635 from SkyLothar/master
Remove redundant if-condition in index template
2015-03-21 19:13:16 -07:00
Justin Mayer
df70fa8596 Merge pull request #1663 from avaris/fix_relative_urls
Use `--relative-urls` only if it is specified
2015-03-15 09:44:55 -07:00
Deniz Turgut
ef737c2239 Use --relative-urls only if it is specified
Otherwise, `RELATIVE_URLS` in the config file is ignored and
`RELATIVE_URLS` is set to `False` if `--relative-urls` is not
specified.

Fixes an issue introduced in #1592
2015-03-14 13:36:51 -04:00
Justin Mayer
e0d40c17a0 Merge pull request #1662 from iKevinY/unused-imports
Remove a couple of unused imports
2015-03-14 09:19:20 -07:00
Kevin Yap
0f7f328206 Remove a couple of unused imports
As reported by Pyflakes.
2015-03-13 23:01:31 -07:00
Ondrej Grover
3d5f01ba3f Merge pull request #1661 from robertlagrant/master
Change docs wording on cache regeneration on pickle errors.
Fixes #1630
2015-03-13 15:23:07 +01:00
robertlagrant
ffe71d324d Change docs wording on cache regen for #1630 2015-03-13 13:42:56 +02:00
Justin Mayer
822fb134e0 Merge pull request #1653 from avaris/check_urlwrappers
Make sure Content uses URLWrappers
2015-03-11 11:56:32 -07:00
Justin Mayer
ddd637b870 Merge pull request #1658 from iKevinY/travis-formatting
Standardize formatting of .travis.yml
2015-03-10 07:04:31 -07:00
Kevin Yap
4e896c427d Standardize formatting of .travis.yml
Use 2 spaces for indentation.
2015-03-07 01:03:25 -08:00
Deniz Turgut
3ea4542015 Make sure Content uses URLWrappers 2015-03-06 16:06:20 -05:00
Justin Mayer
e35ca1d6ff Minor improvements to README 2015-03-05 12:04:39 -08:00
Kevin Yap
87d86d724c Change phrasing and formatting of README
Made a few changes to the README to emphasize Pelican's position as a
general-purpose static site generator, and not just a blogging tool.

See #1645 for more details.
2015-03-05 11:58:14 -08:00
Justin Mayer
63602c4a9e Merge pull request #1632 from foresto/consistent-blog-var
ArticlesGenerator: Set blog=True consistently. Fixes #1631.
2015-02-27 05:33:58 -08:00
Justin Mayer
62e7a41797 Merge pull request #1642 from iKevinY/remove-pdf-links
Remove PDF-related elements from notmyidea
2015-02-26 17:20:11 -08:00
Kevin Yap
555c553992 Remove PDF-related elements from notmyidea
PDF generation was removed from Pelican's core in #1010.
2015-02-25 21:42:25 -08:00
Justin Mayer
d53c166f95 Clarify docs for FORMATTED_FIELDS setting 2015-02-25 09:42:33 -08:00
Justin Mayer
2bcabb5497 Merge pull request #1622 from whiskyechobravo/formatted_fields
Support reStructuredText or Markdown content in metadata fields other than "summary"
2015-02-25 09:35:06 -08:00
Patrick Fournier
d0afaa5fbe Format custom metadata fields listed in the FORMATTED_FIELDS setting.
Adding FORMATTED_FIELDS to the default settings with ['summary'] as the default value.
2015-02-24 16:57:05 -05:00
Justin Mayer
39f5762ae4 Merge pull request #1637 from pkirk/patch-1
Doc fix: rsync -avc, not --avc
2015-02-24 07:45:04 -08:00
pkirk
79aaedc681 rsync -avc, not --avc 2015-02-23 20:13:33 +01:00
SkyLothar
bc3a0e8c59 remove useless if condition in index template 2015-02-22 16:27:18 +08:00
Forest
784d07e940 ArticlesGenerator: set blog=True consistently.
Fixes #1631.
2015-02-19 12:25:48 -08:00
Justin Mayer
d4ba7b7291 Correct Dotclear sample file link in importer docs
Fixes #1570
2015-02-18 09:41:27 -08:00
Justin Mayer
88ec7026ea Merge pull request #1533 from kernc/underscore_dates
Replace underscores in dates with spaces before parsing
2015-02-18 09:14:37 -08:00
Justin Mayer
053d198f22 Merge pull request #1521 from iKevinY/update-tests
Added tests for generators, settings, and pelican_import
2015-02-17 18:59:04 -08:00
Kevin Yap
6549f51591 Add tests for Pelican and pelican_import tool
Added tests to ensure that:
- THEME and deprecated *_DIR settings result in the expected configurations
- Post headers are formatted correctly in both Markdown and reStructuredText
- Files specified in IGNORE_FILES setting are properly ignored
- Generator.get_files()'s `paths` argument is backwards-compatible with strings
2015-02-17 18:26:41 -08:00
Kevin Yap
95860c6b1b Remove unused modules/variables from tests 2015-02-17 18:25:44 -08:00
Justin Mayer
838478d65d Merge pull request #1629 from avaris/fix_windows_tests
Fix tests that were skipped in #1581
2015-02-17 18:03:57 -08:00
Deniz Turgut
fa269d7c6f Fix tests that were skipped in #1581 2015-02-17 20:50:27 -05:00
Justin Mayer
bfbb7d4bb5 Merge pull request #1581 from georgevreilly/win-fixes
Fix Pelican rendering and unit tests on Windows.
2015-02-17 17:06:19 -08:00
Justin Mayer
6a69a2c943 Merge pull request #1608 from abackstrom/patch-1
Docs: Note how posts are published when 'draft' is default
2015-02-17 11:21:51 -08:00
Justin Mayer
1301343d1d Merge pull request #1582 from ingwinlu/quickstart_python_python2
DOCS: http server module for python3 is different then python2
2015-02-17 11:11:14 -08:00
Justin Mayer
5912608b04 Merge pull request #1592 from ingwinlu/add_argparse_relative
Add argparse argument for relative URLs
2015-02-17 10:49:57 -08:00
Justin Mayer
ca0477c62f Merge pull request #1593 from iKevinY/clarify-setting-types
Change the documented type of various settings
2015-02-17 10:41:07 -08:00
Justin Mayer
6c4f0d7894 Merge pull request #1621 from iKevinY/pages-status-fix
Make page status check case-insensitive. Fixes #1620
2015-02-16 09:11:11 -08:00
Justin Mayer
c139221dbc Merge pull request #1627 from johnmastro/smartypants-html-entities
Tell smartypants to also process &quot; entities
2015-02-13 07:31:48 -08:00
John Mastro
0949fa62ec Tell smartypants to also process &quot; entities
This is necessary because Docutils has already replaced double quotes
with &quot; HTML entities by the time the typogrify filter is applied.
2015-02-12 16:27:30 -08:00
Justin Mayer
9152e021e2 Merge pull request #1616 from kernc/all_generators_finalized
Add signal: all_generators_finalized (see getpelican/pelican-plugins#314)
2015-02-11 10:48:51 -08:00
Justin Mayer
efc5e6f2ca Merge pull request #1623 from avaris/fix_test_importer
Fix for tests that were broken in #1607
2015-02-10 19:31:58 -08:00
Deniz Turgut
7fc6aab99a Fix for tests that were broken in #1607 2015-02-10 21:08:26 -05:00
Kevin Yap
954c85a593 Make PagesGenerator status check case-insensitive
Fixes #1620.
2015-02-09 17:11:45 -08:00
Justin Mayer
8218923625 Add pandoc package to Travis CI configuration 2015-02-09 08:22:30 -08:00
Justin Mayer
08f73d7d91 Merge pull request #1614 from Carreau/patch-1
Fix quotes in FAQ
2015-02-08 16:50:37 -08:00
Kernc
265f68a879 Add signal: all_generators_finalized (getpelican/pelican-plugins#314)
Some plugins have used `content_object_init` signal and read `summary`
or `content` properties of the content object. This resulted in
internal (`{filename}`) links being unresolved. When used, this signal
should hopefully mitigate that.

See also:
* https://github.com/getpelican/pelican-plugins/issues/314
* https://github.com/getpelican/pelican-plugins/pull/410
2015-02-07 16:13:12 +01:00
Justin Mayer
82c629b9c0 Merge pull request #1607 from arulrajnet/fixes
Import drafts from WordPress XML
2015-02-07 06:55:48 -08:00
Matthias Bussonnier
f56b699d5b Fix quotes in faq 2015-02-06 14:30:02 -08:00
Arul
77231e97c0 wordpress importer support for draft article 2015-02-04 16:57:40 +05:30
Annika Backstrom
4e2e00b450 Docs: Note how posts are published when 'draft' is default 2015-02-01 16:45:26 -05:00
Justin Mayer
2fc442fe2d Merge pull request #1603 from ltiao/patch-2
Remove PDF generation settings
2015-01-27 14:44:12 -08:00
Louis Tiao
ca2a426a83 Removed PDF Generation settings
Since PDF Generation is no longer a core feature, these settings are irrelevant. If the `pdf` plugin from pelican-plugins is used, it disregards the `PDF_GENERATOR` setting anyways.
2015-01-27 18:45:10 +08:00
Louis Tiao
f7a5d06c6d Removed PDF_GENERATOR=False
It might give the impression that the PDF generation is still part of the core.
2015-01-27 18:42:34 +08:00
Justin Mayer
e3139db712 Merge pull request #1597 from avaris/fix_static_watcher
Fix static path watchers
2015-01-26 17:48:45 -08:00
Kyle Fuller
173beecd17 Merge pull request #1478 from areyoutoo/new-twitter-icon
Update notmyidea's embedded Twitter icon
2015-01-26 21:49:32 +00:00
Kyle Fuller
5332ea4142 Merge pull request #1578 from iKevinY/shields-badges
Use Shields.io as source for Travis badge
2015-01-26 21:48:54 +00:00
George V. Reilly
4c25610cd8 Fix Pelican rendering and unit tests on Windows.
* Fix {filename} links on Windows.
  Otherwise '{filename}/foo/bar.jpg' doesn't work
* Clean up relative Posix path handling in contents.
* Use Posix paths in readers
* Environment for Popen must be strs, not unicodes.
* Ignore Git CRLF warnings.
* Replace CRLFs with LFs in inputs on Windows.
* Fix importer tests
* Fix test_contents
* Fix one last backslash in paginated output
* Skip the remaining failing locale tests on Windows.
* Document the use of forward slashes on Windows.
* Add some Fabric and ghp-import notes
2015-01-25 17:42:53 -08:00
Justin Mayer
8d7d379a61 Merge pull request #1444 from pquentin/master
Unify bottom margins of lists and paragraphs
2015-01-25 11:08:08 -08:00
Deniz Turgut
737db1d641 Fix static path watchers
There was an issue with static path watchers, where they were watching wrong paths.
They need to be prefixed with the 'content' path. So, they were not working at all.

It was also possible to overwrite default watchers like 'content', 'settings' and
'theme' by mistake if any of them were present in `STATIC_PATHS`. This is fixed
by adding a prefix to static watchers.

And static watchers were "too static", meaning, they stayed the same even if
`STATIC_PATHS` was changed in the settings during autoreload. Now static watchers
reflect those changes (i.e. new paths are added to watch list, and removed ones
are no longer watched).
2015-01-21 18:20:06 -05:00
Kevin Yap
88ad46fd4d Change documented type of various settings
- DEFUALT_METADATA, tuple -> dictionary
- OUTPUT_RETENTION, tuple -> list
- JINJA_FILTERS, list -> dictionary
- DIRECT_TEMPLATES, tuple -> list
2015-01-17 18:15:24 -08:00
Kevin Yap
8aa9a9329e Clarify that 'fs' date setting is a string 2015-01-17 18:15:20 -08:00
winlu
a62f9ab23c add argparse argument for relative urls 2015-01-17 17:09:32 +01:00
Justin Mayer
3c514266dd Merge pull request #1561 from iKevinY/server-patch
Minor changes to server.py
2015-01-15 10:17:16 -08:00
Kevin Yap
79548c3bf9 Minor changes to server.py
- Log original path name rather than last path name
- Use for-else construct to avoid use of flag variable
- Make log messages consistent
2015-01-14 20:20:36 -08:00
Justin Mayer
6616ed8816 Merge pull request #1589 from shrayasr/happy-new-year
Change date in copyright information
2015-01-11 20:00:59 -08:00
Shrayas
bf7966183a Changing dates in copyright information 2015-01-12 09:14:09 +05:30
Shrayas
38c307eefd Add link to GitHub docs on custom 404 pages 2015-01-11 19:18:34 -08:00
Justin Mayer
cff5f3e774 Add custom 404 page to Tips section of docs 2015-01-11 18:54:15 -08:00
Justin Mayer
3b22dd4f2d Merge pull request #1588 from dhermes/allow-bind-to-local-network
Add ability to listen on 0.0.0.0 (instead of localhost)
2015-01-10 15:59:31 -08:00
Danny Hermes
3d8ceb1c67 Adding ability to listen on addresses other than localhost.
This is helpful for mobile testing of Pelican sites by allowing
broadcasting on the local network. Using port 80 requires
running as root on most machines.
2015-01-10 15:40:54 -08:00
Justin Mayer
b72961f12d Merge pull request #1583 from ingwinlu/fix_doc_errors
Documentation fixes
2015-01-08 09:36:26 -08:00
winlu
49481f60a5 fix headers, this fixes issues with docs/contributing.rst throwing errors because of the different content structure 2015-01-05 12:36:35 +01:00
winlu
30c4d0eaf3 fix whitespace 2015-01-05 12:22:00 +01:00
winlu
5432dc04a6 fix double definition of simple theme link to different targets 2015-01-05 12:07:01 +01:00
winlu
3763f96011 add comment to 'preview your site' section mentioning the http server module for python3 is different then python 2015-01-05 11:50:48 +01:00
Kevin Yap
0360ce1865 Use Shields.io as source for Travis badge
Using Shields.io as the source for both the Travis and Coveralls badges
keeps styling consistent between the two.
2015-01-02 01:11:51 -08:00
Ondrej Grover
a740f8aa88 Merge pull request #1577 from ehashman/issue1513
Fix for #1513 ({tag}, {category} link on pages) with some new tests
2015-01-02 09:41:57 +01:00
Elana Hashman
49668f711a Generate {tag}-style links on pages correctly. Fixes #1513 2015-01-02 01:20:57 -07:00
Justin Mayer
5a8efcd526 Merge pull request #1567 from webglider/quickstart-timezone
Add timezone prompt to quickstart
2014-12-28 15:10:52 -08:00
Midhul Varma
bbbb3247ea Add timezone prompt to quickstart. Refs 1337. 2014-12-29 04:26:51 +05:30
Justin Mayer
7e961061e1 Merge pull request #1525 from tonyseek/fixup-timezone-comparison
Fix a datetime comparison error related to time zones
2014-12-11 08:19:33 -08:00
Justin Mayer
7b852ffe9d Merge pull request #1507 from dairiki/bug.rst-newlines-in-abbr
Fix for #949 bug with custom reST :abbr: role
2014-12-06 08:35:43 -08:00
Justin Mayer
2c8300e76f Merge pull request #1537 from omasanori/themes-doc
Add missing feed variables to theme docs
2014-12-06 08:28:28 -08:00
Justin Mayer
3e058dd69c Merge pull request #1539 from rndmh3ro/patch-1
Added documentation for default draft-status of articles
2014-12-06 08:26:50 -08:00
Justin Mayer
f46d86d632 Merge pull request #1550 from georgevreilly/fabfile-cleanup
Fabfile improvements
2014-12-06 08:25:19 -08:00
George V. Reilly
8cc2f99ec4 Fabfile improvements
- Remove gratuitous Unixisms so that fabfile will work on Windows
- Docstrings for tasks so `fab --list` is more useful.
- Add `gh_pages` task for publishing to GitHub Pages
  using [ghp-import](https://github.com/davisp/ghp-import)
2014-12-04 19:26:59 -08:00
Justin Mayer
4add2d344b Merge pull request #1546 from lathan/doc-syntax-fix
Fix table formating in importer.rst docs
2014-11-25 07:56:42 -08:00
George Angelopoulos
5006dc95d2 docs: fix table formating in importer.rst 2014-11-25 17:38:37 +02:00
Sebastian Gumprich
b3b2e84533 Added documentation for default draft-status of articles 2014-11-18 13:37:27 +00:00
OGINO Masanori
33994f0024 Add missing names in a list of the feed variables.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-11-18 19:48:35 +09:00
Kernc
88d19d47b5 Replace underscores in dates with spaces before parsing 2014-11-17 06:54:22 +01:00
Sethathi Morokole
90edf14beb unit tests for settings.py 2014-11-11 15:26:13 +02:00
Jiangge Zhang
4654a4efe4 fix up the datetime comparison error caused by timezone.
"can't compare offset-naive and offset-aware datetimes".
2014-11-10 11:40:26 +08:00
Justin Mayer
30b8a2069e Merge branch 'master' of github.com:getpelican/pelican 2014-11-04 19:55:21 -08:00
Justin Mayer
febd28a74e Increment version to 3.5 2014-11-04 19:43:14 -08:00
Justin Mayer
3068075963 Update changelog 2014-11-04 19:35:12 -08:00
Kyle Fuller
e302642d06 Merge pull request #1437 from mlissner/patch-1
Updates docs for Python 3
2014-11-04 23:05:48 +00:00
Justin Mayer
7b84e50584 Merge pull request #1516 from foresto/static-attach
Let documents {attach} static files. Fixes #1019.
2014-11-04 14:42:27 -08:00
Forest
d503ea436c Let documents {attach} static files. Fixes #1019.
Until now, making static files end up in the same output directory as an
article that links to them has been difficult, especially when the article's
output path is generated based on metadata. This changeset introduces the
{attach} link syntax, which works like the {filename} syntax, but also
overrides the static file's output path with the directory of the
linking document.

It also clarifies and expands the documentation on linking to internal content.
2014-11-04 12:45:16 -08:00
Ondrej Grover
369b8b8474 note that {ARTICLE,PAGE}_PATHS may include files, add faq about using that 2014-11-04 17:00:01 +01:00
Ondrej Grover
d356b44631 advertise the i18n_subsites plugin as an addition to simple translations 2014-11-04 16:49:03 +01:00
Justin Mayer
f706f98ce7 Merge pull request #1399 from Scheirle/fix_feed_localized_url
Enables custom locale while feed generation.
2014-11-04 07:29:42 -08:00
Justin Mayer
b3abeb723e Merge pull request #1499 from matrixise/fix_logger
Fix the parameters for a logging.warning call
2014-11-03 16:03:30 -08:00
Ondrej Grover
f87e4faa22 add notices about caching interfering with changes to settings and plugins 2014-11-03 21:54:08 +01:00
Ondrej Grover
08044f2436 Mention the INDEX_SAVE_AS setting in FAQ and direct templates
This setting can be particularly useful when making a static homepage.
2014-11-03 20:43:33 +01:00
gw0 [http://gw.tnode.com/]
85f9608ccb Minor documentation improvements 2014-11-02 15:09:25 -08:00
Justin Mayer
d5d821fd87 Merge pull request #1457 from svenkreiss/master
Add <ul> to authors.html template so HTML is valid
2014-11-02 14:55:04 -08:00
Justin Mayer
618d94c897 Merge pull request #1518 from iKevinY/merge-analytics
Merge piwik.html into analytics.html
2014-11-02 14:52:40 -08:00
Kevin Yap
da41f7681b Merge piwik.html into analytics.html
Addresses #1512.
2014-11-02 14:43:32 -08:00
Tom Most
e65d33b89c Warn that signal receivers are weakly-referenced
For the signal get_generators in particular, it may seem natural to use
a lambda or inner function as the signal receiver, but this does not
work as the receiver is collected before it can be called.
2014-11-02 14:39:08 -08:00
Justin Mayer
afe009e6c9 Merge pull request #1361 from ingwinlu/rewritten_summary_2
Re-work summary attribute to be memoizable
2014-11-02 14:32:41 -08:00
Justin Mayer
7d3c765927 Merge pull request #1358 from ingwinlu/md_exten_add
Improve docs regarding Python-Markdown extensions
2014-11-02 14:29:54 -08:00
Justin Mayer
45417832e1 Document Markdown inclusion in Quickstart install 2014-11-02 13:49:31 -08:00
winlu
636f83ab67 add paragraph mentioning markdown extensions to docs 2014-11-02 22:40:44 +01:00
Justin Mayer
de8b437549 Merge pull request #1466 from cgar/spelling
Minor spelling fixes
2014-11-02 12:20:30 -08:00
Justin Mayer
b4ae60b3d0 Merge pull request #1501 from foresto/subdir-excludes
Make PAGE_EXCLUDES and ARTICLE_EXCLUDES work with subdirs. Fixes #1500.
2014-11-02 12:09:24 -08:00
winlu
72f3b4a116 rework summary attribute
*   write summary property in modern style
*   introduce get_summary which is memoizable, based on localsiteurl
*   introduce get_siteurl
2014-11-02 20:02:58 +01:00
Forest
0fe290c321 Make PAGE_EXCLUDES work with subdirs. Fixes #1500.
The old code was naively comparing the strings in PAGE_EXCLUDES to the
subdirectory names produced by os.walk(). (Same with ARTICLE_EXCLUDES.)
This had two surprising effects:

Setting PAGE_EXCLUDES=['foo'] would exclude all directories named foo,
regardless of whether they were in the top-level content directory or
nested deep within a directory whose contents should not be excluded.

Setting PAGE_EXCLUDES=['subdir/foo'] would never exclude any directories.

In other words, there is no way to exclude a subdirectory without risking
the accidental exclusion of other directories with the same name elsewhere
in the file system.

This change fixes the problem, so 'subdir/foo' and 'foo' will be distinct
and both work as expected. If anyone out there is depending on the old
behavior, they will have to update their settings. I don't expect it to
affect most users yet, since Pelican doesn't yet make nested directory
structures very useful. When it does, this fix will become important to
more people.
2014-11-01 17:38:20 -07:00
Justin Mayer
a81fcd3fef Merge pull request #1509 from foresto/static-files-anywhere
Make StaticGenerator skip content sources. Refs #1019.
2014-11-01 14:34:33 -07:00
Forest
48f4f0850d Make StaticGenerator skip content sources. Refs #1019.
This change partially addresses issue #1019, by teaching Pelican to distinguish
between static files and content source files. A user can now safely add the
same directory to both STATIC_PATHS and PAGE_PATHS (or ARTICLE_PATHS). Pelican
will then process the content source files in that directory normally, and
treat the remaining files as static, without copying the raw content source
files to the output directory. (The OUTPUT_SOURCES setting still works.)

In other words, images and markdown/reST files can now safely live together.

To keep those files together in the generated site, STATIC_SAVE_AS and
PAGE_SAVE_AS (or ARTICLE_SAVE_AS) should point to the same output directory.

There are two new configuration settings:

STATIC_EXCLUDES=[]  # This works just like PAGE_EXCLUDES and ARTICLE_EXCLUDES.
STATIC_EXCLUDE_SOURCES=True  # Set this to False to get the old behavior.

Two small but noteworthy internal changes:

StaticGenerator now runs after all the other generators. This allows it to see
which files are meant to be processed by other generators, and avoid them.

Generators now include files that they fail to process (e.g. those with missing
mandatory metadata) along with all the other paths in context['filenames'].
This allows such files to be excluded from StaticGenerator's file list, so they
won't end up accidentally published. Since these files have no Content object,
their value in context['filenames'] is None. The code that uses that dict has
been updated accordingly.
2014-10-31 16:46:01 -07:00
Justin Mayer
f9bd4acb10 Merge pull request #1511 from olivierverdier/makefile_tab
Fix missing tab in Makefile template
2014-10-22 16:00:39 -07:00
Olivier Verdier
5b389d6f36 fix missing tab in Makefile template 2014-10-20 15:22:11 +02:00
Jeff Dairiki
10c0002af1 Fix bug with custom reST :abbr: role. Fixes #949
This fixes things so that newlines are allowed within the explanation of
an :abbr: role in reST mark-up.
2014-10-16 07:09:20 -07:00
Jeff Dairiki
99e734cb71 Add tests for abbr_role. Refs #949 2014-10-16 07:09:01 -07:00
Stéphane Wirtel
17fd176461 fix the parameters for a logging.warning call 2014-10-12 12:37:04 +01:00
Justin Mayer
17c551c793 Merge pull request #1484 from ingwinlu/complete_rss_feed_removal
add missing author feeds to pelicanconf template
2014-10-10 11:15:33 -07:00
Kyle Fuller
7feb638b5c Merge pull request #1487 from foresto/spelling
Spelling correction in docs: usefull -> useful.
2014-10-04 19:27:38 +01:00
Forest
96eaf9cea0 Spelling correction in docs: usefull -> useful. 2014-10-01 02:05:49 -07:00
tylerhartley
693ad3296c EXTRA_PATH_METADATA path separator is OS-specific
Updating docs for EXTRA_PATH_METADATA to clarify that OS-specific path
separators must be used as keys, unlike some other Pelican variables.
Refs # 1133.
2014-09-30 10:40:26 -07:00
winlu
9b4b123a0e add missing author feeds to pelicanconf template 2014-09-29 23:38:39 +02:00
Stefan 'hr' Berder
5e2e88ca92 add objects details to theme docs 2014-09-28 00:33:29 +08:00
Robert Utter
055fdfa9c6 Update tests to match new Twitter icon 2014-09-24 17:01:05 -07:00
Robert Utter
4310296648 Update notmyidea's embedded Twitter icon
Twitter's logo has been a bird since 2010. The old T-icon is outdated.
2014-09-24 16:19:24 -07:00
Justin Mayer
c7b52bc730 Merge pull request #1473 from ingwinlu/patch-1
Update faq.rst to include missing Author Feeds
2014-09-22 08:08:26 -07:00
winlu
e4a2bb5b52 Update faq.rst
since author feeds are enabled per default http://docs.getpelican.com/en/latest/settings.html#id9 as well, these need to be added here as well.
2014-09-22 16:36:34 +02:00
Justin Mayer
08d5221114 Merge pull request #1374 from singingwolfboy/readme-badges
README: Added Coveralls badge, refactor Travis badge
2014-09-19 07:59:34 -07:00
David Baumgold
683d10a480 README: Added Coveralls badge, refactor Travis badge 2014-09-19 10:47:31 -04:00
Julien Pivotto
c92e00f17b Add a new signal: page_writer_finalized 2014-09-19 10:12:42 +02:00
Justin Mayer
9bf22f20bf Merge pull request #1470 from avaris/fix_1348
Fix for broken test in #1348
2014-09-18 19:07:00 -07:00
Deniz Turgut
dec6023fe6 Fix for broken test in #1348 2014-09-18 20:09:12 -04:00
Justin Mayer
426c7428d6 Merge pull request #1426 from barrysteyn/DOCUTILS_SETTINGS
Documents DOCUTILS_SETTINGS and initializes it. Fixes #1425
2014-09-18 16:17:46 -07:00
Justin Mayer
fbc65e0d7b Merge pull request #1366 from Scheirle/paginated_relative_urls_fix2
Fixes wrongly generated relative urls for pagination.
2014-09-18 16:15:21 -07:00
Justin Mayer
1d9981b4f9 Merge pull request #1348 from vjousse/davidmarble-page-order-by
Support ordering pages and articles when iterating in templates.
2014-09-18 16:12:51 -07:00
Carlos E. Garcia
f5775bcba0 minor spelling fixes 2014-09-15 20:29:00 -04:00
Bernhard Scheirle
69d8015ba7 Updates the custom_locale test feed files to match the correct month names 2014-09-06 10:50:14 +02:00
Bernhard Scheirle
5ea3a36a3f Enables custom locale while feed generation.
Fixes wrong language of month names in feed links.

Related to #1198
2014-09-06 10:39:28 +02:00
Sven Kreiss
8cf89bd623 add <ul> to make valid html 2014-09-05 22:34:29 -04:00
Artemy Tregubenko
304b16a9be Fixes #1405: No error message for invalid syntax in period_archives.html 2014-08-31 09:55:45 +02:00
Justin Mayer
cb11bea1f2 Merge pull request #1408 from arty-name/feed-written
Add feed_written signal
2014-08-28 11:19:58 -07:00
Justin Mayer
1fae9534d5 Merge pull request #1446 from avaris/enhanced_strftime
Fixes #1395: extends pelican.utils.strftime with `-` prefix to strip leading zeros
2014-08-28 11:17:28 -07:00
Artemy Tregubenko
0093984861 Add feed_written signal 2014-08-28 20:09:42 +02:00
Justin Mayer
2b130fb4dd Merge pull request #1438 from mlissner/patch-2
Add reference to SLUGIFY_SOURCE
2014-08-23 13:05:20 -07:00
Justin Mayer
b357592248 Merge pull request #1445 from avaris/fix_1420
Fixes #1420: Handle multiple definitions of standard metadata for Markdown
2014-08-22 15:15:38 -07:00
Deniz Turgut
a2bb80b8bd Fixes #1420: Handle multiple definitions of standard metadata for Markdown 2014-08-22 17:53:36 -04:00
Quentin Pradet
6ac06b28b1 Unify bottom margins of lists and paragraphs 2014-08-20 17:07:01 +02:00
Justin Mayer
b8c9d61f20 Merge pull request #1411 from barrysteyn/typogrify-ignore-list
Allow Typogrify to ignore user specified tags. Refs #1407
2014-08-17 07:18:19 -06:00
Mike Lissner
04978e9b75 Adds reference to SLUGIFY_SOURCE
When working on my site, I wanted SLUGIFY_SOURCE, but I came across PATH_METADATA first and enabled that for a while. Better to include the cross-reference where people can find it.
2014-08-16 21:07:30 -07:00
Mike Lissner
b80f2357b9 Updates docs for Python 3
In Python 3, the simpleHTTPServer has moved into the http module, so the command `python -m simpleHTTPServer no longer works. This minor change adds instructions for those of us using Python 3.
2014-08-16 20:20:08 -07:00
Justin Mayer
2ecd85d7b3 Merge pull request #1412 from avaris/refactor_logging
Refactor logging handling
2014-08-13 14:17:09 -07:00
Kyle Fuller
5563b9baf4 Merge pull request #1418 from willingc/fix-doc-typo
Corrected typo to improve readability
2014-08-03 00:53:07 +01:00
Justin Mayer
4261b9f5d0 Merge pull request #1371 from omasanori/tz
Add timezone to datetime objects. Refs #962.
2014-08-02 07:38:08 -07:00
Barry Steyn
b3b65d77e0 Documents DOCUTILS_SETTINGS and initializes it. Fixes #1425 2014-07-31 18:04:35 -07:00
Barry Steyn
a0ecab901f Allows Typogrify to ignore user specified tags. Refs #1407
Typogrify interferes with certain sections of the output that it should not touch (see #1407 for more details).
This feature adds a setting called TYPOGRIFY_IGNORE_LIST which is a list of tag for Typogrify to ignore.

The following was updated:

 1. readers.py - if TYPOGRIFY_IGNORE_TAGS is present, then use it
 2. settings.ps - default TYPOGRIFY_IGNORE_TAGS to []
 3. contents/article_with_code_block.rst - an article with a code block for typogrify to ignore
 4. updated tests
 5. updated documentation
2014-07-28 15:17:12 -07:00
Carol Willing
c995fa87a7 Corrected typo to improve readability 2014-07-27 07:33:05 -07:00
Ondrej Grover
3b54f3e418 Merge pull request #1415 from RR2DO2/patch-1
Debug print removal

the print() was a leftover from caching development.
2014-07-26 09:15:14 +02:00
RR2DO2
df0731f2e8 Debug print removal
The print either is a debug print that needs removing, or needs an additional description. The first is more likely.
2014-07-25 19:24:40 +01:00
Deniz Turgut
ed3209888a Refactor logging handling
Old system was using manual string formatting for log messages.
This caused issues with common operations like exception logging
because often they need to be handled differently for Py2/Py3
compatibility. In order to unify the effort:

 - All logging is changed to `logging.level(msg, arg1, arg2)` style.
 - A `SafeLogger` is implemented to auto-decode exceptions properly
in the args (ref #1403).
 - Custom formatters were overriding useful logging functionality
like traceback outputing (ref #1402). They are refactored to be
more transparent. Traceback information is provided in `--debug`
mode for `read_file` errors in generators.
 - Formatters will now auto-format multiline log messages in order
to make them look related. Similarly, traceback will be formatted in
the same fashion.
 - `pelican.log.LimitFilter` was (ab)using logging message which
would result in awkward syntax for argumented logging style. This
functionality is moved to `extra` keyword argument.
 - Levels for errors that would result skipping a file (`read_file`)
changed from `warning` to `error` in order to make them stand out
among other logs.
 - Small consistency changes to log messages (i.e. changing all
to start with an uppercase letter) and quality-of-life improvements
(some log messages were dumping raw object information).
2014-07-22 12:39:39 -04:00
Justin Mayer
f1a9d50a06 Merge pull request #1323 from DandyDev/access-reader-names
Reader name now accessible for articles and pages
2014-07-18 09:12:00 -07:00
Deniz Turgut
7c3cc8fc0d Fixes #1395: extends pelican.utils.strftime with - prefix to strip leading zeros
Adds the ability to use `-` prefix with C89 format codes to strip any
leading zeros.
2014-07-16 03:40:53 -04:00
Daan Debie
00434d4bb6 Reader name now accessible for articles and pages 2014-07-15 00:29:52 +02:00
Bernhard Scheirle
af0899ae2a Fixes wrongly generated relative urls for pagination.
When `RELATIVE_URLS` is `True` and the `PAGINATION_PATTERNS` adds folder to the path, the relative urls to these pages does not respect these additional folders.

Example:
	Settings:
			RELATIVE_URLS = True
			PAGINATION_PATTERNS = (
					(1, '{base_name}/', '{base_name}/index.html'),
					(2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'),)

	Theme:
			<link href="{{ SITEURL }}/theme/css/style.css" rel="stylesheet">

If you are on page 2 then "{{ SITEURL }}/theme/css/style.css" expands to "./theme/css/style.css" instead of "./../../theme/css/style.css".

Fix:
Simply compute the relative url from the paginated url instead of the not paginated one.
2014-07-12 21:10:42 +02:00
Kyle Fuller
a3c8fca1db Merge pull request #1372 from Railslide/make_github_commit_message
change make github commit message
2014-07-08 12:46:00 +01:00
Justin Mayer
8553ad6a59 Merge pull request #1392 from arty-name/patch-1
Remove extra backtick in settings documentation
2014-07-06 15:03:44 -07:00
Artemy Tregubenko
d35348830a removed extra backtick in settings documentation
``SLUG_SUBSTITUTIONS` = ()`` becomes ``SLUG_SUBSTITUTIONS = ()``
2014-07-06 23:20:19 +02:00
OGINO Masanori
2c50ccb764 Add timezone to datetime objects. Refs #962.
Based on https://github.com/getpelican/pelican/pull/977, but it adds
timezone information before formatting.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-07-04 01:23:57 +09:00
Justin Mayer
8d14872700 Merge pull request #1387 from eliben/fix-devserver-port
Fix "server didn't start" error message in develop_server.sh
2014-07-02 12:22:15 -07:00
Justin Mayer
e7eb3b8ec3 Increment development version to 3.5.dev 2014-07-01 16:03:02 -07:00
Justin Mayer
9b5261512d Revert setup.py changes. Ensure universal wheels.
Attempts at fancy version number handling in setup.py caused more
problems than they were worth, including Travis CI build failures.

The setup.cfg key for universal binary wheel generation apparently
changed at some point, so that was updated as well.
2014-07-01 14:33:04 -07:00
Justin Mayer
d41331bd69 Work around setup.py encoding issue in last commit 2014-07-01 13:48:16 -07:00
Justin Mayer
a47c0e26c0 Bump version 3.4.0 2014-07-01 13:34:47 -07:00
Justin Mayer
7e516cb7b0 setup.py version should inherit from __init.py__ 2014-07-01 13:33:24 -07:00
Justin Mayer
09c07e2950 Fix SLUGIFY_SOURCE docs 2014-07-01 13:08:55 -07:00
Justin Mayer
bea40aab8c Additions to changelog 2014-07-01 12:24:37 -07:00
Justin Mayer
c7052a6404 Build binary wheels when publishing to PyPI 2014-07-01 12:16:45 -07:00
Justin Mayer
9af2169027 Update changelog in preparation for release 2014-07-01 11:55:18 -07:00
Justin Mayer
975140d352 Promote URL settings docs to top-level heading 2014-06-30 18:58:14 -07:00
Justin Mayer
669bdc92e1 Change IRC webchat provider to Kiwi IRC 2014-06-30 18:48:46 -07:00
Justin Mayer
b2ccc62582 Add troubleshooting info to CONTRIBUTING docs 2014-06-30 18:45:54 -07:00
Ondrej Grover
2e1b16826b Enhance feedback and contributing guidelines
Many folks ask for help (via IRC or filing GitHub issues) without
sufficient detail and/or without first determining if the answers to
their questions might be better sourced elsewhere. These
documentation changes encourage users to follow certain guidelines
when reaching out for help.
2014-06-30 18:34:18 -07:00
Eli Bendersky
43523dac4d Fix "server didn't start" error message in develop_server.sh
It has port 8000 hardcoded into it, which is confusing when the server runs on
another port.
2014-06-30 06:40:19 -07:00
Giulia Vergottini
5eaf2aa2bf update make github commit message 2014-06-29 17:24:47 +02:00
Giulia Vergottini
95e170a15f prettify github make commit message 2014-06-29 17:01:54 +02:00
Ondrej Grover
7fabd712a1 Generator.get_files backwards compatibility for 1 path
This should prevent outdated plugins with generators from failing.
Also fixes #1382.
2014-06-27 20:18:17 +02:00
Ondrej Grover
40c9406ca4 Fix test_direct_templates_save_as_false test case
A non-existent asserts_called_count attr was used which would always
succeed, silently hiding the error.
2014-06-27 14:54:18 +02:00
Justin Mayer
8fe05bb599 Merge pull request #1380 from avaris/py34_warnings
Fix for Python 3.4 deprecation warnings while running tests
2014-06-27 05:49:03 -07:00
Justin Mayer
a44a60ddd4 Merge pull request #1381 from avaris/fix_1198
Fix 1198 and 729: Fixes links with custom locale and related OS X test errors
2014-06-26 15:43:19 -07:00
Deniz Turgut
fc505091c2 Patch docutils.io.FileInput to not use "U" mode in py3
"U" mode is redundant in py3 since "newline" argument replaces it and by default
universal newlines is enabled. As of py3.4, "U" mode triggers a deprecation warning.
2014-06-26 01:10:52 -04:00
Deniz Turgut
ce8574aff4 Fix HTMLParser related deprecation warnings in Py3.4 2014-06-26 01:10:52 -04:00
Deniz Turgut
009543b7e4 Fix test errors on OSX
On OSX, if LC_TIME and LC_CTYPE differs the output of strftime is not properly decoded
in Python 3. This makes sure that the 'utils.DateFormatter' and the related Jinja filter
'strftime' set the same value for LC_TIME and LC_CTYPE while formatting.

Also, '%a' is removed from DEFAULT_DATE_FORMAT in 'custom_locale' tests. OSX and *nix have
different conversions for '%a' ('Jeu' vs 'jeu.') and there is not a feasible way to handle
the difference for tests.
2014-06-26 01:01:42 -04:00
Ondrej Grover
3f6b130d6e Fix #1198, enable custom locale in template rendering, fixes links
reverts getpelican/pelican@ddcccfeaa9

If one used a locale that made use of unicode characters (like fr_FR.UTF-8)
the files on disk would be in correct locale while links would be to C.

Uses a SafeDatetime class that works with unicode format strigns
by using custom strftime to prevent ascii decoding errors with Python2.

Also added unicode decoding for the calendar module to fix period
archives.
2014-06-26 00:00:19 -04:00
Justin Mayer
2432a22400 Merge pull request #1322 from smartass101/get_files_multiple_paths
move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS and correlate with {ARTICLE,PAGE}_EXCLUDES
2014-06-25 07:29:22 -07:00
Justin Mayer
dbf6d7cf8f Merge pull request #1376 from avaris/remove_asciidoc
Remove AsciiDocReader from core. Fixes #1355
2014-06-24 16:02:08 -07:00
Kyle Fuller
24106081b5 [coveralls] Exclude tests from coverage 2014-06-24 22:29:36 +01:00
Kyle Fuller
e3d3675493 Merge pull request #1370 from omasanori/six-version
Require six version 1.4.0 or later.
2014-06-23 16:52:07 +01:00
Deniz Turgut
bf9316bb7e Remove AsciiDocReader from core. Fixes #1355 2014-06-14 02:17:43 -04:00
OGINO Masanori
ca3aa1e75f Use six.moves.urllib.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-10 17:30:17 +09:00
OGINO Masanori
def654434c Require six version 1.4.0 or later.
six.moves.urllib.parse is available since version 1.4.0.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-10 08:35:33 +09:00
Ondrej Grover
ef96705677 catch arbitrary exceptions during cache unpickling
It is hard to forsee what could be raised.
2014-06-08 11:32:10 +02:00
Justin Mayer
8673711d84 Merge pull request #1362 from avaris/neighbor_pages_docs
Doc update for *_{previous|next}_page variables
2014-06-07 15:40:09 -07:00
Mark Lee
b572cbeef1 Addressed comments from @avaris in PR getpelican/pelican#1348 2014-05-27 11:42:37 -07:00
Mark Lee
e86f4d6250 Merge branch 'master' of https://github.com/getpelican/pelican into davidmarble-page-order-by 2014-05-27 11:15:34 -07:00
Deniz Turgut
43701cae7c Docs update for *_{previous|next}_page variables 2014-05-27 12:30:42 -04:00
Ondrej Grover
b8db970455 Fix RstReader authors metadata processing
The reader would return a list of authors already, but
METADATA_PROCESSORS['authors'] expects a string.
Added a test case for this (only the HTMLReader had it).
2014-05-25 09:12:35 +02:00
Mark Lee
144cddaf39 Address code review comments from PR getpelican/pelican#1348
The text about the sort-by-key function comes from:
https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange

Minor style cleanup as well.
2014-05-20 13:53:02 -07:00
Ondrej Grover
6aa0e4346d Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES automatically
This makes it easier for someone to change PAGE_PATHS without the
need to change ARTICLE_EXCLUDES accordingly.
2014-05-14 14:30:21 +02:00
Ondrej Grover
21882fd4a0 Fix #1344 move PLUGIN_PATH -> PLUGIN_PATHS
Pelican uses *_PATHS names for settings that represent a list of paths.
2014-05-14 14:19:52 +02:00
Ondrej Grover
d635a347d1 move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS
Instead of one path a list can be given. This is due to popular request.
Should help people not wanting to use Pelican for blogging.
Maintain backward compatibility though.
Thanks to @ingwinlu for pointing out the change in StaticGenerator.
2014-05-14 14:04:50 +02:00
Vincent Jousse
bf6a4ad747 Add missing methods 2014-05-14 11:11:58 +02:00
Vincent Jousse
ebf0da0f7b Merge remote-tracking branch 'remotes/malept/davidmarble-page-order-by' into davidmarble-page-order-by
Conflicts:
	docs/settings.rst
	pelican/generators.py
	pelican/tests/test_generators.py
2014-05-14 10:48:41 +02:00
Justin Mayer
33e9ce1ddf Merge pull request #1345 from justinmayer/docs34
Split "Getting Started" docs into separate sections
2014-05-13 09:01:57 -07:00
Justin Mayer
9d2a129832 If PATH is undefined, Pelican uses PWD as content 2014-05-13 07:18:33 -07:00
Justin Mayer
86e11c619d Split Getting Started docs into separate sections
The "Getting Started" docs became overly long and unwieldy over time.
This splits it into separate sections, including:

* Quickstart
* Installation
* Writing content
* Publish your site
2014-05-12 07:48:37 -07:00
Justin Mayer
7313d327fb Prepare for splitting up Getting Started docs 2014-05-11 18:14:58 -07:00
Ondrej Grover
7cbf750329 Fix typo in command-line option description. 2014-05-10 17:38:58 +02:00
Ondrej Grover
9a753f4fa9 Fix intrasite links substitions in content
The Content.__eq__ method would indirectly call _update_content too
soon, resulting in failed intrasite links substitution
This effectively reverts fd77926700
for pelican/contents.py, it was unnecessary anyways.
Thanks to Strom for finding this.
2014-05-09 18:14:24 +02:00
Ondrej Grover
cd40105c40 Fix #1335 remove old and unmaintained French docs
Unfortunately nobody keeps them up to date, they would just spread
confusion.
2014-05-04 20:26:40 +02:00
Ondrej Grover
5bad061c19 rename CACHE_DIR -> CACHE_PATH to unify with rest of Pelican
CACHE_PATH can now be relative to settings file like OUTPUT_PATH.
Also add --cache-path commandline option.
Change cache loading warning to a less scary and more helpful message.
2014-05-02 18:08:32 +02:00
Justin Mayer
f2549650e6 Remove errant backtick 2014-05-02 07:34:27 -07:00
Ondrej Grover
f00fc944fb Fix get_writer signal received result unpacking 2014-05-01 10:39:07 +02:00
Justin Mayer
fd231b6ce2 Remove errant leading spaces from fabfile.py.in 2014-04-30 13:35:10 -07:00
Justin Mayer
81cd781c45 Show setting defaults as actual code
For some reason, setting names on the Settings page have long been
wrapped in single back-ticks (usually meant for linking in reST) instead
of double back-ticks (meant for denoting code). This seems to be
widespread throughout the docs, and it's not clear if this is
intentional or simply a reST formatting error that got propagated by
others in order to stay consistent. This commit applies double
back-ticks in any case where something resembling code is shown, with
the idea that single back-ticks should only be used when linking.

More importantly, the settings denoted their default values in
parentheses, which hapless users often included when copying and pasting
these values into their config files. As one can imagine, confusion —
not hilarity — ensued. Setting defaults are now shown as they would
actually appear in one's settings file, with an equal sign and without
parentheses.

During this spelunking expedition, many other minor improvements were
concurrently conducted.
2014-04-30 12:35:13 -07:00
Justin Mayer
3d53b4ca17 Add Python 3.4 to Travic CI configuration 2014-04-30 06:44:55 -07:00
Ondrej Grover
b0e388747c Fix #1277 use rsync -c option as all output is rewritten
Because Pelican always rewrites all output, the mtimes always change, so
rsync would always transfer all the files which defeats the purpose of
rsync. The '-c' option (--checksum) compares the checksums rather than
mtimes.
2014-04-28 22:12:14 +02:00
Ondrej Grover
46c865f295 Really fix #1311 by declaring CSS overrides as !important
this is needed because on RTD the common hosted theme stylesheets get added
after the overrides.
2014-04-28 22:08:34 +02:00
Ondrej Grover
00a5a0f0df Fix #1311 wide tables in RTD theme, remove old theme files
This works by adding a CSS overrides file to the Sphinx app stylesheets.
2014-04-28 20:37:49 +02:00
Justin Mayer
b4f6df2fb6 Merge pull request #1330 from smartass101/unify-run-get_-signals
Add get_writer signal and unify with get_generators
2014-04-27 11:25:06 -07:00
Ondrej Grover
5a3daae72f add get_writer signal and unify with get_generators
Fix outdated docs of get_generators to unify.
2014-04-27 14:25:08 +02:00
Justin Mayer
ddc5367231 Merge pull request #1328 from Scheirle/StaticGeneratorSignals
Send the static_generator_{init, finalized} signals
2014-04-26 10:25:13 -07:00
Justin Mayer
4f3a71d14b Merge pull request #1329 from smartass101/fix_caching_subclass_super
use correct CachingGenerator class in super() call
2014-04-25 13:28:14 -07:00
Ondrej Grover
ad6dc3f8ba use correct CachingGenerator class in super() call
This was a leftover from code moving in c1324b0.
Detected by pylint.
2014-04-25 19:44:26 +02:00
Bernhard Scheirle
30e2cac753 send the static_generator_{init, finalized} signals.
Note: The two signals were already present but were never sent.
2014-04-24 15:30:34 +02:00
Justin Mayer
cd35e713e0 Merge pull request #1313 from al-tonio/frenchdate
Test to reproduce problem with Python 3.3+ on Mac OS X only
2014-04-21 11:46:56 -07:00
Justin Mayer
ac7e2c6d71 Merge pull request #1320 from smartass101/cache_raw_content
split content caching into two layers
2014-04-20 08:09:07 -07:00
Ondrej Grover
c1324b0206 split content caching into two layers
This is a reworked and improved version of content caching.
Notable changes:
- by default only raw content and metadata returned by readers are
  cached which should prevent conficts with plugins, the speed benefit
  of content objects caching is not very big with a simple setup
- renamed --full-rebuild to --ignore-cache
- added more elaborate logging to caching code
2014-04-20 14:34:52 +02:00
Justin Mayer
5959346e17 Merge pull request #1310 from eincs/handle-multiline-meta-in-markdown
Handle multi-line meta in markdown content properly
2014-04-18 20:47:10 -07:00
Shauna
e6be02264a Add feeds for each author 2014-04-18 14:29:18 -07:00
Tastalian
260953da02 Make docutils requirement explicit. Fixes #1243.
Previously, the error returned by Python when docutils is not installed
was not explicit, instead saying that HTMLTranslator is not defined
(needed by FeedGenerator and such), forcing the user to go into
readers.py to figure out that this happens because "import docutils"
failed.

This pull request makes the docutils dependency explicit, so that there
is an ImportError if doctutils is not found.
2014-04-18 13:34:58 -07:00
Justin Mayer
f0802e8114 Text tweaks for "PLUGIN_PATH as list" feature 2014-04-18 13:21:06 -07:00
Lonewolf
c386e29d0c Ability to specify PLUGIN_PATH as list
PLUGIN_PATH added to settings table
2014-04-18 12:59:06 -07:00
James Lee
22484983e9 Handle list metadata as list of string in MarkdownReader 2014-04-19 03:45:48 +09:00
Justin Mayer
06080dd873 Merge pull request #1318 from smartass101/fix_cacher_open_func
set _cache_open func even if not loading cache, fixes autoreload
2014-04-18 11:27:22 -07:00
Justin Mayer
8f58c0582c Merge pull request #1314 from smartass101/write-selected-only-PR
Enable writing of selected output paths only. Refs #224.
2014-04-18 11:21:43 -07:00
Ondrej Grover
676981c621 set _cache_open func even if not loading cache, fixes autoreload
The _cache_open attribute of the FileDataCacher class was not set when
settings[load_policy_key] was not True, so saving later failed.
As a precaution, replaced the `if ...: return` style with a plain
if structure to prevent such readability issues and added tests.
2014-04-18 07:15:26 +02:00
Justin Mayer
8b2e28a6ef Merge pull request #1316 from saimn/tox
Add python 3.4 to tox config.
2014-04-17 15:34:05 -07:00
Simon Conseil
6972261261 Add python 3.4 to tox config. 2014-04-17 22:57:26 +02:00
Ondrej Grover
6703950abe enable writing of only selected output paths
- add WRITE_SELECTED setting
- add --write-selected commandline option
2014-04-17 19:36:18 +02:00
Antoine Brenner
fd7cb9e213 Test to reproduce an issue that occurs with python3.3 under macos10 only
This test passes fine under linux
2014-04-15 22:01:20 +02:00
Justin Mayer
34ef5ab098 Merge pull request #1309 from al-tonio/date_format_japanese_fix_python2
Fix for locale related issues while running the tests.
2014-04-15 11:17:31 -04:00
Justin Mayer
dd70f1b24e Fix settings table in docs 2014-04-15 11:13:10 -04:00
Antoine Brenner
7277c95fb5 Make sure locale is what we want before/after the tests
The locale is a global state, and it was not properly reset to
whatever it was before the unitttest possibly changed it.
This is now fixed.

Not restoring the locale led to weird issues: depending on
the order chosen by "python -m unittest discover" to run
the unit tests, some tests would apparently randomly fail
due to the locale not being what was expected.

For example, test_period_in_timeperiod_archive would
call mock('posts/1970/ 1月/index.html',...) instead of
expected mock('posts/1970/Jan/index.html',...) and fail.
2014-04-15 16:45:45 +02:00
Antoine Brenner
e97e9b5ae5 Fix unittest issue related to python2/python3 differences
Under python 2, with non-ascii locales, u"{:%b}".format(date) can raise UnicodeDecodeError
because u"{:%b}".format(date) will call date.__format__(u"%b"), which will return a byte string
and not a unicode string.
eg:
locale.setlocale(locale.LC_ALL, 'ja_JP.utf8')
date.__format__(u"%b") == '12\xe6\x9c\x88' # True

This commit catches UnicodeDecodeError and calls date.__format__() with byte strings instead
of characters, since it to work with character strings
2014-04-15 16:44:15 +02:00
Lonewolf
4cae9ea88f Added new sphinxtheme as requirement for docs Modified docs conf to support the theme update 2014-04-15 10:37:25 -04:00
Federico Ceratto
5b4381c19c Add s3cmd MIME type detection 2014-04-15 10:31:07 -04:00
Ondrej Grover
fd77926700 Cache content to speed up reading. Fixes #224.
Cache read content so that it doesn't have to be read next time if its
source has not been modified.
2014-04-15 08:57:38 -04:00
Justin Mayer
de9ef74479 Merge pull request #1308 from al-tonio/download_attachments_japanese_error_msg_fix
Fix error in download_attachments() triggered by python2 unit test
2014-04-14 17:17:48 -04:00
Antoine Brenner
aabb7f9345 Fix error in download_attachments() triggered by python2 unit test
The download_attachments error is triggered in the unit tests by a japanese
error message (接続を拒否されました) (connexion denied), that
python is not able to serialize the into a byte string.

This error weirdly does not appear every time the unit tests are run.
It might be related to the order in which the tests are run.

This error was found and fixed during the PyconUS 2014 pelican
sprint. It was discovered on a Linux Fedora20 computer running
Python2.7 in virtualenv
2014-04-14 22:39:10 +02:00
Justin Mayer
7e06912bca Minor text changes to log message limitation 2014-04-14 16:18:07 -04:00
Justin Mayer
66a16b560f Merge pull request #1307 from al-tonio/datetestfix
Fix unittest issue related to python2/python3 differences
2014-04-14 15:52:31 -04:00
Justin Mayer
b11b8a93cd Merge pull request #1030 from Rogdham/filter_log
Limit and filter logs
2014-04-14 14:56:35 -04:00
Antoine Brenner
03976b650d Fix unittest issue related to python2/python3 differences
The test_datetime test passed on python3 but not python2 because
datetime.strftime is a byte string in python2, and a unicode string in python3

This patch allows the test to pass in both python2 and python3 (3.3+ only)
2014-04-14 20:43:19 +02:00
Justin Mayer
c6ff88d0fc Minor correction to settings documentation 2014-04-07 14:29:21 -07:00
Justin Mayer
80842cbc0e Fix deprecated logger warning for Python 3
logger.warn() has been deprecated in Python 3 in favor of logger.warning()
2014-04-02 12:38:49 -07:00
Rogdham
d9b0091357 Limit and filter logs
Drop duplicates logs.
Allow for logs to be grouped, enforcing a maximum number of logs per group.
Add the LOG_FILTER setting to ask from the configuration file to ignore some
logs (of level up to warning).
2014-04-01 20:44:09 +02:00
Justin Mayer
cfd18b20fc Merge pull request #1266 from hrbonz/date_timezone
Change date metadata parsing to dateutil.parser
2014-03-31 16:36:23 -07:00
Justin Mayer
7eb30596f6 Merge pull request #1298 from th3aftermath/feature-inhibit-save_as
Change the inhibition value of *_SAVE_AS to ''
2014-03-31 15:53:27 -07:00
Helmut Grohne
3f304a2e92 change the inhibition value of *_SAVE_AS to ''
Previously, the documentation claimed the value of None for this purpose
even though False was used for certain defaults. The values False and
None cause warnings to be emitted from URLWrapper._from_settings though,
so the new way of inhibiting page generation is to set a *_SAVE_AS value
to the empty string.
2014-03-31 19:38:49 +02:00
Justin Mayer
4c581cdcf2 Merge pull request #1294 from th3aftermath/FixSettingsDocs
Fix indentation error in the settings doc
2014-03-30 18:50:46 -07:00
Justin Mayer
8ec958fb35 Merge pull request #1293 from jeanlauliac/typogrify-summary
Apply Typogrify to article summary
2014-03-30 12:08:05 -07:00
Justin Mayer
382c09c187 Fix docs last_stable version and copyright date 2014-03-30 11:59:32 -07:00
Justin Mayer
16b288222d Merge pull request #1268 from bandb42/multiple_authors_fix
Split multiple authors on ',' instead of every character
2014-03-30 11:40:23 -07:00
th3aftermath
01ad449f29 Fix indentation error in the settings doc
This was accidentally caused by me in #1248
As a result the Basic Settings table was not being updated.
2014-03-30 14:35:22 -04:00
Justin Mayer
a8ead21e95 Merge pull request #1224 from leplatrem/patch-1
Exit code should not be successful on reStructuredText errors
2014-03-30 11:03:58 -07:00
Justin Mayer
216d3548af Merge pull request #1191 from th3aftermath/FixIssue1165
Remove spurious .html suffix. Fix bug #1165
2014-03-30 10:40:28 -07:00
Jean Lauliac
91d576eb45 Apply typogrify on article summary as well 2014-03-24 14:59:03 -04:00
th3aftermath
990ddb5a5e Fix Issue #1165 allows extensions to be set by certain settings
PAGINATION_PATTERNS was hard coded so that all files had a ".html" extension. This fixes that and add a test to
ensure that the pagination code is not changing the filename incorrectly.
2014-03-08 20:33:23 -05:00
Justin Mayer
d9bbdf7f07 Merge pull request #1248 from th3aftermath/AddSlugifyAttribute
Add the setting SLUGIFY_SOURCE. Refs: #197
2014-03-08 15:43:06 +01:00
th3aftermath
56b0061393 Add the setting SLUGIFY_ATTRIBUTE 2014-03-04 21:16:23 -05:00
Justin Mayer
011cd50e2e Minor improvements to Settings docs 2014-03-01 18:25:07 +01:00
Justin Mayer
e38be6b2ea Merge pull request #1267 from mlang/escape-for-html
Run tag names through escape filter to avoid invalid HTML
2014-02-28 18:24:52 +01:00
Justin Mayer
d23c68361a Merge pull request #1201 from hrbonz/draft_lang
Add language support for drafts
2014-02-23 15:13:55 +01:00
Stefan hr Berder
652eb3686f add lang support for drafts (#826 & #1107)
Fix #826
Fix #1107
2014-02-23 14:03:09 +01:00
Stefan hr Berder
7f2bc2a23b change date metadata parsing to dateutil.parser 2014-02-23 11:21:44 +01:00
Ben Bridts
05d357e98e Split multiple authors on ',' 2014-02-18 17:56:57 +01:00
Mario Lang
a7ca52dee0 Run tag name through escape filter to avoid invalid HTML
If a tag contains characters like <> or &, we currently generate invalid HTML.
This is easily fixed by sending the tag through the jinja escape filter.

(This bug is not theoretical, I hit it when using C++ template names for tags,
 like "boost::variant<>".)
2014-02-18 15:01:31 +01:00
Justin Mayer
58e817cb0f Merge pull request #859 from cdunklau/new_github_logo
Update GitHub icon for notmyidea theme
2014-02-17 09:40:46 -08:00
Justin Mayer
de3475aa64 Merge pull request #1265 from mlang/valid-html
Fix notmyidea theme's HTML tags
2014-02-15 10:28:27 -08:00
Mario Lang
e500e64ebd Some browsers like Lynx render adjacent links without implicit spaces.
Put an extra space at the end of each link to a tag so that Lynx doesnt render
the tags as a single word.
2014-02-15 13:24:22 +01:00
Mario Lang
cff9d0aa58 Fix stray </ol> and </section> if only one article is displayed.
We already check if loop.length > 1 before outputting <section> and <ol>
tags, but we neglected to do the same check when outputting the corresponding
end tags.

Also, since I had to read the code when I touched it, simplified a conditional:
if (a) if (a and (b or not b and c))
can be simplified to
if (a) if (b or c)

Note the "b or not b", it was just too ugly to not fix.
2014-02-15 13:21:06 +01:00
Mario Lang
459a13bf79 HTML error in notmyidea: <li> not allowed in <section>.
<li> tags need to be inside of <ul> or <ol>.
Thanks to the w3c_validate plugin for finding this.
2014-02-15 13:02:03 +01:00
Justin Mayer
c00d808bf8 Add squashing to CONTRIBUTING docs. Fix URLs. 2014-02-14 14:37:54 -08:00
Rob Kennedy
1b6f081619 Allow socket address reuse; fixed #1264
The socket may remain in the TIME_WAIT state for some time after the
server shuts down, which prevents another instance of the server from
listening on the same port. This change allows the server to reuse the
address even when it's still waiting.
2014-02-14 14:20:38 -08:00
Justin Mayer
826ff4df50 Merge pull request #1247 from paylogic/multiple-authors
Multiple authors implementation for #956
2014-02-13 19:08:34 -08:00
Anatoly Bubenkov
2c25e488c4 multiple authors implemented 2014-02-14 03:21:06 +01:00
Justin Mayer
57155b561a Merge pull request #1262 from utdemir/master
Fix issue #1258
2014-02-13 17:30:00 -08:00
Utku Demir
e55e550198 Fix issue #1258
Correctly handle DEFAULT_DATE = None .
2014-02-13 12:21:29 +02:00
Justin Mayer
00e1b68e74 Revert to newly-revived Typogrify project
Since the Typogrify project will be actively maintained going forward,
there is no need for the fork.
2014-02-12 10:54:56 -08:00
Colin Dunklau
81e44ed2de Use absolute size for github mark 2014-02-09 21:20:02 +01:00
Colin Dunklau
df21315a24 32px Github logo and CSS shinker 2014-02-09 21:17:39 +01:00
Colin Dunklau
4f0431f9e9 Updated tests 2014-02-09 20:23:12 +01:00
Colin Dunklau
70a690650d Updated github mark for notmyidea
The smallest mark GitHub provides in the bundle is 32x32. Since they
explicitly say don't resize the mark, I asked them to provide a 16x16
so we could use it. I received the 16x16 in this commit from GitHub
support.

However, they suggested we use the 32x32 and use CSS rules to adjust
the size:

"...we use the 32px for both and employ css background and background-
size rules to handle retina displays. I recommend that technique,
since retina users will see a mess of pixels for icons that small."

This sounds like reasonable advice. Should we consider migrating the
notmyidea social icons to 32x32, with appropriate CSS to adjust the
sizes?
2014-02-09 20:23:12 +01:00
Justin Mayer
6b0a99932f Revert test-failing change from #1114 2014-02-09 08:45:06 -08:00
Justin Mayer
c60e0d03fb Merge pull request #1114 from brannerchinese/master
xml => lxml for bs4, in pelican-import.wp2fields()
2014-02-08 15:38:06 -08:00
Justin Mayer
e58cab0250 Merge pull request #1178 from robulouski/devserver_fix
Fix issue in devserver introduced in v3.3
2014-02-08 15:36:14 -08:00
Justin Mayer
a9d1fdae3d PY and PELICAN env variable overrides for Make
This allows the user to set PY and/or PELICAN environment variable
overrides, which will be respected by the Makefile and devserver.sh.
If, for example, the default Python on your system were Python 3 and
you wanted to run Make with Python 2, using bash you could run
`PY=python2 make`. Refs #915.
2014-02-08 14:32:58 -08:00
Justin Mayer
9b36437d97 Merge pull request #1246 from fenekku/period-to-archive-context
Add period to period_archives context. Refs #1044.
2014-02-08 12:19:36 -08:00
Justin Mayer
05f392c6bc Merge pull request #1249 from smartass101/split_articles_generate_context
Add article_generator_pretaxonomy signal
2014-02-08 12:13:23 -08:00
Justin Mayer
45e1aa112f Clarify docs re: settings file 2014-02-07 17:05:15 -08:00
Ondrej Grover
22762f2c16 add signal article_generator_pretaxonomy
invoked before categories and tags lists are created
useful when e.g. modifying the list of articles to be generated
so that removed articles are not leaked in categories or tags
2014-02-07 08:34:27 +01:00
Justin Mayer
dcadf33988 Merge pull request #1183 from Rogdham/pelican-fixcopy
Fix `utils.copy` for copying files
2014-02-05 08:19:34 -08:00
Justin Mayer
89de903925 Merge pull request #1200 from tomtung/patch-1
`ctrl+c` correctly terminates&reenables `fab serve`
2014-02-05 08:11:20 -08:00
Justin Mayer
9dd8e3954c Merge pull request #1202 from tomtung/patch-2
Update settings.rst to match tag cloud code
2014-02-05 07:43:51 -08:00
fenekku
f6e27617f8 Add period to period_archives context. Refs #1044.
* Adds period tuple of (year, month, day) matching the time
  period of the current archive. Note that this is done
  to the archive context if period_archives.html doesn't exist.
* Adds tests to verify this.
* Adds documentation in themes.rst about period in period_archives.html.
2014-02-03 20:26:38 -05:00
Justin Mayer
24866b77c7 Merge pull request #1234 from alistairmagee/wp-custom-posts-and-attachment-download
WordPress custom posts and attachment download
2014-02-03 10:08:17 -08:00
Alistair Magee
ea3e160db1 Extra functionality for pelican-import for wordpress imports 2014-02-03 17:36:41 +00:00
Justin Mayer
d91750090b Merge pull request #1244 from alistairmagee/article-writer-signal
add the new signal to the docs
2014-01-26 15:06:12 -08:00
Alistair Magee
45bc018672 add the new signal to the docs 2014-01-25 20:44:15 +00:00
Justin Mayer
f232958daf Merge pull request #1242 from alistairmagee/article-writer-signal
Add signal upon writing pages and feeds
2014-01-24 13:01:00 -08:00
Alistair Magee
752e862b80 Needed a signal for my subcategory plugin 2014-01-24 06:31:26 +00:00
Justin Mayer
23e7ac3659 Merge pull request #1094 from mua/master
Watch static folders in Autoreload mode
2014-01-22 07:54:12 -08:00
M. Utku Altinkaya
cda21c5481 Update __init__.py
Watch static folders using utils.folder_watcher
2014-01-22 01:55:46 +02:00
Justin Mayer
e60b5602ec Merge pull request #1228 from getpelican/testing
Clean up unit testing dependencies
2014-01-21 10:35:39 -08:00
Justin Mayer
960291c2f2 Merge pull request #1227 from alistairmagee/test_absolute_import
Fix test-suite import error
2014-01-19 12:08:16 -08:00
Justin Mayer
7a15045fbc Merge pull request #1232 from hlapp/fix-sitelink
Append slash to href of link to site home
2014-01-13 09:46:56 -08:00
Hilmar Lapp
5eb9fa6d16 Append slash to href of link to site home
This is necessary to make the link to the site home work locally, because then SITEURL may be set to an empty string (in fact the Pelican default configuration sets it to an empty string in pelicanconf.py).
2014-01-13 12:37:15 -05:00
Alistair Magee
dc552bb869 fix test-suite import error 2014-01-10 16:33:02 +00:00
Kyle Fuller
8dfa7c23f3 Use dev_requirements.txt for tox dependencies 2014-01-10 07:34:13 +00:00
Kyle Fuller
d8e50d56da travis: Use dev_requirements.txt for dependencies 2014-01-10 07:33:41 +00:00
Mathieu Leplatre
dbcbc2c119 Fail and exit on restructuredtext syntax error 2014-01-09 15:19:31 +01:00
Justin Mayer
f6d012adf8 Merge pull request #1220 from saimn/misc
Clarify docs about the DIRECT_TEMPLATES _SAVE_AS and _URL settings.
2014-01-05 14:53:11 -08:00
Simon Conseil
6264cf8916 Clarify docs about the DIRECT_TEMPLATES _SAVE_AS and _URL settings. 2014-01-05 23:37:44 +01:00
Simon Conseil
fb4b894b77 More pep8 fixes and refactor the check for old settings. 2014-01-05 23:34:46 +01:00
Simon Conseil
18e6ec9f02 Simplify a bit pagination code. 2014-01-05 23:34:46 +01:00
Simon Conseil
c90a62ea13 pep8 fixes 2014-01-05 23:34:46 +01:00
Justin Mayer
226672da9f Merge pull request #1219 from iurisilvio/categories_url
Set CATEGORIES_URL and CATEGORIES_SAVE_AS
2014-01-05 13:19:44 -08:00
Iuri de Silvio
fb1cfc35bf Change CATEGORIES_URL and CATEGORIES_SAVE_AS docs to
make it consistent with TAGS_URL and TAGS_SAVE_AS.

Add default values to CATEGORIES_URL and CATEGORIES_SAVE_AS.
2014-01-05 18:34:23 -02:00
Justin Mayer
b25001333d Merge pull request #1214 from hrbonz/article_generator_write_article
Add a signal on article writing
2014-01-05 09:03:09 -08:00
Justin Mayer
f73484a4f4 Merge pull request #1215 from justinmayer/typogrify
Use the actively maintained typogrify-web package
2014-01-03 15:02:43 -08:00
Justin Mayer
127f60c3e9 Update Travis config with new Typogrify package 2014-01-03 14:27:19 -08:00
Justin Mayer
505852c04c Use the actively maintained typogrify-web package
The Typogrify library is no longer actively maintained by the
original author. These changes switch Pelican over to a new fork that
will receive more consistent updates going forward.
2014-01-03 08:51:52 -08:00
Stefan hr Berder
f750f38d60 add a signal on article writing 2014-01-03 05:03:25 +01:00
Tom Yubing Dong
d935af3229 Update settings.rst to match tag cloud code
According to the implementation, the value of `tag.1` should be between 1 and `TAG_CLOUD_STEPS`, inclusive.

See:
https://github.com/getpelican/pelican/blob/master/pelican/generators.py#L457
2013-12-27 15:36:34 +08:00
Tom Yubing Dong
786a209d2b ctrl+c now correctly terminates fab serve
Previously `ctrl+c` a `fab serve` wouldn't necessarily terminate the web server. Even if it does, re-using the command `fab serve` might result in the following error:

```
socket.error: [Errno 48] Address already in use
```

This fix manually creates a `TCPServer` with `allow_reuse_address` set to `True`, which solves this issue.

Tested on OS X 10.9.1.
2013-12-26 22:30:54 +08:00
Justin Mayer
0b3dc9db21 Merge pull request #1190 from w-vi/quickstart-fix1182
Fix for issue #1182
2013-12-23 13:03:49 -08:00
wvi
71103ef2c1 Fix #1182# 2013-12-23 21:32:10 +01:00
Justin Mayer
1e203e955a Merge pull request #879 from joeshaw/post-id
Wordpress import error on empty <wp:post_name>
2013-12-18 18:24:16 -08:00
Justin Mayer
6ab890ddb7 Merge pull request #1186 from mhrivnak/patch-1
Fix a typo in documentation
2013-12-15 20:22:42 -08:00
Michael Hrivnak
1976eac1bf Fixing a typo in documentation 2013-12-15 21:13:03 -05:00
Justin Mayer
3715749cc6 Minor wording changes in develop_server.sh 2013-12-11 21:09:02 -08:00
Kyle Fuller
da690dfc37 Python-Markdown quote's URL's, we need to unquote to use on filesystem
Fixes #1143
Closes #1095
Closes #1149
2013-12-09 18:13:43 +00:00
Rogdham
fd7fc2e202 Simplify usage of utils.copy
Remove confusing parameters, clarify usage in __doc__
2013-12-07 21:11:15 +01:00
Rogdham
7da0506f2d Fix utils.copy for copying files, add unit tests
`copy('', 'a/b.ext0', 'c/d.ext1')` is copying `a/b.ext0` into `c/d.ext1/b.ext0`
(creating folder `c/d.ext1` in the process) instead of `c/d.ext1`.
Bug introduced by e03cf3f517.
2013-12-07 20:58:19 +01:00
Justin Mayer
e10fe42928 Merge pull request #1181 from jculpon/ghpages-config
Support publishing to personal GitHub Pages sites in quickstart
2013-12-06 18:18:27 -08:00
Jamie Culpon
c495502c8f Support publishing to personal pages sites in quickstart
Previously pelican-quickstart would assume that the site it created for GitHub
Pages should be published to the gh-pages branch. This is correct for project
pages, but not correct for personal pages. Personal pages, which live in a
user's special username.github.io repository, are instead deployed to the
master branch. This means that if you did pelican-quickstart and tried to
publish your new personal site with make github you'd see nothing (or whatever
old pages site you had floating around in master).

ghp-import already supports publishing to different branches, so publishing
to the correct branch is just a matter of correct configuration and updating
the Makefile to pass the branch along to ghp-import. pelican-quickstart now
asks if the user wants to publish to GitHub Pages, and if so, asks if this
is a personal page and chooses the correct branch appropriately. I preferred
this approach to prompting for an arbitrary branch because I felt that
choosing the branch would feel more intimidating to someone using
pelican-quickstart for the first time.

This essentially ports changes I made to my personal pages site at
jculpon@82cae477a9e8712b90654f6432464369ebcc7ae5
2013-12-06 17:39:51 -08:00
Justin Mayer
257f9ce1ed Merge pull request #1177 from tcg/tcg/pep8-in-conf
Update spacing in pelicanconf.py.in
2013-12-05 20:10:55 -08:00
Justin Mayer
2dede23a3d Merge pull request #1179 from jculpon/draft-casing
Make marking articles as drafts case-insensitive
2013-12-04 10:59:45 -08:00
Jamie Culpon
c9b84abe46 Make marking articles as drafts case-insensitive
Previously if you tried to mark an article as a draft by using a different
casing (for example, draft) you would get a warning when building:
`Unknown status Draft for file foo.md, skipping it.` This uses a
case-insensitive comparison when looking at article status instead. I
believe this behavior is a little easier for new Pelican users.
2013-12-04 09:32:52 -08:00
Joe Shaw
eeae09be5e wordpress importer: fallback onto wp:post_id if wp:post_name is empty 2013-12-04 09:46:44 -05:00
Rob Iwancz
301268f67f Fixes issue in devserver introduced in v3.3
Fixes an intermittent devserver problem with directory urls
containing index.html (i.e. clean urls).  It tries to send the
index.html file twice, resulting in a scrambled web page complete
with HTTP headers in the output, and sometimes Broken Pipe errors.
2013-12-04 22:26:39 +11:00
Kyle Fuller
44ef4d3eaa Contributing document is reStructuredText not Markdown. Fix formatting 2013-12-04 08:10:26 +00:00
Kyle Fuller
4e6a600b97 Link to PEP8 in CONTRIBUTING guide
It won't be obvious to a non-pythonist what this is.
2013-12-04 08:07:26 +00:00
Tommy George
082ce1dd19 Update pelicanconf.py.in
pep8 issues
2013-12-03 09:48:10 -06:00
Justin Mayer
f4e78d7254 Merge pull request #1144 from idning/master
Check IGNORE_FILES on get_files. Closes #1130.
2013-11-27 16:52:03 -08:00
Justin Mayer
a3cb64c320 Merge pull request #642 from kdeldycke/inline-links-import
Remove `--reference-links` parameter from pelican-import
2013-11-26 07:12:54 -08:00
Kevin Deldycke
83e4d35b44 Produce inline links instead of references. 2013-11-26 10:04:15 +01:00
Justin Mayer
8005f675a7 Merge pull request #1168 from mitchtbaum/patch-1
Add ARCHIVES_URL to settings.rst
2013-11-23 12:24:12 -08:00
Mitchell Tannenbaum
add9a0790d Added ARCHIVES_URL to settings.rst 2013-11-22 19:31:09 -05:00
Justin Mayer
4e3779ae1d Merge pull request #1159 from jcramb/patch-1
Add CATEGORIES_URL and CATEGORIES_SAVE_AS to docs
2013-11-21 15:45:47 -08:00
Justin Mayer
f832a63501 Merge pull request #1161 from florianjacob/modified_no_default
The modified attribute no longer has a default value.
2013-11-20 08:56:11 -08:00
Kyle Fuller
1592a45db8 Add 'adoc' as a file extension for asciidoc
This is to match the behaviour that GitHub have
2013-11-19 17:41:33 +00:00
Kyle Fuller
ba0f07cc1f Merge pull request #1147 from woshilapin/master
Add 'asciidoc' to the ASCIIDoc possible extensions
2013-11-19 09:39:36 -08:00
Kyle Fuller
e9a78b8ccb Merge pull request #1163 from salilpa/patch-1
For creating a CNAME, directory name should be extra
2013-11-19 09:35:37 -08:00
Salil Panikkaveettil
97766ba1f4 For creating a CNAME, directory name should be extra
The name of the directory do not match subsequent commands. hence renaming extras to extra. A one character change
2013-11-19 16:49:37 +05:30
Florian Jacob
bd9d1b9539 The modified attribute no longer has a default value.
This allows for templates using {% if article.modified %}
instead of {% if article.modified != article.published %} .
2013-11-17 23:40:11 +01:00
Mark Lee
69ff7dd634 Add test for PAGE_ORDER_BY 2013-11-14 12:37:22 -08:00
David Marble
0c69f4ad84 Support ordering pages and articles when iterating in templates.
Order can be set to a metadata attribute or a sorting function.
Default to order by slug for articles and order by filename for pages.
2013-11-14 12:35:50 -08:00
Justin Mayer
3b0823f5e6 Build Pelican wheels in universal format
Including a binary wheel when uploading Pelican to PyPI will speed up
installation for the Pelican community. This change ensures that the
Pelican wheel is compatible with all supported Python versions. For more
information, see: https://pypi.python.org/pypi/wheel
2013-11-13 13:44:28 -08:00
John Cramb
da66245729 Update settings.rst
Added missing CATEGORIES_URL and CATEGORIES_SAVE_AS settings to the table.
2013-11-13 14:15:08 +11:00
Justin Mayer
ad74464e94 Merge pull request #1140 from gpoo/fix-invalid-atom-feed-uid
Fix #1039 Atom feed for sites using HTTPS or a subdirectory
2013-11-12 17:56:13 -08:00
Justin Mayer
350706b2f0 Merge pull request #1148 from florianjacob/modified_metadata
Added a new ''modified:' metadata tag
2013-11-09 15:34:51 -08:00
Florian Jacob
4b2fcb09a4 Added a new ''modified:' metadata tag to be able to specify the
publication time and date and the last modified time and date
independently.

This makes it possible to access the last updated date with {{ article.locale_modified }} in templates.
Additionally, an already delivered feed entry can be corrected by changing the modified date and time, as it is used for atom:update
/ rss pubDate field now.
2013-11-10 00:14:55 +01:00
Justin Mayer
c8f5eb54db Merge pull request #1151 from malept/html-reader-non-conforming-meta-tags
Log a warning when the HTML reader encounters a nonconformant meta tag
2013-11-09 14:04:38 -08:00
Mark Lee
35375b19ff Log a warning when the HTML reader encounters a nonconformant meta tag
Instead of throwing an exception and skipping the HTML file, log a
warning with a message which makes it more obvious as to what happened.
2013-11-08 14:37:07 -08:00
Justin Mayer
455c159b48 Various fixes to theme documentation 2013-11-07 11:05:22 -08:00
Alexis Metaireau
9fe3d3c937 Merge pull request #1150 from madewulf/master
Add doc about use of metadata per article in custom templates
2013-11-07 05:02:03 -08:00
Martin De Wulf
dc0edb2b2b Add doc about use of metadata per article in custom templates 2013-11-07 13:41:19 +01:00
Justin Mayer
6b808b2faa Merge pull request #1122 from calfzhou/copy_path
Preserve file metadata (esp. timestamps) when copy static files to output folder.
2013-11-05 18:25:26 -08:00
woshilapin
3b4dad470c Add 'asciidoc' to the ASCIIDoc possible extensions 2013-11-05 18:00:07 +01:00
idning
7fadbd682a check IGNORE_FILES on get_files 2013-11-03 18:08:08 +08:00
Justin Mayer
0dc20329a4 Merge pull request #1142 from FloorLamp/master
Fix typo in manual
2013-11-02 08:54:29 -07:00
Norton Wang
f69c71000a Fix typo in manual 2013-11-01 16:59:45 -04:00
Germán Poo-Caamaño
efc1d38efd Fix invalid atom feed id:tag
Fixes #1039: The atom feed generated produces an invalid attribute
id:tag when SITEURL has something different that http or it contain
a subdirectory, such as:
  * https://myblog.com/
  * https://mysite.com/blog
  * http://mysite.com/blog
2013-10-31 13:29:43 -07:00
Justin Mayer
fb994b1399 Add content dir to default settings file template
This adds a line to the settings file generated by pelican-quickstart
that ensures the automatically-generated "content" directory is
specified in said settings file. Fixes #1116
2013-10-28 15:52:09 -07:00
Justin Mayer
5e5510cfcf Improve Disqus embed code in notmyidea theme
According to Disqus, the disqus_shortname variable is a required field.
Also added a <noscript> notice for those who have JS disabled.
2013-10-27 09:27:30 -07:00
Justin Mayer
4a940da1a2 Merge pull request #1129 from kdeldycke/markdown-youtube-tip
Document video support in reST & Markdown.
2013-10-25 19:41:46 -07:00
Kevin Deldycke
6c808e426f Document video support in Markdown and reST. 2013-10-25 10:52:13 +02:00
Justin Mayer
5a6d60001d Merge pull request #1132 from fly/disqus_ssl
use // instead of explicitly defining http
2013-10-24 14:23:21 -07:00
Jon Chen
9331e42ee1 use // instead of explicitly defining http
for twitter as well

update sample output
2013-10-24 17:06:23 -04:00
Justin Mayer
effac994db Merge pull request #1118 from yapbreak/patch-1
Change StandardError to RuntimeError
2013-10-24 08:41:14 -07:00
Justin Mayer
ae2afa27fc Clarify FAQ entry re: need to install Markdown
Folks keep running into this error, which probably signals a need to
change this behavior. After all, it wouldn't be hard for us to detect
what's going on and provide a better error message, such as: "It looks
like you're trying to process Markdown, but the Markdown library is not
currently installed. Please install the Python-Markdown library via 'pip
install markdown'."

Until we implement something akin to the above, this should serve as a
slightly-improved FAQ entry in the interim.
2013-10-19 17:20:13 +02:00
Alexis Metaireau
cd92ef3696 Merge pull request #1123 from calfzhou/intra-link
Fix #1117 Make intra-link support all url-value HTML attributes.
2013-10-18 06:44:48 -07:00
zhouji
e538aa2cde Fine-tune url-value HTML attributes list. 2013-10-17 11:33:34 +08:00
zhouji
04dba17b80 Fix #1117 Make intra-link support all url-value HTML attributes. 2013-10-16 17:06:56 +08:00
Kyle Fuller
bc94c6b6e3 Merge pull request #1119 from jedbrown/jed/fix-signal-name-doc
docs/plugins.rst: fix signal name "page_generator_context"
2013-10-15 08:44:16 -07:00
zhouji
eb6d4bb008 Preserve file metadata (esp. timestamps) when copy static files to output folder. 2013-10-15 10:37:03 +08:00
Jed Brown
2b5db0321b docs/plugins.rst: fix signal name "page_generator_context"
The old "pages_generate_context" dates from before pelican-3.2
standardization, but AFAIK, "page_generate_context" was never correct.
2013-10-11 22:30:27 -05:00
Adrien Oliva
caa833877d Change StandardError to RuntimeError
Since built-in exception "StandardError" does not exist in the latest python version (at least in version 3.3), use RuntimeError instead (which exists from python2.6 to python3.4)
2013-10-11 15:52:47 +02:00
Alexis Metaireau
754611180b Merge pull request #1115 from torrance/headers_fix
Ensure headers from base.html are included.
2013-10-10 01:48:33 -07:00
Torrance
6dafe69ac6 Ensure headers from base.html are included. 2013-10-10 14:29:42 +13:00
David Branner
00150f3556 xml => lxml for bs4, in pelican-import.wp2fields() 2013-10-09 11:53:11 -04:00
Justin Mayer
e2f50750d2 Add Tumblr and Posterous to importer description 2013-10-08 13:20:56 +02:00
Kyle Fuller
f83d0d3b0c Handle east asian character column width in the importer
Fixes #682
Closes #923
2013-10-08 09:46:40 +01:00
Justin Mayer
9ebe06156c Merge pull request #1110 from tshepang/deprecated
replace Deprecated method; use unittest.mock when available
2013-10-07 03:06:11 -07:00
Tshepang Lekhonkhobe
67d3ab8883 assertEquals is deprecated in favor of assertEqual 2013-10-06 16:15:43 +02:00
Tshepang Lekhonkhobe
9657071301 Python 3.3 got mock 2013-10-06 15:30:14 +02:00
Justin Mayer
cb82e48636 None, not False, in *_SAVE_AS docs. Fixes #1106. 2013-10-04 16:23:19 +02:00
Justin Mayer
47e19b8d18 Merge pull request #1096 from saimn/smartypants
Fix tests with latest version of Smartypants
2013-09-28 05:32:04 -07:00
Simon Conseil
a49b744e95 Fix tests with latest versions of smartypants.
smartypants is now py3 compatible but the default settings for double quotes has
been changed (http://pythonhosted.org/smartypants/changes.html).

This commit:
- update the typogrify test (change quotes, and add more test casesi: caps word,
  ellipsis)
- install typogrify on travis
- uses upstream version of smartypants in tox instead of dmdm's fork for py3
2013-09-26 22:47:55 +02:00
Alexis Metaireau
dbbf95b184 Merge pull request #1093 from honzajavorek/intrasite-link-parsing
Better intrasite link parsing
2013-09-25 07:58:27 -07:00
Honza Javorek
6ed23fec7d Tuned the tests so they are PY3 compilant. 2013-09-25 16:31:23 +02:00
Honza Javorek
7415d370e6 Added tests. 2013-09-25 16:13:28 +02:00
Honza Javorek
6fb0335269 Attempt to be compilant with Python 3. 2013-09-25 11:39:29 +02:00
M. Utku Altinkaya
a987b65bd2 Watch static folders in Autoreload mode 2013-09-25 04:43:06 +03:00
Justin Mayer
2c468f091a Prepare version 3.3.1.dev for next development cycle 2013-09-24 21:57:28 +02:00
Justin Mayer
b35ce43b7f Bump version 3.3.0 2013-09-24 21:57:07 +02:00
Justin Mayer
2f57b86560 Modify sed command in bumpr.rc to support BSD
It appears that BSD sed, unlike Linux, has a requirement that you
provide an extension to the -i option. So, while Linux allows:

    sed -i "sed-command"

... to edit in-place, the BSD variant needs to have:

    sed -i "" "sed-command"

i.e., with an empty backup suffix.
2013-09-24 21:37:53 +02:00
Justin Mayer
5f23aab807 Change Bumpr test from tox to unittest
There are currently some minor problems when running tox that are not
present when running "python -m unittest discover". Once those problems
have been resolved, we should probably change this setting back to tox.
2013-09-24 21:28:59 +02:00
Honza Javorek
7d43c4fa00 Support for params and fragments in intrasite links. Adresses #1063. 2013-09-24 15:18:09 +02:00
Honza Javorek
e5c0a54c57 Removed obsolete comment. 2013-09-24 14:19:47 +02:00
Justin Mayer
f6c9237a01 Enhance and correct documentation 2013-09-23 19:30:51 +02:00
Justin Mayer
07f87969ea Update changelog 2013-09-23 19:28:06 +02:00
Alexis Métaireau
3857fd72b5 Merge branch 'master' of github.com:getpelican/pelican 2013-09-17 17:32:15 +02:00
Alexis Métaireau
22da74211d Fix a broken link 2013-09-17 17:32:08 +02:00
Alexis Metaireau
74069e771f Merge pull request #1084 from karmadharma/pygmentdocsanddefault
Support Pygments customization in settings (reST only)
2013-09-16 02:32:17 -07:00
Alexis Metaireau
76e47e5198 Merge pull request #1083 from bmcorser/bmcorser/fix-utils-copy
Fix `utils.copy` behaviour
2013-09-16 02:01:46 -07:00
SDGSDG
3580233b38 Support for pygment defaults and relevant documentation 2013-09-15 23:13:17 -07:00
Justin Mayer
85213f077b Merge pull request #1075 from jeekajoo/patch-1
Add async and defer attributes to piwik.js
2013-09-15 08:35:01 -07:00
bmcorser
e03cf3f517 Fix utils.copy behaviour
Previously, the copy util failed if only a directory containing only
files was specified in THEME_STATIC_PATHS
2013-09-14 16:18:53 +01:00
Alexis Metaireau
9935286e19 Merge pull request #1056 from bmcorser/fix-utils-copy
Fix for THEME_STATIC_PATHS by copying sensitively
2013-09-09 15:01:13 -07:00
Alexis Metaireau
bb50bdbc34 Merge pull request #1081 from talha131/patch-1
Update changelog.rst
2013-09-09 00:47:28 -07:00
Talha Mansoor
3d419bf55d Update changelog.rst
1. Escape `|tag|` and `|category|` with double ticks otherwise reST converts them to links that are invalid.
2. Updated syntax for relative links use braces instead of bars.
2013-09-09 10:28:47 +05:00
Talha Mansoor
13199792a7 Add tip on how to add videos to your blog. 2013-09-08 23:05:52 +02:00
Talha Mansoor
bc26cde436 Add details on how to use Pelican for non-blog static sites
This question comes up on IRC quite frequently.
2013-09-08 23:05:52 +02:00
Alexis Metaireau
dd66ad6731 Merge pull request #1071 from talha131/change-intrasite-link-syntax-updated
Change intrasite link syntax updated
2013-09-08 14:00:57 -07:00
Talha Mansoor
e2236d50d6 Update settings documentation to explain INTRASITE_LINK_REGEX
I have added reference to "Linking to internal content" section because
without it, it is difficult to explain the usage.

I have also updated changelog.

Closes getpelican/pelican#1061
2013-09-09 00:08:39 +05:00
Talha Mansoor
48fa70c6a6 Add INTRASITE_LINK_REGEX to configuration that user can modify
This INTRASITE_LINK_REGEX is a string. It should have the capturing
group name which is `what`.

This change was made after discussions with @ametaireau and
@justinmayer.

1. https://github.com/getpelican/pelican/pull/1067
1. https://github.com/getpelican/pelican/pull/1071

Updates getpelican/pelican#1061
2013-09-09 00:06:18 +05:00
Talha Mansoor
bddf0faa9c Update documentation to reflect change in intrasite link syntax
Updates getpelican/pelican#1061
2013-09-09 00:06:13 +05:00
Alexis Métaireau
6813cd923f Close some HTML tags. Fix #1076 2013-09-08 17:07:30 +02:00
jeekajoo
b7bc570215 add async and defer attributes to piwik.js
inspired from http://piwik.org/docs/javascript-tracking/#toc-where-can-i-find-the-piwik-tracking-code
2013-09-02 19:25:46 +02:00
bmcorser
089059aec6 Clarify revised functinality 2013-08-31 22:11:03 +01:00
bmcorser
10c62b27dd More exciting files 2013-08-31 22:00:52 +01:00
bmcorser
ef16c915d4 Clarification of THEME_STATIC_PATHS behaviour 2013-08-31 21:49:41 +01:00
Justin Mayer
8d352d9a78 Correct upload targets in Makefile.in 2013-08-29 17:35:48 -07:00
Talha Mansoor
2f34307e12 Change the regex so that it parse |filename| and {filename} equally
Updates getpelican/pelican#1061
2013-08-29 23:14:47 +05:00
Justin Mayer
8367ae4e98 Merge pull request #1066 from saimn/markdown
Fix the behavior of Markdown extensions.
2013-08-28 15:57:44 -07:00
Simon Conseil
71cca7a444 Fix the behavior of Markdown extensions.
There was several issues here:
- `self.extensions` was adding 'meta' multiple times (ref #1058)
- `self.extensions` was keeping a reference to `self.settings['MD_EXTENSIONS']`,
  so adding 'meta' to it.
- the `%s_EXTENSIONS` block coming after, it was overriding `self.extensions`
  with `self.settings['EXTENSIONS']` (while it was a reference, it was working,
  but ...). As this is currently used only for Mardown, the simplest solution is
  to remove this, and let each reader manage its `_EXTENSIONS` setting.
2013-08-29 00:49:59 +02:00
Justin Mayer
2fb00a980a Merge pull request #815 from noirbizarre/doc-versionning
Documentation versioning
2013-08-28 07:59:32 -07:00
Alexis Metaireau
651e59fce1 Merge pull request #1057 from astephen2/metadata
Added metadata information. Refs #1028
2013-08-25 09:31:22 -07:00
Axel Haustant
5a322ecc1e Pin bumpr version to avoid config breakage with new versions 2013-08-25 14:14:43 +02:00
Alex Stephen
8d41d6ba24 Refs #1028. Now iterating over tags 2013-08-24 23:36:07 -04:00
Axel Haustant
bad8cfb3d9 Added bumpr as a development requirement to perform release 2013-08-24 20:20:37 +02:00
Axel Haustant
c61f6f402a Prepare for bumpr 2013-08-24 20:17:05 +02:00
bmcorser
b144c3cfbd Hack out overwrite param 2013-08-24 14:38:06 +01:00
bmcorser
0f4058a317 Add regressison test for recursively copying files 2013-08-24 13:42:55 +01:00
bmcorser
d22b089241 Adding placeholder files for regression test 2013-08-24 13:41:22 +01:00
Alex Stephen
2826c1a558 Added metadata information. Refs #1028 2013-08-21 22:58:50 -04:00
bmcorser
9d583961e7 Fix for THEME_STATIC_PATHS by copying sensitively
If more than one path is defined in THEME_STATIC_PATHS, the theme's
static directory in output is deleted and replaced by the following
path's files.

Using `shutil.rmtree` to remove the entire destination tree if overwrite
is `True` assumes that we didn't want anything at all that was there. We
should recurse through the directory and their subdirs instead, leaving
things put there by the previous path where they were.

I lazily copied almost verbatim the solution for recursively copying a
diectory from http://stackoverflow.com/a/1994840.

The reason for this is patch is that without it, my plugin is broken! It
also makes my code a lot less crazy:

a83f066
2013-08-21 20:28:22 +01:00
Axel Haustant
e6e99ffbb9 Change current release section with a constant title 2013-08-21 06:21:02 +02:00
Axel Haustant
469c531ae4 Include version in doc and warn if it's a dev version. 2013-08-21 06:18:43 +02:00
Axel Haustant
d11b33030f Use .dev suffix for development versions 2013-08-21 06:18:43 +02:00
Alexis Metaireau
1fad70e5b9 Merge pull request #1053 from kura/remove-youtube
Removed YouTube directive as it's been moved to a Plugin
2013-08-19 03:47:51 -07:00
Kura
895945e3cc Removed YouTube directive as it's been moved to a Plugin 2013-08-19 11:45:59 +01:00
Alexis Metaireau
2e845feb02 Merge pull request #1050 from getpelican/content-written-signal
Add a content_written signal
2013-08-17 11:07:55 -07:00
Alexis Métaireau
56371aaf0f update the changelog 2013-08-17 17:42:54 +02:00
Alexis Metaireau
39570053e1 Merge pull request #1051 from getpelican/relative-links
Add categories and tags to the replacement mechanism.
2013-08-17 08:41:50 -07:00
Alexis Métaireau
e2ca6d7608 Add categories and tags to the replacement mechanism. 2013-08-17 17:36:13 +02:00
Alexis Métaireau
339955376e Add a content_written signal 2013-08-17 12:48:34 +02:00
Alexis Métaireau
2a599b8646 Reactivate travis IRC reports. 2013-08-17 01:23:09 +02:00
Alexis Métaireau
aae56fee39 exception.message was removed in py 3.X 2013-08-17 01:12:39 +02:00
Alexis Métaireau
73b37989f7 update the readers tests 2013-08-17 01:02:07 +02:00
Alexis Metaireau
2be674c909 Merge pull request #903 from dominiqueplante/readers.read_file-throwsexception
Add unit test for the case for handing unhandled extension
2013-08-16 15:34:49 -07:00
Alexis Metaireau
1fdda30c9b Merge pull request #1014 from dbrgn/test_output_locale
Explicitly set locale when generating test output
2013-08-16 15:09:07 -07:00
Alexis Metaireau
09c9d48a6a Merge pull request #1040 from ssbarnea/master
Fixing #1038 by allowing nice URLs.
2013-08-16 15:01:28 -07:00
Alexis Metaireau
9ea3871568 Merge pull request #1049 from kenmazy/BetterStaticGenerator
StaticGenerator now stores file list in context.
2013-08-16 14:59:49 -07:00
Ken Jung
6191b2919e StaticGenerator now stores file list in context.
This allows plugins and other generators to easily add files to be
simply copied over.
2013-08-16 13:31:14 -07:00
Justin Mayer
9645356eeb Merge pull request #929 from nicholaskuechler/cf_support_for_quickstart
Adds Rackspace Cloud Files support to quickstart
2013-08-13 06:22:47 -07:00
Justin Mayer
7ddb542ac4 Merge pull request #1031 from talha131/bugfix-autoreload-doesnt-work
Fix for a bug that will make autoreload fail
2013-08-13 06:17:56 -07:00
Justin Mayer
853ce866cb Merge pull request #1041 from shabob/tagbranch
Enhance tag cloud docs
2013-08-13 06:14:52 -07:00
Daniel Goldsmith
d9816be5de Tag Cloud made functional 2013-08-13 10:46:41 +01:00
Sorin Sbarnea
3b315fbc53 Fixing #1038 by allowing nice URLs. 2013-08-12 19:23:57 +01:00
Alexis Métaireau
472abb6fd9 Activate coveralls.io support 2013-08-12 14:49:25 +02:00
Justin Mayer
71a2c14d1b Merge pull request #1032 from talha131/fix-docs-typo
Fix omitted signal name change in docs
2013-08-10 15:00:47 -07:00
Talha Mansoor
b0a13a851c Fix a typo in the docs
getpelican/pelican@f2d6f77462 changed
`article_generate_context` to `article_generator_context`. This commit
updates the docs to reflect the change.
2013-08-11 02:20:25 +05:00
Talha Mansoor
a7152716e2 Receive the two values returned from get_instance()
`get_instance()` returns two values. Old code, instead of unpacking two
values in two variables, placed the tuple in a single variable
`pelican`.

Later in the same block when `pelican.run()` was called, it resulted in
error.

```
-> Modified: content, theme, settings. re-generating...
CRITICAL: ("'tuple' object has no attribute 'run'",)
CRITICAL: 'tuple' object has no attribute 'run'
Traceback (most recent call last):
  File "/Users/talha/Repos/VirtualEnvs/pelican-dev/bin/pelican", line 8,
  in <module>
    load_entry_point('pelican==3.3', 'console_scripts', 'pelican')()
    File
    "/Users/talha/Repos/VirtualEnvs/pelican-dev/lib/python2.7/site-packages/pelican-3.3-py2.7.egg/pelican/__init__.py",
    line 353, in main pelican.run()
```

Either the returned value should be unpacked properly or
`pelican[0].run` should be called.
2013-08-11 01:43:27 +05:00
Justin Mayer
f2aef81c96 Work around pytz & pip 1.4+ problem. Fixes #996.
The latest version of pip (1.4) no longer installs pre-release versions
(alpha, beta, etc.) by default. Because pytz uses an unorthodox version
number scheme, pip thinks it's a pre-release and skips it. This
change to setup.py should alleviate the problem until it is otherwise
resolved.
2013-08-08 12:08:30 -07:00
Justin Mayer
d824b79a19 Merge pull request #1020 from saimn/readers
Don't warn too loud about missing dependencies.
2013-08-07 14:54:58 -07:00
Simon Conseil
c875c27e83 Don't warn too loud about missing dependencies.
- Show the messages only once for each Reader
- Decrease the logging level
2013-08-07 22:43:08 +02:00
Justin Mayer
24e2ad5b3f Improve AsciiDoc parts of Getting Started docs 2013-08-07 12:45:26 -07:00
Justin Mayer
5a469dc2e3 Merge pull request #1011 from saimn/readers
Refactor readers and remove MARKUP. Fixes #866
2013-08-07 12:34:22 -07:00
Justin Mayer
0df12e31e2 Merge pull request #974 from dbrgn/tags_authors_setting_fix
Tags/Authors Setting Fix
2013-08-06 16:18:37 -07:00
Simon Conseil
f47f054d0b Add documentation for readers. 2013-08-07 00:43:49 +02:00
Simon Conseil
bab8d0b26a Move the "find image with an empty alt" block in a function. 2013-08-07 00:36:40 +02:00
Simon Conseil
85ea737a98 Add a signal to give access to the dict of Reader classes. 2013-08-07 00:36:40 +02:00
Simon Conseil
cfe72c2736 Disable asciidoc files for tests 2013-08-06 23:42:41 +02:00
Simon Conseil
4bc4b1500c Refactor readers and remove MARKUP
Add a `Readers` class which contains a dict of file extensions / `Reader`
instances. This dict can be overwritten with a `READERS` settings, for instance
to avoid processing *.html files:

    READERS = {'html': None}

Or to add a custom reader for the `foo` extension:

    READERS = {'foo': FooReader}

This dict is no storing the Reader classes as it was done before with
`EXTENSIONS`. It stores the instances of the Reader classes to avoid instancing
for each file reading.
2013-08-06 23:42:41 +02:00
Alexis Metaireau
c3aa85831f Merge pull request #1015 from karmadharma/morepygmentsoptions
Adding more options for pygments syntax highlighting
2013-08-06 07:52:09 -07:00
SDGSDG
ece437f8fd Added more pygments options for code blocks 2013-08-05 22:50:49 -07:00
Nicholas Kuechler
6b68d94079 Adds Rackspace Cloud Files support to quickstart and fabfile 2013-08-05 23:30:31 -05:00
Danilo Bargen
bbea6d1747 Explicitly set locale when generating test output 2013-08-05 19:18:47 +02:00
Danilo Bargen
42f9726ffa Support TAGS_* and AUTHORS_* by default. 2013-08-05 19:16:00 +02:00
Justin Mayer
e228357f58 Merge pull request #1002 from russkel/sourcecodefix
fix py3 support for sourcecode directive
2013-08-05 08:54:35 -07:00
Russ Webber
5a8f5cefdd fix py3 support for sourcecode directive
added sourcecode to the functional test so it's tested *somewhere*.
fixes #963
2013-08-05 23:45:48 +08:00
Alexis Metaireau
ea6d0cf5b5 Merge pull request #1007 from saimn/refactor-tests
Refactor test_generators and pelican_open
2013-08-05 08:02:45 -07:00
Alexis Métaireau
05437a15a9 Remove the reference to the PDF generation in the docs. Fix #1013 2013-08-05 10:40:06 +02:00
Justin Mayer
97c2598cdf Merge pull request #1006 from saimn/fix_docutils
Use the `docutils` variable to check if docutils is installed, not `core`
2013-08-04 20:58:39 -07:00
Justin Mayer
d4ba9dcf21 Merge pull request #895 from Rogdham/empty_alt
Add warnings for img with empty alts. Fixes #647.
2013-08-04 20:54:23 -07:00
Justin Mayer
23f7a12b52 Merge pull request #1010 from kylewm/pdf-plugin
Move PDF generation to a plugin (Fixes #1009)
2013-08-04 20:30:31 -07:00
Justin Mayer
f9a6d10eec Merge pull request #1004 from russkel/hgrm
Remove old mercurial files
2013-08-04 20:15:53 -07:00
Justin Mayer
8c4b2a0d2e Merge pull request #1003 from russkel/tumblrfix
fix missing 'kind' arg in tumblr importer
2013-08-04 20:09:11 -07:00
Kyle Mahan
dfc3a7ce2f Move PDF generation to a plugin. Fixes #1009 2013-08-04 18:01:56 -07:00
Rogdham
a75eac6c0f Add warnings for img with empty alts. Fixes #647.
Unify Rst and Mkd: if alt is not specified at all, create an empty alt.
Warns the user in case of empty alts.
2013-08-04 16:03:39 +01:00
Justin Mayer
1b904ae767 Merge pull request #943 from Rogdham/override_save_as_url
Deliberate overriding and overwrite detection. Fixes #938
2013-08-04 07:21:10 -07:00
Simon Conseil
41970cb2c6 Refactor pelican_open using contextmanager 2013-08-04 14:47:03 +02:00
Simon Conseil
4ffa34544e More refactoring for test_generators
- list comprehensions for distill_articles/pages
- distill articles only once
- pep8
2013-08-04 14:47:03 +02:00
Simon Conseil
577a3d116e Replace get_populated_generator with setUpClass 2013-08-04 14:47:03 +02:00
Simon Conseil
a268d9e952 Use the docutils variable to check if docutils is installed, not core.
+ remove duplicate import
2013-08-04 14:27:29 +02:00
Rogdham
a495527e2b Delib. overriding and overwrite detect. Fixes #938
Make deliberate overriding (*) works with overwrites detection.

(*) first introduced by d0e9c52410

The following are decided to be deliberate override:
 - articles using the `save_as` metadata
 - pages using the `save_as` metadata
 - template pages (always)

Pelican now exits in the following 2 cases:
 - at least 2 not deliberate writes to the same file name (behaviour introduced
   by the overwrite detection feature ff7410ce2a)
 - at least 2 deliberate writes to the same file name (new behaviour)

Also added info logging when deliberate overrides are performed.

Switched to StandardError instead of IOError, thanks to @ametaireau and
@russkel.
2013-08-04 12:09:26 +01:00
Rogdham
0999d4d691 Deliberate overriding of an existing file to tests
Deliberate overriding via `save_as` metadata should be allowed, even after the
overwrite detection feature. This commit is to add tests for deliberate
overriding. As a result, the relevant tests *should fail* after this commit.

Added a page and an article, both to override a tag, with very old dates so
it limits the amount of diff in the generated pages.

Overriding feature introduced by d0e9c52410
Overwrite detection introduced by ff7410ce2a
2013-08-04 12:07:40 +01:00
Russ Webber
e0a2f1906d Remove old mercurial files 2013-08-04 18:52:53 +08:00
Russ Webber
dc58a17e64 fix missing 'kind' arg in importer
fixes #983
2013-08-04 17:21:35 +08:00
Justin Mayer
a14dc4dad2 Merge pull request #1001 from russkel/issue927
fix: clear directory before generation of context
2013-08-04 00:04:18 -07:00
Justin Mayer
6d32fb2bb7 Merge pull request #995 from karlcow/master
Fixing documentation according to  Issue #362.
2013-08-04 00:03:31 -07:00
Russ Webber
4977de8453 fix: clear directory before generation of context
fixes #927
2013-08-04 14:00:56 +08:00
Justin Mayer
72ea20f06a Merge pull request #871 from dknecht/master
Sort author and category pages using same sort as tags
2013-08-03 22:51:30 -07:00
Justin Mayer
122ec39a27 Merge pull request #932 from qdot/master
Change meta tag "contents" attribute to "content" to conform to HTML spec
2013-08-03 22:40:18 -07:00
karl
a4ce664f17 fixing the inline code markup 2013-08-03 22:31:54 -04:00
Dane Knecht
10dc5ef0b7 sort author and category pages same way as tags 2013-08-03 19:17:14 -07:00
Justin Mayer
2a53934834 Merge pull request #950 from fbs/makedebug
Add a debug target to the template makefile
2013-08-03 16:51:23 -07:00
Justin Mayer
2aa0c6e24b Merge pull request #968 from russkel/encodingfix
Fix setting default locale and exception encoding
2013-08-03 16:42:37 -07:00
Justin Mayer
1abd5ef447 Merge pull request #894 from dominiqueplante/quickstart-debuggable
make Pelican-quickstart debuggable in PyCharm
2013-08-03 16:35:36 -07:00
Justin Mayer
76fa457654 Normalize whitespace via lstrip Jinja parameter
This adds the lstrip_blocks Jinja parameter and removes unnecessary
whitespace from a few notmyidea templates.

Note: The lstrip_blocks parameter requires Jinja 2.7+, which has been
noted in Pelican's setup.py.

Credit for this commit goes entirely to Russ Webber, who has earned my
eternal thanks for discovering and applying this useful Jinja parameter.

Refs #969
2013-08-03 16:17:26 -07:00
Justin Mayer
23e62b0056 Merge pull request #966 from jude/patch-1
Adding a FEED_ALL_ATOM check in the "social" div.
2013-08-03 15:16:58 -07:00
Justin Mayer
1443131fde Merge pull request #976 from kylewm/notmyidea-active-pages
Modify notmyidea to include class="active" on pages
2013-08-03 15:12:52 -07:00
Justin Mayer
bea03bb4bb Merge pull request #979 from nyergler/pagination_conf
Support flexible pagination configuration
2013-08-03 14:58:47 -07:00
Justin Mayer
0de44cc844 Merge pull request #964 from nickzoic/master
Slugify {category} in URLs. Fixes #926
2013-08-03 14:45:07 -07:00
Nathan Yergler
d61ef0c66c Adding basic documentation for PAGINATION_PATTERNS. 2013-08-03 14:06:16 -07:00
Nathan Yergler
50ff7ce89f Fall back to the default PAGINATION PATTERNS when none specified. 2013-08-03 14:04:58 -07:00
Justin Mayer
4d614c173b Merge pull request #999 from nicholaskuechler/group_pdf_settings
Group PDF related settings together.
2013-08-03 14:00:17 -07:00
Nathan Yergler
5ffbf907de Create new formatting context dict instead of using self.__dict__
Using self.__dict__ is fine, but when its mutated it changes the
object's state. Creating a new dict avoids needing to think about
that, and doesn't introduce Python 3 issues (ie, where self.number is
accidentally set to '').
2013-08-03 13:49:43 -07:00
Nicholas Kuechler
92f5c06ba6 Group PDF related settings together. 2013-08-03 14:58:52 -05:00
karl
6a0d19ef5c Adding context to the documentation for metadata
Giving a longer description Thanks to justin mayer for #995
2013-08-03 12:47:44 -04:00
karl
03e9d0182d Fixing documentation according to Issue #362.
The documentation as it is right now produces a  CRITICAL: 'article' is
undefined
2013-08-03 00:31:43 -04:00
Justin Mayer
4c1b5c3429 Correct URL for pip install editable in docs
Refs # 975
2013-08-01 15:13:32 -07:00
Justin Mayer
1cebd345aa Merge pull request #970 from russkel/themestaticdir
added THEME_STATIC_DIR setting
2013-08-01 08:42:13 -07:00
Alexis Metaireau
65a716ec02 Merge pull request #989 from getpelican/plugins-recipes
Start a section about plugin recipes in the docs
2013-08-01 05:48:53 -07:00
Alexis Métaireau
4fa9184b01 Start a section about plugin recipes in the docs 2013-08-01 14:47:56 +02:00
Nathan Yergler
74c7c72fb3 Use six.u instead of unicode. 2013-07-31 21:31:08 -07:00
Russ Webber
89034f8b3f added THEME_STATIC_DIR setting
The theme static output directory path is now customisable via settings.
i.e. you can now use 'assets' instead of 'theme'.
2013-08-01 11:02:38 +08:00
Nathan Yergler
9abc08ea9f Don't assume that PAGINATION_PATTERNS will always be present. 2013-07-31 18:57:21 -07:00
Kyle Fuller
51dc02f298 Add documentation for WITH_FUTURE_DATES
Closes #952
2013-07-31 23:08:42 +01:00
Kyle Fuller
80a7c3f293 Merge pull request #986 from TheHippo/patch-1
Fix file endings for examples
2013-07-31 14:55:06 -07:00
Philipp Klose
0e0775b74a Fix file endings for examples
reStructured should use reStructured for linked documents. Markdown should use Markdown for linked documents.
2013-07-31 22:43:02 +02:00
Justin Mayer
30192b2318 Add fabfile generation to pelican-quickstart
This commit adds optional fabfile.py generation during the
pelican-quickstart process. Reasons include:

* "make" is cumbersome to install on Windows
* Fabric runs in any Python environment
* fabfile is just Python and thus more flexible and extensible

This is an initial implementation and does not currently provide as many
upload options as its Makefile counterpart.

Refs #584.
2013-07-29 11:03:14 -07:00
Nathan Yergler
95890a2a61 Allow definition of pagination rules by page index. 2013-07-29 08:10:28 -04:00
Ross McFarland
71e83635ea remove u prefix from string literal, using unicode_literals 2013-07-29 08:09:45 -04:00
Ross McFarland
0caa101ec7 use six.string_types for python 3 compat 2013-07-29 08:09:44 -04:00
Ross McFarland
e07b39dfcb more robust PAGINATION_(URL|SAVE_AS) support
- add base_name and number_seperator to context to give more flexibility
  when naming things
2013-07-29 08:09:44 -04:00
Ross McFarland
c5eecd23eb PAGINATION_URL/PAGINATION_SAVE_AS implementation
allows the use of custom urls for pagination similar to *_URLS
2013-07-29 08:09:44 -04:00
Kyle Mahan
0ddabb95c3 Modify notmyidea to include class="active" on pages 2013-07-27 12:30:24 -07:00
Russ Webber
b527fd594d added testing for default locale setting
removed LOCALE="" from default conf as it looks weird and you
shouldn't need to set a blank LOCALE for the system to work.
2013-07-21 14:12:21 +08:00
Russ Webber
2ace30cdb0 fix it not setting the default locale
If LOCALE was not specified in the settings file it would default
to [] insted of [''], where '' is used by locale.setlocale
to mean the user's default locale.
2013-07-21 13:31:11 +08:00
Justin Mayer
e32c893aa1 Support Gaug.es analytics in notmyidea theme 2013-07-18 10:26:45 -07:00
Justin Mayer
d4b64a3c8e Merge pull request #873 from xlz/tumblr-import
Support importing Tumblr
2013-07-18 09:17:26 -07:00
Russ Webber
3445066b11 fix an exception not correctly reporting if the locale is not set 2013-07-18 09:44:46 +08:00
Jude N
c5008f61e0 Adding a FEED_ALL_ATOM check in the "social" div.
The head section has a tests for FEED_ALL_ATOM when building the atom link.  This diff add a similar test in the "social" div.
2013-07-16 23:44:53 -04:00
Justin Mayer
9b0cfd9884 Merge pull request #883 from ben2367/author-filter
Add filter-author option to importer
2013-07-16 08:22:26 -07:00
Justin Mayer
f43742c3f0 Add missing SITEURL variable to tag cloud docs 2013-07-15 14:25:39 -07:00
Justin Mayer
b282b7c72d Merge pull request #965 from cdhowie/master
Update tag cloud documentation
2013-07-15 13:59:23 -07:00
Chris Howie
4ca5d908ff Update tag cloud documentation for SLUG_SUBSTITUTIONS 2013-07-15 16:48:08 -04:00
Nick Moore
9b7ae20aa9 test for author & category slugification 2013-07-15 00:22:05 +10:00
Nick Moore
6c5444eb68 do slug_substitutions on category and author ... 2013-07-14 23:01:16 +10:00
Alexis Metaireau
9f0ad2bd95 Merge pull request #958 from hrbonz/dev_server_port
Dev server port
2013-07-14 05:04:42 -07:00
Alexis Metaireau
5e73b7b40e Merge pull request #954 from ajma/master
Adding stackoverflow to social icons
2013-07-14 03:35:13 -07:00
Alexis Metaireau
fe33d3eed5 Merge pull request #931 from Cartroo/slugsubstitutions
Allow text substitutions when generating slugs
2013-07-14 03:31:11 -07:00
Benjamin Port
cb650c1c99 Add filter-author option to importer
Allow to import post from only one author when importing data
2013-07-13 16:15:45 +02:00
Stefan hr Berder
689632835e add port option to Makefile target serve/devserver 2013-07-07 14:28:31 +02:00
Stefan hr Berder
3a5db543bb add port parameter to bash script 2013-07-07 13:27:50 +02:00
Lingzhu Xiang
241ac2400a Use better titles than None for Tumblr posts without title 2013-07-07 19:05:21 +08:00
Lingzhu Xiang
75263fa852 Fix importing Tumblr photo caption
Besides each photo's caption, the general caption is also needed.

While we're at it, also add a linefeed at the end of file.
2013-07-07 19:05:21 +08:00
Lingzhu Xiang
00a1cbb6b8 Support importing Tumblr
Try to integrate Tumblr's various post types without using
additonal templates.
2013-07-07 19:05:21 +08:00
Stefan hr Berder
3da4c2e13e add port option to pelican.server 2013-07-07 12:44:21 +02:00
Andy Pearce
39518e15ef Allow text substitutions when generating slugs
The `slugify()` function used by Pelican is in general very good at
coming up with something both readable and URL-safe. However, there are
a few specific cases where it causes conflicts. One that I've run into
is using the strings `C++` and `C` as tags, both of which transform to
the slug `c`. This commit adds an optional `SLUG_SUBSTITUTIONS` setting
which is a list of 2-tuples of substitutions to be carried out
case-insensitively just prior to stripping out non-alphanumeric
characters. This allows cases like `C++` to be transformed to `CPP` or
similar. This can also improve the readability of slugs.
2013-07-04 12:17:21 +01:00
Justin Mayer
7ec4d5faa2 Merge pull request #880 from joeshaw/pre-index-fix
Exception on WP import looking for <pre> tag
2013-06-29 08:02:27 -07:00
Justin Mayer
ddb6d89be3 Document how to stop generation of certain pages
The documentation doesn't make it very clear how to prevent certain
pages from being generated, such as the Authors, Tags, and Categories
collection pages. This change makes it slightly more obvious how to
prevent these pages from being generated. Fixes #940.
2013-06-28 19:59:00 -07:00
Andrew Ma
bed53d1c0b Updating unit tests 2013-06-28 15:09:36 -07:00
Andrew Ma
298151237e Adding stackoverflow to social icons 2013-07-03 22:36:52 -07:00
Justin Mayer
1448db9603 Merge pull request #951 from dbrgn/document_tags_save_as
More explicit settings docs concerning list templates
2013-06-27 19:16:50 -07:00
Danilo Bargen
931d571606 More explicit settings docs concerning list templates
I think the author list and tag list are so common that they should be
listed explicitly in the settings.
2013-06-28 00:55:22 +02:00
Justin Mayer
5c70e2bcb1 Merge pull request #948 from justinmayer/make-clean
Remove "clean" task from "make html"; revert "make clean" behavior to "rm -rf"
2013-06-26 17:08:19 -07:00
Justin Mayer
5d000ca290 Add more missing -s flags to tips doc page 2013-06-26 06:39:09 -07:00
bas smit
0d63b4520a Add info about debugging to the help output of the makefile 2013-06-26 14:01:01 +02:00
bas smit
12fd53c27e Add debug target to the template makefile
If the DEBUG variable is set (e.g. DEBUG=1 make target) debugging will
be enabled by using pelicans -D flag.
2013-06-26 14:00:45 +02:00
Justin Mayer
7d37cfa748 Missing -s flag added to command on tips doc page 2013-06-25 19:17:40 -07:00
Justin Mayer
d2ef893b72 Merge pull request #944 from justinmayer/vcs-data
Keep certain files when cleaning output; fix #574
2013-06-25 19:12:57 -07:00
Justin Mayer
6f36b0a246 Keep certain files when cleaning output; fix #574
If DELETE_OUTPUT_DIRECTORY is set to True, all files and directories are
deleted from the output directory. There are, however, several reasons
one might want to retain certain files/directories and avoid their
deletion from the output directory. One such use case is version control
system data: a versioned output directory can facilitate deployment via
Heroku and/or allow the user to easily revert to a prior version of the
site without having to rely on regeneration via Pelican.

This change introduces the OUTPUT_RETENTION setting, a tuple of
filenames that will be preserved when the clean_output_dir function in
pelican.utils is run. Setting OUTPUT_RETENTION = (".hg", ".git") would,
for example, prevent the relevant VCS data from being deleted when the
output directory is cleaned.
2013-06-25 19:03:32 -07:00
Justin Mayer
bf0a50880d Revert "make clean" behavior to rm -rf. Fixes #773
The change to the "make clean" task in 764a2cf from "rm -rf" to instead
relying on GNU "find" appears to have broken cross-platform portability,
likely causing problems on *BSD and other platforms. This commit reverts
that change back to the previous "rm -rf" behavior.
2013-06-24 13:40:32 -07:00
Justin Mayer
e9fec3b1dc Remove "clean" task from "make html"; fixes #637
This change removes the "clean" task from the "html" and "regenerate"
tasks in the default Makefile generated by pelican-quickstart. The
previous behavior ignored whether the DELETE_OUTPUT_DIRECTORY
setting was set to True or not and deleted everything in the output
directory every time the "make html" or "make regenerate" task was run.
In addition to violating the Principle of Least Astonishment, there was
also the potential for data loss if the user wasn't careful when
defining the output directory location in the Makefile.

The new behavior therefore relies primarily on the
DELETE_OUTPUT_DIRECTORY setting to control if and when the output
directory is cleaned. The default settings and Makefile generated by the
pelican-quickstart command, for example, no longer clean the output
directory when the "make html" task is run. If the user wants to change
this behavior and have the output directory cleaned on every "make html"
run, the recommended method would be to set DELETE_OUTPUT_DIRECTORY to
True in pelicanconf.py. Alternatively, the user can manually run "make
clean", with the caveat that the output directory and its contents will
be entirely destroyed, including any otherwise to-be-retained files or
folders specified in the OUTPUT_RETENTION setting. It is for that reason
that relying on the DELETE_OUTPUT_DIRECTORY setting is instead
recommended.

As before, DELETE_OUTPUT_DIRECTORY is set to True in the publishconf.py
settings file generated by the pelican-quickstart script. This way, any
potentially old and irrelevant files will be automatically removed
before the latest version of the site is transferred to the production
server environment.

In summary, this change allows for the sanest possible default settings,
while still allowing end users to customize output cleaning to their
preferred behavior with a minimum of confusion.
2013-06-24 13:05:00 -07:00
Justin Mayer
dd9f55c8bb Clean up minor text formatting, spelling, grammar 2013-06-22 12:28:37 -07:00
Alexis Metaireau
4a204f19c9 Merge pull request #936 from dbrgn/isinstance_iterable
Better duck typing in isinstance check
2013-06-19 15:33:04 -07:00
Danilo Bargen
d8c9fb31d0 Better duck typing in isinstance check 2013-06-20 00:13:57 +02:00
Justin Mayer
2188f4de68 Merge pull request #898 from saimn/fix-markup-cli
Ensure that markup is a tuple.
2013-06-19 06:51:59 -07:00
Alexis Metaireau
4f444ee6a8 Merge pull request #934 from wking/generator-init-kwargs
Use keyword arguments to initialize Generators
2013-06-19 00:57:50 -07:00
Kyle Machulis
39dd4a0255 Changed meta tag "contents" attribute to "content", to conform to HTML spec. Fixes #918 2013-06-16 10:56:50 -07:00
W. Trevor King
12dd35ef36 generators: Remove wonky argument handling from Generator.__init__ 2013-06-16 13:31:16 -04:00
W. Trevor King
6e527e7416 test_generators: Use keyword arguments to initialize Generators 2013-06-16 13:30:59 -04:00
W. Trevor King
0d1866b393 Pelican.run: Use keyword arguments when initializing generators
This makes it easier to add new arguments to Generator subclasses.
2013-06-16 12:15:26 -04:00
Justin Mayer
8f295f7a03 PyPI now has CDN; Travis shouldn't use mirrors
Now that PyPI utilizes a CDN, the "--use-mirrors" setting slows down the
install process and has essentially been deprecated.
2013-06-16 08:53:45 -07:00
Justin Mayer
a650dd9d64 Merge pull request #933 from wking/no-static-for-pictures
samples: Remove EXTRA_PATH_METADATA entries for pictures
2013-06-16 08:38:23 -07:00
W. Trevor King
0dee76f259 samples: Remove EXTRA_PATH_METADATA entries for pictures
I'd added them earlier to test that a configuration edit could
preserve the original output locations.  However, it is likely that
you have quite a number of static files, and we shouldn't recommend
listing explicit paths for all of them.  With this configuration
change, the pictures will be copied into the output directory using
their original relative path (e.g. `pictures/Fat_Cat.jpg` without the
`static`).  Any |filename|-style links will be updated automatically.

If you *want* the pictures to end up in a `static` directory, it's
easier to just organize your source that way.
2013-06-15 20:52:16 -04:00
Justin Mayer
dfb29b5388 Update changelog 2013-06-15 12:24:48 -07:00
Justin Mayer
5d9b3d7777 Merge pull request #795 from wking/read-file
Generate context objects in read_file()
2013-06-15 11:54:32 -07:00
Justin Mayer
6fcb6d3766 Merge pull request #928 from wking/iso-8601
utils: Add some ISO 8601 forms to get_date()
2013-06-14 08:27:37 -07:00
W. Trevor King
180cf9165f settings: Fix deprecation warning in configure_settings()
The broken code came from my 1d4d86c (settings: Rework the
LESS_GENERATOR removal warning for easy extension, 2013-03-24), where
I put formatting placeholders ({}) into the warning message, but
forgot to fill them in :/.
2013-06-13 21:18:57 -04:00
W. Trevor King
9b42b2a130 generators: get_files() should use paths relative to Generator.path
All paths should be relative to Generator.path unless we're actively
accessing the filesystem.  This makes the argument less ambiguous, so
we have less likelyhood of joining paths multiple times.
2013-06-12 17:37:22 -04:00
W. Trevor King
ce0a9b697e Document path metadata extraction 2013-06-12 17:37:22 -04:00
W. Trevor King
8797f0ebef docs/plugins.rst: Document signal name changes 2013-06-12 17:37:21 -04:00
W. Trevor King
38c22e83b6 readers: Ensure the reader class is enabled before instantiating
Otherwise the MarkdownReader fails with:

  'bool' object is not callable

if Markdown is not installed.

Reported-by: Deniz Turgut <dturgut@gmail.com>
2013-06-12 17:37:21 -04:00
W. Trevor King
4058cfdea4 settings: Add a warning for folks using FILES_TO_COPY. 2013-06-12 17:37:21 -04:00
W. Trevor King
29f0aa39d2 content: Don't update static content 2013-06-12 17:37:21 -04:00
W. Trevor King
fdde17281d contents: Page fallbacks for context and localsiteurl 2013-06-12 17:37:21 -04:00
W. Trevor King
f63325aa9a test_generators: Replace CUR_DIR with CONTENT_DIR for subdir cat. detection
In situations where I've cleared ARTICLE_DIR, I've done so to ensure
that there are no directories that will override the DEFAULT_CATEGORY
due to USE_FOLDER_AS_CATEGORY.
2013-06-12 17:36:01 -04:00
W. Trevor King
06121eda76 test_readers: Update to new readers.read_file 2013-06-12 15:02:31 -04:00
W. Trevor King
7de7bd0e37 Update sample configurations from FILES_TO_COPY to EXTRA_PATH_METADATA 2013-06-12 15:02:31 -04:00
W. Trevor King
d43dc1b9d6 Add the EXTRA_PATH_METADATA setting
Useful for altering static output paths when you don't want to encode
extra metadata in the static file's source path.
2013-06-12 15:02:31 -04:00
W. Trevor King
1ca0e06a27 Remove the FILES_TO_COPY setting
We no longer instantiate the Static object in the StaticGenerator, so
we can't set the save_as argument anymore.  If you want to adjust the
output path, use the upcoming EXTRA_PATH_METADATA setting.
2013-06-12 15:02:31 -04:00
W. Trevor King
1bc5b100ec generators: Convert StaticGenerator to use the new read_file 2013-06-12 15:02:31 -04:00
W. Trevor King
7be16dd524 generators: Update PagesGenerator to use new read_file
Also standardize signal names.  If `article_generator_*` is singular,
`page_generator_*` should be as well.  Fix it from the older
`pages_generator_*`.
2013-06-12 15:02:31 -04:00
W. Trevor King
a9c530281e Move Article metadata extraction from generators to readers
There's no reason why this information should be Article-specific.

This commit breaks the other generators for the moment.  I'll fix them
shortly.
2013-06-12 15:02:30 -04:00
W. Trevor King
f2d6f77462 signals: Fix *_generate_* signals -> *_generator_*
For example, article_generate_preread is now article_generator_preread
for consistency with the other preread and context signals.
2013-06-12 15:02:30 -04:00
W. Trevor King
386cd1f3f0 signals: Add missing signals
Note that the `pages_*` names are plural , while the `article_*` names
are singular.  I'll fix this once I update the PagesGenerator.
2013-06-12 15:02:30 -04:00
W. Trevor King
effe7e5e12 signals: Sort signals into categories 2013-06-12 15:02:30 -04:00
W. Trevor King
e38e170656 readers: Log signal sending for read_file() 2013-06-12 15:02:30 -04:00
W. Trevor King
4e118eff01 readers: Add debugging logging to read_file 2013-06-12 15:02:30 -04:00
W. Trevor King
ecf5682930 readers: Instrument read_file to return Content objects
The assorted generators all use read_file() to read in the file
contents and metadata.  Previously, they sometimes parse additional
metadata, fire off signals, and initialize a pelican.contents.Content
subclass on their own.  We can reduce duplicated code and increase
consistency by shifting all that stuff into read_file() itself, and
this commit is a step in that direction.
2013-06-12 15:02:29 -04:00
Justin Mayer
ed82f62a5a Merge pull request #930 from wking/specific-assertions
tests: Avoid hidden logic with better .assert*() method choices
2013-06-12 12:01:41 -07:00
W. Trevor King
5a61600bc9 tests: Avoid hidden logic with better .assert*() method choices
We'll get better failure messages if we use an assertion method that
understands the comparison we're trying to make.  If you make the
comparison by hand and assertTrue(), you don't get much constructive
feedback ;).
2013-06-12 14:52:23 -04:00
W. Trevor King
1102143c33 utils: Use pytz instead of datetime.timezone for timezones
datetime.timezone is new in Python 3.2 [1], so pytz allows us to keep
support for Python 2.7.

[1]: http://docs.python.org/dev/library/datetime.html#datetime.timezone
2013-06-11 22:54:01 -04:00
W. Trevor King
228fc82fc9 utils: Add some ISO 8601 forms to get_date()
Support the forms listed by the W3C [1].  I also removed the
'%Y-%d-%m' form, which can be confused with the '%Y-%m-%d' ISO form.
The new ISO forms can use 'Z' to designate UTC or '[+-]HHMM' to
specify offsets from UTC.  Other time zone designators are not
supported.

The '%z' directive has only been supported since Python 3.2 [2], so if
you're running Pelican on Python 2.7, you're stuck with 'Z' for UTC.
Conveniently, we get ValueErrors for both invalid directives and
data/format missmatches, so we don't need special handling for the 2.7
case inside get_date().

[1]: http://www.w3.org/TR/NOTE-datetime
[2]: http://bugs.python.org/issue6641
2013-06-11 22:53:21 -04:00
Justin Mayer
1fcf4a6550 Add documentation for ARCHIVES_SAVE_AS setting
While this setting has existed for some time, there does not seem to
have been any documentation for it until now.
2013-06-10 19:42:53 -07:00
Justin Mayer
e5f1755172 Merge pull request #924 from rptb1/add-missing-lxml-to-tox
Added lxml to the list of dependencies for the tox tests.
2013-06-09 09:37:39 -07:00
Richard Brooksby
edcc027d89 Added lxml to the list of dependencies for the tox tests.
My system python installs are completely clean except for virtualenv, so tox needs a complete set of non-default modules.
2013-06-08 23:40:16 +01:00
Alexis Métaireau
cc15629966 Don't include all the .py files in the root folder 2013-06-07 00:50:51 +02:00
Justin Mayer
15606f8dea Merge pull request #905 from Rogdham/pelican-quickstart_encoding
Encoding issue in pelican-quickstart. Fixes #904
2013-06-03 18:12:55 -07:00
Alexis Metaireau
e91b53be87 Merge pull request #922 from alefteris/docs-install-deps
Docs: Add six, markupsafe to install dependencies
2013-06-03 09:58:41 -07:00
Thanos Lefteris
ba3e14dd1d Docs: Add six, markupsafe to install dependencies 2013-06-03 18:23:07 +03:00
Justin Mayer
07b8c13db3 Merge pull request #921 from wking/default-settings
Standardize `DEFAULT_CONFIG` handling
2013-06-02 18:47:33 -07:00
Simon Conseil
3f91165f09 Ensure that markup is a tuple.
`self.markup` is a list when using the `-m|--markup` cli option, but testing the
extension with `endswith` works only with tuples.
2013-06-02 22:49:16 +02:00
W. Trevor King
8ff34e6c5d Replace settings.get(key) with settings[key] for default settings
If a setting exists in DEFAULT_CONFIG, assume it will be there
(instead of checking and/or providing a local default).  The earlier
code was split between the two idioms, which was confusing.
2013-06-02 14:24:27 -04:00
W. Trevor King
c8e7d95b34 tests.support: Use kwargs overrides in get_settings()
This avoids harcoding test-specific overrides, and makes it easy to
setup a settings dictionary based on DEFAULT_CONFIG for testing.
Because you can trust Pelican to use settings based on DEFAULT_CONFIG,
you are free to go about using:

  settings[my_key]

instead of:

  settings.get(my_key, some_fallback)

or:

  if my_key in settings:
      ...

if you know that `my_key` is in DEFAULT_CONFIG.
2013-06-02 14:24:27 -04:00
W. Trevor King
8511915294 settings: Cleanup configure_settings() (standardization & types)
This pulls out some general patterns to make it easier to apply
existing processing to new settings.
2013-06-02 13:32:10 -04:00
W. Trevor King
1d4d86c876 settings: Rework the LESS_GENERATOR removal warning for easy extension
Setting migration is something that will happen for multiple settings,
and the more we can standardize the reporting procedure, the easier it
will be to add new warnings.
2013-06-02 13:32:10 -04:00
W. Trevor King
e9dc1dd478 settings: Make DEFAULT_CONFIG public
This dictionary is accessed by plugins (like `summary`) which add new
settings, so it should be public (i.e. no prefixed underscore).

The changed name length would have led to a re-indenting of the
default contents anyway, so I shifted them all to four spaces.
2013-06-02 13:32:10 -04:00
W. Trevor King
c6de4430a0 tests/test_readers.py: Remove redundant 'expected' check in AdReaderTest
AdReaderTest.test_article_with_asc_extension() has had duplicate
checks on the expected metadata since it was created by 49f481e3 (Add
asciidoc reader support, 2013-10-28).  This commit removes the
duplicate entry.
2013-06-02 09:58:27 -07:00
Justin Mayer
a81c50ff55 Merge pull request #907 from saimn/py3k
Drop python 3.2 support and move to python 3.3
2013-06-02 09:34:31 -07:00
Simon Conseil
7057d3742b Drop python 3.2 support and move to python 3.3.
Jinja 2.7 (released 2013-05-20) supports only Python3 >=3.3 so it is time to
drop Python 3.2 and move to 3.3
2013-06-02 16:23:36 +02:00
Simon Conseil
427a5ca3c3 Include feeds and mkd files in the dist package.
This files are needed to run the tests.
2013-06-02 16:22:32 +02:00
Simon Conseil
fd018d7ceb Update tests output with feedgenerator 1.6
feedgenerator 1.6 includes a change to write feed attributes in a consistent
order between py2.7 and py3.3.
2013-06-02 16:21:10 +02:00
Simon Conseil
529d0d99c5 Update version requirement with feedgenerator 1.6
feedgenerator 1.6 changes the order of attributes in feeds, so we must use this
version to have consistent functionnal tests.
2013-06-02 16:21:10 +02:00
Simon Conseil
2bf91e54cd Tox: use git urls for py3 versions of smartypants and typogrify
+ This make it easier to use tox with py3: no need to checkout manually
  typogrify and smartypants repos and use tox's distshare.
+ Remove feedgenerator as it is already a dependy for pelican.
2013-06-02 16:17:35 +02:00
Chris Brannon
f8cf685c30 Use the builtin "open" on Python 3. 2013-05-27 14:49:57 +10:00
Rogdham
0ecae1f50d Encoding issue in pelican-quickstart. Fixes #904 2013-05-26 11:38:55 +01:00
Dominique Plante
7a3bc410d0 Add test for the case where we try to read a file with an unhandled extension 2013-05-23 21:53:46 -07:00
Alexis Métaireau
675d6c81cd Include the md / rst files in the dist 2013-05-19 22:28:53 +10:00
Justin Mayer
e999918cd1 Merge pull request #891 from mrshu/patch-1
Updated pelican.server not started error message.
2013-05-18 15:38:09 -07:00
Dominique Plante
6c9d158609 makes Pelican-quickstart debuggable in PyCharm 2013-05-18 06:33:49 -07:00
mr.Shu
2856f49b3a Updated pelican.server not started error message. 2013-05-18 08:20:50 +02:00
Justin Mayer
33653f2864 Merge pull request #890 from dominiqueplante/pep8-content
adhere to pep8
2013-05-16 06:03:36 -07:00
Dominique Plante
7024fe1192 adhere to pep8 2013-05-15 22:18:35 -07:00
Kyle Fuller
ee752d9b66 Merge pull request #888 from dominiqueplante/pep8-setup
adhere to PEP8 coding standards
2013-05-15 03:47:27 -07:00
Dominique Plante
19de7539f4 adhere to PEP8 coding standards 2013-05-14 23:41:18 -07:00
Justin Mayer
8c47ab21ec Merge pull request #881 from ben2367/patch-1
Update importer documentation
2013-05-14 11:36:14 -07:00
Justin Mayer
71150430a9 Merge pull request #885 from avaris/markdown-summary-footnote
Markdown summary should not include content footnote
2013-05-13 15:36:39 -07:00
Alexis Metaireau
86d4aac918 Merge pull request #864 from saimn/docutils_options
Add `DOCUTILS_SETTINGS` to allow to customize the docutils Publisher.
2013-05-13 00:21:12 -07:00
Alexis Metaireau
55382dd184 Merge pull request #858 from jmurty/feature/import_wp_pages
Import wordpress pages to pages/ subdir with --dir-page option
2013-05-13 00:18:01 -07:00
Alexis Metaireau
dcc17bbfa4 Merge pull request #848 from Rogdham/no_overwrite
Check URL overwrite. Fixes #446.
2013-05-13 00:17:26 -07:00
Alexis Métaireau
ead50cca62 some cleanup 2013-05-13 13:53:52 +10:00
Alexis Metaireau
bcfd574664 Merge pull request #804 from dowlingw/master
#803 - Include default configuration file if present
2013-05-12 20:50:31 -07:00
Deniz Turgut
75f214103e Markdown summary should not include content footnote
Markdown instance carries state for subsequent uses. Content
and summary parsing is done with the same instance. Since
footnotes are processed with an extension and stored as state,
content footnote is duplicated for summary.

This PR adds a ``.reset()`` call before summary parsing to clear
the state. It also adds a test case with footnotes.
2013-05-10 03:50:33 -04:00
ben2367
fa1550ceaa Update importer documentation
Dependencies were not the good one, wordpress importer needs BeautifulSoup4 and lxml
2013-05-09 04:07:17 +02:00
Joe Shaw
5fa3504ad0 use string find() instead of index(). Fixes #880.
We're expecting a non-match to return -1, which is what find() does,
but index() instead throws a ValueError.
2013-05-08 09:41:55 -04:00
Justin Mayer
e9ca508e8e Add more detail to Pygments FAQ entry. Fixes #821 2013-05-06 07:28:25 -07:00
Justin Mayer
43f4d0df7a Add reST example to arbitrary metadata FAQ entry 2013-05-06 06:51:54 -07:00
Justin Mayer
2482baf837 Merge pull request #874 from avaris/non-ascii-error
Handle critical exception logging correctly in localized systems
2013-05-04 08:35:01 -07:00
Deniz Turgut
084818b399 Handle critical exception logging correctly in localized systems
Python generates certain exception messages (like IOError) in system
language, if locale is set. This ensures that the message is properly
converted to unicode in Python 2.
2013-05-04 04:55:42 -04:00
Justin Mayer
50505dfd71 Merge pull request #845 from Rogdham/case-insensitive_caterogy_tag
Make tags and cats case insensitive. Fixes #704.
2013-05-03 10:27:46 -07:00
Rogdham
91337940d3 Make tags and cats case insensitive. Fixes #704.
More precisely, group tags or categories without considering the case.
This fixes the bug where two categories with just the case as difference were
considered as distinct, but generate the same file: one overwriting the other.

Thanks to @Avaris for helping with the tests.
2013-05-03 17:37:45 +01:00
Justin Mayer
34f05d4ba6 Add warning to docs re: DELETE_OUTPUT_DIRECTORY 2013-05-02 17:18:19 -07:00
Justin Mayer
7706530aa8 Merge pull request #867 from avaris/summary-max-length
Fixes #708 SUMMARY_MAX_LENGTH=0 should return empty string
2013-05-01 16:54:49 -07:00
Deniz Turgut
9af62414db Fixes #708 SUMMARY_MAX_LENGTH=0 should return empty string 2013-04-26 19:37:31 -04:00
Justin Mayer
0397274fed Prepare for next version 2013-04-24 13:21:28 -07:00
Justin Mayer
ba84658503 Add 3.2 release date to changelog 2013-04-24 09:39:36 -07:00
Justin Mayer
4fa2c30d3f Add new changelog items and link to Tutorials wiki 2013-04-23 11:17:45 -07:00
Justin Mayer
63ddcf22d9 Add new contributors to THANKS 2013-04-23 08:09:50 -07:00
Justin Mayer
6db2ad2130 Remove "Done" after running "make html"
Pelican now provides better user feedback (see #857), so echoing "Done"
after a "make html" run has become redundant.
2013-04-23 07:32:42 -07:00
Justin Mayer
f15f5708bf Update test output for improved notmyidea <head> 2013-04-23 06:57:36 -07:00
Simon Conseil
4d2355bc57 Clean up and improve <head> of notmyidea theme
- remove useless IE stuff (links to files that do not exist)
- use DEFAULT_LANG for the lang attribute
- move charset at the top
2013-04-23 06:51:22 -07:00
Simon Conseil
5ffadd2283 Add DOCUTILS_SETTINGS to allow to customize the docutils Publisher. 2013-04-23 12:28:30 +02:00
Justin Mayer
30c2490f88 Merge pull request #862 from avaris/emacs-autoreload
ignore emacs lock files and exception handling for watchers
2013-04-22 20:04:24 -07:00
Justin Mayer
be511c9ac2 Merge pull request #860 from avaris/strftime-jinja-filter
Fix for #701: adds a 'strftime' jinja fiter that uses LOCALE
2013-04-22 20:01:27 -07:00
Deniz Turgut
be8837963a ignore emacs lock files and exception handling for watchers 2013-04-22 20:50:11 -04:00
Deniz Turgut
09a332aff3 reset locale after DateFormatter test 2013-04-22 20:07:53 -04:00
Deniz Turgut
f3340c1152 added FR and TR locale generation to travis 2013-04-22 20:00:27 -04:00
Deniz Turgut
62a9b05595 added tests for DateFormatter 2013-04-22 19:54:52 -04:00
Justin Mayer
740bb46e6d MOAR Unicode for generated settings files 2013-04-21 15:18:31 -07:00
Justin Mayer
d59a59dc83 Unicode all the things, incl. our settings files 2013-04-21 15:00:40 -07:00
Deniz Turgut
2790446906 adds a 'strftime' jinja fiter that uses LOCALE 2013-04-21 18:00:12 -04:00
Justin Mayer
70a72545ce Add content_object_init to list of signals 2013-04-20 09:08:46 -07:00
Justin Mayer
bdd702384f Improve wording of "cannot find" errors 2013-04-20 08:08:31 -07:00
Justin Mayer
b5e77a0643 Merge pull request #855 from lilix/accept-mdown-file-extension
Accept `mdown` file extension for Markdown files.
2013-04-20 08:02:28 -07:00
Justin Mayer
e55878fc2e Merge pull request #857 from avaris/feedback
add feedback to user and refactor 'autoreload' code
2013-04-20 07:57:56 -07:00
Deniz Turgut
e86f4eedcf bugfix and tests for no settings path (no -s option) 2013-04-19 23:35:09 -04:00
Justin Mayer
13eeb9043a Merge pull request #856 from avaris/non-ascii-path
force argparse output to be unicode in Py2
2013-04-19 17:39:04 -07:00
James Murty
8c7ea8df98 Import wordpress pages to pages/ subdir with --dir-page option
When importing from Wordpress, the --dir-page directive (disabled by
default) automatically adds files to the pages/ when they are recognised
as pages, as opposed to posts.
2013-04-19 23:06:59 +01:00
Justin Mayer
870ec0efe8 Fix outdated link to documentation 2013-04-19 11:12:20 -07:00
Deniz Turgut
5ccbbcc7d1 add feedback to user and refactor 'autoreload' code 2013-04-19 13:35:20 -04:00
Deniz Turgut
a07052ff86 force argparse output to be unicode in Py2 2013-04-18 15:03:43 -04:00
Emily Strickland
08f27e0134 Accept mdown file extension for Markdown files.
This extension is sometimes used for Markdown files and is the default
for a few editors, such as Sublime Text.
2013-04-17 21:14:52 -07:00
Justin Mayer
e03e17bc12 Merge pull request #853 from Rogdham/better-strftime
refactored utils.strftime
2013-04-17 15:12:13 -07:00
Rogdham
d83af30195 Add French version for testing utils.strftime
Do not use abbreviated locale versions of month/whatever, because it seems that
this is not standard (e.g. MacOS abbreviating differently than GNU/Linux).
2013-04-17 22:17:35 +01:00
Justin Mayer
723db1cd7a Merge pull request #854 from Rogdham/strftime-bugfix
Fix bug with MacOS in utils.strftime
2013-04-17 13:41:39 -07:00
Rogdham
3aea29fb2b Fix bug with MacOS in utils.strftime
Force using C89 directives (i.e. mentioned in the Python documentation).
2013-04-17 21:24:45 +01:00
Justin Mayer
598cbeb3be Merge pull request #852 from vene/docfix
DOC: fix the Markdown example for static index page URL override
2013-04-17 09:35:55 -07:00
Justin Mayer
e7370945c9 Merge pull request #851 from avaris/better-strftime
refactored utils.strftime
2013-04-17 09:31:19 -07:00
Vlad Niculae
cdcfdf4605 DOC: fix the Markdown example for static index page URL override 2013-04-17 17:28:36 +09:00
Justin Mayer
bef5e4479e Getting Started documentation overhaul 2013-04-16 19:45:46 -07:00
Deniz Turgut
48f7132ba8 refactored utils.strftime 2013-04-16 20:53:27 -04:00
Justin Mayer
8be7c0dbae Minor documentation improvements 2013-04-16 10:13:47 -07:00
Justin Mayer
7b0165696e Clarify docs regarding pages. Fixes #847. 2013-04-14 15:08:32 -07:00
Justin Mayer
de120aefb4 Merge pull request #846 from Rogdham/output_sources_translations
Output sources for translations as well.
2013-04-14 14:43:46 -07:00
Justin Mayer
1c4a83e1ad Merge pull request #844 from Rogdham/pelican-import_invalid_characters
Do not generate invalid filenames. Fixes #814.
2013-04-14 14:43:13 -07:00
Rogdham
ec8e257fde Output sources for translations as well. 2013-04-14 22:19:57 +01:00
Justin Mayer
907bdd4d46 Merge pull request #849 from avaris/plugin-path-unicode
__import__ fails for unicode 'fromlist' in Py2.x
2013-04-14 14:18:56 -07:00
Deniz Turgut
a3e8a2d18d __import__ fails for unicode 'fromlist' in Py2.x 2013-04-14 17:03:19 -04:00
Rogdham
ff7410ce2a Check URL overwrite. Fixes #446.
Check that template-generated files don't overwrite each other. Log a critical
message otherwise, and exit with non-zero status.
2013-04-14 20:39:04 +01:00
Rogdham
73ca6a1316 Add non unique slug warnings for translations 2013-04-14 20:39:04 +01:00
Justin Mayer
ebee8e9b43 Update FAQ and changelog 2013-04-14 09:41:27 -07:00
Justin Mayer
a2a3f5a393 Minor improvements to contributing guidelines 2013-04-14 07:57:13 -07:00
Rogdham
b2aabdc02b Do not generate invalid filenames. Fixes #814.
Turn invalid characters into underscores, remove leading dots and enforce
a maximum length. Should be fine on main file systems used by Windows, Mac OS
and Linux.
Thanks to @Avaris for helping to clean my code.
2013-04-14 13:20:16 +01:00
Justin Mayer
a6167f64f1 Add CONTRIBUTING file; include in contribute.rst
GitHub recently added a feature that looks for a CONTRIBUTING file in
repo root and displays it whenever a user creates an issue or submits a
pull request. I took this opportunity to put some contribution
submission guidelines into that file, including it dynamically inside
our existing docs/contribute.rst file to eliminate unnecessary
redundancy.
2013-04-13 16:55:13 -07:00
Justin Mayer
f139a04374 Merge pull request #843 from saimn/cleanup-tox
Cleanup tox and remove mentions of webassets.
2013-04-13 16:45:24 -07:00
Simon Conseil
40643ce554 Cleanup tox and remove mentions of webassets.
Nose and unittest2 have been removed from pelican's dependencies, and webassets
moved to pelican-plugins.
2013-04-14 00:36:29 +02:00
Justin Mayer
87735b5215 Merge pull request #842 from avaris/remove-unittest2
remove unittest2 and fix various warnings in py3
2013-04-13 14:23:38 -07:00
Justin Mayer
5554668d37 Merge pull request #841 from Rogdham/pelican-import_wp_no-title
Warn user in case of missing title. Fixes #440.
2013-04-13 14:10:00 -07:00
Deniz Turgut
68921fe94d remove warning for FEED_DOMAIN when SITEURL undefined 2013-04-13 17:07:48 -04:00
Deniz Turgut
bc4bd773a0 remove unittest2 and fix various warnings in py3 2013-04-13 16:36:05 -04:00
Rogdham
a4c16e1b53 Warn user in case of missing title. Fixes #440.
When a WP XML file is imported, items with missing title are generated with a
title which is probably not the good one (instead of being dropped), and a
warning is displayed to the user.
2013-04-13 20:44:18 +01:00
Justin Mayer
091007ddf7 Add contributors to THANKS. Minor language edits. 2013-04-12 21:47:54 -07:00
Justin Mayer
8c907a4cc2 Merge pull request #840 from avaris/move-plugins
remove plugins, update docs and adjust dependencies
2013-04-12 21:33:40 -07:00
Deniz Turgut
c4b3ad58e8 remove plugins, update docs and update dependecies 2013-04-12 23:39:39 -04:00
Justin Mayer
886c8d649c Better defaults for quickstart settings files
Since feed generation is usually unnecessary during development (and can
produce potentially-confusing warnings when SITEURL is not set), running
"make html" will now skip feed generation by default. Feed generation
settings have been added to publishconf.py so feeds will be generated
when the site is published.

Also corrected some URLs in pelicanconf.py.
2013-04-12 08:48:42 -07:00
Justin Mayer
b0ca35279f Merge pull request #839 from wking/mailmap
.mailmap: Add mappings to consolidate author names and emails
2013-04-12 08:10:44 -07:00
W. Trevor King
cb509c1b70 .mailmap: Add mappings to consolidate author names and emails
See "MAPPING AUTHORS" in git-shortlog(1) for syntax details.

I don't think I've accidentally merged two distinct people together,
but I added

  Guillaume B <guitreize@gmail.com>

to avoid someone accidentally merging him into

  Guillaume <guillaume@lame.homelinux.com>

I'm pretty sure these are two different Guillaumes.
2013-04-12 10:51:48 -04:00
Justin Mayer
4687ae7f30 Merge pull request #837 from justinmayer/relativeoff
Change RELATIVE_URLS default to False - Fixes #829
2013-04-12 07:09:23 -07:00
Justin Mayer
ba41611d64 Merge pull request #838 from jimperio/master
Make relative URLs work on Windows.
2013-04-12 06:19:01 -07:00
unknown
8e254e8cd7 Fixed path_to_url when os.sep is not '/'. 2013-04-12 15:44:53 +08:00
Justin Mayer
0d7c3e1b0a Remove allusion to Python versions less than 2.7 2013-04-11 19:27:20 -07:00
Justin Mayer
7364f77c0c Document supported Python versions 2013-04-11 19:23:34 -07:00
Justin Mayer
0a8678a8ae Change RELATIVE_URLS default to False - Fixes #829 2013-04-11 16:12:55 -07:00
Justin Mayer
679d4aa801 Main CSS file uses tabs, not spaces 2013-04-10 17:14:19 -07:00
Justin Mayer
45dc17f41f Current default theme design is MIT licensed 2013-04-10 16:58:25 -07:00
Justin Mayer
0ac8118c46 Merge pull request #830 from Rogdham/translation_metadata
Add translation metadata support.
2013-04-09 16:28:38 -07:00
Justin Mayer
d0489758ad Minor English grammar correction 2013-04-07 14:43:07 -07:00
Rogdham
eb640b09e6 Add translation metadata support.
Allows user to control which posts are the translations independently of the
DEFAULT_LANG setting.
2013-04-06 18:36:37 +01:00
Justin Mayer
e14a658672 Merge pull request #828 from avaris/plugin-path
Fix for issue #428: Use PLUGIN_PATH properly
2013-04-05 09:12:37 -07:00
Deniz Turgut
c2924402ad Fix for issue #428: Use PLUGIN_PATH properly 2013-04-05 02:39:12 -04:00
Justin Mayer
ea6b240541 Merge pull request #825 from avaris/markdown-summary
fix for issue #761: handle unicode correctly in summary for Markdown
2013-04-03 16:59:40 -07:00
Deniz Turgut
0548b62441 fix for issue #761: handle unicode correctly in summary for Markdown 2013-04-03 19:38:42 -04:00
Justin Mayer
ea6f0d8bef Merge pull request #824 from avaris/markdown-css
unify css class for pygments
2013-04-02 16:14:48 -07:00
Deniz Turgut
9936538d8b unify css class for pygments 2013-04-02 18:39:52 -04:00
Justin Mayer
6726e5f139 Merge pull request #578 from davidjb/display-categories-option
Add option to control displaying categories on menu
2013-04-01 07:32:45 -07:00
David Beitey
e042e11c23 Add new option for controlling whether to display categories on menu or not
Conflicts:
	docs/changelog.rst
	pelican/tests/output/basic/tag/bar.html
	pelican/tests/output/basic/tag/baz.html
	pelican/tests/output/basic/tag/foo.html
	pelican/tests/output/custom/tag/bar.html
	pelican/tests/output/custom/tag/baz.html
	pelican/tests/output/custom/tag/foo.html
2013-04-01 22:08:13 +10:00
Justin Mayer
f35206660b Merge pull request #811 from cdunklau/clean_up_tests
Nitpicking - tempdir naming, also backslashes are bad
2013-03-30 10:17:09 -07:00
Irfan Ahmad
58faf9462e Implement Posterous import - fixes #608 2013-03-29 09:10:27 -07:00
James King
999980c07c Added WordPress content decoding to importer 2013-03-28 07:16:01 -07:00
Justin Mayer
433ab37eb8 Merge pull request #807 from saimn/fix_webassets_tests
Fix webassets tests when running on a system with a different locale.
2013-03-28 06:39:44 -07:00
Justin Mayer
4cdd515f5b Merge pull request #819 from avaris/test-warning
Fixes issue #392
2013-03-28 06:27:05 -07:00
Deniz Turgut
ba200c30af Fix for issue #392 2013-03-27 18:17:11 -04:00
Justin Mayer
024ecb301e Merge pull request #813 from avaris/fix_related_posts
fixed related_posts plugin
2013-03-27 09:28:56 -07:00
Deniz Turgut
8710982d2a fixed related_posts plugin 2013-03-26 23:17:59 -04:00
Colin Dunklau
edbac49f2b Nitpicking - tempdir naming, also backslashes are bad
Tempdirs should have useful prefixes to aid in collecting information
    about failed tests.
Implicit concatenation is better than backslash line continuation.
2013-03-26 11:51:33 -05:00
Justin Mayer
54ffdf8ae5 Merge pull request #809 from cdunklau/clean_up_images
Nuked spurious ./tests directory
2013-03-26 09:39:45 -07:00
Justin Mayer
9d25710300 Merge pull request #810 from avaris/translations_in_tags
Fix for issue #219: tags should list only main articles, not translations
2013-03-26 09:35:30 -07:00
Simon Conseil
fad824ef5a Fix webassets tests when running on a system with a different locale. 2013-03-26 09:38:38 +01:00
Deniz Turgut
e6f3126ba6 Fix for issue #219: tags should list only main articles, not translations 2013-03-26 01:28:42 -04:00
Colin Dunklau
58f77012dd Nuked spurious ./tests directory
Only images, someone added a bit too much to the index
2013-03-26 00:13:30 -05:00
Will Dowling
de69739774 Fixing help text 2013-03-26 02:42:11 +00:00
Will Dowling
0d43017704 Adding information to argparse help 2013-03-26 10:37:37 +08:00
Justin Mayer
3dcfe1846c Remove multi_part plugin
As part of our continuing effort to move plugins their own repository,
this plugin was moved to the pelican-plugins repository.
2013-03-25 10:03:41 -07:00
Will Dowling
608e398386 Removing utils.file_exists and replacing with os.path.isfile 2013-03-25 10:45:43 +00:00
Will Dowling
b06fbd78cc Load a default-named configuration file if present 2013-03-25 10:39:22 +00:00
Irfan Ahmad
385a18563c Fixes #630 2013-03-23 20:16:31 -07:00
Alexis Métaireau
cb5f66ffe0 Check all lists are not strings. 2013-03-23 19:56:45 -07:00
Dave King
bd54cb1b88 Prevent people from setting STATIC_PATHS to a str
Previously you could accidentally set for example site/css and pelican would iterate through the string and attempt to copy '/' into your output.
2013-03-23 19:56:14 -07:00
Chenguang Wang
5e4622b229 make pelican-quickstart and the Makefile it generates support py3k. 2013-03-23 19:37:02 -07:00
Alexis Metaireau
5dbb8c3041 Merge pull request #775 from lexual/s3_support_for_quickstart
Added S3 support for pelican quickstart.
2013-03-23 19:16:39 -07:00
Alexis Metaireau
1b2e59756e Merge pull request #784 from idyedov/master
fix for #783
2013-03-23 19:15:05 -07:00
Justin Mayer
4bdb8a5d34 Merge pull request #799 from saimn/webassets_py3k
Install webassets & cssmin only for Python 2.
2013-03-23 08:18:12 -07:00
Simon
b69046f98d Install webassets & cssmin only for Python 2.
webassets is not py3 compatible yet. This will avoid a failed install of
webassets for each py3 Travis build.
2013-03-23 16:07:43 +01:00
Alexis Metaireau
932407f153 Merge pull request #780 from georgevreilly/master
Updated social icons
2013-03-22 00:40:03 -07:00
Alexis Metaireau
c1272bc69d Merge pull request #781 from fe-lix-/master
Getting an explicit error message on server creation
2013-03-22 00:38:20 -07:00
Alexis Metaireau
ff571967cf Merge pull request #790 from davidjb/raise-exceptions
Raise exceptions from the autoreload loop if debug is enabled
2013-03-22 00:34:10 -07:00
Alexis Metaireau
5894624e2e Merge pull request #792 from cdelston/master
Fix simple template article permalink in article page.
2013-03-22 00:32:44 -07:00
Justin Mayer
167128b1f2 Merge pull request #794 from wking/static-reader
Use the static format to read Static metadata
2013-03-21 11:26:22 -07:00
W. Trevor King
29cdb37af3 generators: Use the static format to read Static metadata
This cuts down on the remaining difference between static files and
articles/pages.  The main difference is that path-based metadata is
now parsed for static content.
2013-03-21 14:17:50 -04:00
W. Trevor King
f147d9ec4a readers: Add 'static' to the base Reader's extensions
Instead of just being a base class, we can use it to parse static
files.  It won't actually do any parsing, but we will get path
metadata extraction from read_file, and this will make the
StaticGenerator implementation simpler.
2013-03-21 13:03:54 -04:00
Justin Mayer
90822de962 Merge pull request #768 from wking/path-handling-cleanup
Cleanup path handling (os.path.join and more)
2013-03-21 09:58:12 -07:00
W. Trevor King
ae4fc5a25e utils: Add path_to_url() and generalize get_relative_path()
The old get_relative_path() implementation assumed os.sep == '/',
which doesn't hold on MS Windows.  The new implementation uses
split_all() for a more general component count.

I added path_to_url(), because the:

  '/'.join(split_all(path))

idiom was showing up in a number of cases, and it's easier to
understand what's going on when that reads:

  path_to_url(path)

This will fix a number of places where I think paths and URLs were
conflated, and should improve MS Windows support.
2013-03-21 12:44:44 -04:00
W. Trevor King
b59da89e80 Convert '.' and '..' to the less magical os.curdir and os.pardir
While I'm cleaning up path manipulation, I might as well make things
more semantic.
2013-03-21 12:44:44 -04:00
W. Trevor King
a5c1fdac58 settings: Use splitext to remove extensions, not rpartition 2013-03-21 12:44:44 -04:00
W. Trevor King
e5e455e0e5 Replace os.sep.join with the more robust os.path.join
From the Python docs for os.sep [1]:

  Note that knowing this is not sufficient to be able to parse or
  concatenate pathnames - use os.path.split() and os.path.join()...

Where I touched a line, I also changed double quoted string literals
to single quotes, since they are used more often in the source:

  wking@mjolnir ~/src/pelican $ git grep "'" pelican/*.py | wc -l
  683
  wking@mjolnir ~/src/pelican $ git grep '"' pelican/*.py | wc -l
  181

[1]: http://docs.python.org/3/library/os.html#os.sep
2013-03-21 11:38:14 -04:00
Justin Mayer
4e5454912f Merge pull request #791 from wraithan/add_some_help
Add help directly to publishconf.py
2013-03-21 05:09:02 -07:00
Chris Elston
173e17d992 Simple theme article permalink missing SITEURL
This change modifies the simple template so that the SITEURL
prefix is added to the article permalink found within the article
page itself.
2013-03-21 11:28:06 +00:00
Wraithan (Chris McDonald)
5fcb18ea60 Add help directly to publishconf.py 2013-03-21 03:33:32 -07:00
David Beitey
1ff16f248b Raise exceptions from the autoreload loop if debug is enabled 2013-03-21 15:52:42 +10:00
Justin Mayer
c7f06b9af6 Merge pull request #786 from noirbizarre/more-documentation
Add missing documentation for JINJA_FILTERS and SITESUBTITLE
2013-03-20 13:29:13 -07:00
Axel Haustant
e235cadda4 Fix typos 2013-03-20 21:21:47 +01:00
Justin Mayer
439b783a72 Merge pull request #785 from wraithan/docs_for_ignore_files
documentation for IGNORE_FILES
2013-03-20 09:07:58 -07:00
Justin Mayer
043b9a52d6 Merge pull request #779 from johnmastro/add-period-archives
Add period archives
2013-03-20 08:09:39 -07:00
Axel Haustant
7fb51e94bb Fix typos 2013-03-20 16:08:54 +01:00
Axel Haustant
c36fce8b6a Added missing SITESUBTITLE documentation 2013-03-19 14:58:35 +01:00
Axel Haustant
c6b943bfe9 Added missing JINJA_FILTERS documentation 2013-03-19 14:58:35 +01:00
Félix Delval
66aae01493 Adding a message for gracefully shutting down dev server 2013-03-19 12:15:58 +01:00
Wraithan (Chris McDonald)
e73f7e9f84 documentation for IGNORE_FILES 2013-03-18 17:51:17 -07:00
Justin Mayer
9eda0f79bd External resources should be scheme-independent
By using "//" instead of "http://" when referring to external resources
such as fonts (e.g., from within CSS files), warnings about "insecure"
content can be avoided.
2013-03-18 17:36:35 -07:00
Ivan Dyedov
a3206dbe9e fix for #783 - AttributeError: 'NoneType' object has no attribute 'find' when using summary plugin with static files 2013-03-17 23:09:49 -04:00
Félix Delval
7fa0d3063d Creating a more explicit error message at server creation 2013-03-16 19:29:10 +01:00
George V. Reilly
d4b41bd11d Multiple Social icons
aboutme, bitbucket, google-groups, hackernews, reddit,
slideshare, speakerdeck, vimeo, youtube

Also, fix spacing below a line-block.

Try this in resT::

	| First line
	| Second line
	| Third line

	New paragraph.

	Another paragraph.

Notice how the line-block runs into the first paragraph without the new CSS.
2013-03-15 19:02:44 -07:00
John Mastro
f92c800216 Add a period archives feature and brief docs.
Allows users to have per-year, per-month, and per-day archives of posts
automatically generated. The feature is disabled by default; to enable
it a user must supply format strings for a period's respective
`_SAVE_AS` setting.
2013-03-15 17:22:42 -07:00
lexual
62ab60d0b1 Added S3 support for pelican quickstart. 2013-03-15 15:04:33 +11:00
Alexis Metaireau
c3e9d0e96e Merge pull request #771 from wking/urlwrapper-repr
contents: Add URLWrapper.__repr__
2013-03-14 10:55:45 -07:00
W. Trevor King
9a62b5ec62 contents: Add URLWrapper.__repr__
This makes it easier to troubleshoot collections of URLWrappers,
because printing the collection will give you something you can
actually read ;).
2013-03-12 20:41:56 -04:00
W. Trevor King
bfa8851af0 Add the PATH_METADATA setting
Sometimes the base filename doesn't have everything you need.

Remember that os.sep is platform dependent, so using it in a regular
expression for this setting may not be portable (boo MS Windows!).
2013-03-12 15:16:25 -07:00
W. Trevor King
c46ca5d5d1 readers: Split parse_path_metadata from read_file
For easier re-use.  I also extract the path metadata first, so
metadata explicitly listed in the file contents will take precedence
over metadata parsed from the filename.
2013-03-12 15:16:25 -07:00
Alexis Métaireau
12c43b7d4d Make METADATA_PROCESSORS and EXTENSIONS public. 2013-03-12 12:19:53 -07:00
Alexis Métaireau
fc45d8d791 update the docs regarding all_articles 2013-03-11 23:11:21 -07:00
Alexis Métaireau
14d548fc44 Introduce all_articles where articles is shadowed. 2013-03-11 23:07:54 -07:00
William Light
e045515b91 add "output_file" Jinja context variable
"output_file" contains the name of the HTML file that pelican is
currently rendering.
2013-03-10 23:53:41 -07:00
Alexis Métaireau
37f6190c69 URLWrapper moved! 2013-03-10 23:42:08 -07:00
tehkonst
ab035795bc fix slug for feed urls
Conflicts:

	pelican/contents.py
2013-03-10 23:41:02 -07:00
W. Trevor King
33c60a78cd pelican/utils: Add split_all() and rework static URL generation
I think the conversion from native paths to URLs is best put off until
we are actually trying to generate the URL.  The old handling
(introduced in 2692586, Fixes #645 - Making cross-content linking
windows compatible, 2012-12-19) converted the path at StaticContent
initialization, which left you with a bogus StaticContent.src.

Once we drop the 'static' subdirectory, we will be able to drop the
`dest` and `url` parts from the StaticGenerator.generate_context()
handling, which will leave things looking a good deal cleaner than
they do now.
2013-03-10 23:21:38 -07:00
W. Trevor King
49bf80ec39 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.
2013-03-10 23:19:56 -07:00
Alexis Métaireau
9cbf5c0cbe deactivate travis for now 2013-03-10 23:11:41 -07:00
Alexis Métaireau
c6856dec44 Replace \ with / when replacing the URLs. See #763 2013-03-10 23:09:43 -07:00
Alexis Métaireau
14cf5f014c Some doc + various enhancements 2013-03-10 22:57:08 -07:00
Alexis Métaireau
5aeca4826c Use comments in tests, not docstrings. 2013-03-10 22:42:46 -07:00
Alexis Métaireau
fa77c3d66a This should be a warning, not an error :) 2013-03-10 22:30:36 -07:00
Alexis Métaireau
b9e2825da6 Put ASCII-art tree into a code-block element.
Fix #766
2013-03-10 20:15:37 -07:00
Alexis Metaireau
14f11f8561 Merge pull request #753 from wking/contribute-docs-rename
docs/contribute.rst: Update tests/output generation for moved tests
2013-03-10 12:27:45 -07:00
Alexis Metaireau
61dc53a7e0 Merge pull request #765 from jeredboxman/master
Added clearification in docs for PAGE_SAVE_AS
2013-03-10 12:23:06 -07:00
Jered Boxman
bfaa5f9d5c Added clearification in docs for PAGE_SAVE_AS
I discussed this option in the IRC channel, because I don't think it's
very clear. When I first read the list of options I was under the
impression that Pelican could do rewriting of urls. I discovered that
this isn't the case, so I discusses this in the IRC channel and got the
encouragement to submit a pull request.
2013-03-10 14:34:17 +01:00
Alexis Metaireau
71d437df62 Merge pull request #762 from tthurman/master
Fix stopserver command
2013-03-10 01:08:55 -08:00
Alexis Metaireau
3c5d819736 Merge pull request #764 from talha131/master
Fixes the reST syntax of an example in the docs
2013-03-10 01:08:14 -08:00
Talha Mansoor
a76bca9b0d Fixes the reST syntax of an example in the docs
reST example of the section "Linking to internal content" had incorrect
metadata. Moreover, time was missing from the date of both markdown and
reST example.

This was pointed out by [lefromage at #pelican](https://botbot.me/freenode/pelican/msg/2235275/)
2013-03-10 11:28:54 +05:00
Thomas Thurman
372e8c07cf Fixed the stopserver command to use the correct Makefile syntax 2013-03-09 21:27:19 +00:00
Alexis Métaireau
964f7d96d6 endswith can take a list as an argument ;) 2013-03-06 11:46:17 -08:00
W. Trevor King
2cb89ce528 docs/contribute.rst: Update tests/output generation for moved tests
This brings the docs back up to date after 547f8d2 (Move the tests
into pelican. Fix #500, 2013-04-06).
2013-03-06 09:24:11 -05:00
W. Trevor King
3f26f9af5b generators: Teach Generator.get_files to handle non-directory input
This makes it easier for StaticGenerator to walk FILES_TO_COPY, where
the input may be a directory or a bare filename.

Non-traversable file types (e.g. everything but directories and
symlinks to directories) are not checked against the exclude list.
The user-level effect of this is that explicit entries in STATIC_PATHS
or FILES_TO_COPY will override a hypothetical STATIC_EXCLUDES setting,
which seems like a reasonable approach.

I also removed the Python 2.5 compatibility check for `followlinks` in
os.walk, since Pelican is now Python >=2.7.
2013-03-06 08:38:45 -05:00
Alexis Métaireau
547f8d2e83 Move the tests into pelican. Fix #500 2013-03-06 00:41:27 -08:00
Irfan Ahmad
2692586abe Fixes #645 - Making cross-content linking windows compatible 2013-03-06 00:04:44 -08:00
Alexis Métaireau
a2d585084e update the output files 2013-03-06 00:04:26 -08:00
Leroy Jiang
4f6467ce08 add disqus_url to comment js block 2013-03-05 23:42:42 -08:00
Eric
7cafcf6c24 Fix the tag cloud example 2013-03-05 23:27:00 -08:00
Justin Mayer
d0e9c52410 Merge pull request #623 from bbinet/url-save_as-override
Override page 'url' and 'save_as' directly from the page metadata. Fixes #400.
2013-03-04 10:11:45 -08:00
Joseph Reagle
168d713df8 ul/li have no top/bottom margins, but list do 2013-03-03 22:35:56 -08:00
Joseph Reagle
9ed4e77049 improve spacing of p and nested lists 2013-03-03 22:35:03 -08:00
Joseph Reagle
92e9f3b313 bom detection and removal 2013-03-03 22:33:16 -08:00
Eric
6f5d8eae96 Relative URL issues with the related post examples
I noted that if you set the `ARTICLE_URL` site variable to have some depth and just create relative links, they will not link correctly.

by prefacing the link with `{{ SITEURL}}/` it seems to ensure proper links are created and works with the `make devserver` mode
2013-03-03 22:18:59 -08:00
Eric
11bdb437d2 added unique filtering and config limit param
I hacked some code from other modules and some quick googling, first time with py so this may need to be cleaned up.

The functionality is to have a config var in pythonconfig.py and to remove the duplicates `sorted(set())`
2013-03-03 22:18:59 -08:00
Eric
ccef2a6f13 Settings file is pelicanconf.py now. 2013-03-03 22:18:59 -08:00
dave mankoff
44351aaf31 delete output directory properly 2013-03-03 22:14:05 -08:00
nfletton
4a63695ae2 Fixed pagination link error when <DIRECT_TEMPLATE_NAME>_SAVE_AS setting used.
The unit test for this scenario was passing as it was testing for an incorrect 'page_name' variable being set.
2013-03-03 22:11:09 -08:00
Andrew Spiers
205792e9d4 string types have no decode method in py3 2013-03-03 22:00:37 -08:00
yegle
60ae7aa667 Fix: hashlib.md5 funcition only accepts bytes as input 2013-03-03 21:49:42 -08:00
Richard Duivenvoorde
a13e31a76b adding a stopsever target for make 2013-03-03 21:45:08 -08:00
Richard Duivenvoorde
824edb8823 rsync additions
- adding / otherwise you will endup with output on remote
- adding --cvs-exclude (to not sync cvs stuff)
2013-03-03 21:45:08 -08:00
Simon
a7a71da6df Fix a test in the asciidoc reader, and add asciidoc to travis so that
the related tests will not be skipped.
2013-03-03 21:43:04 -08:00
Steve Schwarz
1bbfdf96a0 Display feed(s) in footer if no SOCIAL links
For sites where there are no SOCIAL links defined the FEED_ALL_ATOM and/or the FEED_ALL_RSS links are not displayed.
Also update the functional tests output.
2013-03-03 21:40:55 -08:00
Eric
e721727476 Allow explicit setting of markdown extensions
These additions are to make it easier to disable pygments or any other
extension the user may not want. In the previous version, these plugins are
hardcoded, but by making it a variable in the config, it is possible to not use
pygments or easily load extra markdown plugins if needed; you can have multiple
plugins in one virtual environment and have different configs load them as
needed.

In my `pelicanconf.py` I then have the following:

    MD_EXTENSIONS = ['extra', 'syntaxhighlighter']

where `syntaxhighlighter` is a custom markdown extension I am working on to use
syntax highlighter instead of pygments for code highlighting.
2013-03-03 21:36:45 -08:00
John Kristensen
4e4080c523 Check output directory exists before doing a clean
- if the output directory does not exist the 'make clean' command fails,
   which also means that the 'make html' command which would otherwise
   create the output directory also fails without generating the output
2013-03-03 21:21:05 -08:00
Steve Schwarz
986733e8fb Corrected parsing of categories/tags 2013-03-03 21:17:42 -08:00
Steve Schwarz
8a6d96b289 pelican_import fix for bs4
Quick fix for this traceback:
$ pelican-import --wpfile ~/Downloads/mysite.wordpress.2013-02-24.xml 
Traceback (most recent call last):
  File "/Users/me/.virtualenvs/pelican/bin/pelican-import", line 8, in <module>
    load_entry_point('pelican==3.2', 'console_scripts', 'pelican-import')()
  File "/Users/me/.virtualenvs/pelican/src/pelican/pelican/tools/pelican_import.py", line 363, in main
    disable_slugs=args.disable_slugs or False)
  File "/Users/me/.virtualenvs/pelican/src/pelican/pelican/tools/pelican_import.py", line 238, in fields2pelican
    for title, content, filename, date, author, categories, tags, in_markup in fields:
  File "/Users/me/.virtualenvs/pelican/src/pelican/pelican/tools/pelican_import.py", line 37, in wp2fields
    if item.fetch('wp:status')[0].contents[0] == "publish":
TypeError: 'NoneType' object is not callable

I'm a BeautifulSoup novice but these changes allowed me to import two of my wordpress.xml files.
2013-03-03 21:17:42 -08:00
Mark Caudill
45c42dfe9a Clarify internal linking. 2013-03-03 21:12:23 -08:00
Sasha Hart
07f4163300 make develop_server.sh notify/cleanup when pelican or server don't start
After waiting for pelican and server to come up, if either one has
died then give a more helpful message and clean up. Previously did not
check for this, so script informed user that everything was running even
if one or both parts failed for whatever reason.

This is meant to provide a little more user-friendliness
in those cases where user has a develop_server.sh in project directory
but forgot to (re)install pelican, activate relevant virtualenv, etc.
as well as other unforeseen situations where one of the processes does
not start.
2013-03-03 21:08:28 -08:00
Alexis Métaireau
3e364bb8a4 Don't overwrite output_path. Fix #750 2013-03-03 21:00:52 -08:00
Alexis Métaireau
519dcdbcb3 Manual pass on sources for better standards. 2013-03-03 20:12:31 -08:00
Alexis Métaireau
20662c2a43 flake8-ed the tests 2013-03-03 19:45:46 -08:00
Justin Mayer
80edafbe50 Merge pull request #745 from bbinet/fix-tests-717
Fix regression introduced in #716
2013-03-02 10:24:50 -08:00
Bruno Binet
03f87057c2 update summary plugin so that tests are fixed (hopefully) 2013-03-01 12:59:26 +01:00
Bruno Binet
d68d2debf9 remove hardcoded values for SUMMARY_BEGIN_MARKER and SUMMARY_END_MARKER 2013-03-01 00:06:52 +01:00
Bruno Binet
ed907b4094 PageClass arg is useless in content_object_init 2013-03-01 00:06:05 +01:00
Justin Mayer
c977e0aa25 Fix Travis image link target in README 2013-02-23 16:13:46 -08:00
Bruno Binet
400a11d4c9 Merge pull request #716 from mankyd/summary-cutoff
Summary Cutoff
2013-02-20 22:02:42 -08:00
dave mankoff
3f4406dd6b support inline summary specification
update documentation

change summary cutoff to a plugin

remove backup file

fix 3.2 tests

update summary plugin initialization and documentation

update documentation

fix documentation formatting
2013-02-12 22:35:02 -05:00
Bruno Binet
557f1cc956 Merge pull request #719 from streeter/pages_generator_finalized
Add a pages_generator_finalized signal.
2013-02-11 00:37:31 -08:00
Bruno Binet
fdb5759610 Merge pull request #721 from mankyd/log-error
Fix String Formatting Errors
2013-02-11 00:27:34 -08:00
dave mankoff
21ad904abc format exceptions as strings 2013-02-10 20:21:28 -05:00
dave mankoff
5737534302 fix string formatting errors 2013-02-10 20:17:06 -05:00
Chris Streeter
de44644700 Add a pages_generator_finalized signal.
I wrote a plugin that I'd like to also be able to run on pages in
addition to articles. Adding this signal will let me update the content
when a page is finished being generated.
2013-02-10 12:42:54 -08:00
Justin Mayer
d0b291e509 Merge pull request #713 from vially/patch-1
Fix typo in documentation
2013-02-10 10:31:38 -08:00
Justin Mayer
8017fa948d Merge pull request #717 from rdegges/master
Fix issue #712
2013-02-10 10:27:00 -08:00
Justin Mayer
5a818e9331 Merge pull request #718 from mankyd/null-attribute
Fix null attributes in new HTML parser
2013-02-10 10:08:41 -08:00
dave mankoff
08439bdcf1 fix null attributes in html parser 2013-02-10 11:02:52 -05:00
Randall Degges
7ec9ea92aa Fixing issue #712.
This commit adds documentation to the getting started guide which describes that
articles must contain a manually set 'date' metadata attribute unless the
DEFAULT_DATE setting is specified.

This fixes some incorrect documentation behavior discussed in the ticket.
2013-02-09 21:29:51 -08:00
Justin Mayer
f3bc2ece86 Merge pull request #382 from mankyd/htmlparser
New, more thorough HTMLParser
2013-02-09 16:48:50 -08:00
Valentin-Costel Hăloiu
64ce845bae Fix typo 2013-02-10 00:38:18 +02:00
dave mankoff
5f5b300ba5 fix documentation 2013-02-09 09:51:02 -05:00
dave mankoff
8ba6a4d19d fix documentation 2013-02-09 09:27:45 -05:00
Bruno Binet
06899aa826 Merge pull request #710 from ikalnitsky/code-directive
Fix bug with docutils' code directive.
2013-02-08 23:08:01 -08:00
Igor Kalnitsky
0285bbcec4 Fix bug with docutils' code directive.
Since version 0.9 `docutils` supports `code` directive. But this directive
can generate fullname classes for the `pygments` style classes.

For example, the following code

```reStructuredText
.. code:: c++

    GetFoo()->do_something();
```

generate the following output

```html
<pre class="code c++ literal-block">
  <span class="name">GetFoo</span>
  <span class="punctuation">()</span>
  <span class="operator">-&gt;</span>
  <span class="name">do_something</span>
  <span class="punctuation">();</span>
</pre>
```

Note, that fullname classes were used, when we need a short one

```html
<pre class="code c++ literal-block">
  <span class="n">GetFoo</span>
  <span class="p">()</span>
  <span class="o">-&gt;</span>
  <span class="n">do_something</span>
  <span class="p">();</span>
</pre>
```
2013-02-08 01:47:20 +02:00
dave mankoff
d5bfec3a8b update documentation and remove commented out code 2013-01-28 22:25:15 -05:00
dave mankoff
2a3d7d0319 fix python3 support 2013-01-28 22:21:45 -05:00
dave mankoff
7b59b34a73 get tests passing 2013-01-28 22:11:06 -05:00
dave mankoff
9e51e767d4 git pull origin htmlparser 2013-01-28 21:51:17 -05:00
dave mankoff
e6a4fe3fc4 fix grammar 2013-01-28 21:50:09 -05:00
dave mankoff
bf6f16e383 add documentation for html reader 2013-01-28 21:50:09 -05:00
dave mankoff
5f639b9a3b git rebase master 2013-01-28 21:46:54 -05:00
dave mankoff
357f3a3da2 properly write out charref's 2013-01-28 21:46:23 -05:00
dave mankoff
bc2bc7a330 git merge upstream/master 2013-01-28 21:41:42 -05:00
Bruno Binet
90672e5491 Merge pull request #697 from khertan/master
Adding a missing space in one error message
2013-01-24 05:47:28 -08:00
Benoît HERVIER
5f3a3e4582 Update pelican/contents.py
Put a space in error message to not concatain word 'about' and the missing tag
2013-01-24 14:10:26 +01:00
Alexis Metaireau
c8da208a91 Merge pull request #691 from webdesignhero/master
Related Post Plugin Example
2013-01-23 04:05:42 -08:00
Bruno Binet
b642d2247d Merge branch 'pr/648'
closes #648
closes #585
2013-01-23 01:04:26 +01:00
Rıdvan Örsvuran
0288bf1f68 added IGNORE_FILES setting for autoreload 2013-01-23 01:02:46 +01:00
Bruno Binet
a7b18515a1 Merge branch 'pr/634'
closes #634
2013-01-21 23:49:52 +01:00
Michael Reneer
a441596b07 Cleaned up markdown test cases:
- test_article_with_md_extension
- test_article_with_mkd_extension
- test_article_with_markdown_extension

and replaced with:

- test_article_with_metadata
- test_article_with_file_extensions
2013-01-21 23:49:16 +01:00
Michael Reneer
56a276d92e Added unit test to test the markdown file extension. 2013-01-21 23:49:16 +01:00
Bruno Binet
ffdf8babbf Merge pull request #651 from traeblain/webasset-config
Update webassets plugin to allow user to pass configuration settings to webassets
2013-01-21 14:32:12 -08:00
Bruno Binet
efbce9a375 Merge branch 'pr/643' 2013-01-21 23:20:13 +01:00
Simon
688dee2dca Improve importer documentation. 2013-01-21 23:19:23 +01:00
Bruno Binet
d9855ae346 Merge pull request #662 from wking/rich-urlwrapper-comparisons
contents: Add rich comparisons to URLWrapper for easy sorting
2013-01-21 13:30:02 -08:00
Bruno Binet
abc73d9d98 Merge pull request #653 from alefteris/docs-depedencies-update
Docs depedencies update
2013-01-21 13:12:42 -08:00
Eric
0a6294a2a3 More clear example for related posts
The existing related posts example doesn't show properties for the collection, this could be confusing to individuals who are not programmers, because as it was the code would render five bullet points.

I am also looking to add some type of loop control or if statement to the loop to detect duplicate, I tried t a dictionary sort filter through jinja, bu that through an error, the following is not guarantted to work then:


		{% set LASTARTICLE = "notset" %}
		{% if article.related_posts %}
			<ul>
			{% for related_post in article.related_posts|dictsort(false, 'url')  %}
				{% if not (LASTARTICLE == related_post.url) %}
				   <li><a href="{{ related_post.url }}">{{ related_post.title }}</a></li>
				{% endif %}
				{% set LASTARTICLE = related_post.url %}
			{% endfor %}
			</ul>
		{% endif %}

the dicsort does not work (is this not a dict, I'm not a python guy so I'm just hacking at it.
2013-01-20 17:27:28 -06:00
Bruno Binet
67a67846aa temporary deactivate travis tests for Python 3.3
the functional tests currently fail on Python 3.3 because the feeds output
differs. (see #688)

this is a temporary fix that will make travis happy while we provide a valid
fix for this issue.
2013-01-19 17:10:14 +01:00
Bruno Binet
b01ddbb29c fix python 3.3 travis build
unittest2py3k is requiredfor python 3.3 (instead of unittest2)
2013-01-19 16:44:14 +01:00
Bruno Binet
86f8743b1b Merge branch 'pr/687' 2013-01-19 16:38:27 +01:00
W. Trevor King
763244dad5 tox.ini: Test on Python 3.3 as well as 2.7 and 3.2
I just copied the 3.2 environment for 3.3.  They should be similar,
but it's possible some packages have extra issues on 3.3.
2013-01-18 19:47:02 -05:00
W. Trevor King
5466ffd614 .travis.yml: Test on Python 3.3 as well as 2.7 and 3.2
If we advertise 3.3 support in setup.py, we should test for it.
2013-01-18 19:45:44 -05:00
W. Trevor King
6686f1c9bd setup.py: Update trove classifiers to Python 2.7, 3.2, and 3.3 2013-01-18 19:44:44 -05:00
Bruno Binet
6233f5a409 Merge pull request #667 from wking/page-path
Consolidate Path.filename and and StaticContent.filepath as `source_path`.
2013-01-18 07:30:03 -08:00
Bruno Binet
370640e008 Merge pull request #664 from wking/mkdir-p-nondir-error
utils: Teach mkdir_p to fail if the existing target isn't a directory
2013-01-18 06:39:58 -08:00
W. Trevor King
13b36a5c34 test_utils: Add log count checks to test_deprecated_attribute 2013-01-18 08:48:26 -05:00
W. Trevor King
4fcdaa91e9 tests/support: Factor LogCountHandler testing out into LoggedTestCase
To avoid duplicating boilerplate when we need to test logged messages
outside of TestPelican.
2013-01-18 08:48:26 -05:00
W. Trevor King
13cd0a4cb3 contents: Add deprecation warnings for Page.filename and StaticContent.filepath 2013-01-18 08:48:26 -05:00
W. Trevor King
ec50e18a3e utils: Add deprecated_attribute decorator 2013-01-18 08:48:21 -05:00
W. Trevor King
c3c3037a1d utils: Teach mkdir_p to fail if the existing target isn't a directory
Existing symlinks to directories will still pass, because isdir()
follows symbolic links.
2013-01-18 08:32:55 -05:00
W. Trevor King
54a9132aea tests: Update tests after filename/filepath -> source_path 2013-01-18 08:07:49 -05:00
W. Trevor King
9b574361c9 doc: convert Markdown example to source_path and modernize 2013-01-18 07:57:53 -05:00
W. Trevor King
004adfa5cc content: Convert Path.filename to .source_path
Making everything consistent is a bit awkward, since this is a
commonly used attribute, but I've done my best.

Reasons for not consolidating on `filename`:

* It is often used for the "basename" (last component in the path).
  Using `source_path` makes it clear that this attribute can contain
  multiple components.

Reasons for not consolidating on `filepath`:

* It is barely used in the Pelican source, and therefore easy to
  change.
* `path` is more Pythonic.  The only place `filepath` ever show up in
  the documentation for `os`, `os.path`, and `shutil` is in the
  `os.path.relpath` documentation [1].

Reasons for not consolidating on `path`:

* The Page elements have both a source (this attribute) and a
  destination (.save_as).  To avoid confusion for developers not aware
  of this, make it painfully obvious that this attribute is for the
  source.  Explicit is better than implicit ;).

Where I was touching the line, I also updated the string formatting in
StaticGenerator.generate_output to use the forward compatible
'{}'.format() syntax.

[1]: http://docs.python.org/2/library/os.path.html#os.path.relpath
2013-01-18 07:57:35 -05:00
W. Trevor King
61f05672e6 content: Convert StaticContent.filepath to .filename
For reasons that are unclear to me, StaticContent introduces the
`filepath` attribute rather than using the existing (and semantically
equivalent) Page.filename.  This has caused confusion before [1], and
it's probably a good idea to merge the two.

While I was touching the line, I also updated the string formatting in
StaticGenerator.generate_output to use the forward compatible
'{}'.format() syntax.

[1]: https://github.com/getpelican/pelican/issues/162#issuecomment-3000363
2013-01-18 07:40:42 -05:00
Bruno Binet
08a5ea6fdf Merge pull request #663 from wking/url-format-metadata
contents: Page.url_format should expose all metadata
2013-01-18 03:20:10 -08:00
W. Trevor King
d2a221c899 contents: Encode Unicode locales for Python 2 in Page.__init__
Python 2.7 chokes on Unicode locales:

  $ python2.7
  >>> import locale
  >>> locale.setlocale(locale.LC_ALL, u'ja_JP.utf8')
  Traceback (most recent call last):
    ...
  ValueError: too many values to unpack

With the addition of:

  from __future__ import unicode_literals

to tests/test_contents.py in:

  commit bebb94c15b
  Author: W. Trevor King <wking@tremily.us>
  Date:   Tue Jan 15 22:50:58 2013 -0500

    test_contents.py: Add URLWrapper comparison tests

the locale strings in TestPage.test_datetime are interpreted as
Unicode.  Rather than fixing the encoding there, this patch updates
Page to handle Unicode locales automatically.
2013-01-17 09:49:03 -05:00
W. Trevor King
733ab8ae6c test_contents: Add tests for metadata export from Page.url_format 2013-01-15 23:08:32 -05:00
W. Trevor King
bebb94c15b test_contents.py: Add URLWrapper comparison tests
The name switch between wrapper_a and wrapper_b ensures that we're not
secretly comparing some other field (e.g. id(object)).
2013-01-15 22:52:02 -05:00
W. Trevor King
656b5150ff docs/themes.rst: Document URLWrapper sorting for use in Jinja templates 2013-01-15 22:52:01 -05:00
W. Trevor King
2c434ebac1 contents: Add rich comparisons to URLWrapper for easy sorting
There have been earlier attempts to sort categories and authors
[1,2,3], but they either sorted based on the object id [3], or only
sorted the main author and categories list.

This patch uses rich comparisons (keyed off URLWrapper.name, but
easily adjustable in subclasses) to make the objects sortable without
specifying a key for each sort.  For example, now

  {% for tag, articles in tags|sort %}

works as expected in a Jinja template.

The functools.total_ordering decorator fills in the missing rich
comparisons [4,5].

[1]: 877d454c8f
[2]: 7f36e0ed20
[3]: d0ec18f4db
[4]: http://docs.python.org/2/library/functools.html#functools.total_ordering
[5]: http://docs.python.org/3/library/functools.html#functools.total_ordering
2013-01-15 22:51:53 -05:00
Alexis Metaireau
a7fb6b5eae Merge pull request #661 from wking/settings-abspath
settings: Fix abspath existence check for path settings
2013-01-15 10:56:57 -08:00
Alexis Métaireau
476f2980ce Damn, I forgot to update travis. 2013-01-15 14:23:00 +01:00
Alexis Métaireau
2f7479374b Merge branch 'master' of github.com:getpelican/pelican 2013-01-15 12:33:50 +01:00
Alexis Métaireau
e11d8aedff Merge branch 'master' into py3k 2013-01-11 21:24:47 +01:00
Alexis Métaireau
d7caaded3f Use the en-us locale for functional tests 2013-01-11 21:24:04 +01:00
Alexis Métaireau
149ca493e0 Annotate py3k code when needed. 2013-01-11 18:55:04 +01:00
Alexis Métaireau
4ac094966e remove py2.6 support 2013-01-11 18:47:22 +01:00
Alexis Métaireau
1197e09626 Revert previously erased changes 2013-01-11 18:46:16 +01:00
Bruno Binet
e5be4b7e40 Merge pull request #658 from elemoine/github
Improve Publishing to GitHub doc section
2013-01-11 07:12:34 -08:00
Dirk Makowski
d1b238638c Update the "how to contribute" docs with py3k info. 2013-01-11 03:21:06 +01:00
Dirk Makowski
71995d5e1b Port pelican to python 3.
Stays compatible with 2.x series, thanks to an unified codebase.
2013-01-11 03:20:09 +01:00
Alexis Metaireau
9847394e12 Merge pull request #674 from peterdesmet/patch-2
Fixed a typo
2013-01-07 02:53:09 -08:00
Peter Desmet
696caac9b0 Fixed a typo
BeatifulSoup -> Beautiful Soup
2013-01-07 10:49:51 +01:00
W. Trevor King
88b5a27ddf contents: Page.url_format should expose all metadata
I want to add `directory` metadata to each page in `content/pages/` to
place my non-article pages by hand:

  PAGE_URL = '{directory}/{slug}'
  PAGE_SAVE_AS = '{directory}/{slug}/index.html'

To do this, I need the `directory` metadata for formatting the URL.
2013-01-03 18:18:18 -05:00
W. Trevor King
9eb5ad77ef settings: Fix abspath existence check for path settings
The path to check is `absp`.  `p` is the setting name.
2013-01-03 12:19:27 -05:00
Trae Blain
a71465217b Update webassets plugin to allow user to pass configuration settings to Webassets through their settings file. Also removed language about DEBUG not compiling CSS since as of at least webassets 0.8 this is no longer an issue. 2013-01-02 16:26:39 -06:00
Alexis Métaireau
be040715f9 remove duplicates 2013-01-02 13:46:55 +01:00
Alexis Métaireau
8cc0da67e1 Fix the THANKS file. 2013-01-02 13:43:38 +01:00
Éric Lemoine
369bb476e9 Improve Publishing to GitHub section of the doc 2013-01-01 01:01:19 +01:00
Kyle Fuller
c73dba7a7a Merge pull request #655 from wraithan/master
tiny bit of code clean up
2012-12-29 10:07:16 -08:00
Wraithan (Chris McDonald)
fcc74be267 pep8/style matching 2012-12-29 10:03:28 -08:00
Thanos Lefteris
a0b29d980f PyPI links for pelican depedencies 2012-12-25 23:59:53 +02:00
Thanos Lefteris
30c8825fa2 Docs update of the pelican core install depedencies 2012-12-25 23:36:44 +02:00
Alexis Métaireau
02f984f7ef update the version of jinja needed, 2.6 is out 2012-12-18 12:34:05 +01:00
Alexis Metaireau
d879218c27 Merge pull request #620 from rskvazh/patch-1
Update docs/plugins.rst
2012-12-18 01:15:50 -08:00
Alexis Metaireau
92c085c28e Merge pull request #635 from michaelreneer/markdown-summary-metadata
Updated markdown reader to parse summary metadata as markup.
2012-12-11 05:07:30 -08:00
Alexis Metaireau
98c8db568b Merge pull request #577 from davidjb/import-improvements-slug
Provide slug storage option for posts during Pelican import
2012-12-11 03:52:12 -08:00
David Beitey
b4c5d7cf62 Store slugs in posts by default on Pelican import 2012-12-11 21:44:40 +10:00
Michael Reneer
b35947f7a6 Cleaned up markdown read. 2012-12-11 00:48:47 -05:00
Michael Reneer
f66c16bd52 Updated unit tests to test markdown summary metadata. 2012-12-11 00:37:06 -05:00
Michael Reneer
733e41a6a7 Updated markdown reader to parse summary metadata as markup. 2012-12-11 00:34:15 -05:00
Bruno Binet
f79c844855 remote duplicated import statement (thanks @traeblain) 2012-12-09 08:30:17 +01:00
Bruno Binet
e8043594f7 Merge pull request #627 from traeblain/docs-update
Documentation doesn't clearly outline what is required for each plugin in the settings
2012-12-07 12:57:13 -08:00
Trae Blain
b0ff693839 Updated plugins documentation to include actual callable names of each plugin included. 2012-12-07 14:40:44 -06:00
Bruno Binet
802c9d1111 add docs for save_as/url override from metadata feature 2012-12-07 01:02:44 +01:00
Bruno Binet
00c7451200 add functional test for save_as/url override
and update functional tests output
2012-12-07 00:14:02 +01:00
Bruno Binet
a5772bf3d6 allow override page url and save_as values directly from the metadata
this is similar to the template override implemented in #404
2012-12-07 00:10:39 +01:00
Roman Skvazh
694f318614 Update docs/plugins.rst
Change yuicompressor to yui_js and yui_css
2012-12-06 21:15:25 +04:00
Bruno Binet
9f66333d77 fix rst issue 2012-12-04 02:08:13 +01:00
Alexis Métaireau
625afa0621 add the changelog to the text on PyPI 2012-12-04 01:53:52 +01:00
Alexis Métaireau
f92c0cb69d update the version scheme to support micro versions 2012-12-04 01:43:19 +01:00
Justin Mayer
a07b56c02b Doc fixes and improvements 2012-12-03 16:31:55 -08:00
Alexis Métaireau
be2a3f4030 bump version number 2012-12-04 01:27:16 +01:00
Alexis Métaireau
822c63cbd7 Merge branch 'master' of github.com:getpelican/pelican 2012-12-04 01:24:09 +01:00
Alexis Métaireau
89fd11d582 tagging 3.1 2012-12-04 01:21:57 +01:00
Bruno Binet
21e8087822 fix weird implementation for extension removal
this leads to raising exception when slug was not used to generate the url
2012-12-04 00:49:32 +01:00
Bruno Binet
e4dd5c1c00 Merge pull request #615 from bbinet/revert-523
revert #523
2012-12-03 14:05:35 -08:00
Bruno Binet
f604cc4df8 update functional tests to test TEMPLATE_PAGES feature
closes #614: cannot reproduce this issue.
2012-12-03 22:56:07 +01:00
Bruno Binet
8bb86d3e5d revert #523
we don't need a new MARKDOWN_EXTENSIONS setting because the equivalent setting
MD_EXTENSIONS already exists.
2012-12-03 22:35:11 +01:00
Justin Mayer
6236e8f66b Updated changelog to include recent changes 2012-12-03 12:59:31 -08:00
Bruno Binet
bb2cfffe6a Merge pull request #606 from bbinet/metadata-from-filename
Extract metadata from filename
2012-12-03 01:23:16 -08:00
Bruno Binet
f86e1128f0 docfix: fix example of FILENAME_METADATA regexp 2012-12-03 10:20:43 +01:00
Bruno Binet
070fa1ff9d add more docs about FILENAME_METADATA 2012-12-03 10:20:40 +01:00
Bruno Binet
fc13ae8e76 add new file to functional test content to showcase FILENAME_METADATA
and update functional tests output
2012-12-03 09:54:43 +01:00
Bruno Binet
92b9ccb08a fix failing TestArticlesGenerator.test_generate_context test
new file have been added to the content directory so articles_expected needs to
be updated
2012-12-03 09:54:43 +01:00
Bruno Binet
dfab8ed5b9 test the "metadata from filename" feature 2012-12-03 09:54:43 +01:00
Bruno Binet
3a25f82c4f update docs/settings.rst for both DEFAULT_METADATA and FILENAME_METADATA 2012-12-03 09:53:14 +01:00
Bruno Binet
debd6fb3b4 add FILENAME_METADATA setting to extract metadata from filename
FILENAME_METADATA default to '(?P<date>\d{4}-\d{2}-\d{2}).*' which will allow
to extract date metadata from the filename.
2012-12-03 09:53:14 +01:00
Justin Mayer
a0049f9fcd Strip tags from title in simple index. Fixes #612
This fix was applied previously to the relevant places in both the
"simple" and "notmyidea" themes, but the simple theme's index.html file
was apparently neglected.
2012-12-02 16:10:11 -08:00
Bruno Binet
e14623b46c Merge pull request #611 from michaelreneer/master
Updated documentation
2012-12-02 12:25:40 -08:00
Justin Mayer
5f47523dd3 Merge pull request #570 from bcl/master-asciidoc
Add asciidoc reader support
2012-12-02 10:42:25 -08:00
Brian C. Lane
49f481e399 Add asciidoc reader support
http://www.methods.co.nz/asciidoc/index.html

Processes files ending in .asc with asciidoc. Extra arguments can be
passed by using the ASCIIDOC_OPTIONS config setting
2012-12-02 10:20:13 -08:00
Michael Reneer
891a66ad8b Updated documentation to reflect addition of new markdown types. 2012-12-02 13:11:47 -05:00
Bruno Binet
f9e7c86a1a Merge pull request #460 from getpelican/remove-url-rewriting
Don't rewrite URLs
2012-12-02 09:47:18 -08:00
Bruno Binet
81cb774a8e add docs for cross-site linking 2012-12-01 21:35:15 +01:00
Bruno Binet
523ac9f64c update functional test output (relative cross-site links support)
$ LC_ALL="C" pelican -o tests/output/custom/ -s samples/pelican.conf.py \
    samples/content/
$ LC_ALL="C" pelican -o tests/output/basic/ samples/content/
2012-12-01 21:33:30 +01:00
Bruno Binet
a0504aeabe add support for relative cross-site links 2012-12-01 21:32:02 +01:00
Bruno Binet
a6dd3178b1 test that 4 occurences of log "skipping url replacement" are found 2012-12-01 21:32:02 +01:00
Bruno Binet
b5b35c9fc8 update functional tests output
$ LC_ALL="C" pelican -o tests/output/custom/ -s samples/pelican.conf.py \
    samples/content/
$ LC_ALL="C" pelican -o tests/output/basic/ samples/content/
2012-12-01 21:31:44 +01:00
Bruno Binet
c74abe579b Don't rewrite URLs
Remove the code that was appending ../static in front of some URLs, and add a
way to do cross-content linking.
2012-12-01 21:30:50 +01:00
Alexis Metaireau
f653118658 Merge pull request #588 from tpievila/dev_server_fix
Kill SimpleHTTPServer also on OS X
2012-11-29 14:08:53 -08:00
Alexis Metaireau
d913761c46 Merge pull request #605 from saimn/relative_links
Change the way to compute relative paths to avoid the leading `.././` when using  relative urls.
2012-11-29 13:55:57 -08:00
Simon
5df258c5f0 Update the basic and custom tests output. 2012-11-29 21:50:46 +01:00
Simon
088c810b00 Change the way to compute relative paths to avoid the leading .././ when using
relative urls.
2012-11-29 21:50:46 +01:00
Alexis Métaireau
c731edcdeb pages should be in the content folder 2012-11-29 19:16:44 +01:00
Bruno Binet
a86fdfc779 update changelog: add gzip_cache plugin 2012-11-29 15:16:57 +01:00
Bruno Binet
6380cd428a Merge branch 'pr/586' (closes #586) 2012-11-29 15:02:26 +01:00
Matt Layman
8fe68aa035 Added some unit tests for the gzip cache plugin 2012-11-29 15:00:45 +01:00
Bruno Binet
3342d3b9b9 Added some documentation about the gzip plugin. 2012-11-29 15:00:44 +01:00
Bruno Binet
c749671778 Reimplemented the gzip compression as a plugin.
Extending the Writer wasn't the complete answer because the static
generator also copies some files. Instead, I implemented the work as a
plugin that attaches to the finalized event.
2012-11-29 15:00:44 +01:00
Matt Layman
2bdbbc3faf Fixed line ending problems by adding a .gitattributes file 2012-11-29 15:00:44 +01:00
Justin Mayer
7056622322 Fix missing SITEURL and base home link
1. Following up on bbinet's changes in f12a297, ensure that the notmyidea
theme's article.html template includes the SITEURL variable when
constructing URL links.

2. Add missing slash to the base.html template so that clicking on the
site header at top left refers to "/" instead of "" when SITEURL is not
defined. Otherwise, the "" target will cause the browser to load the
current page and not the site's root (as one would expect).
2012-11-27 16:01:05 -08:00
Bruno Binet
447e627286 update changelog to reflect changes from #592 2012-11-28 00:41:40 +01:00
Bruno Binet
03c39076e5 Merge branch 'restore-basic-functional-test' 2012-11-28 00:30:59 +01:00
Bruno Binet
ce0723cf48 update contribute.rst doc
$USER environment variable is no longer needed
2012-11-28 00:29:52 +01:00
Bruno Binet
07ccf477d0 update "basic" output for functional tests so that test pass
LC_ALL="C" pelican -o tests/output/basic/ samples/content/
2012-11-28 00:29:52 +01:00
Bruno Binet
080c884c1a restore test_basic_generation_works functional test 2012-11-28 00:29:51 +01:00
Bruno Binet
4d6ddd0af3 fix failing tests 2012-11-28 00:29:51 +01:00
Bruno Binet
fa82e19c1f change default value for DEFAULT_DATE to None
(was 'fs' => guess from file mtime)
2012-11-28 00:29:51 +01:00
Bruno Binet
d9fbb540c5 Merge pull request #599 from MichaelReneer/master
Updated settings documentation
2012-11-26 13:53:26 -08:00
Michael Reneer
103ae436c9 Update docs/settings.rst
Updated commit based on the discussion in the pull request.
2012-11-26 13:03:25 -05:00
Michael Reneer
4de668159d Update docs/settings.rst
Updated the documentation for the MARKUP setting to reflect the current supported markup file extensions.
2012-11-26 11:26:33 -05:00
Bruno Binet
0fbf96b4be Merge pull request #596 from tpievila/doc_fix
Metadata parity for RST/MD, document summary.
2012-11-24 03:41:01 -08:00
Tomi Pieviläinen
a6f328516a Metadata parity for RST/MD, document summary. 2012-11-24 13:18:49 +02:00
Bruno Binet
1c44f49d1b remove importlib dependency
importlib is only available for python >= 2.7
2012-11-23 15:51:01 +01:00
Bruno Binet
5fd6eac477 update changelog (new webassets plugin) 2012-11-23 15:38:41 +01:00
Bruno Binet
801bc755b5 Merge branch 'pr/558'
Conflicts:
	docs/settings.rst
	pelican/signals.py
2012-11-23 15:32:17 +01:00
Simon
816e8d88e0 Change webasset tests organization to avoid running pelican twice for each test.
As setUp is run for each test, the previous implementation was running pelican
twice (once for relative urls and once for absolute) for each test, which was not
really optimal :-).

Solution: make a base class which is inherated by a class for relative urls and
another for absolute urls.
2012-11-22 13:22:49 +01:00
Alexis Métaireau
09ddd92efc update the output for functional tests 2012-11-21 16:39:05 +01:00
Alexis Métaireau
587184c778 trim the blocks when generating templates. 2012-11-21 16:38:27 +01:00
Alexis Métaireau
c022f4d483 Merge branch 'master' of github.com:getpelican/pelican 2012-11-21 16:16:52 +01:00
Alexis Metaireau
6adfec2bd5 Merge pull request #589 from tpievila/translated_pages
List of translations for simple and notmyidea pages
2012-11-21 07:13:26 -08:00
Alexis Métaireau
aee59f42ef Merge branch 'master' of github.com:getpelican/pelican 2012-11-21 15:58:16 +01:00
Tomi Pieviläinen
3e454045e9 Update test data 2012-11-21 15:45:50 +02:00
Tomi Pieviläinen
429991c3f9 List of translations for simple and notmyidea pages 2012-11-21 15:45:50 +02:00
Bruno Binet
a9cdf3c5a1 remove old import statement 2012-11-21 14:24:40 +01:00
Alexis Metaireau
6d11f6d063 Merge pull request #583 from egh/master
create a preread signal
2012-11-21 04:53:42 -08:00
Alexis Métaireau
4aeb65512d delete the TODO file 2012-11-21 13:03:29 +01:00
Tomi Pieviläinen
e006cf04bb Kill SimpleHTTPServer also on OS X 2012-11-21 14:02:56 +02:00
Simon
f413a8da79 Change webassets configuration for relative urls.
Set the ASSET_URL to be relative to the 'theme/' url, which requires to use
{{ SITEURL }}/{{ ASSET_URL }} in the template and make it works with both
relative and absolute urls.
2012-11-20 23:42:52 +01:00
Simon
67af48eed4 travis configuration for webassets tests: install webassets, cssmin and sass. 2012-11-20 23:42:41 +01:00
Simon
00d1ea6157 Use the new generator_init signal for the assets plugin.
This allows to have the assets_environment in all generators.
2012-11-20 23:42:41 +01:00
Simon
09c893f3a3 Add a new signal generator_init, invoked at the end of Generator.__init__. 2012-11-20 23:42:31 +01:00
Simon
7ff0d0e686 Move webassets tests in their own file. 2012-11-20 23:42:11 +01:00
Erik Hetzner
fb562ec7d3 add docs for article_generate_preread signal 2012-11-16 08:09:35 -08:00
Alexis Metaireau
67c576add6 Merge pull request #539 from bbinet/recursive-diff
directory comparison should be recursive in functional tests
2012-11-16 01:07:01 -08:00
Alexis Métaireau
5523240553 What would be a commit without his "fix typo" brother, uh? 2012-11-15 20:09:21 +01:00
Alexis Métaireau
43b1555e5d Mention that FILES_TO_COPY is able to copy dirs. 2012-11-15 20:07:08 +01:00
Erik Hetzner
6d745f32c0 add preread signal 2012-11-14 22:12:46 -08:00
Bruno Binet
ec42fa837f docfix: fix default values for _URL and _SAVE_AS settings
(AUTHOR_URL, AUTHOR_SAVE_AS, CATEGORY_URL, CATEGORY_SAVE_AS)
2012-11-13 01:46:43 +01:00
Bruno Binet
8336df2b9b update changelog: blank author are now allowed
(refs: #555)
2012-11-13 01:41:39 +01:00
Bruno Binet
c787e02dcc Merge branch 'pr/555'
Conflicts:
	pelican/contents.py
2012-11-13 01:23:31 +01:00
Bruno Binet
f49336f087 Merge branch 'pr/551' (closes #551) 2012-11-12 23:57:37 +01:00
Bruno Binet
960c35596c update "custom" output for functional tests
LC_ALL=C pelican -o tests/output/custom/ -s samples/pelican.conf.py samples/content/
2012-11-12 23:56:38 +01:00
Bruno Binet
e56d2b14c8 docfix: updates docs/settings.rst and docs/faq.rst 2012-11-12 23:44:12 +01:00
jawher
1b81f8b830 Move SITEURL check for feed generation from generators.py to settings.py 2012-11-12 23:01:17 +01:00
jawher
cf95b02bc0 Update the faq and changelog 2012-11-12 23:01:17 +01:00
jawher
13f444260c Avoid iterating over all settings keys to detect if a feed is enabled 2012-11-12 23:01:17 +01:00
jawher
8a72b11e3d code style: remove unnecessary trailing \ 2012-11-12 23:01:17 +01:00
jawher
578f9ea21e Update the test sample config to set FEED_ALL_RSS instead of FEED_RSS (fixes the custom generation tests) 2012-11-12 23:01:17 +01:00
jawher
b6db45420c Default to using FEED_ALL_ATOM instead of FEED_ATOM (and likewise for RSS) in the notmyidea theme 2012-11-12 23:01:17 +01:00
jawher
fd18f2efa9 Generate links for FEED_ALL_ATOM and FEED_ALL_RSS in the simple them's head. 2012-11-12 23:01:17 +01:00
jawher
a79904c075 Update the generators tests to use FEED_ALL_ATOM as the default set atom feed instead of FEED_ATOM 2012-11-12 23:01:17 +01:00
jawher
93905e828d Split long if condition in 2 lines 2012-11-12 23:01:17 +01:00
jawher
537e9df3ed Reworked the "unset feed_domain" warning to handle all feed variables 2012-11-12 23:01:16 +01:00
jawher
5593670759 The default settings sets up FEED_ALL_ATOM (instead of FEED_ATOM) to all.atom.xml 2012-11-12 23:01:16 +01:00
jawher
c7d87feec3 Reverted FEED_ATOM and FEED_RSS to their original behaviour and added FEED_ALL_ATOM and FEED_ALL_RSS
FEED_(ATOM|RSS) generated feeds include the version in the default language of a translated article,
whereas FEED_ALL(ATOM|RSS) would include *really* all posts, regardless of their language.
2012-11-12 23:01:16 +01:00
jawher
593acfc37a Remove comment 2012-11-12 23:01:16 +01:00
jawher
721a422e5e The all Atom and RSS feed generators should include all articles, regardless of the article's language or the site's. Fixes #550. 2012-11-12 23:01:16 +01:00
Simon
7088135f5e Add tests for webassets: test absolute url and Jinja configuration 2012-11-07 00:18:48 +01:00
Simon
4c15ec9f86 Move webassets doc to the plugins page 2012-11-07 00:18:00 +01:00
Simon
4cfb0cd24e Move Webassets in a plugin 2012-11-07 00:17:50 +01:00
Bruno Binet
df66579fc2 directory comparison should be recursive in functional tests 2012-11-07 00:01:59 +01:00
Bruno Binet
d6ec9b2028 update "custom" output for functional tests
LC_ALL=C pelican -o tests/output/custom/ -s samples/pelican.conf.py samples/content/

we really need to merge #539 so that functional tests won't succeed if
output is different...
2012-11-06 23:58:34 +01:00
Bruno Binet
dfa69fd383 Merge branch 'pr/571' (closes #571)
Conflicts:
	docs/changelog.rst
2012-11-06 23:54:08 +01:00
Simon
1b20319074 add a warning for the users of the LESS_GENERATOR setting 2012-11-05 21:56:18 +01:00
Simon
b66a37ccb1 Unit tests for webassets
remove the unit tests for the lesscss generator (TestLessCSSGenerator class) and
replace it with tests for webassets:

- add a sample scss file
- run pelican with example files
- compare the generated css file with a reference one
- look in the html code for the correct link tag
2012-11-05 21:56:18 +01:00
Simon
5f51cffe08 update docs: remove mentions of lesscss compiling and replace with webassets 2012-11-05 21:51:27 +01:00
Simon
d0f5875f66 remove the LessCSSGenerator and the related config option 2012-11-05 21:51:27 +01:00
Alexis Metaireau
e84d2ba594 Merge pull request #572 from davidjb/wp-import-improvements
Import Improvements
2012-11-05 08:40:51 -08:00
David Beitey
1b23a4a8e1 Merge remote-tracking branch 'davidjb/decode-html-wp-titles' into wp-import-improvements
Conflicts:
	docs/changelog.rst
2012-11-04 14:09:25 +10:00
David Beitey
528747684d Split post content on all types of line endings for adding paragraph tags 2012-11-04 14:08:58 +10:00
David Beitey
121bc0ad5e Optimize social icons 2012-11-04 12:49:05 +10:00
David Beitey
9fdd378687 Add Google+ social icon 2012-11-04 12:25:02 +10:00
David Beitey
41d3a1e8dd Merge branch 'github-social-icon' into improved-icons
Conflicts:
	docs/changelog.rst
2012-11-04 12:09:28 +10:00
David Beitey
705ab7b0f8 Improve linkedin icon 2012-11-03 22:27:33 +10:00
David Beitey
4afc32c425 GitHub icon also works for git.io addresses in social 2012-11-03 22:21:02 +10:00
David Beitey
868ef2079c Add GitHub social icon support in default theme
Conflicts:
	docs/changelog.rst
2012-11-03 22:13:26 +10:00
David Beitey
e2c3701757 Decode HTML entities in titles on WP import 2012-11-03 21:55:56 +10:00
Alexis Métaireau
bfc963a065 We pass lists, not dicst! 2012-10-30 18:57:06 +01:00
Alexis Métaireau
ac85e9c819 Merge branch 'pr/223' 2012-10-30 11:18:24 +01:00
Bruno Binet
3734c48489 add test for TemplatePagesGenerator 2012-10-30 09:56:10 +01:00
Bruno Binet
54eee3f28a update TemplatePagesGenerator:
* bugfix: now supports custom path for path where to find the content files
* TEMPLATE_PAGES settings is now of the form:
    { 'jinja2/src/file.html': 'dest/file.html' }
* update doc
2012-10-30 09:56:10 +01:00
Bruno Binet
e0e1b3eecf rename STATIC_PAGES to TEMPLATE_PAGES 2012-10-30 09:56:10 +01:00
Tarek Ziade
083a8cc172 added some doc about STATIC_PAGES
Conflicts:
	docs/settings.rst
2012-10-30 09:56:10 +01:00
Tarek Ziade
a91f1cab5d activate the static page generator only if the option is used
Conflicts:
	pelican/__init__.py
2012-10-30 09:56:10 +01:00
Tarek Ziade
7127676f71 added a static pages generator
Conflicts:
	pelican/__init__.py
	pelican/generators.py
	pelican/settings.py
2012-10-30 09:56:08 +01:00
Alexis Métaireau
84c708b74b Revert "Get HtmlReader to work again"
This reverts commit 39db9ddcfd.

Conflicts:

	tests/test_readers.py
2012-10-29 00:36:42 +01:00
Alexis Métaireau
4349a5e815 Update settings documentation. Fix #562 2012-10-28 23:52:16 +01:00
Alexis Métaireau
92d8208309 Merge branch 'master' of github.com:getpelican/pelican 2012-10-28 23:50:49 +01:00
Alexis Metaireau
4234bfc1c2 Merge pull request #564 from edthedev/master
Docs: Added missing link to issue tracker.
2012-10-28 15:48:20 -07:00
Bruno Binet
c0ed9e1cff add test for USE_FOLDER_AS_CATEGORY setting (#517) 2012-10-28 20:54:39 +01:00
Martin Brochhaus
47c972e21a Added USE_FOLDER_AS_CATEGORY setting.
This allows users to organize their files in ways where the subfolder name
would not make a good category name (i.e. /2012/09/). Set this to ``False``
and the subfolder will no longer be used as a standard category,
`DEFAULT_CATEGORY` will be used instead.
2012-10-28 20:43:45 +01:00
Edward Delaporte
318518ee1f Added a second link to the issue tracker - for those who jump directly to the section without seeing the earlier section. 2012-10-28 14:32:48 -05:00
Brendan Wholihan
f7a2f8ea47 Removed AUTHOR defaulting to OS User /John Doe, so both a blank or undefined (None) author is possible.
Reverted templates back to checking author object, since a None object is possible. Name could be checked for blank if required
ATOM spec states an author element should be provided, so passes a blank name if not specified
Updated unit test
2012-10-26 18:20:05 +01:00
Alexis Metaireau
a282499055 Merge pull request #559 from saimn/importer
refactor the check of executable for unit tests
2012-10-25 15:50:24 -07:00
Simon
ae8cf9defd refactor the check of executable for unit tests
pandoc was checked directly with a `os.system` call, and the output with version
and copyright of pandoc was displayed when running tests.

- replace the pandoc check with the `skipIfNoExecutable` function.
- in `skipIfNoExecutable`, the `valid_exit_code` is not needed, the executable
  is not found if an `OSError` exception is catched.
2012-10-25 22:50:29 +02:00
Alexis Métaireau
0ebba1c4ab merge with master 2012-10-25 14:54:19 +02:00
Alexis Métaireau
dd299d272b merge win-encoding 2012-10-25 14:47:57 +02:00
Alexis Métaireau
b349bdd80f Make it obvious in the docs that you need to indent the identifier as well 2012-10-25 14:37:19 +02:00
Bruno Binet
324c7c3674 Merge branch 'bstpierre-files-to-copy-missing-dir' 2012-10-25 14:25:03 +02:00
Bruno Binet
b6cc6bd2d4 remove useless try/except clause
exception will be caught and logged later in Pelican stack
2012-10-25 14:24:17 +02:00
Alexis Métaireau
93c04cd79f merge with master 2012-10-25 13:20:27 +02:00
Thanos Lefteris
d38b32abfd Docs for FILES_TO_COPY setting 2012-10-23 02:04:40 +02:00
Bruno Binet
0856b72c3c cosmetics
lines should be < 80 chars
2012-10-22 23:05:18 +02:00
jawher
a11726783e TRANSLATION_FEED is now split into TRANSLATION_FEED_ATOM and TRANSLATION_FEED_RSS to match the other feed configuration keys
Incidentally, Pelican can now generate RSS translation feeds.
2012-10-22 22:52:06 +02:00
Bruno Binet
4f1e3293ff Merge pull request #547 from bbinet/refactor-settings
Refactor how settings are handled
2012-10-21 15:37:02 -07:00
Bruno Binet
ba99bc5528 Merge commit 'bc0f7ae4f6' 2012-10-21 23:59:11 +02:00
Alexis Metaireau
25e9cccbdf Merge pull request #544 from Lothiraldan/plugins
Add a multi_part plugin
2012-10-20 14:27:56 -07:00
Alexis Metaireau
ddcb4ec72f Merge pull request #543 from Lothiraldan/master
Add a new signal article_generator_finalized, called at the end of ArticleGenerator.generate_context
2012-10-20 14:27:19 -07:00
Brendan Wholihan
bc0f7ae4f6 Amended utils copy so that a warning is produced if a source file is not found in FILES_TO_COPY whilst copying. eg if there is a typo in the file name, or the file is moved. 2012-10-20 16:35:24 +01:00
Brendan Wholihan
94877e033b So that Authors display and output can be disabled for single user sites, allow the AUTHOR setting to be set to an empty string ''.
An author is needed, but was defaults to OS user, or 'John Doe'. If a blank author is provided, it generated authors/.html file, and templates display just "by "
Updated generators.py and templates to ignore Authors objects which have a blank name
2012-10-18 19:55:00 +01:00
Bruno Binet
4029f2ec82 refactoring so that command line options override settings
and Pelican class now accepts a single parameter ``settings``
2012-10-16 01:35:39 +02:00
Bruno Binet
136e2e46d8 remove useless default_settings param in configure_settings 2012-10-15 22:49:24 +02:00
FELD Boris
178d63b154 Add a multi_part plugin
It list all parts of a blog post, helping to create a navigation menu between all the parts
2012-10-13 19:21:20 +02:00
FELD Boris
22f3c40385 Add a new signal article_generator_finalized, called at the end of ArticleGenerator.generate_context 2012-10-13 19:17:16 +02:00
Alexis Métaireau
41b93f3dcc add gittip to the output 2012-10-13 02:12:41 +02:00
Alexis Métaireau
51c08601dc oops 2012-10-13 01:10:52 +02:00
Alexis Métaireau
299277b140 merge rachid changes 2012-10-12 23:31:37 +02:00
Alexis Métaireau
34218ee132 fix the tests 2012-10-12 23:28:18 +02:00
Alexis Métaireau
17dc36aad6 merge upstream 2012-10-12 23:22:55 +02:00
Alexis Métaireau
cce962f3f0 Change the background color of the code-blocks on the default theme. Fix #511 2012-10-12 23:01:51 +02:00
Alexis Métaireau
9add2151c3 Don't force the number of categories to be equal to 1. Fixes #521 2012-10-12 23:01:50 +02:00
Alexis Métaireau
7892c33ec9 Fix the settings about DATE_FORMAT*S*. Fix 540 2012-10-12 23:01:50 +02:00
Thanos Lefteris
ee36f53cb2 Monospace default values of settings 2012-10-12 23:01:50 +02:00
tBunnyMan
ffc8ec7a5b Add sleep to no files exception to avoid CPU load 2012-10-12 23:01:50 +02:00
Chris Streeter
d718bc2eba Apply the string formatting to {TAG,CATEGORY}_FEED urls. 2012-10-12 23:01:50 +02:00
Chris Streeter
da1efcd847 Correctly use the right variable for webassets
According to [the webasset docs](http://webassets.readthedocs.org/en/latest/integration/jinja2.html#using-the-tag)
the variable should be `ASSET_URL` instead of `ASSETS_URL`.
2012-10-12 23:01:50 +02:00
Remi Rampin
7d1c362635 Fixed escaping in files generated from quickstart
Variables are properly escaped before they are replaced in the
templates.
2012-10-12 23:01:50 +02:00
Rémy HUBSCHER
61fe02f411 fix-pelican-rsync_upload-makefile 2012-10-12 23:01:50 +02:00
Justin Mayer
cd85151f97 Add Typogrify to docs as optional dependency 2012-10-12 23:01:50 +02:00
Justin Mayer
c08ab18bff Clarify specifying paths in settings. Closes #477. 2012-10-12 23:01:50 +02:00
Justin Mayer
f7a28dc661 Clarify docs for specifying theme. Closes #475. 2012-10-12 23:01:50 +02:00
Justin Mayer
c659695c5d Add a list of plugins to the docs. Closes #493. 2012-10-12 23:01:50 +02:00
Justin Mayer
9dcf4e5438 Eliminate extraneous whitespace 2012-10-12 23:01:50 +02:00
Justin Mayer
007cd9b8fd Minor doc changes, including those for webassets 2012-10-12 23:01:50 +02:00
epatters
ac67587b79 BUG: Typogrify not applied to pages. 2012-10-12 23:01:50 +02:00
Wladislaw Merezhko
3a6196ccd1 Add two new parameters for creating pdf
* PDF_STYLE - name of custom style to use when generating pdf
* PDF_STYLE_PATH - path where custom style is located
2012-10-12 23:01:50 +02:00
Wladislaw Merezhko
7ffa9e21d8 Change name of utils.open function to pelican_open and refactor this change across project. 2012-10-12 23:01:50 +02:00
Nico Di Rocco
31afafda0f Added possible uses for the finalized signal to the docs 2012-10-12 23:01:50 +02:00
tBunnyMan
914653f140 Clean up Dev Requirements and add typogrify & webassets
typogrify & webassets are optional packages for usage but should be included for testing by developers and CI
dev_requirements also had packages that setup.py covers already. Added comments for redundancy
2012-10-12 23:01:50 +02:00
tBunnyMan
d0e5c3c151 Add the unit2 tests to tox
Remove unnecessary dependencies
These dependencies are installed when tox runs setup.py
2012-10-12 23:01:50 +02:00
m-r-r
0073c64e21 Sitemap plugin & get_generators signal
This is a combination of 13 commits:

1. New signal for registering custom generators
2. New plugin: pelican.plugins.sitemap
3. pelican.plugins.sitemap: more settings
4. pelican.plugins.sitemap: translations are indexed
5. pelican.plugins.sitemap: added documentation
6. pelican.plugins.sitemap: added XML DTD & W3C dates
7. pelican.plugins.sitemap: removed a <changefreq> bug
8. the `get_generators` can now return a tuple
9. pelican.plugins.sitemap: cleaned the code
10. pelican.plugin.sitemap: settings changes
11. sitemap plugin: improved configuration & documentation
12. sitemap plugin: :set spell
13. sitemap plugin: removed useless whitespaces
2012-10-12 23:01:50 +02:00
Nico Di Rocco
966065767a Added description for the finalized signal in the docs 2012-10-12 23:01:50 +02:00
Dirk Makowski
5e45aaab78 Patch to allow relative ASSET_URL
Previously, webassets' ASSET_URL always was absolute.
This patch allows a relative ASSET_URL, depending on Pelican's
RELATIVE_URLS setting.

Hint for templates:
-------------------
Current version of webassets seem to remove any relative
paths at the beginning of the URL. So, if RELATIVE_URLS
is on, ASSET_URL will start with 'theme/', regardless if we
set assets_url here to './theme/' or to 'theme/'.
XXX However, this breaks the ASSET_URL if user navigates to
a sub-URL, e.g. if he clicks on a category. To workaround this
issue, I use
    <link rel="stylesheet" href="{{ SITEURL }}/{{ ASSET_URL }}">
instead of
    <link rel="stylesheet" href="{{ ASSET_URL }}">

Maybe this hint is worth to be included in the documentation.
I have it also written as comments in the source.
2012-10-12 23:01:50 +02:00
Nico Di Rocco
519d664a40 Added a new signal finalized that is dispatched when pelican finishes.
This signal can then be used for post processing.
2012-10-12 23:01:50 +02:00
Wladislaw Merezhko
b9c0f07f57 Fixing pdf generation issue 2012-10-12 23:01:49 +02:00
Alexis Metaireau
48625964f1 Merge pull request #510 from nrocco/sourcegen
New source file .text generator
2012-10-12 13:57:18 -07:00
Alexis Metaireau
c7fa7b6467 Merge pull request #520 from perry/master
Output author details in pelican_import
2012-10-12 13:39:32 -07:00
Alexis Metaireau
848fdedec7 Merge pull request #523 from StephaneBunel/master
New config parameter to enable Markdown extensions
2012-10-12 13:32:30 -07:00
Alexis Metaireau
cf40006b58 Merge pull request #529 from bstpierre/delete-output-dir
Fix DELETE_OUTPUT_DIRECTORY crash when no output dir
2012-10-12 13:29:34 -07:00
Alexis Metaireau
1d14b19f15 Merge pull request #536 from bstpierre/pagination-no-extension
Fix #535: pagination on files without an extension
2012-10-12 13:24:21 -07:00
Alexis Metaireau
38dac13ee3 Merge pull request #538 from bstpierre/sitemap-pages-dont-exist
Fix #537: sitemap.xml contains pages that don't exist
2012-10-12 13:22:16 -07:00
Brian St. Pierre
3606debb15 Fix #537: sitemap.xml contains pages that don't exist 2012-10-07 20:31:20 -04:00
Brian St. Pierre
b1f65f6c9f Fix #535: pagination on files without an extension 2012-10-06 22:35:47 -04:00
Stéphane Bunel
5e895317f6 FIX: Standardizing "extentions" to "extensions" 2012-10-03 22:42:07 +02:00
Stéphane Bunel
e0674aad87 FIX: Standardizing "extentions" to "extensions" 2012-10-03 22:37:18 +02:00
Stéphane Bunel
ee46becaf9 FIX: Standardizing "extentions" to "extensions" 2012-10-03 22:29:59 +02:00
Stéphane Bunel
d9d58b0510 FIX: "extentions" -> "extensions" 2012-10-03 22:28:00 +02:00
Nico Di Rocco
c53a06a5d5 Simplified configuration option to be more flexible
As @ametaireau suggested: instead of having logic that prepends the
OUTPUT_SOURCES_EXTENSION with a '.' we allow the user more
flexibility to control the extension that can be used.
2012-10-03 22:06:45 +02:00
Brian St. Pierre
01293dedaa Fix #530: FILES_TO_COPY error when dest dir missing
If the destination directory specified by FILES_TO_COPY does not
exist, site generation crashes with a CRITICAL error. This creates the
destination if it does not exist.
2012-10-02 19:17:43 -04:00
Alexis Metaireau
1580f7fea7 Merge pull request #527 from justinmayer/quickstart
Add Typogrify to docs as optional dependency
2012-10-02 07:12:55 -07:00
Brian St. Pierre
15875b8bd1 Fix DELETE_OUTPUT_DIRECTORY crash when no output dir 2012-10-02 08:51:31 -04:00
Alexis Metaireau
52ce7983e4 Merge pull request #525 from alefteris/settings-doc
Monospace default values of settings
2012-10-01 08:44:22 -07:00
Thanos Lefteris
0bb323f63c Monospace default values of settings 2012-10-01 18:32:53 +03:00
Stéphane Bunel
1beff31bd8 FIX test_generate_context() to include new file content/article_with_markdown_markup_extentions.md 2012-09-28 23:29:10 +02:00
Stéphane Bunel
45c836fdf5 Update docs and tests for MARKDOWN_EXTENTIONS 2012-09-28 23:09:57 +02:00
Stéphane Bunel
226aa2d8f3 Update docs and tests for MARKDOWN_EXTENTIONS 2012-09-28 22:54:01 +02:00
Alexis Metaireau
74e9c12695 Merge pull request #524 from tbunnyman/loopCPUfix
Add sleep to no files exception to avoid CPU load
2012-09-28 10:03:13 -07:00
tBunnyMan
55783fc3a1 Add sleep to no files exception to avoid CPU load 2012-09-28 08:53:59 -07:00
Nico Di Rocco
a7dd21ffaf Added a new setting OUTPUT_SOURCES_EXTENSION
Using this configurable setting users can control what extension will be
appended to filenames by the SourcesGenerator.

The default is to use the ``.text`` extension.
2012-09-28 14:59:05 +02:00
stephane
4f5253bcb3 Add MARKDOWN_EXTENTIONS configuration parameter to enable Markdown extentions of your choice.
Ex: MARKDOWN_EXTENTIONS = [ 'toc', ] enable TOC markup to generate Table of Contents.
2012-09-27 19:49:42 +02:00
Perry Roper
6afc9f7902 Add missing colon 2012-09-26 19:59:47 +01:00
Perry Roper
cf3697199a Output author details in pelican_import 2012-09-26 19:58:15 +01:00
Alexis Metaireau
7828614459 Merge pull request #471 from nrocco/master
New signal called 'finalized'
2012-09-25 15:03:38 -07:00
Alexis Metaireau
32429d3091 Merge pull request #488 from dmdm/relative_urls_for_webassets
Patch to allow relative ASSET_URL
2012-09-25 15:03:00 -07:00
Alexis Metaireau
ea97e9a9a8 Merge pull request #508 from infinitylx/CyrilicPdf
Cyrilic pdf
2012-09-25 14:54:55 -07:00
Alexis Metaireau
8473a72ee5 Merge pull request #515 from remram44/master
Escaping values from quickstart
2012-09-25 14:51:54 -07:00
Alexis Metaireau
fc8696bf20 Merge pull request #518 from streeter/feed_string_formatting
Apply the string formatting to {TAG,CATEGORY}_FEED urls.
2012-09-25 14:50:28 -07:00
Chris Streeter
36e86a5854 Apply the string formatting to {TAG,CATEGORY}_FEED urls. 2012-09-23 13:55:22 -07:00
Justin Mayer
a9d370f7be Merge pull request #514 from streeter/asset_url_doc_fix
Correctly use the right variable for webassets
2012-09-19 10:36:29 -07:00
Chris Streeter
e096fb66fb Correctly use the right variable for webassets
According to [the webasset docs](http://webassets.readthedocs.org/en/latest/integration/jinja2.html#using-the-tag)
the variable should be `ASSET_URL` instead of `ASSETS_URL`.
2012-09-19 10:24:51 -07:00
Remi Rampin
b1099477f9 Fixed escaping in files generated from quickstart
Variables are properly escaped before they are replaced in the
templates.
2012-09-17 22:48:11 -04:00
Rémy HUBSCHER
6466bb4384 fix-pelican-rsync_upload-makefile 2012-09-17 14:47:05 +02:00
Nico Di Rocco
0a1a868b37 Added sourcefile generator that generates .text files 2012-09-15 23:11:09 +02:00
Justin Mayer
56e2c67f7f Add Typogrify to docs as optional dependency 2012-09-14 10:06:42 -07:00
Justin Mayer
b8279e1c9c Merge pull request #504 from tbunnyman/update-tox
Clean up tox testing configuration
2012-09-14 08:17:03 -07:00
Nico Di Rocco
81d6d85461 Merge branch 'master' of git://github.com/getpelican/pelican 2012-09-11 22:11:59 +02:00
Justin Mayer
3af7e2251d Clarify specifying paths in settings. Closes #477. 2012-09-11 09:27:26 -07:00
Justin Mayer
728d6076e5 Clarify docs for specifying theme. Closes #475. 2012-09-11 07:29:34 -07:00
Justin Mayer
161f60e569 Add a list of plugins to the docs. Closes #493. 2012-09-11 06:50:33 -07:00
Justin Mayer
20daa28452 Eliminate extraneous whitespace 2012-09-10 20:50:45 -07:00
Justin Mayer
3054e71f5b Minor doc changes, including those for webassets 2012-09-10 20:48:13 -07:00
Alexis Metaireau
389bf3298c Merge pull request #509 from epatters/fix-typogrify
BUG: Typogrify not applied to pages.
2012-09-10 15:55:41 -07:00
epatters
1da88a647a BUG: Typogrify not applied to pages. 2012-09-08 21:39:10 -07:00
Wladislaw Merezhko
8b44fa6a2d Add two new parameters for creating pdf
* PDF_STYLE - name of custom style to use when generating pdf
* PDF_STYLE_PATH - path where custom style is located
2012-09-08 18:24:15 +03:00
Wladislaw Merezhko
0c2625e59d Change name of utils.open function to pelican_open and refactor this change across project. 2012-09-08 13:07:51 +03:00
Nico Di Rocco
ff3c12fd71 Added possible uses for the finalized signal to the docs 2012-09-07 08:56:33 +02:00
Nico Di Rocco
75312305b9 Merge branch 'master' of git://github.com/getpelican/pelican 2012-09-07 08:49:00 +02:00
Wladislaw Merezhko
1ca2a77c05 Merge https://github.com/getpelican/pelican 2012-09-07 08:01:05 +03:00
tBunnyMan
2c85fb0d19 Clean up Dev Requirements and add typogrify & webassets
typogrify & webassets are optional packages for usage but should be included for testing by developers and CI
dev_requirements also had packages that setup.py covers already. Added comments for redundancy
2012-09-04 15:17:59 -07:00
Trae Blain
41fdfa63b1 Fixed page_name call to adapt to the link structure provided by the
Settings file. Also updated the documentation accordingly.

Update documentation to cover new page_name behavior

Fixed page_name to adapt to the links provided by the Settings file. Includes documentation updates as well.

Updated terms to maintain better syntax and consistancy

Added docstring to _from_settings() to clarify the get_page_name argument that was added. Explains why/when this argument is used.

Revert contents.py back to commit 2f29c51

Re-added docstring to _get_settings method, but this time not deleting things I shouldn't

Corrected readability change that was altered during revert.
2012-09-04 08:55:43 -05:00
Guillermo López
77a538e588 always return Unix-like relative paths, even on Windows 2012-09-04 00:29:02 +02:00
tBunnyMan
566530ca18 Add the unit2 tests to tox
Remove unnecessary dependencies
These dependencies are installed when tox runs setup.py
2012-09-02 17:15:55 -07:00
Rachid Belaid
c462237b9d Add new setting EXTRA_TEMPLATES_PATHS
This setting allow to use template which are not in the theme.
Should help to build more generic themes around the content.
2012-09-03 00:57:23 +01:00
Rachid Belaid
dcb50a20b2 Add test for the new signal 2012-09-02 19:55:31 +01:00
Rachid Belaid
6100773c24 Add a new signal content_object_init
It's sent when a new content object is created: Page, Article
2012-09-02 19:20:42 +01:00
Alexis Metaireau
8dcc503bc0 Merge pull request #468 from m-r-r/master
New signal and new plugin
2012-09-02 09:30:29 -07:00
m-r-r
229b0e4dcc Sitemap plugin & get_generators signal
This is a combination of 13 commits:

1. New signal for registering custom generators
2. New plugin: pelican.plugins.sitemap
3. pelican.plugins.sitemap: more settings
4. pelican.plugins.sitemap: translations are indexed
5. pelican.plugins.sitemap: added documentation
6. pelican.plugins.sitemap: added XML DTD & W3C dates
7. pelican.plugins.sitemap: removed a <changefreq> bug
8. the `get_generators` can now return a tuple
9. pelican.plugins.sitemap: cleaned the code
10. pelican.plugin.sitemap: settings changes
11. sitemap plugin: improved configuration & documentation
12. sitemap plugin: :set spell
13. sitemap plugin: removed useless whitespaces
2012-09-02 18:17:22 +02:00
guillermooo
c02926e2ad fix encoding issues in Linux 2012-09-02 10:59:33 +02:00
Florian Jacob
39db9ddcfd Get HtmlReader to work again
wrote unit tests and documentation, improved regular expression.
The HtmlReader is enabled by default now and parses metadata in html
files of the form:
<!-- key:value -->
2012-09-02 10:29:09 +02:00
guillermooo
fc749755df fix encoding problem in Windows 2012-09-02 09:26:58 +02:00
Alexis Metaireau
dfd3fca92b Merge pull request #496 from sigmavirus24/gittip
Add Gittip to social icons.
2012-09-01 02:25:53 -07:00
Ian Cordasco
b911972716 Add Gittip to social icons.
This allows someone to include their gittip link so people can donate to them.
2012-08-31 23:12:09 -04:00
Nico Di Rocco
c1b0e83a44 Added description for the finalized signal in the docs 2012-08-31 22:17:19 +02:00
Nico Di Rocco
680e04b4a1 Merge remote-tracking branch 'upstream/master' 2012-08-31 22:04:05 +02:00
Alexis Metaireau
88555de28c Merge pull request #490 from tbunnyman/fixDEFAULT_CONFIGoverwrite
Deep copy _DEFAULT_SETTINGS instead of linking.
2012-08-30 15:08:28 -07:00
tBunnyMan
663d1e7347 Added extra tests to help prevent regression. 2012-08-30 14:50:52 -07:00
Alexis Metaireau
ffe4bf0b71 Merge pull request #484 from saimn/webassets_doc
Webassets documentation
2012-08-30 14:24:22 -07:00
tBunnyMan
644fd4ed5f Deep copy _DEFAULT_SETTINGS instead of linking.
This caused the defaults to be overwritten and edge case bugs with tests.
The test for empty setting needed to be updated to reflect that the method
for setting up the local settings sets extra settings.
2012-08-29 13:36:15 -07:00
the Bunny Man
9c9963b608 Merge pull request #487 from getpelican/DRY-functional-tests
avoid repetition in the functional tests
2012-08-29 11:25:01 -07:00
the Bunny Man
fb8a069d4a Merge pull request #476 from tbunnyman/fixAutorunInfLoop
Fix autorun inf loop
2012-08-29 08:58:19 -07:00
Dirk Makowski
0ec0cf9d0e Patch to allow relative ASSET_URL
Previously, webassets' ASSET_URL always was absolute.
This patch allows a relative ASSET_URL, depending on Pelican's
RELATIVE_URLS setting.

Hint for templates:
-------------------
Current version of webassets seem to remove any relative
paths at the beginning of the URL. So, if RELATIVE_URLS
is on, ASSET_URL will start with 'theme/', regardless if we
set assets_url here to './theme/' or to 'theme/'.
XXX However, this breaks the ASSET_URL if user navigates to
a sub-URL, e.g. if he clicks on a category. To workaround this
issue, I use
    <link rel="stylesheet" href="{{ SITEURL }}/{{ ASSET_URL }}">
instead of
    <link rel="stylesheet" href="{{ ASSET_URL }}">

Maybe this hint is worth to be included in the documentation.
I have it also written as comments in the source.
2012-08-28 00:50:17 +02:00
Alexis Metaireau
bba3caa697 avoid repeatition in the functional tests 2012-08-27 22:17:11 +02:00
Justin Mayer
000210d875 Improve devserver durability. Refs #473.
Three changes:

1. Fix inconsistent "pwd" behavior by using make's $(CURDIR) builtin.
2. Change bash shebang to the more-portable form.
3. Tell users when Pelican and SimpleHTTPServer have been backgrounded.
2012-08-27 13:09:25 -07:00
the Bunny Man
2873a09fd0 Merge pull request #479 from tbunnyman/issue#405
Cleaned up tests.
2012-08-27 09:32:40 -07:00
the Bunny Man
79745f77c0 Merge pull request #474 from tbunnyman/fix#473
use lowercase pwd since only Mac OS X allows uppercase commands
2012-08-27 08:12:03 -07:00
Simon
472063e98c add some doc for webassets:
- usage of the sass compiler as discussed in PR #441
- debug mode and compilers (#481)
2012-08-25 23:16:50 +02:00
Simon
d1d737777c fix issue #480 2012-08-25 22:50:19 +02:00
tBunnyMan
9435b381ed Cleaned up tests.
Used assertItemsEqual in article generation to create more precise tests than with an elif chain
Separated out categories out into their own named test for clarity
Closes #405
2012-08-24 13:14:14 -07:00
BunnyMan
63f37eeeda Merge pull request #478 from davidmarble/fix-docs-start
docs: Pelican outputs to output/ not content/. Markdown ::: syntax must be indented
2012-08-23 20:37:47 -07:00
David Marble
831e1d04b9 docs: Pelican outputs to output/ not content/. Markdown ::: syntax must be indented 2012-08-23 18:31:45 -07:00
tBunnyMan
95af2e46ec Missed a line in commit. 2012-08-23 13:13:41 -07:00
tBunnyMan
a37ba369ef Implemented better "valid files not found" behavior.
Used an exception so show error state.
Used a bool flag to make sure the error is only shown once PER error.
Updated tests to check for the correct Exception raised
2012-08-23 12:44:22 -07:00
tBunnyMan
86da6d1f2e Check for value error caused by no valid files found with files_changed
This causes an infinite loop when in auto-reload
Fix #467
Fix #451
Fix #443
2012-08-23 11:05:07 -07:00
tBunnyMan
62f190d574 use lowercase pwd since only Mac OS X allows uppercase commands
Fix #473
2012-08-23 07:58:39 -07:00
Nico Di Rocco
e9a0717aea Added a new signal finalized that is dispatched when pelican finishes.
This signal can then be used for post processing.
2012-08-22 23:05:07 +02:00
Justin Mayer
8ecebc9310 Merge pull request #470 from case/patch-1
added a missing space
2012-08-21 14:25:31 -07:00
Eric Case
be5b5e880d added a missing space 2012-08-21 14:14:10 -07:00
Justin Mayer
b1866c8f92 Change email address in docs to "authors@" alias 2012-08-21 09:04:37 -07:00
Wladislaw Merezhko
ef3cad5421 Fixing pdf generation issue 2012-08-18 20:32:43 +03:00
Alexis Metaireau
e4df1da252 Merge pull request #449 from Julian/settings
A Possible Re-implementation for Issue #445
2012-08-16 04:40:15 -07:00
Alexis Metaireau
7b5b99b04b Merge pull request #433 from iurisilvio/patch-1
Use async Google Analytics code.
2012-08-16 04:31:40 -07:00
Alexis Metaireau
3aca0d8061 Merge pull request #462 from zoresvit/fix-typos
Fix typos
2012-08-16 04:29:03 -07:00
Zoresvit
892761f732 Fixed description of copying themes/static content.
The content from `static` directory is actually copied into `theme/`, not `theme/static/`.
2012-08-16 14:19:10 +03:00
Zoresvit
515847fdd2 Include index in format() string.
Argument index is included in .format() method format string in order to be friendly with various Python versions and consistent with the rest of the code.
2012-08-16 14:17:46 +03:00
Alexis Metaireau
ec14df9fbb add a way to run setup.py test 2012-08-13 20:58:35 +02:00
Alexis Metaireau
10f75524fc PEP8-ify 2012-08-13 20:58:35 +02:00
Justin Mayer
cadcfa43c3 Increment version to 3.1 in changelog and setup.py 2012-08-08 12:18:02 -07:00
Justin Mayer
440a68636b Fix silly mistakes in last doc update 2012-08-08 10:27:45 -07:00
Justin Mayer
532001c851 Add FAQ entry re: arbitrary metadata in templates 2012-08-08 10:21:29 -07:00
Justin Mayer
3bf377fd5f Minor doc fixes 2012-08-08 09:29:04 -07:00
Justin Mayer
68cf8d5c3d Update Pelican 3.0 release date in changelog 2012-08-08 08:45:04 -07:00
Alexis Metaireau
237dedfae0 Merge changes to the README 2012-08-06 20:09:36 +02:00
Feth AREZKI
e18a63e992 make image clickable. also fix url :) 2012-08-06 18:32:20 +02:00
Feth AREZKI
1eaaf4d8d8 add travis-ci url -> see why build breaks
that deleted some trailing spaces
2012-08-06 18:12:54 +02:00
Justin Mayer
c0e3926b0d Prepare for 3.0 release, make README more readable
Since PyPI doesn't seem to handle anything but the most basic of reST
formatting, moving the inline links to the end of the file should
improve readability when the file is viewed in its raw form. Also
updated changelog with the 3.0 release date.
2012-08-06 07:40:10 -07:00
Justin Mayer
a3e24949af Provide specific links to virtualenvwrapper docs
Rather than detail how to install and configure virtualenvwrapper, it
seems best to instead link to the appropriate external docs.
2012-08-06 06:11:54 -07:00
Feth Arezki
8f7a3044ec Update docs/getting_started.rst
virtualenvwrapper requires a shell restart
2012-08-06 14:24:38 +02:00
Justin Mayer
0c02536605 Give devserver its own make target
Restore "make serve" to a non-backgrounded SimpleHTTPServer process and
give the develop_server.sh its own make target at "make devserver".
Add a few missing make targets to the help list and re-order targets for
consistency. Add note to docs regarding how to stop the devserver.
2012-08-05 17:25:39 -07:00
Justin Mayer
beb4dccc8c Doc links changed to new domain. Other doc fixes. 2012-08-04 11:15:44 -07:00
Kyle Fuller
b72692baaf README: The build status should point to new repo 2012-08-04 17:13:57 +02:00
Kyle Fuller
7732482738 Merge pull request #452 from clinthowarth/patch-1
Update README to new project home
2012-08-04 08:11:51 -07:00
Clint Howarth
aeb6a4842f Update README to new project home 2012-08-03 23:34:46 -03:00
Justin Mayer
7ee6fdd9e6 Make develop_server.sh executable. Refs #443.
The pelican-quickstart command generates a develop_server.sh file that
must have executable permissions in order to run.
2012-08-03 08:26:19 -07:00
Justin Mayer
24d5a6053e Various fixes and improvements to the docs 2012-08-01 18:20:12 -07:00
Julian Berman
7cb18a088e Reimplement settings loading to preserve __file__ 2012-08-01 13:36:47 -04:00
Julian Berman
baeec62e07 Ignore coverage.py 2012-08-01 13:02:15 -04:00
Justin Mayer
9df639b403 Settings docs: some values need quotes, some don't
Some folks have run into trouble when configuring settings because
they wrap integer values in quotes or forget quotes for string-based
values. Added clarification to docs that will hopefully reduce confusion
in the future.
2012-07-31 11:51:38 -07:00
Justin Mayer
f4eea743db Update Pelican project domain in a few more places 2012-07-31 09:41:45 -07:00
Alexis Metaireau
0e4d493d93 typogrify also does some changes on the abbr 2012-07-27 00:34:47 +02:00
Alexis Metaireau
f3280071c1 change the link to pelican in the default theme 2012-07-27 00:31:02 +02:00
Alexis Metaireau
cf71ed75a4 the repositories are now hosted under 'getpelican' 2012-07-27 00:27:08 +02:00
Alexis Metaireau
22c88e4de3 update typogrify support 2012-07-26 22:02:06 +02:00
Alexis Metaireau
d5f1747993 we don't need to have a max size for the title on the default theme 2012-07-23 18:56:47 +02:00
Alexis Metaireau
0494cd1406 remove the selection color in the default theme 2012-07-23 18:56:21 +02:00
Alexis Metaireau
5cb009d782 if not virtualenv is defined, fallback on '.' 2012-07-23 18:37:12 +02:00
Alexis Metaireau
1c5f9e6103 Merge pull request #436 from tbunnyman/FixPR429
Fixed bad signal placement for pages
2012-07-23 02:11:06 -07:00
tBunnyMan
b0d860b7e0 Fixed bad signal placement for pages
The signal needs to be in the loop that iterates through the pages since it runs on each page and uses the page metadata.
Also fixed for pep8
Fix #432
2012-07-22 09:08:47 -07:00
Iuri de Silvio
172555bbce Use async Google Analytics code. 2012-07-20 21:23:27 -03:00
Alexis Metaireau
98f74a9094 Merge pull request #431 from synapticarbors/path_init
Modify system path to ensure current directory is included
2012-07-20 05:01:10 -07:00
Joshua Adelman
6075024469 Modify system path to ensure current directory is included 2012-07-20 07:38:16 -04:00
Alexis Metaireau
20d5c1ab13 update the desired output so the tests pass 2012-07-20 12:57:48 +02:00
Alexis Metaireau
46c19e3cb0 Merge pull request #411 from solsticedhiver/master
Fix issue #175
2012-07-20 03:55:05 -07:00
Alexis Metaireau
8007c20c79 Merge pull request #418 from tbunnyman/WarnOnFeedGeneration#383
Update: De-appreciate FEED for FEED_RSS & FEED_ATOM
2012-07-20 03:53:18 -07:00
Alexis Metaireau
db79abdc13 Merge pull request #419 from tbunnyman/ReverseArchiveOrder#304
Change default REVERSE_ARCHIVE_ORDER to true
2012-07-20 03:51:59 -07:00
Alexis Metaireau
1ba712bea9 Merge pull request #423 from lueo/asian_slug
Add unidecode for translating slugs in asian languages
2012-07-20 03:50:55 -07:00
Alexis Metaireau
65948c8137 Merge pull request #429 from synapticarbors/page_signal
Added signals to plugin for pages generation
2012-07-20 03:50:30 -07:00
Alexis Metaireau
50b02340d0 Merge pull request #430 from djco/inclusive-tarball
Inclusive tarball
2012-07-20 02:39:57 -07:00
Dirkjan Ochtman
bfd3f37bf4 Include test assets in distribution 2012-07-20 11:13:35 +02:00
Dirkjan Ochtman
d48dd63755 Include THANKS in distribution 2012-07-20 10:50:31 +02:00
Joshua Adelman
597dba1391 Added signals to plugin for pages generation 2012-07-19 20:59:48 -04:00
tBunnyMan
625c1d167d Documentation Fix 2012-07-18 11:30:02 -07:00
tBunnyMan
fe91caf325 Changed wording of the setting to NEWEST_FIRST_ARCHIVES
Also updated documentation and tested to make sure behavior matches expected wording
2012-07-18 11:18:48 -07:00
Alexis Metaireau
809ba7f04e Merge pull request #427 from djco/master
Documentation for abbr, move changelog into docs
2012-07-18 10:04:31 -07:00
Dirkjan Ochtman
73351e1eab Add dates to changelog 2012-07-18 18:59:23 +02:00
Dirkjan Ochtman
3277a219fd Add some reST markup to changelog, tweak language 2012-07-18 18:51:15 +02:00
Dirkjan Ochtman
d6f358182a Move changelog into docs 2012-07-18 18:41:09 +02:00
Dirkjan Ochtman
a84d0bf5c5 Add CHANGELOG note about abbr 2012-07-18 18:28:34 +02:00
Dirkjan Ochtman
da5db5aac9 Add documentation for abbr in reST. 2012-07-18 18:22:31 +02:00
Dirkjan Ochtman
636fd6cc38 Add support for abbreviations to reST translator (fixes #395). 2012-07-17 13:30:06 +02:00
tBunnyMan
4a9d2e86cf Moved all rss headers from FAQ into base 2012-07-16 14:52:19 -07:00
tBunnyMan
e626f771c4 Add Themes and FAQ documentation on the new FEED_ATOM
Added all the FEED_ATOM variables to _handle_deprecation
Put FEED_ATOM around `if` in notmyidea
2012-07-16 13:47:39 -07:00
tBunnyMan
5f958ae84d Refactor atom feed names for clarity
FEED -> FEED_ATOM
TAG_FEED -> TAG_FEED_ATOM
CATEGORY_FEED -> CATEGORY_FEED_ATOM
2012-07-16 09:35:05 -07:00
Alexis Metaireau
be2f04f082 Merge pull request #408 from tbunnyman/develop_server
Added the delevop_server script
2012-07-16 08:53:31 -07:00
tBunnyMan
18183632dc Fixed the wording for the quickstart 2012-07-16 08:42:05 -07:00
Leonard Huang
6f40e452e1 Add unidecode for translating slugs in asian languages 2012-07-16 11:36:20 +08:00
Alexis Metaireau
18019efd38 Merge pull request #421 from defnull/patch-1
Fixed left and right aligned images in main.css
2012-07-15 16:21:01 -07:00
Marcel Hellkamp
63cff4c9a0 Fixed left and right aligned images in main.css 2012-07-15 23:41:07 +03:00
tBunnyMan
1e8b05984a Add reference to FAQ statement about feeds 2012-07-14 18:26:33 -07:00
tBunnyMan
6393df3bfe Fix Spelling 2012-07-14 18:08:11 -07:00
tBunnyMan
79e480a894 Change default REVERSE_ARCHIVE_ORDER to true
Updated documentation and updated tests to reflect correct default order
Fixes #304
2012-07-14 17:53:10 -07:00
tBunnyMan
d9817f9a96 Test for FEED & FEED_RSS before generation.
Then we bypass all feed generation of both are set to None or throw a warning if SITEURL is unset.
Updated all documentation, to make sure the usage and warning is clear.
2012-07-14 17:05:04 -07:00
Alexis Metaireau
f4ab1b2cd0 Merge pull request #407 from tbunnyman/fix_publisconf
Small change to fix #406
2012-07-13 09:12:27 -07:00
tBunnyMan
ec23c94645 Made the develop server init script it's own question per req.
Cleaned up an improper whitespace found on 207 as well.
2012-07-12 07:32:08 -07:00
Alexis Metaireau
1e7c939953 pep8-ify 2012-07-12 15:29:08 +02:00
Samrat Man Singh
e92937eea0 Merge remote-tracking branch 'upstream/master' 2012-07-12 14:29:56 +05:45
Alexis Metaireau
e196fb95e1 Merge branch 'master' of github.com:ametaireau/pelican into fix-functional-tests 2012-07-12 10:39:13 +02:00
Alexis Metaireau
76a176f647 Merge pull request #416 from tbunnyman/autoreloadFix#399
Catch and report exceptions in Auto-reload
2012-07-12 01:33:16 -07:00
Alexis Metaireau
0fdd2654f0 Merge pull request #417 from tbunnyman/InconsistentWarning#397
Inconsistent warning/error, pages failing switched to warning.
2012-07-12 01:27:59 -07:00
tBunnyMan
3c5f6e1887 Inconsistent warning/error, pages failing switched to warning.
Fixes #397
2012-07-11 21:04:01 -07:00
tBunnyMan
70ed05625f Catch and report exceptions in Auto-reload
Fixes #399
Also updated the keyboard interrupt to report before quit.
2012-07-11 20:30:56 -07:00
Samrat Man Singh
9ef8df9a19 Remove else: return 2012-07-11 14:53:45 +05:45
Samrat Man Singh
2b933faaf2 Add usage and intallation instructions 2012-07-11 08:52:00 +05:45
Samrat Man Singh
d2a28350ff don't reverse ranked_posts 2012-07-11 01:34:01 +05:45
Samrat Man Singh
d9b5ee10de moved related_posts to plugin 2012-07-11 01:16:19 +05:45
Samrat Man Singh
875734f963 Pull from ametaireau / pelican 2012-07-10 20:56:00 +05:45
Samrat Man Singh
53a1c21a98 More changes to related_posts 2012-07-10 20:43:43 +05:45
Samrat Man Singh
a0812eeb17 Several changes to related_posts. 2012-07-10 19:52:59 +05:45
Alexis Metaireau
4ce5adb2a0 Merge branch 'master' of github.com:ametaireau/pelican into fix-functional-tests 2012-07-10 13:51:34 +02:00
Alexis Metaireau
d726e5e81c Merge pull request #404 from tbunnyman/PerPageTemplates#376
Add per page/article templates. Closes #376
2012-07-10 04:51:17 -07:00
Alexis Metaireau
4d23ffc112 Updated the functional tests to match latest changes. 2012-07-10 13:42:43 +02:00
Samrat Man Singh
ddc0aa0e82 Related posts is now working, but needs some actual logic. 2012-07-10 11:06:07 +05:45
dave mankoff
4ec6cefe1d fix grammar 2012-07-09 22:45:34 -04:00
dave mankoff
a86d5fda71 add documentation for html reader 2012-07-09 22:43:51 -04:00
dave mankoff
c87cf2d2cf Merge branch 'master' into htmlparser 2012-07-09 22:15:36 -04:00
dave mankoff
3c30425276 Merge branch 'master' of git://github.com/ametaireau/pelican 2012-07-09 22:15:04 -04:00
solsTiCe d'Hiver
a0d2d34466 shutil.copytree seems to throw OSError exception too
So revert to previous Exception handling
2012-07-09 20:08:20 +02:00
solsTiCe d'Hiver
842817f110 Revert "Use logging module instead of err function"
This reverts commit 4acbbb8d0f.

I don't know how to use logging/logger

This throws:
No handlers could be found for logger "pelican.tools.pelican_themes"
2012-07-09 20:05:21 +02:00
solsTiCe d'Hiver
4acbbb8d0f Use logging module instead of err function 2012-07-09 19:48:53 +02:00
solsTiCe d'Hiver
10e668a87c Fix issue #175
Force world-readable permission on files and directory of the
themes installed by pelican-themes.
Only on posix system i.e. mostly non Windows

Rationale:
If the theme's files have only -rw------- permissions, once installed
 system wide and owned by root, they will not be accessible to any user but only
root.
2012-07-09 19:39:34 +02:00
tBunnyMan
38ffcfd4c4 Added the delevop_server script
This script and the small changes to quick start's makefile make for easily launching and killing of pelican --debug --autoreload and SimpleHTTPServer.
This is extra useful for working on templates.
2012-07-08 17:50:18 -07:00
tBunnyMan
a1f27d9189 Small change to fix #406 2012-07-07 16:59:58 -07:00
tBunnyMan
dff5b3589b Add per page templates. Closes #376
Also set up helper classes in test_generators.py for cleaner tests
2012-07-07 14:15:43 -07:00
Justin Mayer
dc21efbe10 Improved quickstart config formatting. Fixes #401. 2012-07-07 10:33:47 -07:00
justinmayer
4c060030ae Merge pull request #403 from justinmayer/quickstart
Add dual dev/publish modes to quickstart script
2012-07-07 09:10:19 -07:00
Justin Mayer
18b4d65c4e Clarify quickstart docs and remove spurious line 2012-07-07 08:45:50 -07:00
Justin Mayer
764a2cfa51 Add dual dev/publish modes to quickstart script
Certain configuration options are more useful in production than they
are in development. Some examples might be absolute URLs, external
analytics service identifiers, Disqus comments, etc. This version of the
quickstart script creates two configuration files: one for development
and the other for use when publishing. In addition, the related docs
have been expanded considerably. Last but not least, the quickstart
script will now detect whether there is a project folder associated with
the currently active virtualenv (if any) and use it by default.
2012-07-07 07:41:12 -07:00
Justin Mayer
d8b85580dc Minor syntactical improvements to quickstart 2012-07-05 12:15:55 -07:00
Justin Mayer
72421d4438 Support arbitrary SSH ports in pelican-quickstart
Some folks choose non-standard SSH ports for security reasons, so it
makes sense to try to support that in the pelican-quickstart script.
2012-07-05 11:34:45 -07:00
Alexis Metaireau
6521af5a13 Merge pull request #394 from tbunnyman/issue#380
Small fix for nose tests
2012-07-05 02:19:51 -07:00
tBunnyMan
886a1d94b9 Changed name of the page helper method to prevent nose from running it as a test 2012-07-04 17:09:42 -07:00
Bruno Binet
2b47429c4a update generated output for 'custom' functional test
LC_ALL="C" pelican -o tests/output/custom/ -s samples/pelican.conf.py samples/content/
2012-07-05 01:52:17 +02:00
Bruno Binet
fe9388a7a4 Merge remote-tracking branch 'origin/master' into fix-functional-tests
Conflicts:
	tests/support.py
2012-07-05 01:22:31 +02:00
Alexis Metaireau
236dbb2842 Merge pull request #393 from tbunnyman/DeleteContentsNotDirectory
Change behavior of DELETE_OUTPUT_DIRECTORY to purge contents of the directory…
2012-07-04 15:24:43 -07:00
tBunnyMan
4427424db3 Changed debugging reporting to post file deletion instead of pre file deletion per request. 2012-07-04 15:20:15 -07:00
tBunnyMan
cb3c40256a Merge branch 'master' of github.com:ametaireau/pelican into DeleteContentsNotDirectory 2012-07-04 15:12:39 -07:00
Bruno Binet
7abb2a7a7c temporary skip failing test_basic_generation_works functional test 2012-07-05 00:12:10 +02:00
Bruno Binet
3a2df479da fix test_custom_generation_works functional test 2012-07-05 00:12:05 +02:00
Bruno Binet
775b236c93 update doc for replacing FALLBACK_ON_FS_DATE by DEFAULT_DATE 2012-07-05 00:12:05 +02:00
Bruno Binet
36be150f20 replace FALLBACK_ON_FS_DATE by DEFAULT_DATE
DEFAULT_DATE allows to specify any default date as a tuple in addition to the
fallback on filesystem mtime check
2012-07-05 00:12:05 +02:00
Bruno Binet
b44ea53741 update command to generate functional tests output
we need to force LC_ALL="C" to avoid generating articles/pages in other
languages
2012-07-05 00:11:57 +02:00
tBunnyMan
c07821e8a2 Too many empty lines at end of file 2012-07-04 14:56:52 -07:00
tBunnyMan
2b062ce384 Documentation typo 2012-07-04 14:55:39 -07:00
Alexis Metaireau
ea0a964365 Merge pull request #389 from tbunnyman/issue#380
Add support for `status: hidden` in pages
2012-07-04 14:51:50 -07:00
tBunnyMan
d589450200 Change behavior of DELETE_OUTPUT_DIRECTORY to purge contents of the directory, not the directory itself.
Added Debug level logging for each deletion
Added error level logging when a delete has an exception
Built a test case for clean_output_directory in tests.utils.py
Updated `settings` in documentation to reflect new behavior
Removed the tip from the bottom of getting started since this setting should no longer break web servers pointing to the output directory.
2012-07-04 12:32:20 -07:00
tBunnyMan
cf696939f8 Added tests for page generation.
Currently tests rst & markdown generation, ignoring pages w/ bad status, and status hidden vs published
2012-07-04 10:06:53 -07:00
Alexis Metaireau
76f86fb3ca Merge pull request #391 from MaNDRaXe/master
Fixing a typo in pelican/__init__.py on logger call for debug
2012-07-03 06:59:15 -07:00
Alexandre RODIERE
8a53ee1ad3 Fix typo on debug logger calls. 2012-07-03 15:19:38 +02:00
justinmayer
dff20f250b Merge pull request #388 from sigmavirus24/master
Add -U (--upgrade) to upgrade a theme with pelican-theme
2012-07-01 11:02:41 -07:00
Justin Mayer
9ad93d36a0 Convert code in docs to inline literals
Most of the references to code and settings in the docs were wrapped
in single tickmarks (`), while reStructuredText syntax actually calls
for double tickmarks for inline literals, which are normally rendered
as monospaced text with spaces preserved. Converted the relevant
instances to inline literals, along with some other minor fixes.
2012-07-01 10:52:39 -07:00
tBunnyMan
c2993c4d4e Documentation typo 2012-06-27 07:02:25 -07:00
tBunnyMan
de251bc999 Fixes typo in error message for bad status
Bugfix #380 We want the bad status of page, not article.
2012-06-26 19:51:48 -07:00
tBunnyMan
a0e46c9106 Add support for status: hidden in pages
Resolves #380 If the status metadata is set to 'hidden' on a page it is translated and rendered but not linked anywhere in the site.
2012-06-26 19:26:43 -07:00
Alexis Metaireau
b2ff07d58c we need jinja >= 2.4 2012-06-26 16:28:00 +02:00
Ian Cordasco
707536725d Failed to commit some important changes. 2012-06-25 11:43:12 -04:00
Ian Cordasco
387e5c1ab9 Add upgrade ability to pelican-themes. Fix typos.
I disliked having to do:

$ pelican-theme -r <theme-name> -i <theme-path>

So I modified install() to handle an upgrade of an existing theme. While doing
so, I noticed that in install() and symlink() the script would error with 'no a
directory' instead of 'not a directory'. So I fixed that for you as well.
2012-06-25 08:57:09 -04:00
dave mankoff
847a6fe3ce change 'markdown' to HTML in the comments 2012-06-21 09:12:38 -04:00
dave mankoff
036728a194 properly write out charref's 2012-06-21 09:05:27 -04:00
dave mankoff
c0578eb9ab handle escaped chars in html properly 2012-06-20 23:19:06 -04:00
dave mankoff
56800a1d43 fix failing test with new open context manager 2012-06-20 20:02:41 -04:00
dave mankoff
caa4442abb re-import cgi. properly turn utils.open into a context manager 2012-06-20 19:59:32 -04:00
dave mankoff
c608d39aa4 re-import htmlparser 2012-06-20 19:52:17 -04:00
dave mankoff
7b6a97dee0 git merge master 2012-06-20 19:49:31 -04:00
dave mankoff
0f21583625 Merge branch 'master' of git://github.com/ametaireau/pelican 2012-06-20 19:48:00 -04:00
justinmayer
e89b32511d Merge pull request #374 from maru-sama/master
Small fix for the notmyidea template
2012-06-16 11:55:32 -07:00
Justin Mayer
083f302b19 Remove errant .DS_Store and add to .gitignore 2012-06-16 11:23:55 -07:00
Michael Guntsche
c461c6435d Fix HTML5 conformance of the notmyidea template
The W3C validator complained that the pagination <p> was inside an <ol>.
So just move it out of there.
2012-06-16 19:53:53 +02:00
Alexis Metaireau
f7fcbe7dc9 Merge pull request #373 from asselinpaul/master
Added GoSquared support
2012-06-15 15:31:24 -07:00
Alexis Metaireau
f822e83489 Merge pull request #372 from sigmavirus24/master
Gitorious icon added to default theme
2012-06-15 15:30:53 -07:00
Alexis Metaireau
d3ada540bf Merge pull request #369 from mankyd/summary_len
Max Summary Length
2012-06-15 15:29:04 -07:00
dave mankoff
0373c15e43 include html comments properly in reader 2012-06-14 23:16:27 -04:00
dave mankoff
cc1988fbda new HTMLReader 2012-06-14 23:08:34 -04:00
asselinpaul
d1dfcdafc2 updated
remove GoSqaured from README and template file from the notmyidea theme.
2012-06-14 23:32:23 +02:00
asselinpaul
44cadf7c1f added GoSquared support
GoSquared(analytics) support added in default themes and documentation
(in French and English)
2012-06-14 23:04:23 +02:00
Ian Cordasco
ddb345897e Add gitorious icon to default theme.
See ametaireau/pelican-themes#38 and ametaireau/pelican-themes#39 for
references.
2012-06-14 10:29:44 -04:00
dave mankoff
d93530a6ea merge upstream 2012-06-14 09:31:08 -04:00
Alexis Metaireau
70fd137ced Merge pull request #371 from maru-sama/master
Add Template files to MANIFEST.in
2012-06-13 14:30:46 -07:00
Michael Guntsche
8c375f016f Add template files to MANIFEST.in
Commit 7c53cc8955 put the templates in a separate directory.
As a result setuptools did not include them any longer.
2012-06-13 21:54:40 +02:00
Justin Mayer
336d6fd407 Getting Started documentation improvements
Expanded installation instructions, added Upgrading section, updated
link to Pip installer, and other minor improvements.
2012-06-11 12:27:01 -07:00
dave mankoff
1d5228388b git pull git://github.com/ametaireau/pelican.git 2012-06-11 10:21:13 -04:00
dave mankoff
d9dba38644 Revert "turn utils.open into actual context manager so as to better handle encoding warnings"
This reverts commit 876c7f5093.
2012-06-11 09:00:57 -04:00
dave mankoff
1c708a70ba Revert "better html parser"
This reverts commit c6d1de14f3.
2012-06-11 09:00:36 -04:00
dave mankoff
c6f1d0aada fix SUMMARY_MAX_LENGTH, document it, and test it 2012-06-11 08:39:13 -04:00
dave mankoff
c6d1de14f3 better html parser 2012-06-10 18:27:38 -04:00
dave mankoff
876c7f5093 turn utils.open into actual context manager so as to better handle encoding warnings 2012-06-10 18:26:53 -04:00
dave mankoff
9fb5969c59 Allow settings to specify a summary length, optionally allowing unlimited summary length 2012-06-10 17:58:05 -04:00
Alexis Metaireau
191b1cdb0f skip unless deps are installed in tests 2012-06-10 21:56:17 +02:00
justinmayer
98c8041df2 Merge pull request #367 from ametaireau/reload-for-settings
Also reload when the settings file changes.
2012-06-10 12:55:00 -07:00
Alexis Metaireau
7682f657a4 don't do anything with webassets if the setting is set to false (default) 2012-06-10 21:46:32 +02:00
Alexis Metaireau
4ed8c6a09c don't test webassets key if it can be unset 2012-06-10 13:32:23 +02:00
Alexis Metaireau
7c48937ea2 pandoc is optional 2012-06-10 13:27:36 +02:00
Alexis Metaireau
68d5ed57e3 Add beautifulSoup in the dev deps 2012-06-10 13:17:52 +02:00
Alexis Metaireau
298c15bdda don't test the markdown reader if markdown isn't installed 2012-06-10 12:42:33 +02:00
Alexis Metaireau
6a0937a9e8 merge the plugin branch 2012-06-10 01:14:30 +02:00
Alexis Metaireau
ed8b8bc27e Also reload when the settings file changes.
Fix for #360
2012-06-10 00:24:26 +02:00
Alexis Metaireau
cbe47d4416 Merge pull request #347 from sametmax/pandoc-parse-raw
Added strip raw option to wordpress xml importer
2012-06-09 14:27:44 -07:00
Alexis Metaireau
4d5b1ae741 Merge pull request #351 from quodlibetor/warn-on-skip
Add warnings for files skipped due to unknown status
2012-06-09 14:26:33 -07:00
Alexis Metaireau
e3919a1b82 Merge pull request #341 from m-r-r/trailing-slashes
Trailing slashes removed to avoid category bug
2012-06-09 14:22:03 -07:00
Alexis Metaireau
74bf31b0e9 Merge pull request #337 from saimn/assets
Assets management with webassets
2012-06-09 14:16:57 -07:00
Alexis Metaireau
f94cbc9f98 Merge pull request #366 from theanalyst/master
Docs update for github pages
2012-06-09 14:14:29 -07:00
Abhishek L
219280d203 Updated docs, for user and project pages in Github 2012-06-10 00:00:49 +05:30
Justin Mayer
ae1424a8dd Strip tags from title when within tag attribute
The change mentioned in #336 stripped tags properly in some places but
seems to have forgotten at least one location in the main index.html
2012-06-08 09:56:55 -07:00
Alexis Metaireau
3dd63a012e Thanks the author of the youtube directive. 2012-06-08 11:23:18 +02:00
Alexis Metaireau
46daadc137 add a youtube directive to pelican 2012-06-08 11:21:52 +02:00
Alexis Metaireau
7192f74554 markdown syntax is ':::' not '::' for syntax hl 2012-05-21 15:21:16 +02:00
Bruno Binet
ef77847762 force locale to ascii in functional tests 2012-05-19 23:44:37 +02:00
Bruno Binet
5ffdee42e2 Merge branch 'master' of https://github.com/ametaireau/pelican into fix-functional-tests 2012-05-19 00:04:58 +02:00
Brandon W Maister
849244f61e Add warnings for files skipped due to unknown status 2012-05-15 17:48:07 -04:00
Alexis Metaireau
40dc019b30 Update CHANGELOG 2012-05-15 11:58:40 +03:00
Kyle Fuller
a16c19545f Don't duplicate html across themes 2012-05-14 18:46:27 +01:00
Kyle Fuller
2c1c05923d Fix a broken URL in the simple template 2012-05-14 18:33:49 +01:00
sam
ba8ed9fb18 Added strip raw option to wordpress xml importer 2012-05-13 23:37:33 +02:00
Simon
fed8e8b331 documentation for webassets 2012-05-12 23:48:57 +02:00
m-r-r
0444513e90 Trailing slashes removed to avoid category bug 2012-05-12 11:49:49 +02:00
Bruno Binet
e82c6512b4 clean up temporary dirs in tearDown to force cleanup even if tests fail 2012-05-12 02:03:18 +02:00
Bruno Binet
a8983b420f be more verbose when functional tests fail 2012-05-12 01:30:09 +02:00
Bruno Binet
b7e6d3d98d update functional tests output 2012-05-12 01:07:17 +02:00
Bruno Binet
ebfdabf2d7 Merge branch 'master' into fix-functional-tests
Conflicts:
	tests/test_generators.py
2012-05-12 00:19:14 +02:00
Simon
e6448567a0 add some doc in the code 2012-05-11 22:19:03 +02:00
Simon
d7f28d4328 Merge branch 'master' into assets 2012-05-11 22:00:20 +02:00
Simon
263ba2b0fa Merge remote-tracking branch 'upstream/master' 2012-05-11 21:59:21 +02:00
Simon
d4125ca735 Merge branch 'typogrify' 2012-05-11 21:58:49 +02:00
Simon
ec707930ce integrate webassets 2012-05-11 21:58:10 +02:00
Simon
252d00834f strip tags for feed titles 2012-05-11 21:58:10 +02:00
Alexis Metaireau
1779b66f10 Merge pull request #336 from saimn/typogrify
Apply typogrify on the title.
2012-05-11 07:23:31 -07:00
Alexis Metaireau
a42446268d Merge pull request #338 from bbinet/fix-urls
prefix urls with '{{ SITEURL }}/' so that urls won't break when #330 is merged
2012-05-11 07:19:12 -07:00
Alexis Metaireau
419a2159e6 Merge remote-tracking branch 'muffinresearch/master'
Conflicts:
	docs/settings.rst
	tests/test_generators.py
2012-05-11 16:17:47 +02:00
Stuart Colville
df7b2c968e Add documentation for DIRECT_TEMPLATES and PAGINATED_DIRECT_TEMPLATES 2012-05-09 23:24:31 +01:00
Bruno Binet
f12a297466 prefix urls with '{{ SITEURL }}/' so that urls won't break when #330 is merged 2012-05-07 23:07:44 +02:00
Simon
a6788f83c2 integrate webassets 2012-05-07 17:15:09 +02:00
Simon
e9996b5cc6 strip tags for feed titles 2012-05-07 13:05:33 +02:00
Simon
4a0d4461e1 Apply typogrify on the title.
As it is done when reading the file, we need to remove html tags for the
permalink and the slug (this is done here for the notmyidea and simple themes).

While modifying the themes I also replaced the `pagename` template tag with
`article.url` (`pagename` was an empty variable, no more used ?).
2012-05-07 12:26:17 +02:00
Alexis Metaireau
acf9b0597d Merge pull request #335 from m-r-r/quickstart-templates
Quickstart templates
2012-05-06 17:06:56 -07:00
m-r-r
d97fc8f666 Fixed some errors 2012-05-06 12:32:53 +02:00
m-r-r
7c53cc8955 Moved templates in pelican_quistart.py to a directory 2012-05-06 12:07:13 +02:00
Alexis Metaireau
8a842c0de7 merge with master 2012-05-06 02:43:13 +02:00
Alexis Metaireau
0fe1453c50 Merge pull request #306 from mbowcock/master
Add output markup option to importer doc and multiple file extensions to file reader
2012-05-05 17:26:27 -07:00
Alexis Metaireau
4370b51f02 Merge pull request #318 from MeirKriheli/master
Generator to compile less css files
2012-05-05 17:23:55 -07:00
Alexis Metaireau
3f9c87099d Merge pull request #329 from neoascetic/_save_as_behavior
Checking for basestring isinstance, not (str, unicode)
2012-05-05 17:20:02 -07:00
Alexis Metaireau
718f8989f8 Merge pull request #331 from neoascetic/default_category_url
Use {slug} instead of {name} for category URL and FILENAME formatting
2012-05-05 17:11:27 -07:00
Alexis Metaireau
8946332913 Merge pull request #301 from a7p/master
Added rsync_upload to the generated Makefile
2012-05-05 17:10:36 -07:00
Albrecht Mühlenschulte
1d6289245a removed duplication 2012-05-06 02:01:36 +02:00
Albrecht Mühlenschulte
a60fa59514 removed duplication 2012-05-06 01:59:19 +02:00
Albrecht Mühlenschulte
29fed3cc85 merged back master 2012-05-06 01:50:53 +02:00
Stuart Colville
06ba9acdb8 Pass write function to reduce duplication. Simplify logic. 2012-05-02 09:26:33 +01:00
Matt Bowcock
0d5a1f9cf3 Merge remote-tracking branch 'upstream/master' 2012-05-01 23:32:52 -04:00
Matt Bowcock
3c987d20b1 Added some metadata to new test files 2012-05-01 23:30:23 -04:00
Matt Bowcock
ec610537be Added test for markdown files using extension md and mkd.
Tests ensure the correct reader is processing file.
2012-05-01 23:19:38 -04:00
Matt Bowcock
faecba6035 Changed variable name extension to file_extensions. 2012-05-01 22:34:32 -04:00
Pavel Puchkin
feb1dcc773 Use {slug} instead of {name} for category URL and FILENAME formatting 2012-05-01 16:54:39 +11:00
Stuart Colville
5ab1933be7 added tests for custom save_as for direct templates 2012-04-29 13:45:14 +01:00
Stuart Colville
e4f011a697 Refactor generators to aid testing 2012-04-29 10:34:20 +01:00
Pavel Puchkin
19cfe00397 Checking for basestring isinstance, not (str, unicode) 2012-04-29 14:45:34 +11:00
Stuart Colville
c7de5e6bff add docs for customised save location for direct template pages and switch to notes directive for notes 2012-04-28 18:02:10 +01:00
Stuart Colville
cc46ac5d4c Allow user to customise the save location of direct template pages from settings. 2012-04-28 18:01:19 +01:00
Meir Kriheli
17626b5474 Don't use shell=True 2012-04-28 03:46:43 +03:00
Meir Kriheli
0924a9dd73 Not pdf, but less folder 2012-04-28 03:27:30 +03:00
Meir Kriheli
f558389006 Remove redundant LESS_COMPILER setting 2012-04-28 03:25:54 +03:00
Meir Kriheli
2b93d6d855 Remove empty generate_context 2012-04-28 03:04:58 +03:00
Meir Kriheli
1d3e38c5dd Test less generator 2012-04-28 03:03:53 +03:00
Meir Kriheli
d4e981f916 unittest helper: Skip if exectuable not found 2012-04-28 02:41:48 +03:00
Meir Kriheli
b73d984ec9 Merge branch 'master' of https://github.com/ametaireau/pelican 2012-04-28 00:52:45 +03:00
Alexis Metaireau
58d98e918f Merge pull request #326 from neoascetic/_save_as_behavior
*_SAVE_AS = False fix
2012-04-26 10:39:56 -07:00
Bruno Binet
79e7ccce29 Merge branch 'fix-sort-categories' into fix-functional-tests 2012-04-23 23:33:09 +02:00
Bruno Binet
1efda9eb74 test that categories are ordered as expected 2012-04-23 23:29:00 +02:00
Bruno Binet
a72567fa36 Merge branch 'master' of https://github.com/ametaireau/pelican into fix-sort-categories 2012-04-23 22:51:06 +02:00
Pavel Puchkin
898ac3808f Last fix? 2012-04-20 11:28:00 +11:00
Alexis Metaireau
004ff4e7b6 Merge pull request #325 from akavlie/issue-314
Better output formatting (see issue #314)
2012-04-19 01:34:57 -07:00
Aaron Kavlie
5710dc771d Remove --no-wrap; change para formatting to unicode string. 2012-04-18 22:28:49 -07:00
Aaron Kavlie
5cad4c46f0 Improve wording of docs re: pelican-import deps. 2012-04-18 22:17:43 -07:00
Aaron Kavlie
36a5344282 Beautify two-line string concat. 2012-04-18 22:14:53 -07:00
Aaron Kavlie
cc30695b72 Correct comment; switch to new style string formatting. 2012-04-18 09:29:47 -07:00
Alexis Metaireau
f3188587ce Merge pull request #321 from justinmayer/siteurl
Replace omitted slash in feed URL generation
2012-04-18 07:24:35 -07:00
Justin Mayer
602990b80e Use "endswith" to detect trailing slash on SITEURL 2012-04-18 07:16:51 -07:00
Justin Mayer
f53d902265 Merge branch 'master' into siteurl 2012-04-18 07:12:14 -07:00
Pavel Puchkin
9dcf612f9d Fixes after review 2012-04-18 23:07:57 +11:00
Pavel Puchkin
55d7cf438b Note in docs about previous commit 2012-04-18 19:04:32 +11:00
Pavel Puchkin
6116236ed9 *_SAVE_AS = None fix
Ability to disable creating some files when their `_SAVE_AS` setting is
set to none-value. Mostly for disabling creating of `authors` stuff
(when there only one user, see #320 for details)
2012-04-18 18:56:53 +11:00
Aaron Kavlie
9491bb40d4 Add --no-wrap option to pandoc, fixing issue with long links names (another fix for issue #314) 2012-04-18 00:24:52 -07:00
Aaron Kavlie
6577efc8f4 Wrap paragraphs in <p> tags 2012-04-18 00:20:54 -07:00
Alexis Metaireau
800a5a6d4a Merge pull request #323 from alaski/quickstart-title-question
Modified quickstart title question so that it's more clear
2012-04-16 18:02:58 -07:00
Andrew Laski
a0d5596605 Modifed question so that it's more clear 2012-04-16 20:39:41 -04:00
Meir Kriheli
4793cdfab3 Fix typo in less generator docs 2012-04-16 22:55:50 +03:00
Justin Mayer
e29b54e5e0 Replace omitted slash in feed URL generation
This slash was originally present, but I removed it at some point
because it was causing double-slashes. I believe the reason is that I
had a leading slash in my article URL pattern, which in retrospect
should not have been there. Omitting the slash caused problems for other
folks; I should have tested this better. This commit puts the slash back
where it belongs.
2012-04-16 09:10:20 -07:00
Kyle Fuller
e694cdc2b3 docs: Fix some sphinx warnings, and correctly format the french FAQ 2012-04-15 15:08:06 +01:00
Kyle Fuller
597233c49b Fix a broken link in the docs 2012-04-15 15:01:03 +01:00
Kyle Fuller
51d0e83a21 Merge pull request #307 from kriwil/header-category-link
Fixed hardcoded category url in base.html in default themes
2012-04-15 06:48:01 -07:00
Kyle Fuller
4c4c2a9604 Add a missing ' 2012-04-15 14:40:10 +01:00
Kyle Fuller
7b5b99aafa Merge pull request #303 from dafyddcrosby/typos
Fix some typos and grammar
2012-04-15 06:33:51 -07:00
Kyle Fuller
ac8f3fc653 Fix misspelling of ftp_target_dir in quickstart 2012-04-15 14:31:34 +01:00
Kyle Fuller
644af826ee Merge pull request #302 from stephane/quickstart-fix
Fix misspelling of ssh_target_dir in quickstart
2012-04-15 06:29:44 -07:00
Meir Kriheli
ddf57ca295 Also compile less css files in theme static 2012-04-15 02:52:19 +03:00
Meir Kriheli
50f2cd295f Implement LessCSSGenerator 2012-04-15 02:20:20 +03:00
Meir Kriheli
a9f798eae1 Document less css generator 2012-04-15 00:41:38 +03:00
Aaron Kavlie
23c05ad7db Issue #311, #312
Document BeautifulSoup & pandoc deps.
2012-04-12 19:53:03 -07:00
Aaron Kavlie
6888a04636 Issue #311
Catch BeautifulSoup ImportError.
2012-04-12 19:38:59 -07:00
Matt Bowcock
5e6945d380 Added facebook icon to default theme. 2012-04-10 12:51:16 -04:00
Aldiantoro Nugroho
424cfe1b1e Fixed hardcoded category url in base.html. 2012-04-10 17:30:42 +08:00
Matt Bowcock
c8323af63d Fixed _EXTENSIONS dictionary definition. 2012-04-10 00:40:05 -04:00
Matt Bowcock
d4e632dfa8 Unit test failed due to missing trailing comma in tuple. Fixed. 2012-04-10 00:32:01 -04:00
Matt Bowcock
75febf4bfd Add support for multiple file extensions per file reader.
Conflicts:

	pelican/readers.py
2012-04-10 00:15:12 -04:00
Matt Bowcock
1b978bac6d Added markdown option to importer documentation. Issue #292 2012-04-09 22:45:58 -04:00
Dafydd Crosby
28a1e0f432 Fix some typos and grammar 2012-04-07 18:02:40 -06:00
Stéphane Raimbault
ae97cbfb72 Fix misspelling of ssh_target_dir in quickstart 2012-04-07 17:33:23 +02:00
Albrecht Mühlenschulte
405cc66637 added missing file extension in make file generation (index.html) 2012-04-07 11:01:31 +02:00
Albrecht Mühlenschulte
7b657032ae added rsync_upload to the generated Makefile 2012-04-06 21:54:11 +02:00
Alexis Metaireau
b9973bcf8a Merge pull request #299 from Natim/master
Add rsync_upload
2012-04-06 00:57:49 -07:00
Rémy HUBSCHER
b509fe70cd Add rsync_upload 2012-04-06 09:55:15 +02:00
Bruno Binet
cfebb37c64 fix command to regenerate the output of basic functional test
the command needs to be prefixed by USER="Dummy Author" which is the author
name value mocked in the corresponding functional test.
2012-04-05 06:51:44 +02:00
Bruno Binet
03fdefb158 add instructions to regenerate the output of functional tests 2012-04-04 23:18:13 +02:00
Bruno Binet
912ffe4a91 update basic output with $USER="Dummy Author"
USER="Dummy Author" pelican -o tests/output/basic/ samples/content/
2012-04-04 23:17:46 +02:00
Bruno Binet
c430ab57ba mock getenv to always return the same value for $USER 2012-04-04 22:54:28 +02:00
Bruno Binet
c4c49678f9 update basic output now that categories are correctly sorted
pelican -o tests/output/basic/ samples/content/
2012-04-04 22:54:23 +02:00
Bruno Binet
7fcaca85dd update custom output now that categories are correctly sorted
pelican -o tests/output/custom/ -s samples/pelican.conf.py samples/content/
2012-04-04 22:54:16 +02:00
Bruno Binet
f903aaa1a4 remove unittest.skip statements for functional tests 2012-04-04 22:43:37 +02:00
Bruno Binet
7f36e0ed20 fix sorting of authors list 2012-04-04 22:24:53 +02:00
Bruno Binet
877d454c8f fix sorting of categories list 2012-04-04 22:24:44 +02:00
Alexis Metaireau
e5f58c9594 Merge branch 'master' of github.com:ametaireau/pelican 2012-04-03 11:59:30 +02:00
Alexis Metaireau
b845db30de Add a way to know what metadata exists.
This allows in a theme to have a look at the "metadata" attribute of a content
to know what are the metadata fields defined by it.
2012-04-03 11:58:31 +02:00
Alexis Metaireau
c234005f1c Merge pull request #294 from tshepang/master
pelican-importer for Wordpress doesn't add tags
2012-04-02 07:41:10 -07:00
Tshepang Lekhonkhobe
e999e0f6be Merge branch 'master' of https://github.com/ametaireau/pelican 2012-04-02 01:23:04 +02:00
Tshepang Lekhonkhobe
2db2b671f2 fix #293: pelican-importer for Wordpress doesn't add tags 2012-04-02 01:06:27 +02:00
Alexis Metaireau
f492f2d14d specify supported python version in the setup.py 2012-04-01 15:55:41 +02:00
Alexis Metaireau
9f03a407cb the dep to markdown is optional. rst is not. 2012-04-01 14:46:09 +02:00
Alexis Metaireau
6880f3d1e9 make docs more explicit 2012-04-01 13:54:20 +02:00
Alexis Metaireau
fe9af76e22 default :: doesn't work for syntactic recognition 2012-04-01 13:51:44 +02:00
Alexis Metaireau
be01e9f3a1 Skip functional tests for now 2012-04-01 13:50:03 +02:00
Alexis Metaireau
373ccdebf2 Add style for the note marker. Fix #257 2012-04-01 13:42:28 +02:00
Alexis Metaireau
ebe5c0b2bf Enhance warnings. Fix #196 2012-04-01 13:37:35 +02:00
Alexis Metaireau
2d55eacc57 Fix the autogenerated makefile.
Fix #278
2012-04-01 13:21:44 +02:00
Alexis Metaireau
68b4b8f2f2 Add markdown as a dev requirement.
This allows everyone to have the same setup when generating the tests. It is
useful for #288 for instance.
2012-04-01 03:22:53 +02:00
Alexis Metaireau
af2b588ea6 Merge pull request #289 from bbinet/fix_index_template
Fix index.html template
2012-03-31 18:08:30 -07:00
Alexis Metaireau
3e288b9a0f Merge pull request #288 from bbinet/functionnal-test
Functionnal test
2012-03-31 18:04:42 -07:00
Alexis Metaireau
3cabdb2dbf Merge pull request #285 from yumike/summary_markup
Fix markup for single-paragraph summary in reST metadata
2012-03-31 18:03:26 -07:00
Alexis Metaireau
d20ea30add Merge pull request #284 from m-r-r/log
pelican/log.py simplified a bit
2012-03-31 18:01:51 -07:00
Alexis Metaireau
d3fc327bc9 Merge pull request #282 from draftcode/float_precision
Fix #276 #269.
2012-03-31 18:01:04 -07:00
Alexis Metaireau
520d9b73c0 Merge pull request #281 from m-r-r/master
Patch for issue #271 (« Unicode issue in category name »)
2012-03-31 17:59:56 -07:00
Alexis Metaireau
0993458a57 Merge pull request #290 from justinmayer/feeddomain
Feed link inside feed should use FEED_DOMAIN
2012-03-31 17:59:05 -07:00
Justin Mayer
56b8a88b1f Improve uniqueness of feed entry ID
The ID of a feed entry should never change, but the previous method of
generating the ID -- i.e., using the entry URL -- results in an ID that
is not permanent and can change. Switching to the tag URI method from
RFC 4151 should help improve the long-term uniqueness and permanence of
entry IDs, as espoused here:
<http://web.archive.org/web/20110514113830/http://diveintomark.org/archives/2004/05/28/howto-atom-id>

Also added a trailing slash to the site URL inside the feed; the lack
thereof was causing a feed validation warning.
2012-03-31 10:08:16 -07:00
Justin Mayer
34310a61f5 Feed link inside feed should use FEED_DOMAIN
The initial work on enabling feeds to be served from a different domain
than the site domain focused on the feed link displayed inside the
base template. But there is also a feed link inside the generated feed
itself, which this commit updates to use the FEED_DOMAIN value (if
defined).

Also, it turns out that the FEED_MAIN_URL setting is not necessary; the
existing FEED and FEED_RSS functionality is simpler and can address the
targeted use case just as easily. That attribute has been removed from
the settings and template, along with corresponding changes to the docs.
Refs #177.
2012-03-31 08:10:40 -07:00
Bruno Binet
abadedffec update output for functionnal testing 2012-03-30 14:23:12 +02:00
Bruno Binet
64e12b1809 fix missing </ol> and </section> tags 2012-03-30 14:20:55 +02:00
Bruno Binet
2f1f6b5b43 test that the output of the samples pelican project is correct
(functionnal testing)
2012-03-30 13:46:33 +02:00
Bruno Binet
5ac3fdec50 add output files for "samples" so that we can make functionnal testing 2012-03-30 13:42:11 +02:00
Bruno Binet
ed58799f13 don't override globals settings 2012-03-30 13:33:07 +02:00
Kyle Fuller
c71ad2babc Merge pull request #283 from draftcode/default_category
DEFAULT_CATEGORY is ignored.
2012-03-27 16:00:31 -07:00
Mike Yumatov
4df6179954 Fix markup for single-paragraph summary in reST metadata 2012-03-25 21:39:41 +04:00
m-r-r
5aa12b2319 pelican/log.py simplified a bit 2012-03-25 18:47:14 +02:00
draftcode
9df2e79fb9 Fix #276 #269. 2012-03-24 14:36:47 +09:00
draftcode
cffb44891a Add an test related to articles' category. 2012-03-24 13:52:03 +09:00
draftcode
4efca13c33 Fix a bug that ArticlesGenerator doesn't see DEFAULT_CATEGORY.
When you set ARTICLE_DIR which is not equal to PATH, ArticlesGenerator
doesn't use DEFAULT_CATEGORY but use ARTICLE_DIR's dirname.
2012-03-24 11:53:07 +09:00
m-r-r
fc584969c9 patch for bug #271 (Unicode issue in category name) 2012-03-23 19:31:44 +01:00
Alexis Metaireau
0d9298313f Merge pull request #276 from AndreaCrotti/float_precision
on my machine leaving the places to 2 or 1 makes this test fail, I
2012-03-23 07:37:09 -07:00
Alexis Metaireau
bd767a5273 Merge pull request #280 from justinmayer/siteurl
Remove trailing slash from SITEURL if present. Fixes #275.
2012-03-23 07:31:46 -07:00
Justin Mayer
65b93dbfd4 Remove trailing slash from SITEURL if present 2012-03-23 07:16:23 -07:00
Kyle Fuller
0ed6cf7743 Follow the PATH variable in settings 2012-03-23 09:05:47 +00:00
Andrea Crotti
dbc4d4786b on my machine leaving the places to 2 or 1 makes this test fail, I
suppose because it's too fast, while changing it to 0 makes it pass.
2012-03-22 16:30:26 +00:00
Alexis Metaireau
38b5b94617 Merge pull request #262 from justinmayer/feeddomain
Allow for serving feeds from a separate domain.
2012-03-22 08:58:09 -07:00
Justin Mayer
6e467172e5 Merge branch 'master' into feeddomain
Conflicts:
	pelican/settings.py
	tests/test_settings.py
2012-03-22 08:29:27 -07:00
Justin Mayer
1623394da8 Add tests for pull request #262 2012-03-22 07:58:04 -07:00
Alexis Metaireau
352a67d162 Merge pull request #267 from AndreaCrotti/default_argparse
refactor of the parse_arguments function, using "-p" to pass the path
2012-03-22 04:46:46 -07:00
Andrea Crotti
bc7c8c14f4 - split main and parse arguments in two function
- add '.' as default value for the path
2012-03-22 07:02:06 +00:00
Alexis Metaireau
97d8d0daa6 Merge pull request #270 from bbinet/plugins
Plugins
2012-03-21 17:58:24 -07:00
Alexis Metaireau
9009ed7e43 Merge pull request #268 from AndreaCrotti/unittest2
Clean up testing modules
2012-03-21 17:56:48 -07:00
Alexis Metaireau
a201232843 Merge pull request #273 from AndreaCrotti/logging
change the way logging is done, using the standard log tree instead of
2012-03-21 17:56:04 -07:00
Bruno Binet
50d4901f86 fix whitespace 2012-03-21 00:11:25 +01:00
Bruno Binet
db3d588f64 fix typos and whitespace 2012-03-21 00:10:19 +01:00
Bruno Binet
8510a07a9e isinstance basestring rather than str 2012-03-20 23:34:53 +01:00
Bruno Binet
7cd4d28bb2 better plugins doc 2012-03-20 23:31:04 +01:00
Andrea Crotti
0922efa371 change the way logging is done, using the standard log tree instead of
calling the module-level functions on an unitialised logging object.

This allows to
- simplify log.py
- use one logger object for each file
2012-03-20 13:01:21 +00:00
Bruno Binet
67f7fcba26 remove duplicated pelican-themes entry from the toctree 2012-03-20 01:39:52 +01:00
Bruno Binet
229ebbbcbf plugins branch is planned to be merged for 3.0 2012-03-20 01:26:26 +01:00
Bruno Binet
4fe67b8947 Merge remote-tracking branch 'ametaireau/plugins' into plugins
Conflicts:
	docs/settings.rst
	pelican/__init__.py
	pelican/generators.py
	pelican/settings.py
	setup.py
2012-03-20 01:07:25 +01:00
Andrea Crotti
ff5921a469 - move the try/except dance in support.py
- use relative . imports in test files
- remove the "future with import", since python < 2.6 is not supported
2012-03-18 21:08:43 +00:00
Alexis Metaireau
7fcfea647f Merge branch 'master' of github.com:ametaireau/pelican 2012-03-18 15:23:09 +01:00
Alexis Metaireau
9c4b40fd35 Keep raw metadata text (but for summary) 2012-03-18 15:12:06 +01:00
Alexis Metaireau
cf7359a915 Merge pull request #265 from mbrochh/mini_typo
Always using normal capitalization in headlines.
2012-03-18 04:21:33 -07:00
Martin Brochhaus
a9f5fdc47b Always using normal capitalization in headlines. 2012-03-18 14:57:53 +08:00
Justin Mayer
8819d02600 Allow for serving feeds from a separate domain.
This (indirectly) enables support for FeedBurner. Added docs for
FeedBurner configuration. Clarify how defining the SITEURL attribute
affects URL structure. Closes #177.
2012-03-16 20:27:26 -07:00
Alexis Metaireau
cbc609c8f0 only notify build is okay if it was failing previously 2012-03-16 21:23:34 +01:00
Alexis Metaireau
4819a83003 Fix #171. Handle unicode filenames 2012-03-16 21:13:24 +01:00
Alexis Metaireau
8b846b9fe2 restore back to hardcoded version in setup.py due to import hell 2012-03-16 21:12:48 +01:00
Alexis Metaireau
3dcedb60d8 add irc support to travis-ci 2012-03-16 20:58:08 +01:00
Alexis Metaireau
e38e3e14e6 Merge branch 'master' of github.com:ametaireau/pelican 2012-03-16 19:59:19 +01:00
Alexis Metaireau
c75ab513da use 'summary' rather than ':summary:' in comments 2012-03-16 19:59:03 +01:00
Alexis Metaireau
8b8b9f59a1 Merge pull request #261 from AndreaCrotti/package
move tools in pelican.tools and add the pelican.tools package to setup.p...
2012-03-16 11:56:45 -07:00
Alexis Metaireau
ad36beed1f Merge pull request #259 from AndreaCrotti/version
Version
2012-03-16 11:54:51 -07:00
Alexis Metaireau
d57cd81ca6 Merge pull request #260 from AndreaCrotti/log_refactor
remove unused colors and refactor more how the escaping is done
2012-03-16 11:54:10 -07:00
Andrea Crotti
4e4af9d011 move tools in pelican.tools and add the pelican.tools package to setup.py 2012-03-16 18:53:08 +00:00
Andrea Crotti
173133dbf3 remove couple of extra spaces 2012-03-16 14:53:28 +00:00
Andrea Crotti
26078ecc17 remove unused colors and refactor more how the escaping is done 2012-03-16 14:50:26 +00:00
Andrea Crotti
df8b71f811 remove unused *bat include 2012-03-16 14:27:51 +00:00
Andrea Crotti
74c2449d8f add version information in __init__.py and import them from setup.py
and conf.py
2012-03-16 14:27:26 +00:00
Alexis Metaireau
4714276e2c Merge pull request #247 from saimn/summary
Summary - Fix for #245
2012-03-15 14:15:01 -07:00
Alexis Metaireau
5890ae7bcd Merge pull request #253 from danawoodman/patch-1
`MD_EXTENSIONS` should be a list not a tuple.
2012-03-15 14:12:23 -07:00
Alexis Metaireau
a3e6988d87 Merge pull request #254 from AndreaCrotti/reset_term
fix the reset term code to make it work also on OSX
2012-03-15 14:06:39 -07:00
Alexis Metaireau
b8377f50c9 Merge pull request #250 from AndreaCrotti/argparse
- remove default=None with argparse is redundant since it's the
2012-03-15 14:06:12 -07:00
Andrea Crotti
2ff3db8f51 fix the reset term code to make it work also on OSX 2012-03-15 19:37:49 +00:00
Dana Woodman
99852ebda8 MD_EXTENSIONS should be a list not a tuple. 2012-03-15 11:59:58 -07:00
Alexis Metaireau
db91c70ce9 Merge pull request #246 from stephane/cleanup-wp
Cleanup wp
2012-03-15 07:43:41 -07:00
Alexis Metaireau
8cd0939bfe Merge pull request #248 from saimn/cleanup
Cleanup
2012-03-15 07:41:10 -07:00
Alexis Metaireau
d5c251042f Merge pull request #251 from AndreaCrotti/templates
Templates
2012-03-15 07:39:30 -07:00
Alexis Metaireau
61d5ba1776 Merge pull request #252 from AndreaCrotti/settings
Settings
2012-03-15 07:37:57 -07:00
Andrea Crotti
020c1400e2 add the pelican path to the sys.path, to be able to use autodoc 2012-03-15 00:23:07 +00:00
Andrea Crotti
7f8f6e8a7e the sys.path should not contain the _themes directory, which is not a
python package
2012-03-15 00:17:50 +00:00
Andrea Crotti
10fc8a733d fix warnings and errors from settings.rst 2012-03-15 00:17:01 +00:00
Andrea Crotti
d01606e86d remove unused class _dict 2012-03-14 20:06:13 +00:00
Andrea Crotti
ec31832c5c - reorganize imports and remove unused import
- remove trailing spaces at the end of the generated files
2012-03-14 20:04:58 +00:00
Andrea Crotti
4bac1ee745 - remove default=None with argparse is redundant since it's the
default value already.
- use the argparse.ArgumentDefaultsHelpFormatter as the
  formatter_class, to print out automatically the default values
2012-03-14 19:54:28 +00:00
Simon
39bdbcfd86 files_changed: cleanup and add a test 2012-03-14 12:36:55 +01:00
Simon
4f95b9f05c remove useless .keys() for key in dict expressions 2012-03-14 09:38:36 +01:00
Simon
c441855522 add a test for the summary metadata 2012-03-13 21:52:56 +01:00
Simon
ff2426c4ad Fix for #245: return the summary of an article based on the :summary: metadata if it is set, else troncate the content. 2012-03-13 21:52:50 +01:00
Stéphane Raimbault
2f79d5f052 Improve error handling when pandoc is missing 2012-03-13 16:54:45 +01:00
Stéphane Raimbault
d7f0b1637e Cleanup awful line with TODO in pelican-import 2012-03-13 16:54:45 +01:00
Stéphane Raimbault
fec605b577 Fix way to handle OSError (error doesn't exist)
A better way would to use sys.stderr.write or PY3 print(file=sys.stderr)
2012-03-13 16:53:56 +01:00
Stéphane Raimbault
c4f96b108f Don't set unused fields of Dotclear post 2012-03-13 02:16:11 +01:00
Stéphane Raimbault
e097175a77 Import not used of BeautifulSoup 2012-03-13 02:14:38 +01:00
Alexis Metaireau
71a5ba3283 Merge pull request #241 from draftcode/metadata_lowercase
Make names of metadata lower.
2012-03-12 04:15:34 -07:00
Alexis Metaireau
0951831c64 Merge pull request #243 from alefteris/patch-1
Match closing tag
2012-03-12 04:14:32 -07:00
Alexis Metaireau
f08aad6b14 Merge pull request #244 from alefteris/master
Double-quote HTML attribute
2012-03-12 04:13:56 -07:00
Thanos Lefteris
acad3e864d Double-quote HTML attribute 2012-03-11 21:08:18 +02:00
Thanos Lefteris
89a481f8e7 Match closing tag 2012-03-11 21:00:38 +02:00
draftcode
a4ce10d88e Add a test for readers. 2012-03-12 02:24:26 +09:00
Alexis Metaireau
e95b26bf20 Add travis-ci build-image support on the README 2012-03-11 18:07:08 +01:00
Alexis Metaireau
9cc7efbe12 add requirements to travis-ci 2012-03-11 18:02:57 +01:00
Alexis Metaireau
991a49084a Merge pull request #242 from draftcode/housekeeping
Housekeeping
2012-03-11 09:53:55 -07:00
draftcode
c05b743fa6 Add mock to dev_requirements. 2012-03-12 01:40:27 +09:00
draftcode
08b40c7967 Make names of metadata lower. 2012-03-12 01:33:30 +09:00
Alexis Metaireau
3cb18303f6 fix python 2.6 support 2012-03-11 17:26:59 +01:00
draftcode
2827a6df47 Fixed some typos. 2012-03-12 01:22:54 +09:00
Alexis Metaireau
d42b6d9ad7 fix nose 2012-03-11 17:20:04 +01:00
Alexis Metaireau
912b1dbc1a test travis-ci 2012-03-11 17:05:59 +01:00
Alexis Metaireau
48b318d29e skip typogrify if not installed 2012-03-11 17:05:46 +01:00
Alexis Metaireau
32355f5463 add some more tests for the utils module 2012-03-11 15:51:48 +01:00
Alexis Metaireau
c393b011c4 cleaning 2012-03-11 15:50:53 +01:00
Alexis Metaireau
3c983d62c9 change the tests to use the mock library instead of a custom mocking system 2012-03-11 11:25:30 +01:00
Alexis Metaireau
78091bfa80 Merge pull request #238 from draftcode/feed_issue
Do not create feeds when their filenames are set to None.
2012-03-11 01:46:58 -08:00
Alexis Metaireau
cfd050b0f2 Add a CSS file for typogrify on the notmyidea theme 2012-03-11 03:02:12 +01:00
Alexis Metaireau
6a4f4a55b4 updated the changelog 2012-03-11 02:52:40 +01:00
Alexis Metaireau
189da25c5b Merge branch 'master' of github.com:ametaireau/pelican 2012-03-11 02:50:37 +01:00
Alexis Metaireau
d43bd1dcb8 Add a way to use Typogrify to enhance the generated HTML. 2012-03-11 02:48:36 +01:00
Alexis Metaireau
fbf89687cc start functional testing 2012-03-11 01:59:58 +01:00
Alexis Metaireau
d6be2fb44c Put deprecation code in a separate place 2012-03-11 01:59:22 +01:00
Alexis Metaireau
f076f64404 Merge pull request #240 from bbinet/parametrable-dirs
Parametrable source directories for pages and articles
2012-03-10 16:32:28 -08:00
Bruno Binet
aef7418bdf add docs for new page/article paths settings 2012-03-11 01:22:22 +01:00
Bruno Binet
0ca9997e10 paths for finding articles and pages are now parametrable 2012-03-11 01:22:16 +01:00
Alexis Metaireau
1c219d14bb Use the slug as default URL for tags and authors. 2012-03-11 01:16:32 +01:00
Alexis Metaireau
1ec2779f5e Make the readers tests a bit more verbose. 2012-03-11 01:16:02 +01:00
Alexis Metaireau
3bdc769134 Factorize some code about URL wrapping. 2012-03-11 01:14:22 +01:00
draftcode
1194764ed1 Do not create feeds when their filenames are set to None. 2012-03-11 01:30:45 +09:00
Alexis Metaireau
012caed1dc Merge pull request #237 from draftcode/226
Avoid #226.
2012-03-10 05:18:02 -08:00
draftcode
1c2f631723 Avoid #226. 2012-03-10 21:25:11 +09:00
Alexis Metaireau
38668785e4 Merge pull request #236 from m-r-r/pelican-qickstart
Removed small errors in pelican-quickstart
2012-03-10 04:24:57 -08:00
Alexis Metaireau
8499ce3340 add some url and saveas settings that weren't present in the default settings dict 2012-03-10 13:23:50 +01:00
m-r-r
fd1fbca520 Removed small errors in pelican-quickstart 2012-03-10 12:25:05 +01:00
Alexis Metaireau
a7ea166fd2 fix #233 2012-03-10 12:21:54 +01:00
Alexis Metaireau
0cf820f07b Merge pull request #234 from saghul/issue-233
Fix for issue #233
2012-03-10 03:20:54 -08:00
saghul
5e26062fd0 Fix for issue #233 2012-03-10 11:32:22 +01:00
Alexis Metaireau
174f1b50c8 Merge pull request #231 from AndreaCrotti/master
various small improvements
2012-03-09 09:04:16 -08:00
Alexis Metaireau
542b8b8705 add a 'coding standards' section in the contributors' guide 2012-03-09 16:27:23 +01:00
Alexis Metaireau
8a442e726a Don't specify the default when accessing settings.
There is no need to do this, since all the default values are already provided
in the default settings dict (in settings.py)
2012-03-09 16:22:28 +01:00
Alexis Metaireau
6cde7fd27a PEP8-ify.
Wrap to 80 chars, sanitize imports.
2012-03-09 16:21:38 +01:00
Alexis Metaireau
df25dec30a Use the with statement when opening files. 2012-03-09 16:17:09 +01:00
Alexis Metaireau
0298d412dc updated CHANGELOG 2012-03-09 15:36:29 +01:00
Alexis Metaireau
7240460688 Update the CHANGELOG for 2.8 2012-03-09 15:33:34 +01:00
Alexis Metaireau
a7cea63db6 Merge branch 'urls' of https://github.com/kylef/pelican 2012-03-09 11:42:21 +01:00
Alexis Metaireau
019382220a Merge pull request #232 from MeirKriheli/master
Make sure test passes for dates formatted as utf-8
2012-03-09 02:36:04 -08:00
Meir Kriheli
dd07ddb0b0 Make sure test passes for dates formatted as utf-8 2012-03-09 02:03:15 +02:00
Andrea Crotti
20af8fd378 refactoring of the ANSI dictionary, removing all the repeated code 2012-03-07 12:17:39 +00:00
Andrea Crotti
2e0e893a9b fix three print statement 2012-03-07 12:14:13 +00:00
Andrea Crotti
4eb20c5d82 global declaration is only needed if it's necessary to modify a module
level variable, to declare it and use it read only it's not necessary
2012-03-07 12:00:32 +00:00
Alexis Metaireau
1405667692 Merge pull request #230 from AndreaCrotti/master
refactor the scripts
2012-03-07 03:59:15 -08:00
Andrea Crotti
8f7b08a01c remove now useless if __name__ == '__main__' checks and clean up the
old pelican script in bin
2012-03-07 10:38:08 +00:00
Andrea Crotti
7c78f232b4 remove unused imports 2012-03-07 10:34:14 +00:00
Andrea Crotti
8009324a3b restructure the whole way scripts are created, using setuptools magic
to take care of creating .exe wrappers for windows.

To make this work needed to
- rename modules with a "-" in it (not a valid name)
- add an __init__.py to the tools directory
- create an entry point dictionary which stores the right associations
2012-03-07 10:33:46 +00:00
Andrea Crotti
1f32624e8b use a try / except to check if argparse is a needed dependency 2012-03-07 10:14:52 +00:00
Alexis Metaireau
352d2047b4 MOAR TYPOGRAPHY 2012-03-06 17:57:29 +01:00
Bruno Binet
8f8933d991 fix test test_save_as
ERROR: test_save_as (tests.test_contents.TestPage)
If a lang is not the default lang, save_as should be set
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bruno/dev/pelican/tests/test_contents.py", line 63, in test_save_as
    page.save_as = 'foo-bar.html'
AttributeError: can't set attribute
2012-03-06 16:41:36 +00:00
Bruno Binet
c2b8caed3f fix test test_article_with_metadata
error was:
ERROR: test_article_with_metadata (tests.test_readers.RstReaderTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bruno/dev/pelican/tests/test_readers.py", line 22, in test_article_with_metadata
    reader = readers.RstReader()
TypeError: __init__() takes exactly 2 arguments (1 given)
2012-03-06 16:41:36 +00:00
Bruno Binet
bfd0e63e3d fix pages urls 2012-03-06 16:41:36 +00:00
Bruno Binet
8bf0a22eb0 fix encoding errors
error was:codeEncodeError: 'ascii' codec can't encode character u'\xe9' [..]
2012-03-06 16:41:36 +00:00
Kyle Fuller
c5816c9c5a Make these patches compatible with upstream master 2012-03-06 16:41:36 +00:00
Kyle Fuller
9ba55c28b4 Support CLEAN_URLS and ARTICLE_PERMALINK_STRUCTURE for backwards compatibility 2012-03-06 16:41:36 +00:00
Kyle Fuller
44cf2ad400 Support configurable URL's & SAVE_AS path for Author, Category and Tag 2012-03-06 16:41:35 +00:00
Kyle Fuller
a39787c1a2 Add settings to change the URL's and SAVE_AS paths
Example usage:

* ARTICLE_URL = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/'
* ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html'

This removes CLEAN_URLS and ARTICLE_PERMALINK_STRUCTURE because these
new settings can produce the same result.
2012-03-06 16:41:35 +00:00
Kyle Fuller
ff9c786149 Create a Author class which has a url property 2012-03-06 16:39:07 +00:00
Kyle Fuller
f9ed01bb64 Create a Tag class which has a url property 2012-03-06 16:39:07 +00:00
Kyle Fuller
6754099730 Create a Category class which has a url property 2012-03-06 16:39:07 +00:00
Alexis Metaireau
2de789325f Merge pull request #229 from justinmayer/master
Updated outdated links and added Contribute link to README for issue #227
2012-03-06 08:29:18 -08:00
Justin Mayer
4861a15774 Update outdated links to documentation and add Contribute link to README for issue #227 2012-03-06 08:12:15 -08:00
Alexis Metaireau
8997a08cd7 Merge pull request #228 from justinmayer/master
Improved English documentation with enhanced clarity, grammar, and spelling
2012-03-06 06:38:02 -08:00
Justin Mayer
bde06c4011 Improve English documentation with enhanced clarity, grammar, and spelling 2012-03-06 06:13:17 -08:00
Alexis Metaireau
ddac40e9cb Include .bat files in the distribution. Fix #221 2012-03-03 18:26:07 +01:00
Alexis Metaireau
917633628a add some more articles for the tests 2012-02-29 18:15:38 +01:00
Alexis Metaireau
6c5fe3b0cf prepare next release 2012-02-28 19:09:41 +01:00
Alexis Metaireau
f31d588839 Merge branch 'master' of github.com:ametaireau/pelican 2012-02-28 19:00:15 +01:00
Alexis Metaireau
e0308e3528 bump version 2012-02-28 18:59:46 +01:00
Alexis Metaireau
097a781e0e Merge pull request #218 from stephane/cleanup
Cleanup
2012-02-28 08:48:53 -08:00
Stéphane Raimbault
a4e620680c Add pytz in requirements 2012-02-28 17:40:13 +01:00
Stéphane Raimbault
483bed74b8 Removed extra whitespace before /usr/bin/env 2012-02-28 17:40:13 +01:00
Stéphane Raimbault
9cced6be83 Sort imports and remove trailing whitespaces 2012-02-28 17:40:13 +01:00
Stéphane Raimbault
821fa5460b Removed execution mode of default_conf.py 2012-02-28 17:37:17 +01:00
Stéphane Raimbault
c699172fd6 Removed useless imports 2012-02-28 17:37:17 +01:00
Stéphane Raimbault
90dab85e13 Removed execution mode of generators.py 2012-02-28 17:37:17 +01:00
Alexis Metaireau
02b9b964b8 restore the use of python rather than pypy in the batfiles (windows) 2012-02-27 21:06:33 +01:00
Alexis Metaireau
7a7fc781a0 Merge branch 'localedate' of https://github.com/farseerfc/pelican 2012-02-27 19:46:55 +01:00
Jiachen Yang
3ccbe19c8a typo in docs/settings.rst#date format and locales 2012-02-28 03:37:58 +09:00
Alexis Metaireau
278d1105cf Merge pull request #215 from farseerfc/d1d82db4f7096793feee4e56ff510b0846762b04
Changing LOCALE according to lang of current page in DATE_FORMAT
2012-02-27 10:22:56 -08:00
Jiachen Yang
76ee6c2149 Added document and test case for #215 2012-02-28 03:08:39 +09:00
Jiachen Yang
189d72e989 Merge remote-tracking branch 'ametaireau/master' into localedate 2012-02-28 01:43:50 +09:00
Jiachen Yang
e78372f338 import unittest if cannot found unittest2 2012-02-28 01:43:36 +09:00
Alexis Metaireau
ab245726ed Merge pull request #212 from mbrochh/fix_tests
Added some fixes to the test suite so that it doesn't fail any more.
2012-02-26 03:47:15 -08:00
Jiachen Yang
d1d82db4f7 Change date_format to support (locale,format) 2012-02-26 16:35:04 +09:00
Martin Brochhaus
67472298ca Added changes as per codereview. 2012-02-20 17:58:23 +01:00
Martin Brochhaus
52fb81a441 Added some fixes to the test suite so that it doesn't fail any more. 2012-02-20 17:39:47 +01:00
Alexis Metaireau
bf314fde6b Remove an useless css background image. Fix #209 2012-02-20 13:36:41 +01:00
Alexis Metaireau
3e96908786 Merge pull request #210 from mbrochh/doc_update
Missing documentation for MENUITEMS setting.
2012-02-20 04:32:55 -08:00
Martin Brochhaus
1ceb2745b1 Added missing documentation for MENUITEMS setting. 2012-02-20 13:18:18 +01:00
Simon Liedtke
6e73edd81f Merge pull request #206 from tobeplugged/patch-1
DOC: fixed typo in 'CLEAN_URLS'
2012-02-12 12:50:19 -08:00
Tobias
1f4bb6a2e4 DOC: fixed typo in 'CLEAN_URLS'
was singular in docs but only works as plural
2012-02-12 18:25:51 +01:00
Alexis Metaireau
3e8226da15 minor changes to MANIFEST.in 2012-01-12 11:50:08 +01:00
Alexis Metaireau
9543ce049f update the documentation to make timezone configuration clearer 2011-12-29 16:04:46 +01:00
Alexis Metaireau
501e1b8524 Merge pull request #200 from kylef/except
Fix a bug in the exception handler for a page reader
2011-12-24 04:29:47 -08:00
Kyle Fuller
6ca3fd423b Fix a bug in the exception handler for a page reader 2011-12-24 00:57:12 +00:00
Alexis Metaireau
b3b0af5a45 Merge pull request #198 from kylef/page
Remove WITH_PAGINATION, only have a DEFAULT_PAGINATION setting
2011-12-22 09:09:35 -08:00
Kyle Fuller
2be58aa51a Remove WITH_PAGINATION, only have a DEFAULT_PAGINATION setting
DEFAULT_PAGINATION can be set to False instead of using WITH_PAGINATION
2011-12-22 14:02:31 +00:00
Alexis Metaireau
522ac12dc9 Merge pull request #194 from kylef/clean_urls
Fix CLEAN_URLS and place articles in <slug>/index.html
2011-12-17 10:01:07 -08:00
Alexis Metaireau
c4fec61d08 Add the dev_requirements.txt file. Fix #195 2011-12-14 14:34:38 +01:00
Kyle Fuller
256b92e5c4 Fix CLEAN_URLS and place articles in <slug>/index.html 2011-12-13 23:30:27 +00:00
Jökull Sólberg Auðunsson
651249a6c5 Bad logic in delete output booleans. Pretty sure this is just a check to make sure the posts directory is not inside the output. 2011-12-06 01:42:14 +01:00
Alexis Metaireau
4a8b3ddb75 oops, broken link 2011-11-30 21:19:42 +01:00
Alexis Metaireau
889cdd4dbd typo 2011-11-30 21:16:26 +01:00
Alexis Metaireau
df4e88ff15 add some docs written a long time ago 2011-11-30 21:11:50 +01:00
Alexis Metaireau
b0dcce01cb Don't install the venv in the sources root, this can cause troubles with the bin folder 2011-11-29 16:06:08 +01:00
Alexis Metaireau
4de99619c3 Merge pull request #190 from brianhsu/master
Add <guid> to RSS xml.
2011-11-29 01:19:10 -08:00
Brian Hsu
b2919e9051 Add unique_id to RSS/ATOM feeds.
Reason:

    Without <guid> tag in RSS XML, some RSS reader will show all
    items in RSS as unread item.
2011-11-29 09:53:48 +08:00
Alexis Metaireau
fb9a622ca7 add CLEAN_URLS to the documentation 2011-11-27 18:08:28 +01:00
Alexis Metaireau
92b232972e add information about mardown in the FAQ 2011-11-27 18:00:29 +01:00
Alexis Metaireau
53f7811a89 Merge pull request #188 from jokull/master
Please review these updates I've made after some experience with Calepin
2011-11-26 16:47:10 -08:00
Jökull Sólberg Auðunsson
dc22d2b131 Added WITH_FUTURE_DATES settings, which if true treats future dated content as drafts. 2011-11-26 23:23:19 +00:00
Jökull Sólberg Auðunsson
082cc2a401 Warning string formatting needs unicode if filename is utf-8 2011-11-26 22:31:43 +00:00
Skami18
c63eb85070 exit replaced by sys.exit to avoid crashes on cx_Freeze & py2exe (useful for Windows installer) 2011-11-25 18:39:19 +01:00
Jökull Sólberg Auðunsson
499a67912f Never fail on generating posts, just skip and log exception. 2011-11-23 20:35:45 +00:00
Jökull Sólberg Auðunsson
4144c8d76f More forgiving date strings. 2011-11-23 20:35:18 +00:00
Alexis Metaireau
aee3f661f4 Merge pull request #183 from ranjhith/master
Remove intermediate .html file generated during import
2011-11-14 07:53:21 -08:00
Alexis Metaireau
c588342cfc Merge pull request #182 from kryskool/master
Fix issue 181, with tags not recognize as unicode
2011-11-14 07:52:31 -08:00
Christophe Chauvet
2911a38f40 Issue #181, when parse tags 2011-11-06 13:16:47 +01:00
Ranjhith Kalisamy
5b7cd45668 The intermediate .html file has to be removed during the import process. 2011-10-30 23:04:24 +05:30
Skami18
c522ce7fbc New plugin that provides an ..html:: directive for reStructuredText 2011-10-30 14:16:51 +01:00
Skami18
b735f5fa49 Plugin loading is logged in debug mode (-D) 2011-10-30 14:10:50 +01:00
Skami18
f248a81107 Plugins are now installed by setuptools 2011-10-29 18:04:59 +02:00
Skami18
b9157df1a3 Fixes the bug re-introduced in 0b6896a. Thank to @mapio for noticing the problem :-) 2011-10-29 12:57:15 +02:00
Alexis Metaireau
4da387127e Merge pull request #179 from ranjhith/master
Changes to import script
2011-10-27 07:24:31 -07:00
Alexis Metaireau
3cf3657202 Merge pull request #176 from kpanic/plugin-github-activity-new-feed
Plugin github activity new feed
2011-10-27 07:15:24 -07:00
Skami18
0b6896a0ab Adding a summary no more make Pelican crashes
Setting pelican.readers.Article.summary was impossible and raised an
exception because pelican.readers.Article.summary was a @property
2011-10-25 18:31:17 +02:00
Ranjhith Kalisamy
3192cf6e37 Create output folder if doesn't exist 2011-10-24 00:30:58 +05:30
Ranjhith Kalisamy
2d5dd70e85 In import script, add support to output posts in markdown format 2011-10-24 00:23:03 +05:30
Skami18
ed954ee839 The .bat files are no longer installed in other platforms than Windows 2011-10-23 19:04:34 +02:00
Marco Milanesi
462e637e69 updated doc 2011-10-19 11:57:37 +02:00
Marco Milanesi
83d59d6b93 revised github activity to adapt it to new github atom feed changes 2011-10-18 22:21:43 +02:00
Skami18
3bdb1eae0b Pelican no more use ANSI codes on Windows (CMD.exe don't support it) 2011-10-14 17:21:03 +02:00
Alexis Metaireau
1bd2af1064 merge with nsteinmetz/pelican 2011-10-06 22:45:19 +02:00
Alexis Metaireau
713da771cb Merge pull request #174 from mapio/master
Fixing URLs relativization in summary (done the right way)
2011-10-06 03:51:47 -07:00
Massimo Santini
5bcc56fed8 elativize URLs in summary as we do for content (this time by rewriting summary as a property to defer the access to content when URLs in it have been relativized by the writer). 2011-10-04 07:43:26 +02:00
Massimo Santini
8b36f90db9 Revert "Relativize URLs in summary as we do for content"
This reverts commit 5a993de400.
2011-10-04 07:31:21 +02:00
Massimo Santini
5a993de400 Relativize URLs in summary as we do for content 2011-10-03 16:11:42 +02:00
Nicolas Steinmetz
358e92cf04 Clean dot clear import 2011-09-30 22:48:16 +02:00
Skami18
73d9ab4763 Tracebacks are shown in debug mode 2011-09-30 16:25:32 +02:00
Alexis Metaireau
d877150df1 Merge pull request #158 from renhbo/master
The .bat scripts for pelican in Windows
2011-09-15 01:14:09 -07:00
Skami18
87c22dc7ac Pelican exits 1 or Exception.exitcode if an exception is raised 2011-09-10 11:37:19 +02:00
Alexis Metaireau
d33bd1cad1 Merge pull request #168 from kpanic/plugin-github-activity
Github activity Plugin
2011-09-07 09:59:45 -07:00
Marco Milanesi
948ef452ca documentation for the github activity plugin 2011-09-07 18:55:37 +02:00
Marco Milanesi
48d7df72f1 refactored code and introduced a new signal in ArticlesGenerator __init__ 2011-09-07 17:08:28 +02:00
Marco Milanesi
575905ac53 some commentary
copyright infos

some instructions on how to use the plugin
2011-09-06 19:14:21 +02:00
Marco Milanesi
3743617d27 removed spurious signal 2011-09-06 18:56:44 +02:00
Marco Milanesi
c6c0ee76c2 implemented github activity plugin 2011-09-06 18:54:41 +02:00
Nicolas Steinmetz
a50e986f80 add tag import feature for dotclear import 2011-08-30 23:49:45 +02:00
Nicolas Steinmetz
8f6da4fa7f final fix for dotclear import 2011-08-30 22:27:43 +02:00
Nicolas Steinmetz
de790b9e72 for the --dir-cat option, also slugify category's name to avoid encoding or spaces issues or ... 2011-08-30 17:14:05 +03:00
Nicolas Steinmetz
f337f5067b Fix as in dotclear, format is not "markdown" but "wiki". So add an "or" statement. 2011-08-30 16:37:59 +03:00
Alexis Metaireau
da84603558 Merge pull request #165 from nsteinmetz/patch-1
Fix #164, by "slugifying" titles (which for generated filename is also be
2011-08-30 06:34:03 -07:00
Nicolas Steinmetz
67485be240 Fix #164, by "slugifying" titles (which for generated filename is also better imho) + a few remplacement of ".rst" by the "ext" variable. 2011-08-30 15:11:30 +03:00
Alexis Metaireau
56749af1da Merge pull request #163 from n1k0/master
fixed aliased replacements were broken when using ARTICLE_PERMALINK_STRUCTURE
2011-08-22 11:33:49 -07:00
Nicolas Perriault
fc3ca7ea0e fixed aliased replacements were broken when using ARTICLE_PERMALINK_STRUCTURE 2011-08-22 19:42:42 +02:00
Alexis Metaireau
28e13be3a4 Merge pull request #159 from myano/master
checks if pdf_path exists before trying to create pdf_path
2011-08-20 07:43:11 -07:00
Michael Yanovich
5b4e148a2e Updated pelican/generators.py to check if the folder exists before
trying to create it. It will always generate an OSError if the
folder already exists even if it has the appropriate permissions.
2011-08-20 09:51:18 -04:00
Alexis Metaireau
100d94cd12 add ghp-import features to push to github pages easily 2011-08-19 23:01:01 +02:00
renhbo
af93f76836 A wraper on .bat for pelican in Windows. 2011-08-19 22:35:23 +08:00
renhbo
e7168c1d18 A .bat wrapper for pelican in Windows. 2011-08-19 22:14:19 +08:00
renhbo
396db8411c A .bat wraper for pelican in Windows. 2011-08-19 22:12:17 +08:00
renhbo
eea6c7477d Fix an unicode error on Windows platform. 2011-08-19 02:19:44 +08:00
Alexis Metaireau
96b52a2283 issue a warning in case no timezone is defined 2011-08-18 13:58:04 +02:00
Alexis Metaireau
720b8d3168 doc: update the settings page about latest changes 2011-08-18 13:47:31 +02:00
Alexis Metaireau
bee3140fc6 doc: reorder settings 2011-08-18 13:35:53 +02:00
Alexis Metaireau
b2092fe0e7 Merge pull request #156 from Natim/master
GTM Time in ATOM feeds
2011-08-18 03:53:36 -07:00
Alexis Metaireau
f185c45c16 Merge pull request #157 from renhbo/master
Fix an unicode error in Windows.
2011-08-18 03:24:20 -07:00
Alexis Metaireau
36b89b3e4b Merge branch 'master' of github.com:ametaireau/pelican 2011-08-17 10:39:06 +02:00
Alexis Metaireau
e5d4e90b8f update the docs on how to view generated blog 2011-08-17 10:38:48 +02:00
Skami18
26eecf082a Removed another utf-8 related bug 2011-08-16 18:43:51 +02:00
Rémy HUBSCHER
32a6ecbcc5 Fix timezone bug for ATOM generation 2011-08-16 15:11:49 +02:00
Rémy HUBSCHER
66ca61dfbb Patch the makefile to automaticaly create the output dir if it doesn't exists, use PWD to work in different computer base_dir from scratch 2011-08-16 11:47:20 +02:00
Rémy HUBSCHER
acb65b77af GMT Time in ATOM feeds 2011-08-16 11:40:08 +02:00
Alexis Metaireau
4a6bf81b2e remove skribit support. fixes #154 2011-08-11 23:50:04 +02:00
Alexis Metaireau
1edbe044a2 Include the "pelican-quickstart" script.
This ease the creation of a new blog. I modified slightly the code wrote by @Skami18
here: https://gist.github.com/1025236/dfa695e67482477907c79ae709ab827b20b18b04

This commit also renames the import script to "pelican-import".

Fixes #129.
2011-08-11 23:34:53 +02:00
Alexis Metaireau
c73ae02170 pep8ize 2011-08-11 22:42:20 +02:00
Alexis Metaireau
0adb76d5d2 Merge pull request #155 from borgar/configurable-readers
Allow overriding reader extensions.
2011-08-11 13:42:38 -07:00
Alexis Metaireau
e9f1bb9853 add ideas 2011-08-11 11:24:41 +02:00
Alexis Metaireau
7f1cad26ba typos 2011-08-11 11:24:41 +02:00
Borgar
a5f47cfae9 Allow overriding reader extensions.
This adds an extensions setting all readers in the style of [ext]_EXTENSIONS. So for the MarkdownReader, who's extension is "md", the setting read is MD_EXTENSIONS.

The settings allow overriding the default options passed through the readers. In the case of Markdown the default values are ['codehilite','extra'], but user may change this through the setting:

MD_EXTENSIONS = ['footnotes','abbr','codehilite']
2011-08-07 23:05:58 +00:00
Alexis Metaireau
d6a2946aef Merge pull request #151 from saimn/importer
improvements for importers
2011-08-04 01:21:59 -07:00
Alexis Metaireau
4685e41173 Merge pull request #152 from mviera/master
Fixing errors in ARTICLE_PERMALINK_STRUCTURE option
2011-08-04 01:19:22 -07:00
mviera
ae4a3cb6da I have been talking with alexis and he doesn't want 'markdown' to be installed by default if it's not needed. Issue #145 2011-08-04 00:31:58 +02:00
mviera
a32dc03616 Keeping simple theme up-to-date too. Issue #145 2011-08-03 22:11:16 +02:00
Simon
7b7695509d importer - add documentation 2011-08-03 22:06:10 +02:00
mviera
e8cac3bfff I change article.slug to article.url for always referencing the disqus thread to the correct url. Issue #145 2011-08-03 22:01:45 +02:00
mviera
319b553f69 I developed the ARTICLE_PERMALINK_STRUCTURE option into the wrong method, because urls in feed are not being modified. Now, it's fixed. Issue #145. 2011-08-03 22:00:41 +02:00
mviera
a9bb789b14 Adding markdown module as requirement. Even I install pelican in a new virtualenv and i tried to execute the pelican command it shows an error such as 'No module md'. Issue #145 2011-08-03 21:59:22 +02:00
Simon
69636a9da0 importer: add an option to put files in directories with category names 2011-08-03 19:23:09 +02:00
Simon
3b37b42633 some improvements for importers:
- for dotclear: remove seconds in date, remove \\n
- fix categories for wordpress (categories is a list a string)
- refactor a bit the code between markdown and rst
2011-08-03 19:23:02 +02:00
Alexis Metaireau
79e675b911 Merge pull request #150 from borgar/limit-feeds-to-n
Configurable feeds: add an option to reduce the number of items in the feed
2011-08-03 01:58:46 -07:00
Borgar
cd277672d0 Add a setting to limit feeds to a max number of items.
This adds FEED_MAX_ITEMS, which dictates the maximum number of items allowed in a feed.
2011-08-02 23:29:34 +00:00
Alexis Metaireau
73ba522508 Thanks Manuel :) 2011-07-29 23:35:57 +03:00
Alexis Metaireau
89a48ecb1d Merge pull request #146 from mviera/master
Year and month in URL. Fixes #145
2011-07-29 13:34:23 -07:00
mviera
a13ae91f0b Adding more documentation about ARTICLE_PERMALINK_STRUCTURE in settings. Also, i deleted the try except because strftime never raises an exception. Issue #145
I set the ARTICLE_PERMALINK_STRUCTURE option as null in settings.py and remove it from pelican sample config file.
2011-07-29 22:09:09 +02:00
mviera
2609004719 I change PERMALINK_STRUCTURE to ARTICLE_PERMALINK_STRUCTURE and updating the settings.rst documentation.
Also I have implemented other options to this setting, such as the category, the date, the author, this kind of things.

Finally, I have setted the ARTICLE_PERMALINK_STRUCTURE option as null in pelican.conf.py sample file.
2011-07-29 01:11:35 +02:00
mviera
068a3d2f1d Year and month in URL. Issue #145 2011-07-27 23:47:50 +02:00
Skami18
b892f758a8 Pelican show a warning instead of raising an exception if the author of an article is not found an there is no settings file 2011-07-26 17:45:15 +02:00
Alexis Metaireau
6611107e48 little english review on theme extension 2011-07-23 16:06:58 +02:00
Skami18
09d7847c7e Modified the sphinx settings
It seems the manpages ``pelican-themes.en.1`` and
``pelican-themes.fr.1`` were only used for the Debian packages.

Unforunately, ``dh_manpages`` seems to support installation of manpages
depending of their languages, so i've changed the settings and only
``pelican-themes.1`` is generated, this avoids having to rename the
manpages before packaging...

The documentation about making themes for Pelican is now generated in
the file ``pelican-theming.1``.
2011-07-23 15:01:46 +02:00
Skami18
52df0dc47a Added the documentation for template inheritance
Requires a re-reading by someone speaking English better than me...
2011-07-23 14:53:55 +02:00
Skami18
17e7fb4509 Some changes in the templates loading system — documentation will be updated soon
-    The `simple` theme can now be extended with the syntax `{% extends "!simple/index.html" %}`
     instead of `{% extends "simple/index.html" %}` to avoid conflicts with a `simple/` folder.

-    If a template is missing in a theme, it will be replaced by the
     corresponding template of the `simple` theme, so it's possible to
     make a new theme with only two file: a `base.html` file that
     extends the `base.html` file of the `simple` theme, and a CSS
     stylesheet, for example.
2011-07-22 18:45:41 +02:00
Alexis Metaireau
53b295b980 Update the features proposed by pelican on the doc. 2011-07-22 02:12:10 +02:00
Alexis Metaireau
fc2843306f Add a settings.py sample into the documentation.
Fixes #118
2011-07-22 02:11:18 +02:00
Alexis Metaireau
b9aa3d0bfd add a changelog with features per version 2011-07-22 01:56:23 +02:00
Simon
d77f657aa7 add dotclear importer - a bit ugly but it works ! some issues remain with end of lines 2011-07-22 07:18:32 +08:00
Skami18
55bc684380 Added a head block to the simple theme. The html lang attribute of the simple theme now depends of the DEFAULT_LANG variable. 2011-07-21 19:10:38 +02:00
Skami18
dc8b168fc1 Improved the menu in themes/simple/templates/index.html. Added a #menu id 2011-07-21 18:43:18 +02:00
Skami18
3f844ee5d8 Removed an URL-related bug in templates 2011-07-21 18:41:25 +02:00
Skami18
81722f65b8 Template from the simple themes can now be extended from the other themes
Templates from the `simple` themes can be used in the other themes using
the `extends` keyword:

    {% extends "simple/index.html" %}

This does not affect the behavior of Pelican:, so there is no need to modify
the existing themes.
2011-07-19 12:31:18 +02:00
Skami18
bafa2154ff Added the author.html template to the simple theme. 2011-07-19 12:18:14 +02:00
Alexis Metaireau
ffbf5016ac Merge pull request #142 from mapio/master
Added author pages generation
2011-07-15 17:02:06 -07:00
Massimo Santini
d7f85712db Added author.html and authors.html templates and modified the docs accordingly 2011-07-16 00:44:49 +02:00
Massimo Santini
dd5aeb678a Added author.html and authors.html templates and modified the docs accordingly 2011-07-16 00:44:36 +02:00
Massimo Santini
90c3b98413 Merge remote-tracking branch 'upstream/master' 2011-07-16 00:17:49 +02:00
Alexis Metaireau
34c41b43e5 Merge pull request #144 from marsam/master
Improving tests
2011-07-15 14:39:05 -07:00
Massimo Santini
86803b8ae4 Merge remote-tracking branch 'upstream/master' 2011-07-14 14:28:27 +02:00
Mario Rodas
77aac049fd improved test_setting.py 2011-07-02 23:47:22 -05:00
Mario Rodas
3958cbcce3 removing reqs.txt file: replaced by tox 2011-07-02 15:55:26 -05:00
Mario Rodas
53c19cc9a0 adding tox 2011-07-02 15:54:24 -05:00
Mario Rodas
d19b0c975b test works with python2.5 2011-07-02 15:53:27 -05:00
Mario Rodas
dc6934be43 all test pass 2011-07-02 15:15:21 -05:00
Mario Rodas
3cd84ab396 moving tests dir 2011-07-02 14:41:39 -05:00
Mario Rodas
0e596a29d9 Merge remote branch 'upstream/master' 2011-07-02 14:19:11 -05:00
Simon Liedtke
10869f7845 Merge pull request #143 from myano/master
add unicode handling for logging
2011-07-02 08:02:35 -07:00
Michael Yanovich
9d9355c597 added ability for pelican to handle non-ascii characters when logging 2011-07-01 16:22:21 -04:00
Massimo Santini
d8da5ce590 Genetare authors pages with all their posts 2011-06-30 23:49:09 +02:00
Massimo Santini
0a26fcbd0d Avoiding to generate 1/1 if pagination is set to false 2011-06-30 23:46:29 +02:00
Simon Liedtke
9dc9fc1d40 Merge pull request #140 from borgar/date-with-seconds
Adding a date format with seconds.
2011-06-30 07:24:09 -07:00
Simon Liedtke
f05da13f47 Merge pull request #139 from borgar/rel-url-fix
Relative URLs rewriter fixes
2011-06-30 07:23:53 -07:00
Borgar
53e25ce2cf Fixed typo in docs: missing plural s in RELATIVE_URLS. 2011-06-29 13:42:12 +00:00
Borgar
a7d5a9a420 Don't rewrite content URLs unless RELATIVE_URLS is True. 2011-06-29 13:42:04 +00:00
Borgar
f2ea886ed2 Rewrote URL reformatter.
This attempts to fix several issues:

1. The regexp that's supposed to catch href's doesn't work at all and even if it did match anything, it has too many parentheses for the following loop.

2. When a relative URL is replaced then it is done globally on the text and not per instance. So this `<a href="/foo/bar">/foo/bar</a>` will incorrectly get reformatted to `<a href="./static/foo/bar">./static/foo/bar</a>`.

3. Query parameter URLs are rewritten but shouldn't: `<a href="?foo=bar">` gets rewritten to `<a href="./static/?foo=bar">`

4. The joiner is producing too many slashes: `"." + "static" + "/files/image.png"` => `./static//files/image.png`.
2011-06-29 13:41:57 +00:00
Borgar
a6dc53fe20 Adding a date format with seconds. 2011-06-29 13:40:35 +00:00
Mario Rodas
0183882cf7 ignoring tags file 2011-06-22 12:22:04 -05:00
Alexis Metaireau
3d6bf828fd Merge pull request #138 from joedicastro/master
Enable Markdown Extra by default in Pelican.
2011-06-21 03:32:56 -07:00
joe di castro
6ac802bcf1 Enable Markdown Extra by default. 2011-06-21 03:23:41 -07:00
Alexis Metaireau
eee004cdb5 update the documentation about code highlighting 2011-06-18 19:02:57 +02:00
Alexis Metaireau
95b44ef8bf Add Pygments support to the default sourcecode directive.
It is now possible to have highlited sourcecode using the ``::`` syntax.
2011-06-18 18:59:44 +02:00
Alexis Metaireau
28c0644eb6 Plugins doc + minor design changes. 2011-06-18 01:03:53 +02:00
Alexis Metaireau
c5a63c953a Remove the dependency to pkgutil for the plugins 2011-06-17 23:37:08 +02:00
Alexis Metaireau
7184484488 merge nduhamel/plugins 2011-06-17 22:33:54 +02:00
Alexis Metaireau
96c42c0aa5 give full credit (with url to the initial theme) for the notmyidea theme 2011-06-17 20:32:59 +02:00
Alexis Metaireau
971f3b4937 bump version number 2011-06-17 19:45:09 +02:00
Alexis Metaireau
e617b08ab6 add information about the importer in the documentation 2011-06-17 19:26:28 +02:00
Simon Liedtke
a66fa4c77d Merge pull request #137 from borgar/upstream
read_settings should be passed a string argument
2011-06-16 08:52:02 -07:00
Borgar
5398da9d76 read_settings should be passed a string argument
This solves a crash when user runs with no settings: `pelican .`
2011-06-16 13:10:03 +00:00
Alexis Metaireau
b474a6f4e5 remove unnecessary exclamation mark 2011-06-13 18:42:31 +02:00
Alexis Metaireau
eb7c5674a0 add a link to the IRC channel and the webchat into the documentation 2011-06-13 18:26:31 +02:00
Alexis Metaireau
d366fd376e Merge branch 'master' of github.com:ametaireau/pelican 2011-06-13 15:01:10 +02:00
Alexis Metaireau
5ae0d2f20c Merge branch 'master' of https://github.com/flashingpumpkin/pelican 2011-06-13 15:00:34 +02:00
Alexis Metaireau
78d10b1feb update the sphinx documentation settings 2011-06-13 14:23:07 +02:00
Alexis Metaireau
9d194b5a84 Merge pull request #135 from brejoc/master
Add Piwki support to the notmyidea theme
2011-06-13 02:13:28 -07:00
Alexis Metaireau
84ab2059d7 Merge pull request #134 from derdon/master
[1 line change] check only paths (i.e. not None) for being absolute when reading the settings
2011-06-13 02:12:10 -07:00
Alexis Metaireau
014b3b3852 mention the #pelican irc channel on the documentation 2011-06-13 11:10:25 +02:00
Jochen Breuer
94b15b5260 Added template, inlcude in base and some documentation for Piwik. 2011-06-13 07:30:33 +02:00
derdon
1288676302 check the actual value in the settings 2011-06-13 01:34:36 +02:00
derdon
ac0b1a6f82 check only paths (i.e. not None) for being absolute when reading the settings 2011-06-13 01:25:29 +02:00
Alexis Metaireau
61884c5de4 Bump minor version 2011-06-12 22:37:39 +02:00
Alexis Metaireau
515e02bcc6 Add the OUTPUT_PATH as a relative path. 2011-06-12 22:31:26 +02:00
Alexis Metaireau
d698ca3899 Merge branch 'master' of github.com:ametaireau/pelican 2011-06-12 22:29:31 +02:00
Alexis Metaireau
9698bdebcd Merge pull request #132 from rory/master
Fix #131 and #130
2011-06-12 13:29:30 -07:00
Alexis Metaireau
7fc5fa0661 Order tag articles per date. Fix #133 2011-06-12 22:18:50 +02:00
Rory McCann
fee2b50cb9 If the PATH settings is set to a non-absolute path, then use normalize it relative to the settings file. This should probably be done for other settings aswell 2011-06-12 18:52:42 +01:00
Rory McCann
83a61da255 fix typo to make work if path ends in / (cf. issue #131) 2011-06-12 18:41:29 +01:00
Alexis Metaireau
086df21ce7 bump 2.7.0 2011-06-11 21:43:31 +02:00
Alexis Metaireau
8862e5db74 Merge pull request #125 from Alexis-D/master
Theme documentation - Update english + new french
2011-06-09 09:44:15 -07:00
Alexis Daboville
eb16c6e980 Added a french doc for theming. 2011-06-04 15:37:51 +02:00
Alexis Daboville
6ba15e6a52 Added a little doc about page.html, fix some typos, follow a single convention for '.' at end of lines. 2011-06-04 15:35:44 +02:00
Skami18
8b914fcec2 Removed issue #124 2011-06-03 18:26:27 +02:00
Alen Mujezinovic
c5ffe377df European date format parsing. 2011-06-01 14:27:08 -07:00
Skami18
a5d4027c80 Removed the bug #122 and a lone closing tag 2011-06-01 19:00:56 +02:00
Alexis Metaireau
631f0cd2e7 Merge branch 'master' of github.com:ametaireau/pelican 2011-05-31 12:45:44 +02:00
Alexis Metaireau
1c6ea5aab2 Fix locale setup in settings.py 2011-05-31 12:44:40 +02:00
Skami18
3f0ce7ec4e New version of pelican-themes
- New parameter -c/--clean (remove the broken symlinks)
- Added docstrings
- Some bugs corrected
- Compatibility with the old version is not broken (so the triggers in the debian packages are still working)
2011-05-27 19:13:41 +02:00
Skami18
a7baab6a97 Added the manual for pelican-themes 2011-05-22 18:57:02 +02:00
Alexis Metaireau
44c1fe4840 Definitely a bad day for commits. Thanks kmike for reviewing 2011-05-19 18:10:21 +01:00
Alexis Metaireau
f759491279 Oops. This is it. See #115. 2011-05-19 18:00:17 +01:00
Alexis Metaireau
19ed8d5ef1 Merge branch 'master' of github.com:ametaireau/pelican 2011-05-19 17:36:34 +01:00
Alexis Metaireau
5277b9dc16 Add the possibility to specify a list of alternatives for locales. Fixes #115 2011-05-19 17:28:45 +01:00
Skami18
421a8768d4 Modified setup.py: tools/pelican-themes will now be installed as a script... 2011-05-18 20:26:02 +02:00
Alexis Metaireau
bb0b001184 Merge pull request #121 from derdon/master
check also the theme dir in autoreload mode. this fixes #120
2011-05-15 11:02:38 -07:00
derdon
0bbdc6bc00 check also the theme dir in autoreload mode 2011-05-15 12:14:03 +02:00
Alexis Metaireau
34d29e6192 Merge pull request #119 from derdon/master
simplified a one-liner
2011-05-14 08:34:02 -07:00
derdon
93d0ad25d1 simplify some code in utils.files_changed 2011-05-14 17:08:04 +02:00
Skami18
1cd7ac0483 The metadatas are now case insensitive. Removes a tags-related bug. 2011-05-14 15:31:07 +02:00
Skami18
37474e5ccb Some corrections on tools/pelican-themes 2011-05-14 12:57:57 +02:00
Alexis Metaireau
f6870f4a01 Merge branch 'master' of github.com:ametaireau/pelican 2011-05-11 11:10:44 +01:00
Alexis Metaireau
278038ee87 Add information about TAG_FEED. Fixes #117 2011-05-11 11:10:14 +01:00
Alexis Metaireau
4aa829d45d Merge pull request #116 from kmike/better_metadata2
Better metadata handling. Fixes #114
2011-05-11 03:02:44 -07:00
Alexis Metaireau
0a041c2509 python -m doesnt work for python < 2.7 2011-05-11 10:48:39 +01:00
Mikhail Korobov
6cd425e408 Basic test for the new rst reader. Locale is also converted to fr_FR.utf-8 (I wasn't able to run tests without this) 2011-05-11 09:42:37 +06:00
Mikhail Korobov
cacc6db9a4 ReST metadata parsing using docutils. 2011-05-11 06:01:21 +06:00
Alexis Metaireau
eb988ab763 Update the "how to contribute" document.
Also remove an unwanted dep to Markdown and add a dev_requirement.txt file to use with pip.
2011-05-10 23:59:21 +01:00
Alexis Metaireau
0d1edc6450 Add some informations about how to contribute.
This would need a more precise description and some good practices to follow.
2011-05-10 23:42:16 +01:00
Alexis Metaireau
e7eecb03e0 Add features to the readme 2011-05-10 23:40:19 +01:00
Alexis Metaireau
371892ceaa Merge branch tests into main. (See #44)
Conflicts:
	pelican/contents.py
	pelican/settings.py
	samples/pelican.conf.py
2011-05-10 23:18:11 +01:00
Alexis Metaireau
aab3ee78dc Split the settings into different sections.
Fixes #112
2011-05-08 16:15:43 +01:00
Alexis Metaireau
6b44d93780 Add the possibility to publish drafts. Fixes #111 2011-05-08 14:58:57 +01:00
Alexis Metaireau
1171d24f3f Remove logger infos 2011-05-08 14:53:10 +01:00
Alexis Metaireau
4909877fc0 Merge branch 'master' of github.com:ametaireau/pelican 2011-05-08 14:33:54 +01:00
Alexis Metaireau
ec5196e5f0 Don't replace dicts with lists when iterating. 2011-05-08 14:33:05 +01:00
Skami18
bf38517a91 Merge branch 'master' of github.com:ametaireau/pelican 2011-05-08 13:33:52 +02:00
Skami18
ddad637bb3 Added a theme manager. Will be useful to create triggers in Debian packages. 2011-05-08 13:30:09 +02:00
Alexis Metaireau
3641703a49 Merge branch 'master' of github.com:ametaireau/pelican 2011-05-07 22:53:06 +01:00
Alexis Metaireau
04da794b6b Add a feature to copy files from src to dest.
Fixes #86
2011-05-07 22:47:30 +01:00
Alexis Metaireau
52f2a8383a Metadata, not metadatas. 2011-05-07 20:00:30 +01:00
Alexis Metaireau
56effc24cb Add a DEFAULT_METADATA setting.
It is now possible to have soem default metadata defined in the settings. Fixes #98
2011-05-07 19:56:55 +01:00
Alexis Metaireau
1baca77f3a Merge pull request #110 from kmike/master
Python 2.5 compatibility, executable setup.py and up-to-date docstrings. (thanks kmike)
2011-05-07 11:35:19 -07:00
Alexis Metaireau
e09444fa89 Don't delete the output dir as a default behaviour.
Fixes #107
2011-05-07 19:27:33 +01:00
Alexis Metaireau
b7daed2ce3 Merge branch 'hacks' of https://github.com/RonnyPfannschmidt/pelican 2011-05-07 19:12:30 +01:00
Skami18
252ba7d53a pelican.log.warning added to pelican.log.__all__ 2011-05-07 18:53:10 +02:00
Ronny Pfannschmidt
ffe8e00046 move the sleep so we correctly handle keyboard interupts 2011-05-06 22:09:49 +02:00
Ronny Pfannschmidt
d03a412e5b add a sleep to the autoreload loop since we dont need too high cpu load 2011-05-06 22:05:13 +02:00
Ronny Pfannschmidt
24c3447d6c make file-times directly use walk, also skip dot-dirs 2011-05-06 21:04:29 +02:00
Ronny Pfannschmidt
b270c1bac4 stupidly replace rmtree by a pass, since we dont want to rmtree the output dir 2011-05-06 19:29:01 +02:00
Ronny Pfannschmidt
e7c75147d2 pass along the source filename of the rst files for better errors 2011-05-06 19:28:14 +02:00
Ronny Pfannschmidt
3c37704b3b use unicode.strip instead of string.strip of the string module for metadata processors 2011-05-06 19:26:25 +02:00
Ronny Pfannschmidt
e69b55dbcd use absolute import for the rstdirectives 2011-05-06 19:25:11 +02:00
Ronny Pfannschmidt
9c99db7119 better log info for doubls slug/empty slug 2011-05-06 19:24:25 +02:00
Ronny Pfannschmidt
0441127c41 logging star import cleanups 2011-05-06 19:23:37 +02:00
Mikhail Korobov
70ea12aec3 os.walk does not support followlinks kwargs in python 2.5 2011-05-06 17:01:34 +06:00
Mikhail Korobov
f3a8f45de4 One more python 2.5 fix 2011-05-06 16:56:02 +06:00
Mikhail Korobov
3a301b1859 Python 2.5 compatibility 2011-05-06 16:45:27 +06:00
Mikhail Korobov
06246557c5 A couple of docstrings are fixed (they were refering obsolete params) 2011-05-06 16:44:12 +06:00
Mikhail Korobov
1264b81bb6 Make setup.py executable 2011-05-06 16:29:15 +06:00
Alexis Metaireau
18c827653d Merge pull request #106 from derdon/master
fixed link to pelican homepage in the simple theme
2011-05-04 16:53:29 -07:00
Nicolas Duhamel
20b0d1d4ae Fix little bug when declaring plugins path in config file 2011-04-27 18:09:55 +02:00
Nicolas Duhamel
1085e0b2f1 plugins initial support 2011-04-27 13:08:36 +02:00
Alexis Metaireau
b4d7628b86 Merged pull request #105 from nduhamel/fixtoc.
Fix internal linkref for allow TOC
2011-04-27 03:20:05 -07:00
Nicolas Duhamel
4a5f4fe6e4 Fix internal linkref for allow TOC 2011-04-27 11:45:59 +02:00
Nicolas Duhamel
07edd96088 add blinker to requires 2011-04-26 23:13:28 +02:00
Nicolas Duhamel
f4b2b62874 fix mistake 2011-04-26 20:04:44 +02:00
Nicolas Duhamel
09567fa99e add global license capabability as a plugin 2011-04-26 20:02:05 +02:00
Nicolas Duhamel
91831eb525 add doc 2011-04-26 19:54:15 +02:00
Nicolas Duhamel
eef5fc8f99 rename signal 2011-04-26 19:54:15 +02:00
Nicolas Duhamel
dfe4d4e132 add gravatar plugin and pelican_generate_context signal 2011-04-26 19:54:04 +02:00
Nicolas Duhamel
4fb5d2b31e add plugin sample 2011-04-26 19:51:55 +02:00
Nicolas Duhamel
91cb42d7d8 add a KISS plugin system 2011-04-26 19:51:55 +02:00
Alexis Metaireau
3d2ae33799 update the theme (logo) 2011-04-26 19:51:55 +02:00
Alexis Metaireau
ca2030f62c theme switch 2011-04-26 19:51:55 +02:00
Alexis Metaireau
15de7d45c9 Little doc fix 2011-04-26 19:51:55 +02:00
Alexis Metaireau
d2bb85ab6c Thanks Simon Liedtke 2011-04-26 19:51:55 +02:00
derdon
deb5b8a98f typos, grammar mistakes, minor whitespace issues 2011-04-26 19:51:55 +02:00
derdon
f9819e0c71 another whitespace mistake in the CLI help 2011-04-26 19:51:55 +02:00
derdon
bb24c05b90 added missing whitespace in the CLI help 2011-04-26 19:51:55 +02:00
derdon
51f760edc2 move a default value to the table cell it belongs to 2011-04-26 19:51:55 +02:00
derdon
60807d1958 removed a confusing question mark 2011-04-26 19:51:55 +02:00
derdon
6b62ed8673 removed a useless comma 2011-04-26 19:51:55 +02:00
derdon
1ef913cb64 various grammar fixes 2011-04-26 19:51:55 +02:00
derdon
c8d20a7064 fixed the writings of two variable names in the settings table 2011-04-26 19:51:55 +02:00
derdon
ec9525a3e8 include the default values of the settings in the 1st column in parens
this way, it is much easier for the reader to see which variable has which
default value. I also added some default values which could not be found in
the documentation before.
2011-04-26 19:51:55 +02:00
Simon Liedtke
b6b7238519 removed unused import 2011-04-26 19:51:55 +02:00
Simon Liedtke
764a135bb3 Pelican is an "it", not a "he" 2011-04-26 19:51:55 +02:00
Skami18
8de525fa28 Removed a bug (debug messages was not showed) and improved readability 2011-04-26 19:51:55 +02:00
Alexis Metaireau
bb0d4bcc2f Add documentation about the RELATIVE_URLS setting. Thanks to Günter Kolousek. 2011-04-26 19:51:55 +02:00
Alexis Metaireau
98ed7338e6 add a test metadata for #98 2011-04-26 19:51:54 +02:00
Alexis Metaireau
afda2fcbbd Merge branch 'master' of github.com:ametaireau/pelican 2011-04-26 13:47:45 +01:00
Alexis Metaireau
8febf10651 Include the complete license rather than the short version. See #103 2011-04-26 13:46:02 +01:00
derdon
ac391479f2 fixed link to pelican homepage in the simple theme 2011-04-26 13:44:26 +02:00
Alexis Metaireau
dcc9a5596e Merged pull request #102 from derdon/master.
fixed whitespace + typos in doc and CLI help
2011-04-26 01:25:11 -07:00
derdon
52ae61fe24 Merge git://github.com/ametaireau/pelican 2011-04-26 02:55:19 +02:00
derdon
befd7098ce typos, grammar mistakes, minor whitespace issues 2011-04-26 02:49:00 +02:00
derdon
77457ed800 another whitespace mistake in the CLI help 2011-04-26 02:39:57 +02:00
derdon
dd62f293d6 added missing whitespace in the CLI help 2011-04-26 02:37:56 +02:00
Alexis Metaireau
f9f01320ca update the theme (logo) 2011-04-26 00:40:16 +01:00
Alexis Metaireau
62c08f66fb Merge branch 'master' of github.com:ametaireau/pelican 2011-04-26 00:34:38 +01:00
Alexis Metaireau
1013ae5eb3 theme switch 2011-04-26 00:34:03 +01:00
Alexis Metaireau
c21d7a1233 Merged pull request #101 from derdon/master.
broken table
2011-04-25 15:42:10 -07:00
derdon
6b10d86407 move a default value to the table cell it belongs to 2011-04-26 00:39:31 +02:00
Alexis Metaireau
36cc74b224 Little doc fix 2011-04-25 23:33:13 +01:00
Alexis Metaireau
26b756d7d8 Thanks Simon Liedtke 2011-04-25 23:29:45 +01:00
Alexis Metaireau
a92394eac2 Merged pull request #99 from derdon/master.
[doc] moved default values to 1st column + more doc fixes
2011-04-25 15:27:52 -07:00
Skami18
8732569a01 Removed a bug (debug messages was not showed) and improved readability 2011-04-25 12:13:44 +02:00
derdon
e9364df4ed removed a confusing question mark 2011-04-25 00:40:42 +02:00
derdon
6f89ffec83 removed a useless comma 2011-04-25 00:39:21 +02:00
derdon
9e05b1fd51 various grammar fixes 2011-04-25 00:38:15 +02:00
derdon
b602e3799d fixed the writings of two variable names in the settings table 2011-04-25 00:36:15 +02:00
derdon
c9f9f4e500 include the default values of the settings in the 1st column in parens
this way, it is much easier for the reader to see which variable has which
default value. I also added some default values which could not be found in
the documentation before.
2011-04-25 00:33:55 +02:00
Simon Liedtke
fcab48a5e5 removed unused import 2011-04-24 09:24:05 -07:00
Simon Liedtke
94ce3bea64 Pelican is an "it", not a "he" 2011-04-24 09:05:38 -07:00
Alexis Metaireau
34d88bb13c Add documentation about the RELATIVE_URLS setting. Thanks to Günter Kolousek. 2011-04-24 13:05:40 +02:00
Alexis Metaireau
a65cfe6237 add a test metadata for #98 2011-04-21 19:26:12 +02:00
Nicolas Duhamel
105b5c2863 Add subtitle 2011-04-21 17:43:38 +02:00
Alexis Metaireau
c749f610c5 add a markdown article for tests purposes 2011-04-20 16:17:36 +02:00
Alexis Metaireau
698686e1d4 Catch all exceptions in __init__ 2011-04-20 14:44:25 +02:00
Alessandro Martin
c421956cd9 Modified Generator Base Class in order to pass custom Jinja filters in
settings.py
2011-04-20 20:29:29 +08:00
Alessandro Martin
f8f59502b5 Fixed some typos and added links in README 2011-04-20 20:29:28 +08:00
Nicolas Duhamel
93e62c6336 fix issue #91 2011-04-20 19:54:14 +08:00
Alexis Metaireau
129ce24308 Merge branch 'master' of https://github.com/Skami18/pelican 2011-04-20 12:50:39 +02:00
Alexis Metaireau
85a4cbd64e Merge branch 'master' of https://github.com/JNRowe/pelican 2011-04-20 12:30:26 +02:00
Skami18
af1bc749e1 Removed a bug related to unicode 2011-04-19 15:08:04 +02:00
Skami18
3166e6dfe3 Calls to «print» replaced by the «pelican.log» module. 2011-04-19 14:49:46 +02:00
Skami18
834c952f20 Added shortcuts functions in the `log' module 2011-04-19 11:49:24 +02:00
Skami18
c5578e338d Added a colored logging system 2011-04-18 20:14:07 +02:00
Skami18
9d10e2bff1 Added a logging system (will be useful for plugins) 2011-04-18 17:58:48 +02:00
Skami18
752e9d1c75 Tabs replaced by spaces 2011-03-27 12:49:28 +02:00
Skami18
421dc21f72 Removed a category-related bug 2011-03-27 12:46:33 +02:00
Skami18
b909e4aac3 Removed a division by zero 2011-03-26 17:46:31 +01:00
Alexis Metaireau
dfb214d47d default tags to [] 2011-03-23 16:41:24 +00:00
Alexander Artemenko
f9f6da0a43 Don't add 'static' prefix to urls with schema.
Don't add 'static' prefix to urls like 'mailto:some@example.com' or
'skype:somename'.
2011-03-23 11:15:37 +03:00
Alexander Artemenko
ddcccfeaa9 Switch to 'C' locale during page rendering.
Don't know why, but without it Jinja fails with UnicodeDecode error.
2011-03-23 11:14:25 +03:00
Alexander Artemenko
138e19fa19 Merge branch 'master' of git://github.com/ametaireau/pelican
Conflicts:
	docs/settings.rst
	pelican/generators.py
	pelican/settings.py
2011-03-23 10:25:38 +03:00
James Rowe
37666770be imports→import typo fix. 2011-03-23 07:10:28 +00:00
Alexis Metaireau
5f3c4ffafe Thanks to DrMegahertz ! 2011-03-09 12:11:53 +00:00
Marcus Fredriksson
f9123a4cc6 Binds the summary property to the current instance
An unbound property will just return itself instead of calling the intended
method.
2011-03-09 12:21:15 +01:00
Alexis Metaireau
8d6de4ec59 Bump version 2011-03-08 19:37:35 +00:00
Alexis Metaireau
ec06e6ed95 Add a possibility to define the summary of an article directly in rst. 2011-03-08 15:41:40 +00:00
Alexis Metaireau
d8e8bc868f fix pagination 2011-02-27 04:01:10 +00:00
Alexis Metaireau
0f45b5ab1b Merge branch 'dynamic_nosetupfools' of https://github.com/JNRowe/pelican 2011-02-27 03:33:13 +00:00
James Rowe
09f964ffcb Split hard and soft dependencies in getting_started doc. 2011-02-26 16:17:20 +00:00
James Rowe
6fc6a4dac9 Document Reader.enabled attribute usage. 2011-02-24 05:17:05 +00:00
James Rowe
43e931baa4 Make readers with external dependencies optional. 2011-02-24 05:15:04 +00:00
FELD Boris
906c620327 Correct docs. 2011-02-22 11:41:57 +01:00
FELD Boris
6902485c12 Add some docs for skribit integration. 2011-02-22 11:35:06 +01:00
FELD Boris
b2be5638f8 Rename SKRIBIT_TAB_DISTANCE_VERT (SKRIBIT_TAB_DISTANCE_HORIZ) to respectively SKRIBIT_TAB_VERT (SKRIBIT_TAB_HORIZ). 2011-02-22 11:18:41 +01:00
FELD Boris
68f8826ecf Add support for skribit widget. WARNING : NOT TESTED. 2011-02-22 11:15:20 +01:00
FELD Boris
e43d660733 Add support for skribit suggestions tab. WARNING : NOT TESTED. 2011-02-22 11:10:58 +01:00
Alexis Metaireau
7b4d5e8317 remove 'except as' for python 2.5 compat 2011-02-18 13:34:26 +00:00
Alexis Metaireau
fabc1f346e Do not activate the pagination by default 2011-02-18 12:36:53 +00:00
Alexis Metaireau
9f12721895 typo 2011-02-18 12:33:11 +00:00
Laureline Guerin
3f9319d55f some doc about pagination 2011-02-18 11:21:33 +01:00
Alexis Metaireau
77e05b285f Merge branch 'master' of https://github.com/Skami18/pelican 2011-02-17 22:23:08 +00:00
Alexis Metaireau
e9515130e0 Merge branch 'pagination-zebuline' 2011-02-17 19:04:30 +00:00
Alexis Metaireau
80d1fdaef3 Add some few test content. 2011-02-17 19:03:55 +00:00
Alexis Metaireau
8171e1753c Fix a template bug. 2011-02-17 19:03:23 +00:00
Alexis Metaireau
b1f6cfb2c9 pagination - fix extension 2011-02-17 19:02:42 +00:00
skami
284233a920 Non-ASCII in dates are now rendered as xml entities 2011-02-16 15:39:22 +01:00
Alexis Metaireau
90c084f818 fixed a but 2011-02-16 20:13:40 +08:00
Massimo Santini
cbb8a78c19 Fixed getlocale/setlocale bug accoriding to http://bugs.python.org/issue1699853 and http://hub.esss.com.br/wordpress/blog/archives/8561 2011-02-16 20:13:40 +08:00
Massimo Santini
d3fd066209 Fixed path definition from settings/command line opt 2011-02-16 20:13:40 +08:00
Alexis Metaireau
fd45299b6b add the settings for pelican command line usage example 2011-02-16 20:13:39 +08:00
Skami18
bf7ba84d93 Removed an useless "print" statment... 2011-02-16 00:02:09 -08:00
Alexis Metaireau
608fcc17e0 fixed a but 2011-02-15 22:07:57 +00:00
Alexis Metaireau
28d29aa33c Merge branch 'master' of https://github.com/Skami18/pelican 2011-02-15 18:30:09 +00:00
skami
4fddcf6c92 Removed the issue #75
See:
https://github.com/ametaireau/pelican/issues#issue/75
2011-02-15 18:48:23 +01:00
Alexis Metaireau
e0e4155e89 PEP 8 fixes 2011-02-15 13:48:57 +00:00
Laureline Guerin
d272896adf Pagination - refactoring 2011-02-15 14:36:55 +01:00
Laureline Guerin
636e939d23 Pagination - update simple theme 2011-02-15 13:57:00 +01:00
Laureline Guerin
17fe724ca4 Fix category url in base template - simple theme 2011-02-15 13:53:20 +01:00
Laureline Guerin
eb0f33df16 Pagination - rename template 2011-02-15 13:48:14 +01:00
Laureline Guerin
b042974673 Paginiation - add dates pagination to tag/category pages 2011-02-15 13:46:31 +01:00
Laureline Guerin
be7274064b Cat and tag page generation - update dates list with articles of current tag/category 2011-02-15 13:44:36 +01:00
Laureline Guerin
60756678ab Pagination - simplification 2011-02-15 13:41:55 +01:00
Alexis Metaireau
384c579c4a Merge branch 'master' of https://github.com/mapio/pelican 2011-02-15 11:03:51 +00:00
skami
c019443026 Added support for HTML as input format 2011-02-14 19:10:01 +01:00
Laureline Guerin
dc6771d604 Pagination - fix context 2011-02-14 16:46:18 +01:00
Laureline Guerin
4111acd1c1 Pagination added for index and tag/category pages 2011-02-14 16:24:54 +01:00
Massimo Santini
aba1b39211 Fixed getlocale/setlocale bug accoriding to http://bugs.python.org/issue1699853 and http://hub.esss.com.br/wordpress/blog/archives/8561 2011-02-14 15:40:23 +01:00
Massimo Santini
1f821ce2f6 Fixed path definition from settings/command line opt 2011-02-14 15:35:17 +01:00
Alexis Metaireau
a9a0bd6cd3 add the settings for pelican command line usage example 2011-02-14 22:19:16 +08:00
Alexis Metaireau
4edb5bf497 add the settings for pelican command line usage example 2011-02-14 10:42:25 +00:00
Massimo Santini
ca58928b6c Path is an optional argument on the command line, since it can be a setting in the configuration file 2011-02-11 15:36:51 +01:00
Massimo Santini
d484517555 Added a small fix to pygments use 2011-02-11 15:36:04 +01:00
Alexis Metaireau
ad4f7cd3c9 Don't loose the file in the rename. Fixes #55 2011-02-10 01:31:04 +00:00
Alexis Metaireau
a07fe2abee Add a way to import from RSS/Atom feeds. Fixes #55 2011-02-10 01:27:28 +00:00
Alexis Metaireau
00f0f89cbd Add some documentation about the code-block feature. Fixes #66 2011-02-09 21:29:07 +00:00
Alexis Metaireau
bbd8305310 Set locale to default while writing RSS feeds
to always output RFC822 compatible dates. Fixes #67
2011-02-09 21:17:57 +00:00
Alexis Metaireau
06246d1aa4 Fix #65. Unicode, grr. Thanks Bruno Bord. 2011-02-01 22:50:18 +00:00
Alexis Metaireau
816d2cd4b4 Move martyalchin and brownstone theme to pelican-themes 2011-02-01 21:51:58 +00:00
Alexis Metaireau
d13e6f14fb Changes about locales and dates.
Add a way to specify the locale in the settings, and the date formating as well.
Fixes #61.
2011-02-01 21:44:50 +00:00
Alexis Metaireau
3070c8fc9e remove useless conf.py for the fr doc 2011-02-01 17:09:45 +00:00
Alexis Metaireau
1f8b15c710 Merge branch 'master' of https://github.com/Freeculture/pelican 2011-02-01 17:09:14 +00:00
Freeculture
81c6ae3b2d Update french documentation 2011-02-01 14:41:26 +01:00
Alexis Metaireau
cd9f672662 fix documentation 2011-02-01 02:06:54 +00:00
Alexis Metaireau
d0ec18f4db Add the ability to sort categories.
generator.categories is now a list of (category, articles) instead of a dict. This
is to avoid using ordered dicts that have been introduces in python 2.7, so we stay
as much as possible compatible with older versions.

This fixes #62. Thanks to Bruno for the report.
2011-02-01 01:57:39 +00:00
Guillaume
079e9f878e Francisation des noms de fichier de la doc fr 2011-01-26 17:36:59 +01:00
Alexis Metaireau
ac70770ba5 Add the translation of the FAQ. 2011-01-25 16:50:34 +00:00
Alexis Metaireau
fb219afeba Integrated the french documentation to the already existing one. 2011-01-25 16:35:59 +00:00
Alexis Metaireau
eb9cc3923a Merge branch 'master' into Freeculture-dev_freeculture 2011-01-25 16:28:37 +00:00
Alexis Metaireau
da6435ce28 Merge branch 'dev_freeculture' of https://github.com/Freeculture/pelican into Freeculture-dev_freeculture 2011-01-25 16:27:15 +00:00
Alexis Metaireau
54c918a10e Add the output folder to the gitignore 2011-01-25 16:26:37 +00:00
Alexis Metaireau
e14ed4749d Add the slug for the translation articles. 2011-01-25 16:23:43 +00:00
Guillaume
156d757bd8 Début Documentation Français 2011-01-25 14:32:06 +01:00
Alexis Metaireau
8a0aec18eb Removed the hg repository. 2011-01-25 00:19:09 +00:00
Alexis Metaireau
bbaa618726 Merge branch 'master' of https://github.com/Lothiraldan/pelican 2011-01-24 23:09:47 +00:00
FELD Boris
a5203ae363 Refactor building of header part. 2011-01-25 00:02:00 +01:00
FELD Boris
246753c6d4 Remove temporary html files after their utilisation. 2011-01-24 23:59:15 +01:00
FELD Boris
f4450b0091 Add extraction of categories and tags, put rst files in category subdir. 2011-01-24 23:57:53 +01:00
FELD Boris
1cc5017fb4 Correct bug in date format importation. 2011-01-24 23:50:29 +01:00
Alexis Metaireau
4d0e18db23 Avoid rewriting protocol related links. 2011-01-24 01:59:09 +00:00
Alexis Metaireau
282730e635 Merge branch 'master' of https://github.com/Lothiraldan/pelican 2011-01-24 00:07:34 +00:00
FELD Boris
3566bb6f5f Update wp2pelican script to extract date and author taken from wordpress xml file. 2011-01-23 22:54:31 +01:00
Alexis Metaireau
2954098004 Update an anchor. 2011-01-20 01:04:54 +01:00
Alexis Metaireau
f081c3b41b Merge branch 'master' of github.com:ametaireau/pelican 2011-01-19 16:23:37 +01:00
Alexis Metaireau
6b1434f7a7 Add a FAQ. 2011-01-19 16:22:15 +01:00
Alexis Metaireau
8454b0d1b8 Tests for settings. 2011-01-13 00:46:10 +01:00
Alexis Metaireau
c13c707a62 Tests for contents.py 2011-01-13 00:32:37 +01:00
Alexis Metaireau
39b761c056 Merge branch 'master' of github.com:ametaireau/pelican into tests 2011-01-12 23:50:47 +01:00
Alexis Metaireau
a64ecf24be Merge branches 'autoreload' and 'master' 2011-01-12 23:47:19 +01:00
Alexis Metaireau
b8fb45de9e Add the autoreload feature. This fixes #45. I've choosen to not serve the content
via HTTP, because it's really simple to do "firefox output/index.html".
2011-01-12 23:45:06 +01:00
Alexis Metaireau
55da03ad2f Fix notmyidea layout. This fixes #54 2011-01-12 19:08:29 +01:00
Alexis Metaireau
e53eea6ecc Merge branch 'master' of github.com:ametaireau/pelican into tests 2011-01-12 00:49:19 +01:00
Alexis Metaireau
30c2a0b681 Update doc version. 2011-01-06 02:37:37 +01:00
Alexis Metaireau
6e4a826dc1 Update the translation documentation. 2011-01-06 02:33:14 +01:00
Alexis Metaireau
2f915caff2 branch merge
Conflicts:
	pelican/generators.py
	pelican/settings.py
2011-01-05 18:25:14 +01:00
Alexis Metaireau
b03598b168 Merge branch 'master' into tests 2011-01-05 16:29:32 +01:00
Alexis Metaireau
bb96e253c9 Start working on the testsuite. 2011-01-05 16:24:44 +01:00
Alexis Metaireau
6b4b5fce13 update sphinx configuration 2011-01-05 16:23:44 +01:00
Alexis Metaireau
79576f25b6 Fix translation feature. Add translation support to the notmyidea theme. 2011-01-05 16:22:52 +01:00
Alexis Metaireau
2f6300af46 Do not create a general function for "update_object_content". 2011-01-05 14:27:46 +01:00
Alexis Metaireau
b3ca36a8b0 Add references to the simple theme in the documentation. 2011-01-05 14:04:11 +01:00
Alexis Metaireau
f495cb41d9 Add TWITTER_USERNAME settings in the docs. 2011-01-05 13:51:04 +01:00
Arnaud BOS
3ee595f927 Images support and add built files to gitignore 2011-01-05 13:32:54 +01:00
Alexander Artemenko
fd47a74b9e Template loading on demand get_templates was transformed into get_template. 2011-01-02 02:50:08 +03:00
Alexander Artemenko
b3256f0ecd Added tag cloud generation. Result stored in the context.tag_cloud as list of tuples (tag, weight). Weight is from 1 to TAG_CLOUD_STEPS, lesser weight corresponds to bigger font size. 2011-01-01 23:08:29 +03:00
Alexis Metaireau
5af56793eb Add generated docs to gitignore. 2010-12-29 15:37:25 +01:00
Allan Whatmough
35ca78f642 Typo 2010-12-29 13:23:09 +00:00
Allan Whatmough
164c703861 Add a default for JINJA_EXTENSIONS (default is no extensions) 2010-12-29 13:21:21 +00:00
Allan Whatmough
426ee1f76e Add JINJA_EXTENSIONS to the settings docs 2010-12-29 13:20:53 +00:00
Allan Whatmough
3c0649d89f Use JINJA_EXTENSIONS setting if available when creating the Environment object. 2010-12-27 23:27:40 +00:00
Alexander Artemenko
01b4c06916 Custom bicycle 'update_dict' was replaced with 'collections.defaultdict'. 2010-12-26 23:59:30 +03:00
Alexander Artemenko
03104bfbc3 Feed writer was refactored to allow more granular overriding of functionality. 2010-12-25 17:58:47 +03:00
Alexander Artemenko
a937424faa Base routines were transformed into the class Pelican. This class could be overridden using PELICAN_CLASS option. 2010-12-25 17:26:24 +03:00
Alexis Metaireau
7873370583 Merge branch 'master' of https://github.com/svetlyak40wt/pelican 2010-12-22 19:07:30 +00:00
Guillaume B
31cee95b6f Fixed the PDF generation
Signed-off-by: Guillaume B <guitreize@gmail.com>
2010-12-22 10:45:55 +08:00
Alexander Artemenko
c64ccc4fcd Added setting option RELATIVE_URLS to change default behaviour of file writer. 2010-12-22 03:19:35 +03:00
Alexander Artemenko
52459768f2 Fixed feed generator for translations. 2010-12-22 02:35:29 +03:00
Alexander Artemenko
558038be32 Fixed tags parsing, now it can parse tags like this "blah,minor, foo , bar". Also, code for metadata parsing was slightly refactored. 2010-12-22 01:08:23 +03:00
Alexis Metaireau
750e211649 Update the documentations and fix some little things about the translation feature. 2010-12-20 22:50:54 +00:00
Alexis Metaireau
8f59649eb6 Merge branch 'master' of https://github.com/svetlyak40wt/pelican
Conflicts:
	pelican/generators.py
2010-12-20 22:42:29 +00:00
Alexander Artemenko
a45f705bda Typo was fixed. 2010-12-21 00:22:15 +03:00
Alexander Artemenko
1d74de2559 Added another option CLEAN_URLS, to use generated files with mod_rewrite and to show nice urls to the end user. 2010-12-21 00:21:29 +03:00
Alexander Artemenko
3afdb8fcff Articles translations are enabled. To use this feature, you need to
add a Lang meta into the each article and set DEFAULT_LANG setting
which is 'en' by default.

Than, only articles in the default language (or without variant in
default language) will be shown in the index of the blog. And each
Article will have translations list.

The same is applicable to the static Pages.

Also, separate feeds are generated for each language except default.
2010-12-20 22:02:27 +03:00
Alexis Metaireau
a71d93c63c Add comment number support. 2010-12-19 03:34:19 +00:00
Alexis Metaireau
67b43c6079 Added tag 2.5.3 for changeset 1f9dd44b5464 2010-12-19 01:30:18 +00:00
Alexis Metaireau
4aacf4f7c7 Version bump 2010-12-19 01:30:08 +00:00
Alexis Metaireau
1c29609f08 Temporary circular dependency fix about getting the right version. 2010-12-19 01:29:02 +00:00
Alexis Metaireau
9c485a7561 Branch merge with Freeculture. 2010-12-18 22:12:56 +00:00
Alexis Metaireau
472c6871da Added tag 2.5.2 for changeset 6d368a1739a4 2010-12-18 21:14:14 +00:00
Freeculture
9e2e73d39c Fixed a mistake for tag feed generator 2010-12-18 20:42:15 +01:00
Alexander Artemenko
1a31c74d5c .gitignore updated. 2010-12-17 00:32:27 +03:00
Alexander Artemenko
bc5a19a37b Slugify is broken for non-ascii titles. Now slug could be redefined, using the metadata. 2010-12-17 00:32:12 +03:00
Alexander Artemenko
658e1203b2 Simplier metadata processing, using dict's 'get' method with default value. 2010-12-17 00:07:55 +03:00
Alexander Artemenko
3decf7f519 Added .gitignore file. 2010-12-17 00:05:39 +03:00
Alexander Artemenko
a322d6c4e8 Lowercase meta field's name before looking the processor. 2010-12-17 00:04:45 +03:00
536 changed files with 56975 additions and 4142 deletions

4
.coveragerc Normal file
View file

@ -0,0 +1,4 @@
[report]
omit =
pelican/tests/*
pelican/signals.py

15
.editorconfig Normal file
View file

@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.py]
max_line_length = 88
[*.{yml,yaml}]
indent_size = 2

21
.git-blame-ignore-revs Normal file
View file

@ -0,0 +1,21 @@
# .git-blame-ignore-revs
# Apply code style to project via: ruff format .
cabdb26cee66e1173cf16cb31d3fe5f9fa4392e7
# Upgrade code base for Python 3.8 and above
ecd598f293161a52564aa6e8dfdcc8284dc93970
# Apply Ruff and pyupgrade to Jinja templates
db241feaa445375dc05e189e69287000ffe5fa8e
# Change pre-commit to run ruff and ruff-format with fixes
6d8597addb17d5fa3027ead91427939e8e4e89ec
# Upgrade Ruff from 0.1.x to 0.4.x
0bd02c00c078fe041b65fbf4eab13601bb42676d
# Apply more Ruff checks to code
9d30c5608a58d202b1c02d55651e6ac746bfb173
# Apply yet more Ruff checks to code
7577dd7603f7cb3a09922d1edb65b6eafb6e2ac7
# Indent Jinja templates, HTML, CSS, and JS via DjHTML
4af40e80772a58eac8969360e5caeb99e3e26e78
# Ruff UP031: Use F-string format specifiers instead of percent format
30bde3823f50b9ba8ac5996c1c46bb72031aa6b8
# Upgrade Ruff to 0.12.x & comply with new rules
4dedf1795831db99d18941c707923ba48cc28ce7

11
.gitattributes vendored Normal file
View file

@ -0,0 +1,11 @@
# Auto detect text files and perform LF normalization
* text=auto
# Improve accuracy of GitHub's Linguist-powered language statistics
pelican/tests/content/* linguist-vendored
pelican/tests/output/* linguist-vendored
pelican/tests/theme_overrides/* linguist-vendored
pelican/themes/notmyidea/templates/*.html linguist-language=Jinja
pelican/themes/simple/templates/*.html linguist-language=Jinja
samples/* linguist-vendored
*.html linguist-vendored

1
.github/CODEOWNERS vendored Normal file
View file

@ -0,0 +1 @@
.github/workflows/github_pages.yml @seanh

5
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,5 @@
---
github: justinmayer
custom: https://donate.getpelican.com
liberapay: pelican

44
.github/ISSUE_TEMPLATE/---bug-report.md vendored Normal file
View file

@ -0,0 +1,44 @@
---
name: "\U0001F41E Bug Report"
about: Did you find a bug?
title: ''
labels: bug
assignees: ''
---
<!--
Hi there! Thank you for discovering and submitting an issue.
Before you submit this, lets make sure of a few things.
Please make sure the following boxes are ticked if they are correct.
If not, please try and fulfill them first.
-->
<!-- Checked checkbox should look like this: [x] -->
- [ ] I have read the [Filing Issues](https://docs.getpelican.com/en/latest/contribute.html#filing-issues) and subsequent “How to Get Help” sections of the documentation.
- [ ] I can reproduce this problem with stock/default settings file, theme, and sample content (as described in above “How to Get Help” sections of the documentation).
- [ ] I have searched the [issues](https://github.com/getpelican/pelican/issues?q=is%3Aissue) (including closed ones) and believe that this is not a duplicate.
<!--
If you cannot reproduce the problem with stock/default settings file, theme, and sample content,
please close this tab and ask your question in the Discussions area instead:
<https://github.com/getpelican/pelican/discussions>
Otherwise, once the above boxes are checked, please fill out the following list
of information, which would be very helpful for maintainers.
-->
- **OS version and name**: <!-- Replace with version + name -->
- **Python version**: <!-- Replace with version -->
- **Pelican version**: <!-- Replace with version -->
- **Link to theme**: <!-- Replace with link to the theme you are using -->
- **Links to plugins**: <!-- Replace with list of links to plugins you are using -->
- **Link to your site**: <!-- If available, replace with link to your site -->
- **Link to your source**: <!-- If available, replace with link to relevant source repository -->
- **Link to a [Gist](https://gist.github.com/) with the contents of your settings file**: <!-- If your source is not accessible, put Gist link here -->
## Issue
<!--
Now feel free to write your issue. Please avoid vague phrases like “[…] doesnt work”.
Be descriptive! Thanks again 🙌 ❤️
-->

View file

@ -0,0 +1,22 @@
---
name: "\U0001F4DA Documentation"
about: Did you find errors, problems, or anything unclear in the docs (https://docs.getpelican.com/)?
title: ''
labels: docs
assignees: ''
---
<!--
Hi there! Thank you for discovering and submitting an issue with our documentation.
Before you submit this, lets make sure of a few things.
Please make sure the following boxes are ticked if they are correct.
If not, please try and fulfill them first.
-->
<!-- Checked checkbox should look like this: [x] -->
- [ ] I have searched the [issues](https://github.com/getpelican/pelican/issues?q=is%3Aissue) (including closed ones) and believe that this is not a duplicate.
## Issue
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ -->

View file

@ -0,0 +1,24 @@
---
name: "\U0001F381 Feature Request"
about: Do you have ideas for new features and improvements?
title: ''
labels: enhancement
assignees: ''
---
<!--
Hi there! Thank you for wanting to make Pelican better.
Before you submit this, lets make sure of a few things.
Please make sure the following boxes are ticked if they are correct.
If not, please try and fulfill them first. The last one is optional but encouraged.
-->
<!-- Checked checkbox should look like this: [x] -->
- [ ] I have searched the [issues](https://github.com/getpelican/pelican/issues?q=is%3Aissue) (including closed ones) and believe that this is not a duplicate.
- [ ] I have searched the [documentation](https://docs.getpelican.com/) and believe that my question is not covered.
- [ ] I am willing to lend a hand to help implement this feature. <!-- optional but encouraged -->
## Feature Request
<!-- Now feel free to write your idea for improvement. Thanks again 🙌 ❤️ -->

View file

@ -0,0 +1,28 @@
---
name: "\U0001F5C3 Everything Else"
about: Do you have a question/issue that does not fall into any of the other categories?
title: ''
labels: question
assignees: ''
---
<!--
Instead of a new issue, please consider submitting your question to:
<https://github.com/getpelican/pelican/discussions>
If for some reason you believe that your question warrants a new issue
instead of a discussion thread, describe your question/issue here.
This space is meant to be used for general questions
that are not bugs, feature requests, or documentation issues.
Before you submit this, lets make sure of a few things.
Please make sure the following boxes are ticked if they are correct.
If not, please try and fulfill them first.
-->
<!-- Checked checkbox should look like this: [x] -->
- [ ] I have searched the [issues](https://github.com/getpelican/pelican/issues?q=is%3Aissue) (including closed ones) and believe that this is not a duplicate.
- [ ] I have searched the [documentation](https://docs.getpelican.com/) and believe that my question is not covered.
- [ ] I have carefully read the [How to Get Help](https://docs.getpelican.com/en/latest/contribute.html#how-to-get-help) section of the documentation.
## Issue
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ -->

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1,8 @@
---
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: false
contact_links:
- name: '💬 Pelican IRC Channel'
url: https://web.libera.chat/?#pelican
about: |
Chat with the community, ask questions, and learn about best practices.

9
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,9 @@
# See https://docs.github.com/en/free-pro-team@latest/
# github/administering-a-repository/enabling-and-disabling-version-updates
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

12
.github/pull_request_template.md vendored Normal file
View file

@ -0,0 +1,12 @@
# Pull Request Checklist
Resolves: #issue-number-here <!-- Only if related issue *already* exists — otherwise remove this line -->
<!-- This is just a reminder about the most common mistakes. Please make sure that you tick all *appropriate* boxes. Also, please read our [contribution guide](https://docs.getpelican.com/en/latest/contribute.html#contributing-code) at least once — it will save you unnecessary review cycles! -->
- [ ] Ensured **tests pass** and (if applicable) updated functional test output
- [ ] Conformed to **code style guidelines** by running appropriate linting tools
- [ ] Added **tests** for changed code
- [ ] Updated **documentation** for changed code
<!-- If you have *any* questions to *any* of the points above, just **submit and ask**! This checklist is here to *help* you, not to deter you from contributing! -->

31
.github/stale.yml vendored Normal file
View file

@ -0,0 +1,31 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
daysUntilClose: 30
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: true
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your participation and understanding.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
# Limit to only `issues` or `pulls`
only: issues

105
.github/workflows/github_pages.yml vendored Normal file
View file

@ -0,0 +1,105 @@
# Workflow for building the site and (optionally) publishing it to GitHub Pages.
name: Deploy to GitHub Pages
on:
workflow_call:
inputs:
settings:
required: true
description: "The path to your Pelican settings file (`pelican`'s `--settings` option), for example: 'publishconf.py'"
type: string
requirements:
required: false
default: "pelican"
description: "The Python requirements to install, for example to enable markdown and typogrify use: 'pelican[markdown] typogrify' or if you have a requirements file use: '-r requirements.txt'"
type: string
output-path:
required: false
default: "output/"
description: "Where to output the generated files (`pelican`'s `--output` option)"
type: string
theme:
required: false
default: ""
description: "The GitHub repo URL of a custom theme to use, for example: 'https://github.com/seanh/sidecar.git'"
type: string
python:
required: false
default: "3.12"
description: "The version of Python to use, for example: '3.12' (to use the most recent version of Python 3.12, this is faster) or '3.12.1' (to use an exact version, slower)"
type: string
siteurl:
required: false
default: ""
description: "The base URL of your web site (Pelican's SITEURL setting). If not passed this will default to the URL of your GitHub Pages site, which is correct in most cases."
type: string
feed_domain:
required: false
default: ""
description: "The domain to be prepended to feed URLs (Pelican's FEED_DOMAIN setting). If not passed this will default to the URL of your GitHub Pages site, which is correct in most cases."
type: string
deploy:
required: false
default: true
description: "Whether to deploy the site. If true then build the site and deploy it. If false then just test that the site builds successfully but don't deploy anything."
type: boolean
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python }}
- name: Checkout theme
if: ${{ inputs.theme }}
run: git clone '${{ inputs.theme }}' .theme
- name: Configure GitHub Pages
id: pages
uses: actions/configure-pages@v5
- name: Install requirements
run: pip install ${{ inputs.requirements }}
- name: Build Pelican site
shell: python
run: |
import subprocess
cmd = "pelican"
cmd += " --settings ${{ inputs.settings }}"
cmd += " --extra-settings"
cmd += """ SITEURL='"${{ inputs.siteurl || steps.pages.outputs.base_url }}"'"""
cmd += """ FEED_DOMAIN='"${{ inputs.feed_domain || steps.pages.outputs.base_url }}"'"""
cmd += " --output ${{ inputs.output-path }}"
if "${{ inputs.theme }}":
cmd += " --theme-path .theme"
subprocess.run(cmd, shell=True, check=True)
- name: Fix permissions
run: |
chmod -c -R +rX "${{ inputs.output-path }}" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ inputs.output-path }}
deploy:
concurrency:
group: "pages"
cancel-in-progress: false
if: ${{ inputs.deploy }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

146
.github/workflows/main.yml vendored Normal file
View file

@ -0,0 +1,146 @@
name: build
on: [push, pull_request]
env:
# color output for pytest and tox
PYTEST_ADDOPTS: "--color=yes"
PY_COLORS: 1
jobs:
test:
name: Test - ${{ matrix.python }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos, windows]
python: ["3.10", "3.11", "3.12", "3.13"]
include:
- os: ubuntu
python: "3.9"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/requirements/*"
- name: Install locale (Linux)
if: startsWith(runner.os, 'Linux')
run: sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: "2.9.2"
- name: Install tox
run: python -m pip install -U pip tox
- name: Info
run: |
echo "===== PYTHON ====="
python --version
echo "===== PANDOC ====="
pandoc --version | head -2
- name: Run tests
run: tox -e py${{ matrix.python }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
with:
python-version: "3.11"
cache: true
cache-dependency-path: ./pyproject.toml
- name: Install dependencies
run: |
pdm install --no-default --dev
- name: Run linters
run: pdm lint --diff
- name: Run pre-commit checks on all files
uses: pre-commit/action@v3.0.1
build:
name: Test build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
with:
python-version: "3.11"
cache: true
cache-dependency-path: ./pyproject.toml
- name: Install dependencies
run: pdm install --dev
- name: Build package
run: pdm build
- name: Test build
run: pdm run pytest --check-build=dist pelican/tests/build_test
docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "**/requirements/*"
- name: Install tox
run: python -m pip install -U pip tox
- name: Check
run: tox -e docs
- name: cache the docs for inspection
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_build/html/
deploy:
name: Deploy
environment: Deployment
needs: [test, lint, docs, build]
runs-on: ubuntu-latest
if: github.ref=='refs/heads/main' && github.event_name!='pull_request' && github.repository == 'getpelican/pelican'
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Check release
id: check_release
run: |
python -m pip install --upgrade pip
python -m pip install autopub[github]
autopub check
- name: Publish
if: ${{ steps.check_release.outputs.autopub_release=='true' }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
autopub prepare
autopub commit
autopub build
autopub githubrelease
- name: Upload package to PyPI
if: ${{ steps.check_release.outputs.autopub_release=='true' }}
uses: pypa/gh-action-pypi-publish@release/v1

29
.gitignore vendored Normal file
View file

@ -0,0 +1,29 @@
*.egg-info
.*.swp
.*.swo
*.pyc
.DS_Store
docs/_build
docs/*/_build
build
dist
tags
.tox
.coverage
htmlcov
*.orig
venv
samples/output
*.pem
*.lock
.pdm-python
.vale
.venv
**/LC_MESSAGES/*.mo
# direnv
.envrc
# IDE cruft
.idea
.vscode

View file

@ -1,9 +0,0 @@
syntax: glob
output/*
*.pyc
MANIFEST
build
dist
docs/_build
Paste-*
*.egg-info

26
.hgtags
View file

@ -1,26 +0,0 @@
7acafbf7e47b1287525026ad8b4f1efe443d5403 1.2
7acafbf7e47b1287525026ad8b4f1efe443d5403 1.2
ae850ab0fd62a98a98da7ce74ac794319c6a5066 1.2
54a0309f79d6c5b54d8e1e3b5e3f744856b68a73 1.1
8f5e0eb037768351eb08840e588a4364266a69b3 1.1.1
bb986ed591734ca469f726753cbc48ebbfce0dcc 1.2.1
8a3dad99cbfa6bb5d0ef073213d0d86e0b4c5dba 1.2.2
4a20105a242ab154f6202aa6651979bfbb4cf95e 1.2.3
803aa0976cca3dd737777c640722988b1f3769fe 1.2.4
703c4511105fd9c8b85afda951a294c194e7cf3e 1.2.5
6e46a40aaa850a979f5d09dd95d02791ec7ab0ef 2.0
bf14d1a5c1fae9475447698f0f9b8d35c551f732 2.1
da86343ebd543e5865050e47ecb0937755528d13 2.1.1
760187f048bb23979402f950ecb5d3c5493995b1 2.2
20aa16fe4daa3b70f6c063f170edc916b49837ed 2.3
f9c1d94081504f21f5b2ba147a38099e45db1769 2.4
e65199a0b2706d2fb48f7a3c015e869716e0bec1 2.4.1
89dbd7b6f114508eae62fc821326f4797dfc8b23 2.4.2
979b4473af56a191a278c83058bc9c8fa1fde30e 2.4.3
26a444fbb78becae358afa0a5b47587db8739b21 2.4.4
3542b65fd1963ae7065b6a3bc912fbb6c150e98c 2.4.5
87745dfdd51b96bf18eaaf6c402effa902c1b856 2.5.0
294a2830a393d5a97671dc211dbdb5254a15e604 2.5.1
294a2830a393d5a97671dc211dbdb5254a15e604 2.5.1
92b31e41134cb2c1a156ce623338cf634d2ebc3e 2.5.1
7d728f8e771cbbc802ce81e424e08a8eecbd48dc 2.5.2

24
.mailmap Normal file
View file

@ -0,0 +1,24 @@
Alexis Métaireau <alexis@notmyidea.org>
Alexis Métaireau <alexis@notmyidea.org> <alexis, notmyidea, org>
Alexis Métaireau <alexis@notmyidea.org> <ametaireau@gmail.com>
Axel Haustant <noirbizarre@gmail.com> <axel.haustant.ext@mappy.com>
Axel Haustant <noirbizarre@gmail.com> <axel.haustant@valtech.fr>
Dave Mankoff <mankyd@gmail.com>
Feth Arezki <feth@tuttu.info>
Guillaume <guillaume@lame.homelinux.com>
Guillaume <guillaume@lame.homelinux.com> <guillaume@mint.(none)>
Guillaume B <guitreize@gmail.com>
Guillermo López <guilan70@hotmail.com>
Guillermo López <guilan70@hotmail.com> <guillermo.lopez@outlook.com>
Jomel Imperio <jimperio@gmail.com>
Justin Mayer <entrop@gmail.com>
Justin Mayer <entrop@gmail.com> <entroP@gmail.com>
Marco Milanesi <kpanic@gnufunk.org> <marcom@openquake.org>
Massimo Santini <santini@dsi.unimi.it> <santini@spillane.docenti.dsi.unimi.it>
Rémy HUBSCHER <hubscher.remy@gmail.com> <remy.hubscher@ionyse.com>
Simon Conseil <contact@saimon.org>
Simon Liedtke <liedtke.simon@googlemail.com>
Skami18 <skami@skami-laptop.dyndns.org>
Stuart Colville <muffinresearchlabs@gmail.com> <muffinresearch@gmail.com>
Stéphane Bunel <stephane@lutetium.(none)>
tBunnyMan <WagThatTail@Me.com>

30
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,30 @@
---
# See https://pre-commit.com/hooks.html for info on hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# ruff version should match the one in pyproject.toml
rev: v0.12.2
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/rtts/djhtml
rev: '3.0.8'
hooks:
- id: djhtml
- id: djcss
- id: djjs

28
.readthedocs.yaml Normal file
View file

@ -0,0 +1,28 @@
---
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the OS, Python version, and any other needed tools
build:
os: ubuntu-22.04
tools:
python: "3.10"
# Build HTML & PDF formats
formats:
- htmlzip
- pdf
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Version of Python and requirements required to build the docs
python:
install:
- requirements: requirements/developer.pip
- method: pip
path: .

10
.vale.ini Normal file
View file

@ -0,0 +1,10 @@
StylesPath = .vale/styles
Vocab = Pelican
MinAlertLevel = suggestion
Packages = proselint, alex
[*]
BasedOnStyles = Vale, proselint, alex

139
CONTRIBUTING.rst Normal file
View file

@ -0,0 +1,139 @@
Filing issues
=============
* Before you submit a new issue, try `asking for help`_ first.
* If determined to create a new issue, first search `Pelican Discussions`_
and `existing issues`_ (open and closed) to see if your question has already
been answered previously.
.. _`asking for help`: `How to get help`_
.. _`Pelican Discussions`: https://github.com/getpelican/pelican/discussions
.. _`existing issues`: https://github.com/getpelican/pelican/issues
How to get help
===============
Before you ask for help, please make sure you do the following:
1. Read the documentation_ thoroughly. If in a hurry, at least use the search
field that is provided at top-left on the documentation_ pages. Make sure
you read the docs for the Pelican version you are using.
2. Use a search engine (e.g., DuckDuckGo, Google) to search for a solution to
your problem. Someone may have already found a solution, perhaps in the
form of a ':pelican-doc:`plugins` or a specific combination of settings.
3. Try reproducing the issue in a clean environment, ensuring you are using:
* latest Pelican release (or an up-to-date Git clone of Pelican ``main`` branch)
* latest releases of libraries used by Pelican
* no plugins or only those related to the issue
**NOTE:** The most common sources of problems are anomalies in (1) themes, (2)
plugins, (3) settings files, and (4) ``make``/``invoke`` automation wrappers.
If you can't reproduce your problem when using the following steps to generate
your site, then the problem is almost certainly with one of the above-listed
elements (and not Pelican itself)::
cd ~/projects/your-site
git clone https://github.com/getpelican/pelican ~/projects/pelican
pelican content -s ~/projects/pelican/samples/pelican.conf.py -t ~/projects/pelican/pelican/themes/notmyidea
If you can generate your site without problems using the steps above, then your
problem is unlikely to be caused by Pelican itself, and therefore please
consider reaching out to the maintainers of the plugins/theme you are using
instead of raising the topic with the Pelican core community.
If despite the above efforts you still cannot resolve your problem, be sure to
include in your inquiry the following information, preferably in the form of
links to content uploaded to a `paste service`_, GitHub repository, or other
publicly-accessible location:
* Describe what version of Pelican you are running (output of ``pelican --version``
or the HEAD commit hash if you cloned the repo) and how exactly you installed
it (the full command you used, e.g. ``python -m pip install pelican``).
* If you are looking for a way to get some end result, prepare a detailed
description of what the end result should look like (preferably in the form of
an image or a mock-up page) and explain in detail what you have done so far to
achieve it.
* If you are trying to solve some issue, prepare a detailed description of how
to reproduce the problem. If the issue cannot be easily reproduced, it cannot
be debugged by developers or volunteers. Describe only the **minimum steps**
necessary to reproduce it (no extra plugins, etc.).
* Upload your settings file or any other custom code that would enable people to
reproduce the problem or to see what you have already tried to achieve the
desired end result.
* Upload detailed and **complete** output logs and backtraces (remember to add
the ``--debug`` flag: ``pelican --debug content [...]``)
.. _documentation: https://docs.getpelican.com/
.. _`paste service`: https://dpaste.com
Once the above preparation is ready, you can post your query as a new thread in
`Pelican Discussions`_. Remember to include all the information you prepared.
Contributing code
=================
Before you submit a contribution, please ask whether it is desired so that you
don't spend a lot of time working on something that would be rejected for a
known reason. Consider also whether your new feature might be better suited as
a ':pelican-doc:`plugins` — you can `ask for help`_ to make that determination.
Also, if you intend to submit a pull request to address something for which there
is no existing issue, there is no need to create a new issue and then immediately
submit a pull request that closes it. You can submit the pull request by itself.
Using Git and GitHub
--------------------
* `Create a new branch`_ specific to your change (as opposed to making
your commits in the ``main`` branch).
* **Don't put multiple unrelated fixes/features in the same branch / pull request.**
For example, if you're working on a new feature and find a bugfix that
doesn't *require* your new feature, **make a new distinct branch and pull
request** for the bugfix. Similarly, any proposed changes to code style
formatting should be in a completely separate pull request.
* Add a ``RELEASE.md`` file in the root of the project that contains the
release type (major, minor, patch) and a summary of the changes that will be
used as the release changelog entry. For example::
Release type: minor
Reload browser window upon changes to content, settings, or theme
* Check for unnecessary whitespace via ``git diff --check`` before committing.
* First line of your commit message should start with present-tense verb, be 50
characters or less, and include the relevant issue number(s) if applicable.
*Example:* ``Ensure proper PLUGIN_PATH behavior. Refs #428.`` If the commit
*completely fixes* an existing bug report, please use ``Fixes #585`` or ``Fix
#585`` syntax (so the relevant issue is automatically closed upon PR merge).
* After the first line of the commit message, add a blank line and then a more
detailed explanation (when relevant).
* `Squash your commits`_ to eliminate merge commits and ensure a clean and
readable commit history.
* After you have issued a pull request, the continuous integration (CI) system
will run the test suite on all supported Python versions and check for code style
compliance. If any of these checks fail, you should fix them. (If tests fail
on the CI system but seem to pass locally, ensure that local test runs aren't
skipping any tests.)
Contribution quality standards
------------------------------
* Adhere to the project's code style standards. See: `Development Environment`_
* Ensure your code is compatible with the `officially-supported Python releases`_.
* Add docs and tests for your changes. Undocumented and untested features will
not be accepted.
* :pelican-doc:`Run all the tests <contribute>` **on all versions of Python
supported by Pelican** to ensure nothing was accidentally broken.
Check out our `Git Tips`_ page or `ask for help`_ if you
need assistance or have any questions about these guidelines.
.. _`plugin`: https://docs.getpelican.com/en/latest/plugins.html
.. _`Create a new branch`: https://github.com/getpelican/pelican/wiki/Git-Tips#making-your-changes
.. _`Squash your commits`: https://github.com/getpelican/pelican/wiki/Git-Tips#squashing-commits
.. _`Git Tips`: https://github.com/getpelican/pelican/wiki/Git-Tips
.. _`ask for help`: `How to get help`_
.. _`Development Environment`: https://docs.getpelican.com/en/latest/contribute.html#setting-up-the-development-environment
.. _`officially-supported Python releases`: https://devguide.python.org/versions/#versions

669
LICENSE
View file

@ -1,14 +1,661 @@
This file is part of Pelican.
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Pelican is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Copyright (C) 2007 Free Software Foundation, Inc. <https://www.fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Pelican is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero Public License for more details.
Preamble
You should have received a copy of the GNU Affero Public License
along with Pelican. If not, see <http://www.gnu.org/licenses/>.
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View file

@ -1,3 +0,0 @@
include *.rst
recursive-include pelican *.html *.css *png
include LICENSE

View file

@ -1,47 +1,78 @@
Pelican
#######
Pelican |build-status| |pypi-version| |downloads| |repology|
============================================================
Pelican is a simple weblog generator, writen in python.
Pelican is a static site generator, written in Python_, that allows you to create
web sites by composing text files in formats such as Markdown, reStructuredText, and HTML.
With Pelican, you can create web sites without worrying about databases or server-side programming.
Pelican generates static sites that can be served via any web server or hosting service.
You can perform the following functions with Pelican:
* Compose content in Markdown_ or reStructuredText_ using your editor of choice
* Simple command-line tool (re)generates HTML, CSS, and JS from your source content
* Easy to interface with version control systems and web hooks
* Completely static output is simple to host anywhere
* Write your weblog entries directly with your editor of choice (vim!) and
directly in restructured text, or markdown.
* A simple cli-tool to (re)generate the weblog.
* Easy to interface with DVCSes and web hooks
* Completely static output, so easy to host anywhere !
Features
--------
Pelican currently supports:
Pelicans feature highlights include:
* blog articles
* comments, via an external service (disqus). Please notice that while
it's useful, it's an external service, and you'll not manage the
comments by yourself. It could potentially eat your data.
* theming support (themes are done using `jinja2 <http://jinjna.pocoo.org>`_)
* PDF generation of the articles/pages (optional).
* Chronological content (e.g., articles, blog posts) as well as static pages
* Integration with external services
* Site themes (created using Jinja2_ templates)
* Publication of articles in multiple languages
* Generation of Atom and RSS feeds
* Code syntax highlighting via Pygments_
* Import existing content from WordPress, Dotclear, or RSS feeds
* Fast rebuild times due to content caching and selective output writing
* Extensible via a rich plugin ecosystem: `Pelican Plugins`_
Have a look to `the documentation <http://alexis.notmyidea.org/pelican/>`_ for
more informations.
Check out the `Pelican documentation`_ for further information.
Why the name "Pelican" ?
------------------------
Heh, you didn't noticed? "Pelican" is an anagram for "Calepin" ;)
How to get help, contribute, or provide feedback
------------------------------------------------
See our `contribution submission and feedback guidelines <CONTRIBUTING.rst>`_.
Source code
-----------
You can access the source code via mercurial at http://hg.notmyidea.org/pelican/
or via git on http://github.com/ametaireau/pelican/
Pelicans source code is `hosted on GitHub`_. For information on how it works,
have a look at `Pelican's internals`_.
If you feel hackish, have a look to the `pelican's internals explanations
<http://alexis.notmyidea.org/pelican/internals.html>`_.
Feedback !
----------
Why the name “Pelican”?
-----------------------
If you want to see new features in Pelican, dont hesitate to tell me, to clone
the repository, etc. That's open source, dude!
“Pelican” is an anagram of *calepin*, which means “notebook” in French.
Contact me at "alexis at notmyidea dot org" for any request/feedback !
.. Links
.. _Python: https://www.python.org/
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
.. _Markdown: https://daringfireball.net/projects/markdown/
.. _Jinja2: https://palletsprojects.com/p/jinja/
.. _Pygments: https://pygments.org/
.. _`Pelican Plugins`: https://github.com/pelican-plugins
.. _`Pelican documentation`: https://docs.getpelican.com/
.. _`Pelican's internals`: https://docs.getpelican.com/en/latest/internals.html
.. _`hosted on GitHub`: https://github.com/getpelican/pelican
.. |build-status| image:: https://img.shields.io/github/actions/workflow/status/getpelican/pelican/main.yml?branch=main
:target: https://github.com/getpelican/pelican/actions/workflows/main.yml?query=branch%3Amain
:alt: GitHub Actions CI: continuous integration status
.. |pypi-version| image:: https://img.shields.io/pypi/v/pelican.svg
:target: https://pypi.org/project/pelican/
:alt: PyPI: the Python Package Index
.. |downloads| image:: https://img.shields.io/pypi/dm/pelican.svg
:target: https://pypi.org/project/pelican/
:alt: Monthly Downloads from PyPI
.. |repology| image:: https://repology.org/badge/tiny-repos/pelican.svg
:target: https://repology.org/project/pelican/versions
:alt: Repology: the packaging hub

188
THANKS
View file

@ -1,12 +1,178 @@
Some people have helped to improve pelican by contributing features, reporting
bugs or giving ideas. Thanks to them !
Pelican is a project led by Justin Mayer <https://justinmayer.com/>
and originally created by Alexis Métaireau <https://blog.notmyidea.org/>, but
there are a large number of people that have contributed or implemented key
features over time. We do our best to keep this list up-to-date, but you can
also have a look at the nice contributor graphs produced by GitHub:
https://github.com/getpelican/pelican/graphs/contributors
- Dan Jacka
- solsTiCe on linuxfr for reporting bugs
- Guillaume B (Gui13)
- Ronny Pfannschmidt
- Jérome Renard
- Nicolas Martin
- David Kulak
- Arnaud Bos
- nblock (Florian)
If you want to contribute, check the documentation section about how to do so:
<https://docs.getpelican.com/en/latest/contribute.html>
Aaron Kavlie
Abhishek L
Albrecht Mühlenschulte
Aldiantoro Nugroho
Alen Mujezinovic
Alessandro Martin
Alexander Artemenko
Alexandre RODIERE
Alexis Daboville
Alexis Métaireau
Allan Whatmough
Andrea Crotti
Andrew Laski
Andrew Spiers
Arnaud BOS
asselinpaul
Axel Haustant
Ben Rosser (TC01)
Ben Sturmfels
Benoît HERVIER
Bernhard Scheirle
Borgar
Brandon W Maister
Brendan Wholihan
Brian C. Lane
Brian Hsu
Brian St. Pierre
Bruno Binet
BunnyMan
Chenguang Wang
Chris Elston
Chris McDonald (Wraithan)
Chris Streeter
Christophe Chauvet
Clint Howarth
Colin Dunklau
Dafydd Crosby
Dana Woodman
Dave King
Dave Mankoff
David Beitey
David Marble
Deniz Turgut (Avaris)
derdon
Dirkjan Ochtman
Dirk Makowski
draftcode
Edward Delaporte
Emily Strickland
epatters
Eric Case
Erik Hetzner
FELD Boris
Feth Arezki
Florian Jacob
Florian Preinstorfer
Félix Delval
Frederik Ring
Freeculture
George V. Reilly
Guillaume
Guillaume B
Guillermo López
guillermooo
Ian Cordasco
Igor Kalnitsky
Irfan Ahmad
Iuri de Silvio
Ivan Dyedov
James King
James Rowe
Jason K. Moore
jawher
Jered Boxman
Jerome
Jiachen Yang
Jochen Breuer
joe di castro
John Kristensen
John Mastro
Jökull Sólberg Auðunsson
Jomel Imperio
Jonas Borges
Joseph Reagle
Joshua Adelman
Julian Berman
Justin Mayer
Kevin Deldycke
Kevin Yap
Kyle Fuller
Laureline Guerin
Leonard Huang
Leonardo Giordani
Leroy Jiang
Lucas Cimon
Marcel Hellkamp
Marco Milanesi
Marcus Fredriksson
Mario Rodas
Mark Caudill
Martin Brochhaus
Massimo Santini
Matt Bowcock
Matt Layman
Meir Kriheli
Michael Guntsche
Michael Reneer
Michael Yanovich
Mike Yumatov
Mikhail Korobov
Mirek Długosz
m-r-r
mviera
Nam Nguyen
NianQing Yao
Nico Di Rocco
Nicolas Duhamel
Nicolas Perriault
Nicolas Steinmetz
Paolo Melchiorre
Paul Asselin
Pavel Puchkin
Perry Roper
Peter Desmet
Peter Sabaini
Petr Viktorin
Philippe Pepiot
Rachid Belaid
Randall Degges
Ranjhith Kalisamy
Remi Rampin
Rémy HUBSCHER
renhbo
Richard Duivenvoorde
Rogdham
Romain Porte
Roman Skvazh
Ronny Pfannschmidt
Rory McCann
Rıdvan Örsvuran
saghul
sam
Samrat Man Singh
Simon Conseil
Simon Liedtke
Skami18
solsTiCe d'Hiver
Steve Schwarz
Stéphane Bunel
Stéphane Raimbault
Stuart Colville
Talha Mansoor
Tarek Ziade
Thanos Lefteris
Thomas Thurman
Tobias
Tom Adler
Tomi Pieviläinen
Trae Blain
Tristan Miller
Tshepang Lekhonkhobe
Valentin-Costel Hăloiu
Vlad Niculae
William Light
William Minchin
Wladislaw Merezhko
W. Trevor King
Zoresvit

8
TODO
View file

@ -1,8 +0,0 @@
* Add a way to support pictures (see how sphinx makes that)
* Find a way to extend the existing templates instead of rewriting all from scratch.
* Make the program support UTF8-encoded files as input (and later: any encoding?)
* Add status support (draft, published, hidden)
* Add a serve + automatic generation behaviour.
* Recompile only the changed files, not all.
* Add a way to make the coffee (or not)
* Add a sitemap generator.

View file

@ -1,3 +0,0 @@
#!/usr/bin/env python
from pelican import main
main()

BIN
docs/_static/overall.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

1
docs/_static/pelican-logo.svg vendored Normal file
View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="svg33" width="64" height="64" style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.4142" version="1.1" viewBox="0 0 64 64" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g id="g864" transform="matrix(.10228 0 0 .10228 2.441 6.0098e-5)"><g id="g4" transform="matrix(4.1667 0 0 4.1667 -301.27 -2392.2)"><path id="path2" d="m210.35 607.22c-.34-2.106-.842-4.303-1.491-6.591-1.537-5.441-4.918-10.074-9.506-13.854-1.205-1.001-2.503-1.946-3.88-2.823-5.293-3.381-11.692-5.851-18.522-7.32-4.588-.99-9.367-1.525-14.139-1.593-34.662-.774-56.234.387-90.373-.911.012.023.012.046.022.068 1.56 1.264 3.154 2.471 4.782 3.643 3.573 2.584 7.297 4.952 11.155 7.127 7.184 4.04 14.845 7.342 22.859 9.801.956.295 1.912.58 2.87.842 5.6.603 10.631 1.206 14.648 3.074 1.015.455 1.959 1.001 2.835 1.639 2.87 2.106 6.057 6.124 8.152 8.936 4.497 5.999 3.551 10.928 8.88 13.887.557.308 1.182.604 1.889.866 1.696.638 4.119 1.491 5.225-.91.16-.342.283-.764.387-1.264-.446-1.434-1.981-2.675-2.905-3.29-1.638-1.07-2.287-1.719-3.47-2.937-2.186-2.243-2.333-6.056-3.871-8.708 1.935-.82 12.146-2.186 14.287-1.89 4.576.204 8.185.557 10.939 3.392 1.08.854 1.672 1.594 2.652 2.334.069.057.125.114.194.159 4.338 3.153 8.343 4.28 11.894 5.362.936.284 1.822.558 2.69.876 1.332.478 2.582 1.048 3.754 1.81 1.39.922 3.748 3.336 3.849 5.419-3.496-1.116-1.185.296-6.342-.102-2.515-.285-5.087-.456-7.671-.638-4.018-.284-8.038-.581-11.805-1.297-.627-.115-1.254-.251-1.867-.399-.479-.102-.946-.227-1.401-.353-.011.193-.021.376-.021.546-.104 3.939 2.674 5.908-3.678 13.399-.057.08-.137.159-.205.25-1.686 1.97-10.449 5.715-13.182 6.432-11.634 2.334-20.502-5.237-34.515-1.423-4.929 1.833-8.549 9.824-10.815 15.8-3.016 7.936-5.406 17.576-8.139 27.06 5.329-.797 10.53-1.936 15.585-3.427 11.167-3.279 21.651-8.185 31.168-14.445.911-1.231 1.912-2.29 2.994-3.108.284-.217.58-.422.877-.603.215-.137.956-.286 2.127-.502 10.861-1.924 58.5-8.377 61.597-42.962.319-3.494.172-7.285-.513-11.372zm-106.94 18.59c-6.375-1.924-8.003-2.243-12.055-5.385.067.33.17.695.307 1.081 10.779 6.068 22.608 10.462 35.141 12.842-3.893-9.051-8.502-7.445-23.393-8.538zm29.518-4.099c-2.779-6.738-10.313-10.575-16.813-12.464-8.721-3.12-15.061-.125-33.458-8.811.147.239.284.467.432.694 3.575 2.584 7.297 4.963 11.157 7.126 7.184 4.041 14.844 7.343 22.857 9.802 4.167.489 8.175 1.184 11.863 2.96 1.639.773 3.21 1.764 4.702 3.039-.183-.82-.434-1.605-.74-2.346z" style="fill-rule:nonzero;fill:url(#_Linear1)"/></g><g id="g8" transform="matrix(4.1667 0 0 4.1667 -301.27 -2392.2)"><path id="path6" d="m114.13 595.61c-.958-.262-1.914-.547-2.87-.842-8.014-2.459-15.675-5.761-22.859-9.801-3.858-2.175-7.582-4.543-11.155-7.127-1.628-1.172-3.222-2.379-4.782-3.643 2.14 6.603 11.634 13.57 18.078 16.313 8.218 3.495 16.381 4.303 23.588 5.1z" style="fill:#90d4d1"/></g><g id="g12" transform="matrix(4.1667 0 0 4.1667 -301.27 -2392.2)"><path id="path10" d="m94.253 608.25c-3.86-2.163-7.582-4.542-11.157-7.126 10.006 15.823 22.575 15.584 34.014 16.928-8.013-2.459-15.673-5.761-22.857-9.802z" style="fill:#90d4d1"/></g><g id="g16" transform="matrix(4.1667 0 0 4.1667 -301.27 -2392.2)"><path id="path14" d="m126.81 634.34c-12.533-2.38-24.362-6.774-35.141-12.842 1.376 3.973 6.351 10.257 12.943 11.658 2.858 1.024 2.094.762 6.967.614 7.137-.364 10.552-.592 15.608 1.469-.126-.308-.251-.604-.377-.899z" style="fill:#90d4d1"/></g><g id="g20" transform="matrix(4.1667 0 0 4.1667 -301.27 -2392.2)"><path id="path18" d="m143.27 665.76c-.081.101-.159.204-.239.318-13.844 14.093-31.179 24.69-50.59 30.393 1.492-4.132 2.824-8.468 4.076-12.839 5.329-.797 10.53-1.936 15.585-3.427 11.167-3.279 21.651-8.185 31.168-14.445z" style="fill:#90d4d1"/></g><g id="g24" transform="matrix(4.1667 0 0 4.1667 -301.27 -2392.2)"><path id="path22" d="m143.03 666.08c-6.046 8.287-9.118 24.122-12.659 33.274-5.144 13.342-12.294 22.95-27.958 24.317-3.928.351-27.582 1.24-30.11-.035.159-1.344 4.098-2.961 5.123-3.747 6.852-4.847 11.416-13.5 15.014-23.416 19.411-5.703 36.746-16.3 50.59-30.393z" style="fill:#14a0c4"/></g></g><defs id="defs31"><linearGradient id="_Linear1" x2="1" gradientTransform="matrix(138.58 0 0 138.58 72.442 628.88)" gradientUnits="userSpaceOnUse"><stop id="stop26" style="stop-color:rgb(84,196,198)" offset="0"/><stop id="stop28" style="stop-color:rgb(18,186,213)" offset="1"/></linearGradient></defs></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

BIN
docs/_static/theme-basic.zip vendored Normal file

Binary file not shown.

11
docs/_static/theme_overrides.css vendored Normal file
View file

@ -0,0 +1,11 @@
/* override table width restrictions */
.wy-table-responsive table td, .wy-table-responsive table th {
/* !important prevents the common CSS stylesheets from
overriding this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}
.wy-table-responsive {
overflow: visible !important;
}

BIN
docs/_static/uml.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

201
docs/_templates/page.html vendored Normal file
View file

@ -0,0 +1,201 @@
{% extends "base.html" %}
{% block body -%}
{{ super() }}
{% include "partials/icons.html" %}
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
<label class="overlay sidebar-overlay" for="__navigation">
<div class="visually-hidden">Hide navigation sidebar</div>
</label>
<label class="overlay toc-overlay" for="__toc">
<div class="visually-hidden">Hide table of contents sidebar</div>
</label>
{% if theme_announcement -%}
<div class="announcement">
<aside class="announcement-content">
{% block announcement %} {{ theme_announcement }} {% endblock announcement %}
</aside>
</div>
{%- endif %}
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<div class="visually-hidden">Toggle site navigation sidebar</div>
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
</label>
</div>
<div class="header-center">
<a href="{{ pathto(master_doc) }}"><div class="brand">{{ docstitle if docstitle else project }}</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon{% if furo_hide_toc %} no-toc{% endif %}" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
{% block left_sidebar %}
<div class="sidebar-sticky">
{%- for sidebar_section in sidebars %}
{%- include sidebar_section %}
{%- endfor %}
</div>
{% endblock left_sidebar %}
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<a href="#" class="back-to-top muted-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
</svg>
<span>{% trans %}Back to top{% endtrans %}</span>
</a>
<div class="content-icon-container">
{% if theme_top_of_page_button == "edit" -%}
{%- include "components/edit-this-page.html" with context -%}
{%- elif theme_top_of_page_button != None -%}
{{ warning("Got an unsupported value for 'top_of_page_button'") }}
{%- endif -%}
{#- Theme toggle -#}
<div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon{% if furo_hide_toc %} no-toc{% endif %}" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
<article role="main">
{% block content %}{{ body }}{% endblock %}
</article>
</div>
<footer>
{% block footer %}
<div class="related-pages">
{% if next -%}
<a class="next-page" href="{{ next.link }}">
<div class="page-info">
<div class="context">
<span>{{ _("Next") }}</span>
</div>
<div class="title">{{ next.title }}</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
{%- endif %}
{% if prev -%}
<a class="prev-page" href="{{ prev.link }}">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>{{ _("Previous") }}</span>
</div>
{% if prev.link == pathto(master_doc) %}
<div class="title">{{ _("Home") }}</div>
{% else %}
<div class="title">{{ prev.title }}</div>
{% endif %}
</div>
</a>
{%- endif %}
</div>
<div class="bottom-of-page">
<div class="left-details">
{%- if show_copyright %}
<div class="copyright">
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e -%}
<a href="{{ path }}">Copyright</a> &#169; {{ copyright }}
{%- endtrans %}
{%- else %}
{% trans copyright=copyright|e -%}
Copyright &#169; {{ copyright }}, <a href="https://justinmayer.com">Justin Mayer</a>, Alexis Metaireau, and contributors
{%- endtrans %}
{%- endif %}
</div>
{%- endif %}
{%- if last_updated -%}
<div class="last-updated">
{% trans last_updated=last_updated|e -%}
Last updated on {{ last_updated }}
{%- endtrans -%}
</div>
{%- endif %}
</div>
<div class="right-details">
{% if theme_footer_icons or READTHEDOCS -%}
<div class="icons">
{% if theme_footer_icons -%}
{% for icon_dict in theme_footer_icons -%}
<a class="muted-link {{ icon_dict.class }}" href="{{ icon_dict.url }}" aria-label="{{ icon_dict.name }}">
{{- icon_dict.html -}}
</a>
{% endfor %}
{%- else -%}
{#- Show Read the Docs project -#}
{%- if READTHEDOCS and slug -%}
<a class="muted-link" href="https://readthedocs.org/projects/{{ slug }}" aria-label="On Read the Docs">
<svg x="0px" y="0px" viewBox="-125 217 360 360" xml:space="preserve">
<path fill="currentColor" d="M39.2,391.3c-4.2,0.6-7.1,4.4-6.5,8.5c0.4,3,2.6,5.5,5.5,6.3 c0,0,18.5,6.1,50,8.7c25.3,2.1,54-1.8,54-1.8c4.2-0.1,7.5-3.6,7.4-7.8c-0.1-4.2-3.6-7.5-7.8-7.4c-0.5,0-1,0.1-1.5,0.2 c0,0-28.1,3.5-50.9,1.6c-30.1-2.4-46.5-7.9-46.5-7.9C41.7,391.3,40.4,391.1,39.2,391.3z M39.2,353.6c-4.2,0.6-7.1,4.4-6.5,8.5 c0.4,3,2.6,5.5,5.5,6.3c0,0,18.5,6.1,50,8.7c25.3,2.1,54-1.8,54-1.8c4.2-0.1,7.5-3.6,7.4-7.8c-0.1-4.2-3.6-7.5-7.8-7.4 c-0.5,0-1,0.1-1.5,0.2c0,0-28.1,3.5-50.9,1.6c-30.1-2.4-46.5-7.9-46.5-7.9C41.7,353.6,40.4,353.4,39.2,353.6z M39.2,315.9 c-4.2,0.6-7.1,4.4-6.5,8.5c0.4,3,2.6,5.5,5.5,6.3c0,0,18.5,6.1,50,8.7c25.3,2.1,54-1.8,54-1.8c4.2-0.1,7.5-3.6,7.4-7.8 c-0.1-4.2-3.6-7.5-7.8-7.4c-0.5,0-1,0.1-1.5,0.2c0,0-28.1,3.5-50.9,1.6c-30.1-2.4-46.5-7.9-46.5-7.9 C41.7,315.9,40.4,315.8,39.2,315.9z M39.2,278.3c-4.2,0.6-7.1,4.4-6.5,8.5c0.4,3,2.6,5.5,5.5,6.3c0,0,18.5,6.1,50,8.7 c25.3,2.1,54-1.8,54-1.8c4.2-0.1,7.5-3.6,7.4-7.8c-0.1-4.2-3.6-7.5-7.8-7.4c-0.5,0-1,0.1-1.5,0.2c0,0-28.1,3.5-50.9,1.6 c-30.1-2.4-46.5-7.9-46.5-7.9C41.7,278.2,40.4,278.1,39.2,278.3z M-13.6,238.5c-39.6,0.3-54.3,12.5-54.3,12.5v295.7 c0,0,14.4-12.4,60.8-10.5s55.9,18.2,112.9,19.3s71.3-8.8,71.3-8.8l0.8-301.4c0,0-25.6,7.3-75.6,7.7c-49.9,0.4-61.9-12.7-107.7-14.2 C-8.2,238.6-10.9,238.5-13.6,238.5z M19.5,257.8c0,0,24,7.9,68.3,10.1c37.5,1.9,75-3.7,75-3.7v267.9c0,0-19,10-66.5,6.6 C59.5,536.1,19,522.1,19,522.1L19.5,257.8z M-3.6,264.8c4.2,0,7.7,3.4,7.7,7.7c0,4.2-3.4,7.7-7.7,7.7c0,0-12.4,0.1-20,0.8 c-12.7,1.3-21.4,5.9-21.4,5.9c-3.7,2-8.4,0.5-10.3-3.2c-2-3.7-0.5-8.4,3.2-10.3c0,0,0,0,0,0c0,0,11.3-6,27-7.5 C-16,264.9-3.6,264.8-3.6,264.8z M-11,302.6c4.2-0.1,7.4,0,7.4,0c4.2,0.5,7.2,4.3,6.7,8.5c-0.4,3.5-3.2,6.3-6.7,6.7 c0,0-12.4,0.1-20,0.8c-12.7,1.3-21.4,5.9-21.4,5.9c-3.7,2-8.4,0.5-10.3-3.2c-2-3.7-0.5-8.4,3.2-10.3c0,0,11.3-6,27-7.5 C-20.5,302.9-15.2,302.7-11,302.6z M-3.6,340.2c4.2,0,7.7,3.4,7.7,7.7s-3.4,7.7-7.7,7.7c0,0-12.4-0.1-20,0.7 c-12.7,1.3-21.4,5.9-21.4,5.9c-3.7,2-8.4,0.5-10.3-3.2c-2-3.7-0.5-8.4,3.2-10.3c0,0,11.3-6,27-7.5C-16,340.1-3.6,340.2-3.6,340.2z" />
</svg>
</a>
{%- endif -%}
{#- Show GitHub repository home -#}
{%- if READTHEDOCS and display_github and github_user != "None" and github_repo != "None" -%}
<a class="muted-link" href="https://github.com/{{ github_user }}/{{ github_repo }}" aria-label="On GitHub">
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
</svg>
</a>
{%- endif -%}
{%- endif %}
</div>
{%- endif %}
</div>
</div>
{% endblock footer %}
</footer>
</div>
<aside class="toc-drawer{% if furo_hide_toc %} no-toc{% endif %}">
{% block right_sidebar %}
{% if not furo_hide_toc %}
<div class="toc-sticky toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
{{ _("On this page") }}
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
{{ toc }}
</div>
</div>
</div>
{% endif %}
{% endblock right_sidebar %}
</aside>
</div>
</div>
{%- endblock %}

View file

@ -1,3 +0,0 @@
*.pyc
*.pyo
.DS_Store

37
docs/_themes/LICENSE vendored
View file

@ -1,37 +0,0 @@
Copyright (c) 2010 by Armin Ronacher.
Some rights reserved.
Redistribution and use in source and binary forms of the theme, with or
without modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* The names of the contributors may not be used to endorse or
promote products derived from this software without specific
prior written permission.
We kindly ask you to only use these themes in an unmodified manner just
for Flask and Flask-related products, not for unrelated projects. If you
like the visual style and want to use it for your own projects, please
consider making some larger changes to the themes (such as changing
font faces, sizes, colors or margins).
THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

31
docs/_themes/README vendored
View file

@ -1,31 +0,0 @@
Flask Sphinx Styles
===================
This repository contains sphinx styles for Flask and Flask related
projects. To use this style in your Sphinx documentation, follow
this guide:
1. put this folder as _themes into your docs folder. Alternatively
you can also use git submodules to check out the contents there.
2. add this to your conf.py:
sys.path.append(os.path.abspath('_themes'))
html_theme_path = ['_themes']
html_theme = 'flask'
The following themes exist:
- 'flask' - the standard flask documentation theme for large
projects
- 'flask_small' - small one-page theme. Intended to be used by
very small addon libraries for flask.
The following options exist for the flask_small theme:
[options]
index_logo = '' filename of a picture in _static
to be used as replacement for the
h1 in the index.rst file.
index_logo_height = 120px height of the index logo
github_fork = '' repository name on github for the
"fork me" badge

View file

@ -1,16 +0,0 @@
{%- extends "basic/layout.html" %}
{%- block extrahead %}
{{ super() }}
{% if theme_touch_icon %}
<link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
{% endif %}
<link media="only screen and (max-device-width: 480px)" href="{{
pathto('_static/small_flask.css', 1) }}" type= "text/css" rel="stylesheet" />
{% endblock %}
{%- block relbar2 %}{% endblock %}
{%- block footer %}
<div class="footer">
&copy; Copyright {{ copyright }}.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
{%- endblock %}

View file

@ -1,19 +0,0 @@
<h3>Related Topics</h3>
<ul>
<li><a href="{{ pathto(master_doc) }}">Documentation overview</a><ul>
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}">{{ parent.title }}</a><ul>
{%- endfor %}
{%- if prev %}
<li>Previous: <a href="{{ prev.link|e }}" title="{{ _('previous chapter')
}}">{{ prev.title }}</a></li>
{%- endif %}
{%- if next %}
<li>Next: <a href="{{ next.link|e }}" title="{{ _('next chapter')
}}">{{ next.title }}</a></li>
{%- endif %}
{%- for parent in parents %}
</ul></li>
{%- endfor %}
</ul></li>
</ul>

View file

@ -1,387 +0,0 @@
/*
* flasky.css_t
* ~~~~~~~~~~~~
*
* :copyright: Copyright 2010 by Armin Ronacher.
* :license: Flask Design License, see LICENSE for details.
*/
{% set page_width = '940px' %}
{% set sidebar_width = '220px' %}
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: 'Georgia', serif;
font-size: 17px;
background-color: white;
color: #000;
margin: 0;
padding: 0;
}
div.document {
width: {{ page_width }};
margin: 30px auto 0 auto;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 {{ sidebar_width }};
}
div.sphinxsidebar {
width: {{ sidebar_width }};
}
hr {
border: 1px solid #B1B4B6;
}
div.body {
background-color: #ffffff;
color: #3E4349;
padding: 0 30px 0 30px;
}
img.floatingflask {
padding: 0 0 10px 10px;
float: right;
}
div.footer {
width: {{ page_width }};
margin: 20px auto 30px auto;
font-size: 14px;
color: #888;
text-align: right;
}
div.footer a {
color: #888;
}
div.related {
display: none;
}
div.sphinxsidebar a {
color: #444;
text-decoration: none;
border-bottom: 1px dotted #999;
}
div.sphinxsidebar a:hover {
border-bottom: 1px solid #999;
}
div.sphinxsidebar {
font-size: 14px;
line-height: 1.5;
}
div.sphinxsidebarwrapper {
padding: 18px 10px;
}
div.sphinxsidebarwrapper p.logo {
padding: 0 0 20px 0;
margin: 0;
text-align: center;
}
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
font-family: 'Garamond', 'Georgia', serif;
color: #444;
font-size: 24px;
font-weight: normal;
margin: 0 0 5px 0;
padding: 0;
}
div.sphinxsidebar h4 {
font-size: 20px;
}
div.sphinxsidebar h3 a {
color: #444;
}
div.sphinxsidebar p.logo a,
div.sphinxsidebar h3 a,
div.sphinxsidebar p.logo a:hover,
div.sphinxsidebar h3 a:hover {
border: none;
}
div.sphinxsidebar p {
color: #555;
margin: 10px 0;
}
div.sphinxsidebar ul {
margin: 10px 0;
padding: 0;
color: #000;
}
div.sphinxsidebar input {
border: 1px solid #ccc;
font-family: 'Georgia', serif;
font-size: 1em;
}
/* -- body styles ----------------------------------------------------------- */
a {
color: #004B6B;
text-decoration: underline;
}
a:hover {
color: #6D4100;
text-decoration: underline;
}
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: 'Garamond', 'Georgia', serif;
font-weight: normal;
margin: 30px 0px 10px 0px;
padding: 0;
}
div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }
div.body h2 { font-size: 180%; }
div.body h3 { font-size: 150%; }
div.body h4 { font-size: 130%; }
div.body h5 { font-size: 100%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: #ddd;
padding: 0 4px;
text-decoration: none;
}
a.headerlink:hover {
color: #444;
background: #eaeaea;
}
div.body p, div.body dd, div.body li {
line-height: 1.4em;
}
div.admonition {
background: #fafafa;
margin: 20px -30px;
padding: 10px 30px;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
div.admonition tt.xref, div.admonition a tt {
border-bottom: 1px solid #fafafa;
}
dd div.admonition {
margin-left: -60px;
padding-left: 60px;
}
div.admonition p.admonition-title {
font-family: 'Garamond', 'Georgia', serif;
font-weight: normal;
font-size: 24px;
margin: 0 0 10px 0;
padding: 0;
line-height: 1;
}
div.admonition p.last {
margin-bottom: 0;
}
div.highlight {
background-color: white;
}
dt:target, .highlight {
background: #FAF3E8;
}
div.note {
background-color: #eee;
border: 1px solid #ccc;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre, tt {
font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
font-size: 0.9em;
}
img.screenshot {
}
tt.descname, tt.descclassname {
font-size: 0.95em;
}
tt.descname {
padding-right: 0.08em;
}
img.screenshot {
-moz-box-shadow: 2px 2px 4px #eee;
-webkit-box-shadow: 2px 2px 4px #eee;
box-shadow: 2px 2px 4px #eee;
}
table.docutils {
border: 1px solid #888;
-moz-box-shadow: 2px 2px 4px #eee;
-webkit-box-shadow: 2px 2px 4px #eee;
box-shadow: 2px 2px 4px #eee;
}
table.docutils td, table.docutils th {
border: 1px solid #888;
padding: 0.25em 0.7em;
}
table.field-list, table.footnote {
border: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
table.footnote {
margin: 15px 0;
width: 100%;
border: 1px solid #eee;
background: #fdfdfd;
font-size: 0.9em;
}
table.footnote + table.footnote {
margin-top: -15px;
border-top: none;
}
table.field-list th {
padding: 0 0.8em 0 0;
}
table.field-list td {
padding: 0;
}
table.footnote td.label {
width: 0px;
padding: 0.3em 0 0.3em 0.5em;
}
table.footnote td {
padding: 0.3em 0.5em;
}
dl {
margin: 0;
padding: 0;
}
dl dd {
margin-left: 30px;
}
blockquote {
margin: 0 0 0 30px;
padding: 0;
}
ul, ol {
margin: 10px 0 10px 30px;
padding: 0;
}
pre {
background: #eee;
padding: 7px 30px;
margin: 15px -30px;
line-height: 1.3em;
}
dl pre, blockquote pre, li pre {
margin-left: -60px;
padding-left: 60px;
}
dl dl pre {
margin-left: -90px;
padding-left: 90px;
}
tt {
background-color: #ecf0f3;
color: #222;
/* padding: 1px 2px; */
}
tt.xref, a tt {
background-color: #FBFBFB;
border-bottom: 1px solid white;
}
a.reference {
text-decoration: none;
border-bottom: 1px dotted #004B6B;
}
a.reference:hover {
border-bottom: 1px solid #6D4100;
}
a.footnote-reference {
text-decoration: none;
font-size: 0.7em;
vertical-align: top;
border-bottom: 1px dotted #004B6B;
}
a.footnote-reference:hover {
border-bottom: 1px solid #6D4100;
}
a:hover tt {
background: #EEE;
}

View file

@ -1,70 +0,0 @@
/*
* small_flask.css_t
* ~~~~~~~~~~~~~~~~~
*
* :copyright: Copyright 2010 by Armin Ronacher.
* :license: Flask Design License, see LICENSE for details.
*/
body {
margin: 0;
padding: 20px 30px;
}
div.documentwrapper {
float: none;
background: white;
}
div.sphinxsidebar {
display: block;
float: none;
width: 102.5%;
margin: 50px -30px -20px -30px;
padding: 10px 20px;
background: #333;
color: white;
}
div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
div.sphinxsidebar h3 a {
color: white;
}
div.sphinxsidebar a {
color: #aaa;
}
div.sphinxsidebar p.logo {
display: none;
}
div.document {
width: 100%;
margin: 0;
}
div.related {
display: block;
margin: 0;
padding: 10px 0 20px 0;
}
div.related ul,
div.related ul li {
margin: 0;
padding: 0;
}
div.footer {
display: none;
}
div.bodywrapper {
margin: 0;
}
div.body {
min-height: 0;
padding: 0;
}

View file

@ -1,7 +0,0 @@
[theme]
inherit = basic
stylesheet = flasky.css
pygments_style = flask_theme_support.FlaskyStyle
[options]
touch_icon =

View file

@ -1,22 +0,0 @@
{% extends "basic/layout.html" %}
{% block header %}
{{ super() }}
{% if pagename == 'index' %}
<div class=indexwrapper>
{% endif %}
{% endblock %}
{% block footer %}
{% if pagename == 'index' %}
</div>
{% endif %}
{% endblock %}
{# do not display relbars #}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}
{% if theme_github_fork %}
<a href="http://github.com/{{ theme_github_fork }}"><img style="position: fixed; top: 0; right: 0; border: 0;"
src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
{% endif %}
{% endblock %}
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{% endblock %}

View file

@ -1,287 +0,0 @@
/*
* flasky.css_t
* ~~~~~~~~~~~~
*
* Sphinx stylesheet -- flasky theme based on nature theme.
*
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: 'Georgia', serif;
font-size: 17px;
color: #000;
background: white;
margin: 0;
padding: 0;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 40px auto 0 auto;
width: 700px;
}
hr {
border: 1px solid #B1B4B6;
}
div.body {
background-color: #ffffff;
color: #3E4349;
padding: 0 30px 30px 30px;
}
img.floatingflask {
padding: 0 0 10px 10px;
float: right;
}
div.footer {
text-align: right;
color: #888;
padding: 10px;
font-size: 14px;
width: 650px;
margin: 0 auto 40px auto;
}
div.footer a {
color: #888;
text-decoration: underline;
}
div.related {
line-height: 32px;
color: #888;
}
div.related ul {
padding: 0 0 0 10px;
}
div.related a {
color: #444;
}
/* -- body styles ----------------------------------------------------------- */
a {
color: #004B6B;
text-decoration: underline;
}
a:hover {
color: #6D4100;
text-decoration: underline;
}
div.body {
padding-bottom: 40px; /* saved for footer */
}
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: 'Garamond', 'Georgia', serif;
font-weight: normal;
margin: 30px 0px 10px 0px;
padding: 0;
}
{% if theme_index_logo %}
div.indexwrapper h1 {
text-indent: -999999px;
background: url({{ theme_index_logo }}) no-repeat center center;
height: {{ theme_index_logo_height }};
}
{% endif %}
div.body h2 { font-size: 180%; }
div.body h3 { font-size: 150%; }
div.body h4 { font-size: 130%; }
div.body h5 { font-size: 100%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: white;
padding: 0 4px;
text-decoration: none;
}
a.headerlink:hover {
color: #444;
background: #eaeaea;
}
div.body p, div.body dd, div.body li {
line-height: 1.4em;
}
div.admonition {
background: #fafafa;
margin: 20px -30px;
padding: 10px 30px;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
div.admonition p.admonition-title {
font-family: 'Garamond', 'Georgia', serif;
font-weight: normal;
font-size: 24px;
margin: 0 0 10px 0;
padding: 0;
line-height: 1;
}
div.admonition p.last {
margin-bottom: 0;
}
div.highlight{
background-color: white;
}
dt:target, .highlight {
background: #FAF3E8;
}
div.note {
background-color: #eee;
border: 1px solid #ccc;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
div.warning {
background-color: #ffe4e4;
border: 1px solid #f66;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre, tt {
font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
font-size: 0.85em;
}
img.screenshot {
}
tt.descname, tt.descclassname {
font-size: 0.95em;
}
tt.descname {
padding-right: 0.08em;
}
img.screenshot {
-moz-box-shadow: 2px 2px 4px #eee;
-webkit-box-shadow: 2px 2px 4px #eee;
box-shadow: 2px 2px 4px #eee;
}
table.docutils {
border: 1px solid #888;
-moz-box-shadow: 2px 2px 4px #eee;
-webkit-box-shadow: 2px 2px 4px #eee;
box-shadow: 2px 2px 4px #eee;
}
table.docutils td, table.docutils th {
border: 1px solid #888;
padding: 0.25em 0.7em;
}
table.field-list, table.footnote {
border: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
table.footnote {
margin: 15px 0;
width: 100%;
border: 1px solid #eee;
}
table.field-list th {
padding: 0 0.8em 0 0;
}
table.field-list td {
padding: 0;
}
table.footnote td {
padding: 0.5em;
}
dl {
margin: 0;
padding: 0;
}
dl dd {
margin-left: 30px;
}
pre {
padding: 0;
margin: 15px -30px;
padding: 8px;
line-height: 1.3em;
padding: 7px 30px;
background: #eee;
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
}
dl pre {
margin-left: -60px;
padding-left: 60px;
}
tt {
background-color: #ecf0f3;
color: #222;
/* padding: 1px 2px; */
}
tt.xref, a tt {
background-color: #FBFBFB;
}
a:hover tt {
background: #EEE;
}

View file

@ -1,10 +0,0 @@
[theme]
inherit = basic
stylesheet = flasky.css
nosidebar = true
pygments_style = flask_theme_support.FlaskyStyle
[options]
index_logo_height = 120px
index_logo =
github_fork =

View file

@ -1,86 +0,0 @@
# flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = ""
styles = {
# No corresponding class for the following:
#Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#000000", # class 'x'
Comment: "italic #8f5902", # class: 'c'
Comment.Preproc: "noitalic", # class: 'cp'
Keyword: "bold #004461", # class: 'k'
Keyword.Constant: "bold #004461", # class: 'kc'
Keyword.Declaration: "bold #004461", # class: 'kd'
Keyword.Namespace: "bold #004461", # class: 'kn'
Keyword.Pseudo: "bold #004461", # class: 'kp'
Keyword.Reserved: "bold #004461", # class: 'kr'
Keyword.Type: "bold #004461", # class: 'kt'
Operator: "#582800", # class: 'o'
Operator.Word: "bold #004461", # class: 'ow' - like keywords
Punctuation: "bold #000000", # class: 'p'
# because special names such as Name.Class, Name.Function, etc.
# are not recognized as such later in the parsing, we choose them
# to look the same as ordinary variables.
Name: "#000000", # class: 'n'
Name.Attribute: "#c4a000", # class: 'na' - to be revised
Name.Builtin: "#004461", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#000000", # class: 'nc' - to be revised
Name.Constant: "#000000", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "bold #cc0000", # class: 'ne'
Name.Function: "#000000", # class: 'nf'
Name.Property: "#000000", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#000000", # class: 'nn' - to be revised
Name.Other: "#000000", # class: 'nx'
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
Name.Variable: "#000000", # class: 'nv' - to be revised
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
Number: "#990000", # class: 'm'
Literal: "#000000", # class: 'l'
Literal.Date: "#000000", # class: 'ld'
String: "#4e9a06", # class: 's'
String.Backtick: "#4e9a06", # class: 'sb'
String.Char: "#4e9a06", # class: 'sc'
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
String.Double: "#4e9a06", # class: 's2'
String.Escape: "#4e9a06", # class: 'se'
String.Heredoc: "#4e9a06", # class: 'sh'
String.Interpol: "#4e9a06", # class: 'si'
String.Other: "#4e9a06", # class: 'sx'
String.Regex: "#4e9a06", # class: 'sr'
String.Single: "#4e9a06", # class: 's1'
String.Symbol: "#4e9a06", # class: 'ss'
Generic: "#000000", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #000000", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "bold #000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #000000", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
}

577
docs/changelog.rst Normal file
View file

@ -0,0 +1,577 @@
Release history
###############
4.11.0 - 2025-01-15
===================
- Add setting to selectively omit Typogrify filters `(#3439) <https://github.com/getpelican/pelican/pull/3439>`_
- Add more blocks to the Simple themes base template, making it easier to create new themes by inheriting from the Simple theme `(#3405) <https://github.com/getpelican/pelican/pull/3405>`_
- Fix auto-reload behavior upon changes to the theme, content or settings. Make default ``IGNORE_FILES`` recursively ignore all hidden files as well as the `default filters <https://watchfiles.helpmanual.io/api/filters/#watchfiles.DefaultFilter.ignore_dirs>`_ from ``watchfiles.DefaultFilter``. `(#3441) <https://github.com/getpelican/pelican/pull/3441>`_
- Get current year from the ``SOURCE_DATE_EPOCH`` environment variable, if available `(#3430) <https://github.com/getpelican/pelican/pull/3430>`_
- Add Python 3.13 to test matrix and remove Python 3.8 `(#3435) <https://github.com/getpelican/pelican/pull/3435>`_
- Require Typogrify 2.1+ and Pygments <2.19
4.10.2 - 2024-11-27
===================
- Change ``IGNORE_FILES`` setting default to ignore all hidden files
- Fix ``SUMMARY_MAX_PARAGRAPHS`` not being respected in some combinations with ``SUMMARY_MAX_LENGTH``
4.10.1 - 2024-09-28
===================
- Fix error when running ``pelican -r -l``
- Fix symlink handling in ``pelican-themes``
4.10.0 - 2024-09-16
===================
- Add setting to specify summary via paragraph count
- Add new status to skip generation of a post
- Add setting to append ``ref`` parameter to links in feeds
- Configure logging handler via ``--log-handler`` CLI option
- Resolve intra-site links in summaries
- Warn when files are not processed due to disabled readers
- Add Medium post importer
- Improve GitHub Pages workflow
- Improve code test coverage
- Translate documentation into Simplified Chinese
4.9.1 - 2023-11-15
==================
* Ensure ``tzdata`` dependency is installed on Windows
4.9.0 - 2023-11-12
==================
* Upgrade code to new minimum supported Python version: 3.8
* Settings support for ``pathlib.Path`` `(#2758) <https://github.com/getpelican/pelican/pull/2758>`_
* Various improvements to Simple theme (`#2976 <https://github.com/getpelican/pelican/pull/2976>`_ & `#3234 <https://github.com/getpelican/pelican/pull/3234>`_)
* Use Furo as Sphinx documentation theme `(#3023) <https://github.com/getpelican/pelican/pull/3023>`_
* Default to 100 articles maximum in feeds `(#3127) <https://github.com/getpelican/pelican/pull/3127>`_
* Add ``period_archives common context`` variable `(#3148) <https://github.com/getpelican/pelican/pull/3148>`_
* Use ``watchfiles`` as the file-watching backend `(#3151) <https://github.com/getpelican/pelican/pull/3151>`_
* Add GitHub Actions workflow for GitHub Pages `(#3189) <https://github.com/getpelican/pelican/pull/3189>`_
* Allow dataclasses in settings `(#3204) <https://github.com/getpelican/pelican/pull/3204>`_
* Switch build tool to PDM instead of Setuptools/Poetry `(#3220) <https://github.com/getpelican/pelican/pull/3220>`_
* Provide a ``plugin_enabled`` Jinja test for themes `(#3235) <https://github.com/getpelican/pelican/pull/3235>`_
* Preserve connection order in Blinker `(#3238) <https://github.com/getpelican/pelican/pull/3238>`_
* Remove social icons from default ``notmyidea`` theme `(#3240) <https://github.com/getpelican/pelican/pull/3240>`_
* Remove unreliable ``WRITE_SELECTED`` feature `(#3243) <https://github.com/getpelican/pelican/pull/3243>`_
* Importer: Report broken embedded video links when importing from Tumblr `(#3177) <https://github.com/getpelican/pelican/issues/3177>`_
* Importer: Remove newline addition when iterating Photo post types `(#3178) <https://github.com/getpelican/pelican/issues/3178>`_
* Importer: Force timestamp conversion in Tumblr importer to be UTC with offset `(#3221) <https://github.com/getpelican/pelican/pull/3221>`_
* Importer: Use tempfile for intermediate HTML file for Pandoc `(#3221) <https://github.com/getpelican/pelican/pull/3221>`_
* Switch linters to Ruff `(#3223) <https://github.com/getpelican/pelican/pull/3223>`_
4.8.0 - 2022-07-11
==================
* Use JSON values for extra settings in Invoke tasks template `(#2994) <https://github.com/getpelican/pelican/pull/2994>`_
* Add content tag for links, which can help with things like Twitter social cards `(#3001) <https://github.com/getpelican/pelican/pull/3001>`_
* Improve word count behavior when generating summary `(#3002) <https://github.com/getpelican/pelican/pull/3002>`_
4.7.2 - 2022-02-09
==================
* Fix incorrect parsing of parameters specified via `-e` / `--extra-settings` option flags `(#2938) <https://github.com/getpelican/pelican/pull/2938>`_
* Add ``categories.html`` template to default theme `(#2973) <https://github.com/getpelican/pelican/pull/2973>`_
* Document how to use plugins to inject content `(#2922) <https://github.com/getpelican/pelican/pull/2922>`_
4.7.1 - 2021-10-12
==================
* Extend rich logging to server component `(#2927) <https://github.com/getpelican/pelican/pull/2927>`_
* Fix an issue where metadata flagged to be discarded was being cached `(#2926) <https://github.com/getpelican/pelican/pull/2926>`_
* Adjust suffix in server to allow redirection when needed `(#2931) <https://github.com/getpelican/pelican/pull/2931>`_
* Add MIME types for web fonts `(#2929) <https://github.com/getpelican/pelican/pull/2929>`_
* Distribute sample data used to run tests `(#2935) <https://github.com/getpelican/pelican/pull/2935>`_
* Add Python 3.10 to test matrix
4.7.0 - 2021-10-01
==================
* Improve default theme rendering on mobile and other small screen devices `(#2914) <https://github.com/getpelican/pelican/pull/2914>`_
* Add support for hidden articles `(#2866) <https://github.com/getpelican/pelican/pull/2866>`_
* Improve word count behavior when generating summary CJK & other locales `(#2864) <https://github.com/getpelican/pelican/pull/2864>`_
* Add progress spinner during generation `(#2869) <https://github.com/getpelican/pelican/pull/2869>`_
and richer logging `(#2897) <https://github.com/getpelican/pelican/pull/2897>`_, both via `Rich <https://github.com/willmcgugan/rich>`_
* Invoke tasks ``serve`` and ``livereload`` now auto-open a web browser pointing to the locally-served web site `(#2764) <https://github.com/getpelican/pelican/pull/2764>`_
* Support some date format codes used by ISO dates `(#2902) <https://github.com/getpelican/pelican/pull/2902>`_
* Document how to add a new writer `(#2901) <https://github.com/getpelican/pelican/pull/2901>`_
4.6.0 - 2021-03-23
==================
* Add new URL pattern to ``PAGINATION_PATTERNS`` for the last page in the list `(#1401) <https://github.com/getpelican/pelican/issues/1401>`_
* Speed up ``livereload`` Invoke task via caching `(#2847) <https://github.com/getpelican/pelican/pull/2847>`_
* Ignore ``None`` return value from ``get_generators`` signal `(#2850) <https://github.com/getpelican/pelican/pull/2850>`_
* Relax dependency minimum versions and remove upper bounds
4.5.4 - 2021-01-04
==================
Replace plugin definitions in settings with string representations after registering, so they can be cached correctly `(#2828) <https://github.com/getpelican/pelican/issues/2828>`_.
4.5.3 - 2020-12-01
==================
Fix a mistake made in PR #2821
4.5.2 - 2020-11-22
==================
Improve logging of generators and writer loaders
4.5.1 - 2020-11-02
==================
* Refactor intra-site link discovery in order to match more permissively `(#2646) <https://github.com/getpelican/pelican/issues/2646>`_
* Fix plugins running twice in auto-reload mode `(#2817) <https://github.com/getpelican/pelican/issues/2817>`_
* Add notice to use ``from pelican import signals`` instead of ``import pelican.signals`` `(#2805) <https://github.com/getpelican/pelican/issues/2805>`_
4.5.0 - 2020-08-20
==================
* Add namespace plugin support; list plugins via ``pelican-plugins`` command
* Override settings via ``-e`` / ``--extra-settings`` CLI option flags
* Add settings for custom Jinja globals and tests
* Customize article summary ellipsis via ``SUMMARY_END_SUFFIX`` setting
* Customize Typogrify dash handling via new ``TYPOGRIFY_DASHES`` setting
* Support Unicode when generating slugs
* Support Asciidoc ``.adoc`` file generation in Pelican importer
* Improve user experience when ``pelican --listen`` web server is quit
* Improve Invoke tasks template
* Include tests in source distributions
* Switch CI from Travis to GitHub Actions
* Remove support for Python 2.7
4.2.0 - 2019-10-17
==================
* Support inline SVGs; don't treat titles in SVGs as HTML titles
* Add category to feeds (in addition to tags)
* Improve content metadata field docs
* Add docs for including other Markdown/reST files in content
4.1.3 - 2019-10-09
==================
* Fix quick-start docs regarding ``pelican --listen``
* Set default listen address to 127.0.0.1
* Add extra/optional Markdown dependency to setup.py
* Use correct SSH port syntax for rsync in tasks.py
* Place all deprecated settings handling together
* Add related project URLs for display on PyPI
* Skip some tests on Windows that can't pass due to filesystem differences
4.1.2 - 2019-09-23
==================
Fix pelican.settings.load_source to avoid caching issues - PR #2621
4.1.1 - 2019-08-23
==================
* Add AutoPub to auto-publish releases on PR merge
* Add CSS classes for reStructuredText figures
* Pass ``argv`` to Pelican ``main`` entrypoint
* Set default content status to a blank string rather than ``None``
4.1.0 - 2019-07-14
==================
* Live browser reload upon changed files (provided via Invoke task)
* Add ``pyproject.toml``, managed by Poetry
* Support for invoking ``python -m pelican``
* Add relative source path attribute to content
* Allow directories in ``EXTRA_PATH_METADATA``
* Add ``all_articles`` variable to period pages (for recent posts functionality)
* Improve debug mode output
* Remove blank or duplicate summaries from Atom feed
* Fix bugs in pagination, pelican-import, pelican-quickstart, and feed importer
4.0.1 (2018-11-30)
==================
* Refactor ``pelican.server`` logging
* Fix bug in which all static files were processed as "draft"
* Bug fixes for Invoke/Makefile automation, Importer, and other miscellanea
If upgrading from 3.7.x or earlier, please note that slug-related settings in
4.0+ use ``{slug}`` and/or ``{lang}`` rather than ``%s``. If ``%s``-style
settings are encountered, Pelican will emit a warning and fall back to the
default setting. Some user-submitted themes might try to format setting values
but fail upon site build with a ``TypeError``. In such cases, the theme needs
to be updated. For example, instead of ``TAG_FEED_ATOM|format(tag.slug)``, use
``TAG_FEED_ATOM.format(slug=tag.slug)``
4.0.0 (2018-11-13)
==================
* Replace ``develop_server.sh`` script with ``pelican --listen``
* Improved copy/link behavior for large static files (e.g., videos)
* New ``{static}`` syntax to link to static content; content linked to by
``{static}`` and ``{attach}`` is automatically copied over even if not in
``STATIC_PATHS``
* Pages can now have ``draft`` status
* Show current settings via new ``--print-settings`` flag
* All settings for slugs now use ``{slug}`` and/or ``{lang}`` rather than
``%s``. If ``%s``-style settings are encountered, Pelican will emit a warning
and fallback to the default setting.
* New signals: ``feed_generated`` and ``page_generated_write_page``
* Replace Fabric with Invoke and ``fabfile.py`` template with ``tasks.py``
* Replace ``PAGINATED_DIRECT_TEMPLATES`` by ``PAGINATED_TEMPLATES``, extending
control over pagination to all templates and making page size variable
* Replace ``SLUG_SUBSTITUTIONS`` (and friends) by ``SLUG_REGEX_SUBSTITUTIONS``
for more finegrained control
* ``'{base_name}'`` value in ``PAGINATION_PATTERNS`` setting no longer strips
``'bar'`` from ``'foo/bar.html'`` (unless ``'bar' == 'index'``).
* ``ARTICLE_ORDER_BY`` and ``PAGE_ORDER_BY`` now also affect 1) category, tag
and author pages 2) feeds 3) draft and hidden articles and pages
* New ``ARTICLE_TRANSLATION_ID`` and ``PAGE_TRANSLATION_ID`` settings to
specify metadata attributes used to identify/disable translations
* Make the HTML reader parse multiple occurrences of metadata tags as a list
* New Blogger XML backup importer
* Wordpress importer now updates file links to point to local copies if the
files were downloaded with ``--wp-attach``.
* Importer no longer inserts extra newlines, to prevent breaking of HTML
attributes.
* Pelican server now prioritises ``foo.html`` and ``foo/index.html`` over
``foo/`` when resolving ``foo``.
3.7.1 (2017-01-10)
==================
* Fix locale issues in Quickstart script
* Specify encoding for README and CHANGELOG in setup.py
3.7.0 (2016-12-12)
==================
* Atom feeds output ``<content>`` in addition to ``<summary>``
* Atom feeds use ``<published>`` for the original publication date and
``<updated>`` for modifications
* Simplify Atom feed ID generation and support URL fragments
* Produce category feeds with category-specific titles
* RSS feeds now default to summary instead of full content;
set ``RSS_FEED_SUMMARY_ONLY = False`` to revert to previous behavior
* Replace ``MD_EXTENSIONS`` with ``MARKDOWN`` setting
* Replace ``JINJA_EXTENSIONS`` with more-robust ``JINJA_ENVIRONMENT`` setting
* Improve summary truncation logic to handle special characters and tags that
span multiple lines, using HTML parser instead of regular expressions
* Include summary when looking for intra-site link substitutions
* Link to authors and index via ``{author}name`` and ``{index}`` syntax
* Override widget names via ``LINKS_WIDGET_NAME`` and ``SOCIAL_WIDGET_NAME``
* Add ``INDEX_SAVE_AS`` option to override default ``index.html`` value
* Remove ``PAGES`` context variable for themes in favor of ``pages``
* ``SLUG_SUBSTITUTIONS`` now accepts 3-tuple elements, allowing URL slugs to
contain non-alphanumeric characters
* Tag and category slugs can be controlled with greater precision using the
``TAG_SUBSTITUTIONS`` and ``CATEGORY_SUBSTITUTIONS`` settings
* Author slugs can be controlled with greater precision using the
``AUTHOR_SUBSTITUTIONS`` setting
* ``DEFAULT_DATE`` can be defined as a string
* Use ``mtime`` instead of ``ctime`` when ``DEFAULT_DATE = 'fs'``
* Add ``--fatal=errors|warnings`` option for use with continuous integration
* When using generator-level caching, ensure previously-cached files are
processed instead of just new files.
* Add Python and Pelican version information to debug output
* Improve compatibility with Python 3.5
* Comply with and enforce PEP8 guidelines
* Replace tables in settings documentation with ``data::`` directives
3.6.3 (2015-08-14)
==================
* Fix permissions issue in release tarball
3.6.2 (2015-08-01)
==================
* Fix installation errors related to Unicode in tests
* Don't show pagination in ``notmyidea`` theme if there's only one page
* Make hidden pages available in context
* Improve URLWrapper comparison
3.6.0 (2015-06-15)
==================
* Disable caching by default in order to prevent potential confusion
* Improve caching behavior, replacing ``pickle`` with ``cpickle``
* Allow Markdown or reST content in metadata fields other than ``summary``
* Support semicolon-separated author/tag lists
* Improve flexibility of article sorting
* Add ``--relative-urls`` argument
* Support devserver listening on addresses other than localhost
* Unify HTTP server handlers to ``pelican.server`` throughout
* Handle intra-site links to draft posts
* Move ``tag_cloud`` from core to plugin
* Load default theme's external resources via HTTPS
* Import drafts from WordPress XML
* Improve support for Windows users
* Enhance logging and test suite
* Clean up and refactor codebase
* New signals: ``all_generators_finalized`` and ``page_writer_finalized``
3.5.0 (2014-11-04)
==================
* Introduce ``ARTICLE_ORDER_BY`` and ``PAGE_ORDER_BY`` settings to control the
order of articles and pages.
* Include time zone information in dates rendered in templates.
* Expose the reader name in the metadata for articles and pages.
* Add the ability to store static files along with content in the same
directory as articles and pages using ``{attach}`` in the path.
* Prevent Pelican from raising an exception when there are duplicate pieces of
metadata in a Markdown file.
* Introduce the ``TYPOGRIFY_IGNORE_TAGS`` setting to add HTML tags to be
ignored by Typogrify.
* Add the ability to use ``-`` in date formats to strip leading zeros. For
example, ``%-d/%-m/%y`` will now result in the date ``9/8/12``.
* Ensure feed generation is correctly disabled during quickstart configuration.
* Fix ``PAGE_EXCLUDES`` and ``ARTICLE_EXCLUDES`` from incorrectly matching
sub-directories.
* Introduce ``STATIC_EXCLUDE`` setting to add static file excludes.
* Fix an issue when using ``PAGINATION_PATTERNS`` while ``RELATIVE_URLS``
is enabled.
* Fix feed generation causing links to use the wrong language for month
names when using other locales.
* Fix an issue where the authors list in the simple template wasn't correctly
formatted.
* Fix an issue when parsing non-string URLs from settings.
* Improve consistency of debug and warning messages.
3.4.0 (2014-07-01)
==================
* Speed up content generation via new caching mechanism
* Add selective post generation (instead of always building entire site)
* Many documentation improvements, including switching to prettier RtD theme
* Add support for multiple content and plugin paths
* Add ``:modified:`` metadata field to complement ``:date:``.
Used to specify the last date and time an article was updated independently
from the date and time it was published.
* Add support for multiple authors via new ``:authors:`` metadata field
* Watch for changes in static directories when in auto-regeneration mode
* Add filters to limit log output when desired
* Add language support to drafts
* Add ``SLUGIFY_SOURCE`` setting to control how post slugs are generated
* Fix many issues relating to locale and encoding
* Apply Typogrify filter to post summary
* Preserve file metadata (e.g. time stamps) when copying static files to output
* Move AsciiDoc support from Pelican core into separate plugin
* Produce inline links instead of reference-style links when importing content
* Improve handling of ``IGNORE_FILES`` setting behavior
* Properly escape symbol characters in tag names (e.g., ``C++``)
* Minor tweaks for Python 3.4 compatibility
* Add several new signals
3.3.0 (2013-09-24)
==================
* Drop Python 3.2 support in favor of Python 3.3
* Add ``Fabfile`` so Fabric can be used for workflow automation instead of Make
* ``OUTPUT_RETENTION`` setting can be used to preserve metadata (e.g., VCS
data such as ``.hg`` and ``.git``) from being removed from output directory
* Tumblr import
* Improve logic and consistency when cleaning output folder
* Improve documentation versioning and release automation
* Improve pagination flexibility
* Rename signals for better consistency (some plugins may need to be updated)
* Move metadata extraction from generators to readers; metadata extraction no
longer article-specific
* Deprecate ``FILES_TO_COPY`` in favor of ``STATIC_PATHS`` and
``EXTRA_PATH_METADATA``
* Summaries in Markdown posts no longer include footnotes
* Remove unnecessary whitespace in output via ``lstrip_blocks`` Jinja parameter
* Move PDF generation from core to plugin
* Replace ``MARKUP`` setting with ``READERS``
* Add warning if img tag is missing ``alt`` attribute
* Add support for ``{}`` in relative links syntax, besides ``||``
* Add support for ``{tag}`` and ``{category}`` relative links
* Add a ``content_written`` signal
3.2.1 and 3.2.2
===============
* Facilitate inclusion in FreeBSD Ports Collection
3.2 (2013-04-24)
================
* Support for Python 3!
* Override page save-to location from meta-data (enables using a static page as
the site's home page, for example)
* Time period archives (per-year, per-month, and per-day archives of posts)
* Posterous blog import
* Improve WordPress blog import
* Migrate plugins to separate repository
* Improve HTML parser
* Provide ability to show or hide categories from menu using
``DISPLAY_CATEGORIES_ON_MENU`` option
* Auto-regeneration can be told to ignore files via ``IGNORE_FILES`` setting
* Improve post-generation feedback to user
* For multilingual posts, use meta-data to designate which is the original
and which is the translation
* Add ``.mdown`` to list of supported Markdown file extensions
* Document-relative URL generation (``RELATIVE_URLS``) is now off by default
3.1 (2012-12-04)
================
* Importer now stores slugs within files by default. This can be disabled with
the ``--disable-slugs`` option.
* Improve handling of links to intra-site resources
* Ensure WordPress import adds paragraphs for all types of line endings
in post content
* Decode HTML entities within WordPress post titles on import
* Improve appearance of LinkedIn icon in default theme
* Add GitHub and Google+ social icons support in default theme
* Optimize social icons
* Add ``FEED_ALL_ATOM`` and ``FEED_ALL_RSS`` to generate feeds containing all
posts regardless of their language
* Split ``TRANSLATION_FEED`` into ``TRANSLATION_FEED_ATOM`` and
``TRANSLATION_FEED_RSS``
* Different feeds can now be enabled/disabled individually
* Allow for blank author: if ``AUTHOR`` setting is not set, author won't
default to ``${USER}`` anymore, and a post won't contain any author
information if the post author is empty
* Move LESS and Webassets support from Pelican core to plugin
* The ``DEFAULT_DATE`` setting now defaults to ``None``, which means that
articles won't be generated unless date metadata is specified
* Add ``FILENAME_METADATA`` setting to support metadata extraction from
filename
* Add ``gzip_cache`` plugin to compress common text files into a ``.gz``
file within the same directory as the original file, preventing the server
(e.g. Nginx) from having to compress files during an HTTP call
* Add support for AsciiDoc-formatted content
* Add ``USE_FOLDER_AS_CATEGORY`` setting so that feature can be toggled on/off
* Support arbitrary Jinja template files
* Restore basic functional tests
* New signals: ``generator_init``, ``get_generators``, and
``article_generate_preread``
3.0 (2012-08-08)
================
* Refactored the way URLs are handled
* Improved the English documentation
* Fixed packaging using ``setuptools`` entrypoints
* Added ``typogrify`` support
* Added a way to disable feed generation
* Added support for ``DIRECT_TEMPLATES``
* Allow multiple extensions for content files
* Added LESS support
* Improved the import script
* Added functional tests
* Rsync support in the generated Makefile
* Improved feed support (easily pluggable with Feedburner for instance)
* Added support for ``abbr`` in reST
* Fixed a bunch of bugs :-)
2.8 (2012-02-28)
==================
* Dotclear importer
* Allow the usage of Markdown extensions
* Themes are now easily extensible
* Don't output pagination information if there is only one page
* Add a page per author, with all their articles
* Improved the test suite
* Made the themes easier to extend
* Removed Skribit support
* Added a ``pelican-quickstart`` script
* Fixed timezone-related issues
* Added some scripts for Windows support
* Date can be specified in seconds
* Never fail when generating posts (skip and continue)
* Allow the use of future dates
* Support having different timezones per language
* Enhanced the documentation
2.7 (2011-06-11)
==================
* Use ``logging`` rather than echoing to stdout
* Support custom Jinja filters
* Compatibility with Python 2.5
* Added a theme manager
* Packaged for Debian
* Added draft support
2.6 (2011-03-08)
==================
* Changes in the output directory structure
* Makes templates easier to work with / create
* Added RSS support (was Atom-only)
* Added tag support for the feeds
* Enhance the documentation
* Added another theme (brownstone)
* Added translations
* Added a way to use cleaner URLs with a rewrite url module (or equivalent)
* Added a tag cloud
* Added an autoreloading feature: the blog is automatically regenerated each
time a modification is detected
* Translate the documentation into French
* Import a blog from an RSS feed
* Pagination support
* Added Skribit support
2.5 (2010-11-20)
==================
* Import from WordPress
* Added some new themes (martyalchin / wide-notmyidea)
* First bug report!
* Linkedin support
* Added a FAQ
* Google Analytics support
* Twitter support
* Use relative URLs, not static ones
2.4 (2010-11-06)
================
* Minor themes changes
* Add Disqus support (so we have comments)
* Another code refactoring
* Added config settings about pages
* Blog entries can also be generated in PDF
2.3 (2010-10-31)
================
* Markdown support
2.2 (2010-10-30)
================
* Prettify output
* Manages static pages as well
2.1 (2010-10-30)
================
* Make notmyidea the default theme
2.0 (2010-10-30)
================
* Refactoring to be more extensible
* Change into the setting variables
1.2 (2010-09-28)
================
* Added a debug option
* Added per-category feeds
* Use filesystem to get dates if no metadata is provided
* Add Pygments support
1.1 (2010-08-19)
================
* First working version

View file

@ -1,149 +1,102 @@
# -*- coding: utf-8 -*-
import sys, os
import datetime
import os
import sys
import time
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('..'))
if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib
# -- General configuration -----------------------------------------------------
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Pelican'
copyright = u'2010, Alexis Metaireau'
exclude_patterns = ['_build']
pygments_style = 'sphinx'
# -- Options for HTML output ---------------------------------------------------
sys.path.append(os.path.abspath(os.pardir))
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
sys.path.append(os.path.abspath('_themes'))
html_theme_path = ['_themes']
html_theme = 'flask_small'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
with open("../pyproject.toml", "rb") as f:
project_data = tomllib.load(f).get("project")
if project_data is None:
raise KeyError("project data is not found")
# -- General configuration ----------------------------------------------------
templates_path = ["_templates"]
locale_dirs = ["locale/"]
gettext_compact = False
gettext_uuid = True
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.extlinks",
"sphinxext.opengraph",
]
source_suffix = ".rst"
master_doc = "index"
project = project_data.get("name").upper()
year = datetime.datetime.fromtimestamp(
int(os.environ.get("SOURCE_DATE_EPOCH", time.time())), datetime.timezone.utc
).year
project_copyright = f"2010{year}" # noqa: RUF001
exclude_patterns = ["_build"]
release = project_data.get("version")
version = ".".join(release.split(".")[:1])
last_stable = project_data.get("version")
rst_prolog = f"""
.. |last_stable| replace:: :pelican-doc:`{last_stable}`
.. |min_python| replace:: {project_data.get("requires-python").split(",")[0]}
"""
extlinks = {"pelican-doc": ("https://docs.getpelican.com/en/latest/%s.html", "%s")}
# -- Options for HTML output --------------------------------------------------
html_theme = "furo"
html_title = f"<strong>{project}</strong> <i>{release}</i>"
html_static_path = ["_static"]
html_theme_options = {
'index_logo': 'pelican.png',
'github_fork': 'ametaireau/pelican',
"light_logo": "pelican-logo.svg",
"dark_logo": "pelican-logo.svg",
"navigation_with_keys": True,
}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# Output file base name for HTML help builder.
htmlhelp_basename = "Pelicandoc"
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
html_use_smartypants = True
# If false, no module index is generated.
#html_domain_indices = True
html_use_modindex = False
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
html_use_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'Raclettedoc'
html_show_sourcelink = False
# -- Options for LaTeX output --------------------------------------------------
def setup(app):
# overrides for wide tables in RTD theme
app.add_css_file("theme_overrides.css") # path relative to _static
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
# -- Options for LaTeX output -------------------------------------------------
latex_documents = [
('index', 'Raclette.tex', u'Raclette Documentation',
u'Alexis Métaireau', 'manual'),
("index", "Pelican.tex", "Pelican Documentation", "Justin Mayer", "manual"),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
# -- Options for manual page output -------------------------------------------
man_pages = [
('index', 'raclette', u'Raclette Documentation',
[u'Alexis Métaireau'], 1)
("index", "pelican", "pelican documentation", ["Justin Mayer"], 1),
(
"pelican-themes",
"pelican-themes",
"A theme manager for Pelican",
["Mickaël Raybaud"],
1,
),
(
"themes",
"pelican-theming",
"How to create themes for Pelican",
["The Pelican contributors"],
1,
),
]

652
docs/content.rst Normal file
View file

@ -0,0 +1,652 @@
Writing content
###############
Articles and pages
==================
Pelican considers "articles" to be chronological content, such as posts on a
blog, and thus associated with a date.
The idea behind "pages" is that they are usually not temporal in nature and are
used for content that does not change very often (e.g., "About" or "Contact"
pages).
You can find sample content in the repository at ``samples/content/``.
.. _internal_metadata:
File metadata
=============
Pelican tries to be smart enough to get the information it needs from the
file system (for instance, about the category of your articles), but some
information you need to provide in the form of metadata inside your files.
If you are writing your content in reStructuredText format, you can provide
this metadata in text files via the following syntax (give your file the
``.rst`` extension)::
My super title
##############
:date: 2010-10-03 10:20
:modified: 2010-10-04 18:40
:tags: thats, awesome
:category: yeah
:slug: my-super-post
:authors: Alexis Metaireau, Conan Doyle
:summary: Short version for index and feeds
Author and tag lists may be semicolon-separated instead, which allows
you to write authors and tags containing commas::
:tags: pelican, publishing tool; pelican, bird
:authors: Metaireau, Alexis; Doyle, Conan
Pelican implements an extension to reStructuredText to enable support for the
``abbr`` HTML tag. To use it, write something like this in your post::
This will be turned into :abbr:`HTML (HyperText Markup Language)`.
You can also use Markdown syntax (with a file ending in ``.md``, ``.markdown``,
``.mkd``, or ``.mdown``). Markdown generation requires that you first
explicitly install the Python-Markdown_ package, which can be done via ``pip
install Markdown``.
Pelican also supports `Markdown Extensions`_, which might have to be installed
separately if they are not included in the default ``Markdown`` package and can
be configured and loaded via the ``MARKDOWN`` setting.
Metadata syntax for Markdown posts should follow this pattern::
Title: My super title
Date: 2010-12-03 10:20
Modified: 2010-12-05 19:30
Category: Python
Tags: pelican, publishing
Slug: my-super-post
Authors: Alexis Metaireau, Conan Doyle
Summary: Short version for index and feeds
This is the content of my super blog post.
You can also have your own metadata keys (so long as they don't conflict with
reserved metadata keywords) for use in your templates. The following table
contains a list of reserved metadata keywords:
=============== ===============================================================
Metadata Description
=============== ===============================================================
``title`` Title of the article or page
``date`` Publication date (e.g., ``YYYY-MM-DD HH:SS``)
``modified`` Modification date (e.g., ``YYYY-MM-DD HH:SS``)
``tags`` Content tags, separated by commas
``keywords`` Content keywords, separated by commas (HTML content only)
``category`` Content category (one only — not multiple)
``slug`` Identifier used in URLs and translations
``author`` Content author, when there is only one
``authors`` Content authors, when there are multiple
``summary`` Brief description of content for index pages
``lang`` Content language ID (``en``, ``fr``, etc.)
``translation`` If content is a translation of another (``true`` or ``false``)
``status`` Content status: ``draft``, ``hidden``, ``skip``, or ``published``
``template`` Name of template to use to generate content (without extension)
``save_as`` Save content to this relative file path
``url`` URL to use for this article/page
=============== ===============================================================
Readers for additional formats (such as AsciiDoc_) are available via plugins,
which you can find via the `Pelican Plugins`_ collection as well as the legacy
`pelican-plugins`_ repository.
Pelican can also process HTML files ending in ``.html`` and ``.htm``. Pelican
interprets the HTML in a very straightforward manner, reading metadata from
``meta`` tags, the title from the ``title`` tag, and the body out from the
``body`` tag::
<html>
<head>
<title>My super title</title>
<meta name="tags" content="thats, awesome" />
<meta name="date" content="2012-07-09 22:28" />
<meta name="modified" content="2012-07-10 20:14" />
<meta name="category" content="yeah" />
<meta name="authors" content="Alexis Métaireau, Conan Doyle" />
<meta name="summary" content="Short version for index and feeds" />
</head>
<body>
This is the content of my super blog post.
</body>
</html>
With HTML, there is one simple exception to the standard metadata: tags can be
specified either via the ``tags`` metadata, as is standard in Pelican, or via
the ``keywords`` metadata, as is standard in HTML. The two can be used
interchangeably.
Note that, aside from the title, none of this content metadata is mandatory:
if the date is not specified and ``DEFAULT_DATE`` is set to ``'fs'``, Pelican
will rely on the file's "mtime" timestamp, and the category can be determined
by the directory in which the file resides. For example, a file located at
``python/foobar/myfoobar.rst`` will have a category of ``foobar``. If you would
like to organize your files in other ways where the name of the subfolder would
not be a good category name, you can set the setting ``USE_FOLDER_AS_CATEGORY``
to ``False``. When parsing dates given in the page metadata, Pelican supports
the W3C's `suggested subset ISO 8601`__.
So the title is the only required metadata. If that bothers you, worry not.
Instead of manually specifying a title in your metadata each time, you can use
the source content file name as the title. For example, a Markdown source file
named ``Publishing via Pelican.md`` would automatically be assigned a title of
*Publishing via Pelican*. If you would prefer this behavior, add the following
line to your settings file::
FILENAME_METADATA = '(?P<title>.*)'
.. note::
When experimenting with different settings (especially the metadata
ones) caching may interfere and the changes may not be visible. In
such cases disable caching with ``LOAD_CONTENT_CACHE = False`` or
use the ``--ignore-cache`` command-line switch.
__ `W3C ISO 8601`_
``modified`` should be last time you updated the article, and defaults to
``date`` if not specified. Besides you can show ``modified`` in the templates,
feed entries in feed readers will be updated automatically when you set
``modified`` to the current date after you modified your article.
``authors`` is a comma-separated list of article authors. If there's only one
author you can use ``author`` field.
If you do not explicitly specify summary metadata for a given post, the
``SUMMARY_MAX_LENGTH`` setting can be used to specify how many words from the
beginning of an article are used as the summary. You can also use an article's
first N paragraphs as its summary using the ``SUMMARY_MAX_PARAGRAPHS`` setting.
If both settings are in use, the specified number of paragraphs will
be used but may be truncated to respect the specified maximum length.
You can also extract any metadata from the filename through a regular
expression to be set in the ``FILENAME_METADATA`` setting. All named groups
that are matched will be set in the metadata object. The default value for the
``FILENAME_METADATA`` setting will only extract the date from the filename. For
example, if you would like to extract both the date and the slug, you could set
something like: ``'(?P<date>\d{4}-\d{2}-\d{2})_(?P<slug>.*)'``
Please note that the metadata available inside your files takes precedence over
the metadata extracted from the filename.
Pages
=====
If you create a folder named ``pages`` inside the content folder, all the
files in it will be used to generate static pages, such as **About** or
**Contact** pages. (See example filesystem layout below.)
You can use the ``DISPLAY_PAGES_ON_MENU`` setting to control whether all those
pages are displayed in the primary navigation menu. (Default is ``True``.)
If you want to exclude any pages from being linked to or listed in the menu,
then add a ``status: hidden`` attribute to its metadata. This is useful for
things like making error pages that fit the generated theme of your site.
Static content
==============
Static files are files other than articles and pages that are copied to the
output folder as-is, without processing. You can control which static files
are copied over with the ``STATIC_PATHS`` setting of the project's
``pelicanconf.py`` file. Pelican's default configuration includes the
``images`` directory for this, but others must be added manually. In addition,
static files that are explicitly linked to are included (see below).
.. note::
In the default configuration, all files with a valid content file suffix
(``.html``, ``.rst``, ``.md``, ...) get processed by the article and page
generators *before* the static generator. This is avoided by altering the
``*_EXCLUDE`` settings appropriately.
Mixed content in the same directory
-----------------------------------
Starting with Pelican 3.5, static files can safely share a source directory
with page source files, without exposing the page sources in the generated
site. Any such directory must be added to both ``STATIC_PATHS`` and
``PAGE_PATHS`` (or ``STATIC_PATHS`` and ``ARTICLE_PATHS``). Pelican will
identify and process the page source files normally, and copy the remaining
files as if they lived in a separate directory reserved for static files.
Note: Placing static and content source files together in the same source
directory does not guarantee that they will end up in the same place in the
generated site. The easiest way to do this is by using the ``{attach}`` link
syntax (described below). Alternatively, the ``STATIC_SAVE_AS``,
``PAGE_SAVE_AS``, and ``ARTICLE_SAVE_AS`` settings (and the corresponding
``*_URL`` settings) can be configured to place files of different types
together, just as they could in earlier versions of Pelican.
.. _ref-linking-to-internal-content:
Linking to internal content
===========================
From Pelican 3.1 onwards, it is now possible to specify intra-site links to
files in the *source content* hierarchy instead of files in the *generated*
hierarchy. This makes it easier to link from the current post to other content
that may be sitting alongside that post (instead of having to determine where
the other content will be placed after site generation).
To link to internal content (files in the ``content`` directory), use the
following syntax for the link target: ``{filename}path/to/file``.
Note: forward slashes, ``/``,
are the required path separator in the ``{filename}`` directive
on all operating systems, including Windows.
For example, a Pelican project might be structured like this::
website/
├── content
│   ├── category/
│   │   └── article1.rst
│   ├── article2.md
│ └── pages
│      └── about.md
└── pelican.conf.py
In this example, ``article1.rst`` could look like this::
The first article
#################
:date: 2012-12-01 10:02
See below intra-site link examples in reStructuredText format.
`a link relative to the current file <{filename}../article2.md>`_
`a link relative to the content root <{filename}/article2.md>`_
and ``article2.md``::
Title: The second article
Date: 2012-12-01 10:02
See below intra-site link examples in Markdown format.
[a link relative to the current file]({filename}category/article1.rst)
[a link relative to the content root]({filename}/category/article1.rst)
Linking to static files
-----------------------
You can link to static content using ``{static}path/to/file``. Files linked to
with this syntax will automatically be copied to the output directory, even if
the source directories containing them are not included in the ``STATIC_PATHS``
setting of the project's ``pelicanconf.py`` file.
For example, a project's content directory might be structured like this::
content
├── images
│   └── han.jpg
├── pdfs
│   └── menu.pdf
└── pages
   └── test.md
``test.md`` would include::
![Alt Text]({static}/images/han.jpg)
[Our Menu]({static}/pdfs/menu.pdf)
Site generation would then copy ``han.jpg`` to ``output/images/han.jpg``,
``menu.pdf`` to ``output/pdfs/menu.pdf``, and write the appropriate links
in ``test.md``.
If you use ``{static}`` to link to an article or a page, this will be turned
into a link to its source code.
Attaching static files
----------------------
Starting with Pelican 3.5, static files can be "attached" to a page or article
using this syntax for the link target: ``{attach}path/to/file``. This works
like the ``{static}`` syntax, but also relocates the static file into the
linking document's output directory. If the static file originates from a
subdirectory beneath the linking document's source, that relationship will be
preserved on output. Otherwise, it will become a sibling of the linking
document.
This only works for linking to static files.
For example, a project's content directory might be structured like this::
content
├── blog
│   ├── icons
│   │   └── icon.png
│   ├── photo.jpg
│   └── testpost.md
└── downloads
└── archive.zip
``pelicanconf.py`` would include::
PATH = 'content'
ARTICLE_PATHS = ['blog']
ARTICLE_SAVE_AS = '{date:%Y}/{slug}.html'
ARTICLE_URL = '{date:%Y}/{slug}.html'
``testpost.md`` would include::
Title: Test Post
Category: test
Date: 2014-10-31
![Icon]({attach}icons/icon.png)
![Photo]({attach}photo.jpg)
[Downloadable File]({attach}/downloads/archive.zip)
Site generation would then produce an output directory structured like this::
output
└── 2014
├── archive.zip
├── icons
│   └── icon.png
├── photo.jpg
└── test-post.html
Notice that all the files linked using ``{attach}`` ended up in or beneath
the article's output directory.
If a static file is linked multiple times, the relocating feature of
``{attach}`` will only work in the first of those links to be processed.
After the first link, Pelican will treat ``{attach}`` like ``{static}``.
This avoids breaking the already-processed links.
**Be careful when linking to a file from multiple documents:**
Since the first link to a file finalizes its location and Pelican does
not define the order in which documents are processed, using ``{attach}`` on a
file linked by multiple documents can cause its location to change from one
site build to the next. (Whether this happens in practice will depend on the
operating system, file system, version of Pelican, and documents being added,
modified, or removed from the project.) Any external sites linking to the
file's old location might then find their links broken. **It is therefore
advisable to use {attach} only if you use it in all links to a file, and only
if the linking documents share a single directory.** Under these conditions,
the file's output location will not change in future builds. In cases where
these precautions are not possible, consider using ``{static}`` links instead
of ``{attach}``, and letting the file's location be determined by the project's
``STATIC_SAVE_AS`` and ``STATIC_URL`` settings. (Per-file ``save_as`` and
``url`` overrides can still be set in ``EXTRA_PATH_METADATA``.)
.. note::
When using ``{attach}``, any parent directory in ``*_URL`` / ``*_SAVE_AS``
settings should match each other. See also: :ref:`url-settings`
Linking to authors, categories, index and tags
----------------------------------------------
You can link to authors, categories, index and tags using the ``{author}name``,
``{category}foobar``, ``{index}`` and ``{tag}tagname`` syntax.
Deprecated internal link syntax
-------------------------------
To remain compatible with earlier versions, Pelican still supports vertical
bars (``||``) in addition to curly braces (``{}``) for internal links. For
example: ``|filename|an_article.rst``, ``|tag|tagname``, ``|category|foobar``.
The syntax was changed from ``||`` to ``{}`` to avoid collision with Markdown
extensions or reST directives. Similarly, Pelican also still supports linking
to static content with ``{filename}``. The syntax was changed to ``{static}``
to allow linking to both generated articles and pages and their static sources.
Support for the old syntax may eventually be removed.
Including other files
---------------------
Both Markdown and reStructuredText syntaxes provide mechanisms for this.
Following below are some examples for **reStructuredText** using `the include directive`_:
.. code-block:: rst
.. include:: file.rst
Include a fragment of a file delimited by two identifiers, highlighted as C++ (slicing based on line numbers is also possible):
.. code-block:: rst
.. include:: main.cpp
:code: c++
:start-after: // begin
:end-before: // end
Include a raw HTML file (or an inline SVG) and put it directly into the output without any processing:
.. code-block:: rst
.. raw:: html
:file: table.html
For **Markdown**, one must rely on an extension. For example, using the `mdx_include plugin`_:
.. code-block:: none
```html
{! template.html !}
```
Importing an existing site
==========================
It is possible to import your site from several other blogging sites
(like WordPress, Tumblr, ..) using a simple script. See :ref:`import`.
Translations
============
It is possible to translate articles. To do so, you need to add a ``lang`` meta
attribute to your articles/pages and set a ``DEFAULT_LANG`` setting (which is
English [en] by default). With those settings in place, only articles with the
default language will be listed, and each article will be accompanied by a list
of available translations for that article.
.. note::
This core Pelican functionality does not create sub-sites
(e.g. ``example.com/de``) with translated templates for each
language. For such advanced functionality the `i18n_subsites
plugin`_ can be used.
By default, Pelican uses the article's URL "slug" to determine if two or more
articles are translations of one another. (This can be changed with the
``ARTICLE_TRANSLATION_ID`` setting.) The slug can be set manually in the file's
metadata; if not set explicitly, Pelican will auto-generate the slug from the
title of the article.
Here is an example of two articles, one in English and the other in French.
The English article::
Foobar is not dead
##################
:slug: foobar-is-not-dead
:lang: en
That's true, foobar is still alive!
And the French version::
Foobar n'est pas mort !
#######################
:slug: foobar-is-not-dead
:lang: fr
Oui oui, foobar est toujours vivant !
Post content quality notwithstanding, you can see that only item in common
between the two articles is the slug, which is functioning here as an
identifier. If you'd rather not explicitly define the slug this way, you must
then instead ensure that the translated article titles are identical, since the
slug will be auto-generated from the article title.
If you do not want the original version of one specific article to be detected
by the ``DEFAULT_LANG`` setting, use the ``translation`` metadata to specify
which posts are translations::
Foobar is not dead
##################
:slug: foobar-is-not-dead
:lang: en
:translation: true
That's true, foobar is still alive!
.. _internal_pygments_options:
Syntax highlighting
===================
Pelican can provide colorized syntax highlighting for your code blocks.
To do so, you must use the following conventions inside your content files.
For reStructuredText, use the ``code-block`` directive to specify the type
of code to be highlighted (in these examples, we'll use ``python``)::
.. code-block:: python
print("Pelican is a static site generator.")
For Markdown, which utilizes the `CodeHilite extension`_ to provide syntax
highlighting, include the language identifier just above the code block,
indenting both the identifier and the code::
There are two ways to specify the identifier:
:::python
print("The triple-colon syntax will *not* show line numbers.")
To display line numbers, use a path-less shebang instead of colons:
#!python
print("The path-less shebang syntax *will* show line numbers.")
The specified identifier (e.g. ``python``, ``ruby``) should be one that
appears on the `list of available lexers <https://pygments.org/docs/lexers/>`_.
When using reStructuredText the following options are available in the
`code-block` directive:
============= ============ =========================================
Option Valid values Description
============= ============ =========================================
anchorlinenos N/A If present, wrap line numbers in ``<a>`` tags.
classprefix string String to prepend to token class names
hl_lines numbers List of lines to be highlighted, where
line numbers to highlight are separated
by a space. This is similar to
``emphasize-lines`` in Sphinx, but it
does not support a range of line numbers
separated by a hyphen, or comma-separated
line numbers.
lineanchors string Wrap each line in an anchor using this
string and -linenumber.
linenos string If present or set to "table", output line
numbers in a table; if set to
"inline", output them inline. "none" means
do not output the line numbers for this
table.
linenospecial number If set, every nth line will be given the
'special' CSS class.
linenostart number Line number for the first line.
linenostep number Print every nth line number.
lineseparator string String to print between lines of code,
'\n' by default.
linespans string Wrap each line in a span using this and
-linenumber.
nobackground N/A If set, do not output background color for
the wrapping element
nowrap N/A If set, do not wrap the tokens at all.
tagsfile string ctags file to use for name definitions.
tagurlformat string format for the ctag links.
============= ============ =========================================
Note that, depending on the version, your Pygments module might not have
all of these options available. Refer to the *HtmlFormatter* section of the
`Pygments documentation <https://pygments.org/docs/formatters/>`_ for more
details on each of the options.
For example, the following code block enables line numbers, starting at 153,
and prefixes the Pygments CSS classes with *pgcss* to make the names
more unique and avoid possible CSS conflicts::
.. code-block:: identifier
:classprefix: pgcss
:linenos: table
:linenostart: 153
<indented code block goes here>
It is also possible to specify the ``PYGMENTS_RST_OPTIONS`` variable in your
Pelican settings file to include options that will be automatically applied to
every code block.
For example, if you want to have line numbers displayed for every code block
and a CSS prefix, you would set this variable to::
PYGMENTS_RST_OPTIONS = {'classprefix': 'pgcss', 'linenos': 'table'}
If specified, settings for individual code blocks will override the defaults in
your settings file.
Publishing drafts
=================
If you want to publish an article or a page as a draft (for friends to review
before publishing, for example), you can add a ``Status: draft`` attribute to
its metadata. That article will then be output to the ``drafts`` folder and not
listed on the index page nor on any category or tag page.
If your articles should be automatically published as a draft (to not
accidentally publish an article before it is finished), include the status in
the ``DEFAULT_METADATA``::
DEFAULT_METADATA = {
'status': 'draft',
}
To publish a post when the default status is ``draft``, update the post's
metadata to include ``Status: published``.
Hidden Posts
============
Like pages, posts can also be marked as ``hidden`` with the ``Status: hidden``
attribute. Hidden posts will be output to ``ARTICLE_SAVE_AS`` as expected, but
are not included by default in tag, category, and author indexes, nor in the
main article feed. This has the effect of creating an "unlisted" post.
Skip Posts
==========
Posts marked with ``skip`` status are ignored entirely. They are not processed
nor output to the ``ARTICLE_SAVE_AS`` path. Such posts will similarly not be
included in indexes or feeds.
.. _W3C ISO 8601: https://www.w3.org/TR/NOTE-datetime
.. _AsciiDoc: https://asciidoc.org
.. _Pelican Plugins: https://github.com/pelican-plugins
.. _pelican-plugins: https://github.com/getpelican/pelican-plugins
.. _Python-Markdown: https://github.com/Python-Markdown/markdown
.. _Markdown Extensions: https://python-markdown.github.io/extensions/
.. _CodeHilite extension: https://python-markdown.github.io/extensions/code_hilite/#syntax
.. _i18n_subsites plugin: https://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites
.. _the include directive: http://docutils.sourceforge.net/docs/ref/rst/directives.html#include
.. _mdx_include plugin: https://github.com/neurobin/mdx_include

299
docs/contribute.rst Normal file
View file

@ -0,0 +1,299 @@
Contributing and feedback guidelines
####################################
There are many ways to contribute to Pelican. You can improve the
documentation, add missing features, and fix bugs (or just report them). You
can also help out by reviewing and commenting on
`existing issues <https://github.com/getpelican/pelican/issues>`_.
Don't hesitate to fork Pelican and submit an issue or pull request on GitHub.
When doing so, please consider the following guidelines.
.. include:: ../CONTRIBUTING.rst
Setting up the development environment
======================================
While there are many ways to set up one's development environment, the following
instructions will utilize Pip_ and PDM_. These tools facilitate managing
virtual environments for separate Python projects that are isolated from one
another, so you can use different packages (and package versions) for each.
Please note that Python |min_python| is required for Pelican development.
*(Optional)* If you prefer to `install PDM <https://pdm.fming.dev/latest/#installation>`_ once for use with multiple projects,
you can install it via::
curl -sSL https://pdm.fming.dev/install-pdm.py | python3 -
Point your web browser to the `Pelican repository`_ and tap the **Fork** button
at top-right. Then clone the source for your fork and add the upstream project
as a Git remote::
mkdir ~/projects
git clone https://github.com/YOUR_USERNAME/pelican.git ~/projects/pelican
cd ~/projects/pelican
git remote add upstream https://github.com/getpelican/pelican.git
While PDM can dynamically create and manage virtual environments, we're going
to manually create and activate a virtual environment::
mkdir ~/virtualenvs && cd ~/virtualenvs
python3 -m venv pelican
source ~/virtualenvs/pelican/*/activate
Install the needed dependencies and set up the project::
python -m pip install invoke
invoke setup
Your local environment should now be ready to go!
.. _Pip: https://pip.pypa.io/
.. _PDM: https://pdm.fming.dev/latest/
.. _Pelican repository: https://github.com/getpelican/pelican
Development
===========
Once Pelican has been set up for local development, create a topic branch for
your bug fix or feature::
git checkout -b name-of-your-bugfix-or-feature
Now you can make changes to Pelican, its documentation, and/or other aspects of
the project.
Setting up ``git blame`` (optional)
-----------------------------------
``git blame`` annotates lines in a file with information about the pull request
that last modified it. Sweeping shallow changes (like formatting) can make that
information less useful, so we keep a list of such changes to be ignored. Run the
following command to set this up in your repository, adding ``--global`` if you
want this setting to apply to all repositories::
git config blame.ignoreRevsFile .git-blame-ignore-revs
As noted in a `useful article`_ about ``git blame``, there are other related
settings you may find to be beneficial::
# Add `?` to any lines that have had a commit skipped using --ignore-rev
git config --global blame.markIgnoredLines true
# Add `*` to any lines that were added in a skipped commit and can not be attributed
git config --global blame.markUnblamableLines true
.. _useful article: https://www.michaelheap.com/git-ignore-rev/
Running the test suite
----------------------
Each time you make changes to Pelican, there are two things to do regarding
tests: check that the existing tests pass, and add tests for any new features
or bug fixes. The tests are located in ``pelican/tests``, and you can run them
via::
invoke tests
(For more on Invoke, see ``invoke -l`` to list tasks, or
https://pyinvoke.org for documentation.)
In addition to running the test suite, it is important to also ensure that any
lines you changed conform to code style guidelines. You can check that via::
invoke lint
If style violations are found, many of them can be addressed automatically via::
invoke lint --fix
invoke format
If code style violations are found in lines you changed, correct those lines
and re-run the ``invoke lint`` command until they have all been fixed. You do
not need to address style violations, if any, for code lines you did not touch.
After making your changes and running the tests, you may see a test failure
mentioning that "some generated files differ from the expected functional tests
output." If you have made changes that affect the HTML output generated by
Pelican, and the changes to that output are expected and deemed correct given
the nature of your changes, then you should update the output used by the
functional tests. To do so, **make sure you have both** ``en_EN.utf8`` **and**
``fr_FR.utf8`` **locales installed**, and then run the following command::
invoke update-functional-tests
You may also find that some tests are skipped because some dependency (e.g.,
Pandoc) is not installed. This does not automatically mean that these tests
have passed; you should at least verify that any skipped tests are not affected
by your changes.
You should run the test suite under each of the supported versions of Python.
This is best done by creating a separate Python environment for each version.
Tox_ is a useful tool to automate running tests inside ``virtualenv``
environments.
.. _Tox: https://tox.readthedocs.io/en/latest/
Running a code coverage report
------------------------------
Code is more likely to stay robust if it is tested. Coverage_ is a library that
measures how much of the code is tested. To run it::
invoke coverage
This will show overall coverage, coverage per file, and even line-by-line coverage.
There is also an HTML report available::
open htmlcov/index.html
.. _Coverage: https://github.com/nedbat/coveragepy
Building the docs
-----------------
If you make changes to the documentation, you should build and inspect your
changes before committing them::
invoke docserve
Open http://localhost:8000 in your browser to review the documentation. While
the above task is running, any changes you make and save to the documentation
should automatically appear in the browser, as it live-reloads when it detects
changes to the documentation source files.
Plugin development
------------------
To create a *new* Pelican plugin, please refer to the `plugin template`_
repository for detailed instructions.
If you want to contribute to an *existing* Pelican plugin, follow the steps
above to set up Pelican for local development, and then create a directory to
store cloned plugin repositories::
mkdir -p ~/projects/pelican-plugins
Assuming you wanted to contribute to the Simple Footnotes plugin, you would
first browse to the `Simple Footnotes`_ repository on GitHub and tap the **Fork**
button at top-right. Then clone the source for your fork and add the upstream
project as a Git remote::
git clone https://github.com/YOUR_USERNAME/simple-footnotes.git ~/projects/pelican-plugins/simple-footnotes
cd ~/projects/pelican-plugins/simple-footnotes
git remote add upstream https://github.com/pelican-plugins/simple-footnotes.git
Install the needed dependencies and set up the project::
invoke setup
Create a topic branch for your plugin bug fix or feature::
git checkout -b name-of-your-bugfix-or-feature
After writing new tests for your plugin changes, run the plugin test suite and
check for code style compliance via::
invoke tests
invoke lint
If style violations are found, many of them can be addressed automatically via::
invoke lint --fix
invoke format
If style violations are found even after running the above auto-formatters,
you will need to make additional manual changes until ``invoke lint`` no longer
reports any code style violations.
.. _plugin template: https://github.com/getpelican/cookiecutter-pelican-plugin
.. _Simple Footnotes: https://github.com/pelican-plugins/simple-footnotes
Submitting your changes
-----------------------
Assuming linting validation and tests pass, add a ``RELEASE.md`` file in the root
of the project that contains the release type (major, minor, patch) and a
summary of the changes that will be used as the release changelog entry.
For example::
Release type: patch
Fix browser reloading upon changes to content, settings, or theme
Commit your changes and push your topic branch::
git add .
git commit -m "Your detailed description of your changes"
git push origin name-of-your-bugfix-or-feature
Finally, browse to your repository fork on GitHub and submit a pull request.
Logging tips
============
Try to use logging with appropriate levels.
For logging messages that are not repeated, use the usual Python way::
# at top of file
import logging
logger = logging.getLogger(__name__)
# when needed
logger.warning("A warning with %s formatting", arg_to_be_formatted)
Do not format log messages yourself. Use ``%s`` formatting in messages and pass
arguments to logger. This is important, because the Pelican logger will
preprocess some arguments, such as exceptions.
Limiting extraneous log messages
--------------------------------
If the log message can occur several times, you may want to limit the log to
prevent flooding. In order to do that, use the ``extra`` keyword argument for
the logging message in the following format::
logger.warning("A warning with %s formatting", arg_to_be_formatted,
extra={'limit_msg': 'A generic message for too many warnings'})
Optionally, you can also set ``'limit_args'`` as a tuple of arguments in
``extra`` dict if your generic message needs formatting.
Limit is set to ``5``, i.e, first four logs with the same ``'limit_msg'`` are
outputted normally but the fifth one will be logged using ``'limit_msg'`` (and
``'limit_args'`` if present). After the fifth, corresponding log messages will
be ignored.
For example, if you want to log missing resources, use the following code::
for resource in resources:
if resource.is_missing:
logger.warning(
'The resource %s is missing', resource.name,
extra={'limit_msg': 'Other resources were missing'})
The log messages will be displayed as follows::
WARNING: The resource prettiest_cat.jpg is missing
WARNING: The resource best_cat_ever.jpg is missing
WARNING: The resource cutest_cat.jpg is missing
WARNING: The resource lolcat.jpg is missing
WARNING: Other resources were missing
Outputting traceback in the logs
--------------------------------
If you're logging inside an ``except`` block, you may want to provide the
traceback information as well. You can do that by setting ``exc_info`` keyword
argument to ``True`` during logging. However, doing so by default can be
undesired because tracebacks are long and can be confusing to regular users.
Try to limit them to ``--debug`` mode like the following::
try:
some_action()
except Exception as e:
logger.error('Exception occurred: %s', e,
exc_info=settings.get('DEBUG', False))

299
docs/faq.rst Normal file
View file

@ -0,0 +1,299 @@
Frequently Asked Questions (FAQ)
################################
Here are some frequently asked questions about Pelican.
What's the best way to communicate a problem, question, or suggestion?
======================================================================
Please read our :doc:`feedback guidelines <contribute>`.
How can I help?
===============
There are several ways to help out. First, you can communicate any Pelican
suggestions or problems you might have via `Pelican Discussions
<https://github.com/getpelican/pelican/discussions>`_. Please first check the
existing list of discussions and issues (both open and closed) in order to
avoid submitting topics that have already been covered before.
If you want to contribute, please fork `the Git repository
<https://github.com/getpelican/pelican/>`_, create a new feature branch, make
your changes, and issue a pull request. Someone will review your changes as
soon as possible. Please refer to the :doc:`How to Contribute <contribute>`
section for more details.
You can also contribute by creating themes and improving the documentation.
Is the Pelican settings file mandatory?
=======================================
Configuration files are optional and are just an easy way to configure Pelican.
For basic operations, it's possible to specify options while invoking Pelican
via the command line. See ``pelican --help`` for more information.
Changes to the settings file take no effect
===========================================
When experimenting with different settings (especially the metadata ones)
caching may interfere and the changes may not be visible. In such cases, ensure
that caching is disabled via ``LOAD_CONTENT_CACHE = False`` or use the
``--ignore-cache`` command-line switch.
I'm creating my own theme. How do I use Pygments for syntax highlighting?
=========================================================================
Pygments adds some classes to the generated content. These classes are used by
themes to style code syntax highlighting via CSS. Specifically, you can
customize the appearance of your syntax highlighting via the ``.highlight pre``
class in your theme's CSS file. To see how various styles can be used to render
Django code, for example, use the style selector drop-down at top-right on the
`Pygments project demo site <https://pygments.org/demo/>`_.
You can use the following example commands to generate a starting CSS file from
a Pygments built-in style (in this case, "monokai") and then copy the generated
CSS file to your new theme::
pygmentize -S monokai -f html -a .highlight > pygment.css
cp pygment.css path/to/theme/static/css/
Don't forget to import your ``pygment.css`` file from your main CSS file.
How do I create my own theme?
=============================
Please refer to :ref:`theming-pelican`.
Can I override individual templates without forking the whole theme?
====================================================================
Yes, you can override existing templates of the theme that you are using, or
add new templates, via the ``THEME_TEMPLATES_OVERRIDES`` variable. For example,
to override the page template, you can define the location for your templates
like this::
THEME_TEMPLATES_OVERRIDES = ["templates"]
You can then define a custom template in ``templates/page.html``.
See :ref:`settings/themes` for details.
I want to use Markdown, but I got an error.
===========================================
If you try to generate Markdown content without first installing the Markdown
library, you may see a message that says ``No valid files found in content``.
Markdown is not a hard dependency for Pelican, so if you have content in
Markdown format, you will need to explicitly install the Markdown library. You
can do so by typing the following command, prepending ``sudo`` if permissions
require it::
python -m pip install markdown
Can I use arbitrary metadata in my templates?
=============================================
Yes. For example, to include a modified date in a Markdown post, one could
include the following at the top of the article::
Modified: 2012-08-08
For reStructuredText, this metadata should of course be prefixed with a colon::
:Modified: 2012-08-08
This metadata can then be accessed in templates such as ``article.html`` via::
{% if article.modified %}
Last modified: {{ article.modified }}
{% endif %}
If you want to include metadata in templates outside the article context (e.g.,
``base.html``), the ``if`` statement should instead be::
{% if article and article.modified %}
How do I make my output folder structure identical to my content hierarchy?
===========================================================================
Try these settings::
USE_FOLDER_AS_CATEGORY = False
PATH_METADATA = r"(?P<path_no_ext>.*)\..*"
ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = "{path_no_ext}.html"
How do I assign custom templates on a per-page basis?
=====================================================
It's as simple as adding an extra line of metadata to any page or article that
you want to have its own template. For example, this is how it would be handled
for content in reST format::
:template: template_name
For content in Markdown format::
Template: template_name
Then just make sure your theme contains the relevant template file (e.g.
``template_name.html``). If you just want to add a new custom template to an
existing theme, you can also provide it in a directory specified by ``THEME_TEMPLATES_OVERRIDES`` (see :ref:`settings/themes`).
How can I override the generated URL of a specific page or article?
===================================================================
Include ``url`` and ``save_as`` metadata in any pages or articles that you want
to override the generated URL. Here is an example page in reST format::
Override url/save_as page
#########################
:url: override/url/
:save_as: override/url/index.html
With this metadata, the page will be written to ``override/url/index.html``
and Pelican will use the URL ``override/url/`` to link to this page.
How can I use a static page as my home page?
============================================
The override feature mentioned above can be used to specify a static page as
your home page. The following Markdown example could be stored in
``content/pages/home.md``::
Title: Welcome to My Site
URL:
save_as: index.html
Thank you for visiting. Welcome!
If the original blog index is still wanted, it can then be saved in a
different location by setting ``INDEX_SAVE_AS = 'blog_index.html'`` for
the ``'index'`` direct template.
What if I want to disable feed generation?
==========================================
To disable feed generation, all feed settings should be set to ``None``. All
but three feed settings already default to ``None``, so if you want to disable
all feed generation, you only need to specify the following settings::
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
The word ``None`` should not be surrounded by quotes. Please note that ``None``
and ``''`` are not the same thing.
I'm getting a warning about feeds generated without SITEURL being set properly
==============================================================================
`RSS and Atom feeds require all URL links to be absolute
<https://validator.w3.org/feed/docs/rss2.html#comments>`_. In order to properly
generate links in Pelican you will need to set ``SITEURL`` to the full path of
your site.
Feeds are still generated when this warning is displayed, but links within may
be malformed and thus the feed may not validate.
Can I force Atom feeds to show only summaries instead of article content?
=========================================================================
Instead of having to open a separate browser window to read articles, the
overwhelming majority of folks who use feed readers prefer to read content
within the feed reader itself. Mainly for that reason, Pelican does not support
restricting Atom feeds to only contain summaries. Unlike Atom feeds, the RSS
feed specification does not include a separate ``content`` field, so by default
Pelican publishes RSS feeds that only contain summaries (but can optionally be
set to instead publish full content RSS feeds). So the default feed generation
behavior provides users with a choice: subscribe to Atom feeds for full content
or to RSS feeds for just the summaries.
Is Pelican only suitable for blogs?
===================================
No. Pelican can be easily configured to create and maintain any type of static
site. This may require a little customization of your theme and Pelican
configuration. For example, if you are building a launch site for your product
and do not need tags on your site, you could remove the relevant HTML code from
your theme. You can also disable generation of tag-related pages via::
TAGS_SAVE_AS = ''
TAG_SAVE_AS = ''
Why does Pelican always write all HTML files even with content caching enabled?
===============================================================================
In order to reliably determine whether the HTML output is different before
writing it, a large part of the generation environment including the template
contexts, imported plugins, etc. would have to be saved and compared, at least
in the form of a hash (which would require special handling of unhashable
types), because of all the possible combinations of plugins, pagination, etc.
which may change in many different ways. This would require a lot more
processing time and memory and storage space. Simply writing the files each
time is a lot faster and a lot more reliable.
However, this means that the modification time of the files changes every time,
so a ``rsync`` based upload will transfer them even if their content hasn't
changed. A simple solution is to make ``rsync`` use the ``--checksum`` option,
which will make it compare the file checksums in a much faster way than Pelican
would.
How to process only a subset of all articles?
=============================================
It is often useful to process only e.g. 10 articles for debugging purposes.
This can be achieved by explicitly specifying only the filenames of those
articles in ``ARTICLE_PATHS``. A list of such filenames could be found using a
command similar to ``cd content; find -name '*.md' | head -n 10``.
My tag cloud is missing/broken since I upgraded Pelican
=======================================================
In an ongoing effort to streamline Pelican, tag cloud generation has been
moved out of Pelican core and into a separate `plugin
<https://github.com/pelican-plugins/tag-cloud>`_. See the :ref:`plugins`
documentation for further information about the Pelican plugin system.
Since I upgraded Pelican my pages are no longer rendered
========================================================
Pages were available to themes as lowercase ``pages`` and uppercase ``PAGES``.
To bring this inline with the :ref:`templates-variables` section, ``PAGES`` has
been removed. This is quickly resolved by updating your theme to iterate over
``pages`` instead of ``PAGES``. Just replace::
{% for pg in PAGES %}
with something like::
{% for pg in pages %}
How can I stop Pelican from trying to parse my static files as content?
=======================================================================
Pelican's article and page generators run before it's static generator. That
means if you use a setup similar to the default configuration, where a static
source directory is defined inside a ``*_PATHS`` setting, all files that have a
valid content file ending (``.html``, ``.rst``, ``.md``, ...) will be treated
as articles or pages before they get treated as static files.
To circumvent this issue either use the appropriate ``*_EXCLUDES`` setting or
disable the offending reader via ``READERS`` if you don't need it.
Why is [arbitrary Markdown syntax] not supported?
=================================================
Pelican does not directly handle Markdown processing and instead delegates that
task to the Python-Markdown_ project, the core of which purposefully follows
the original Markdown syntax rules and not the myriad Markdown "flavors" that
have subsequently propagated. That said, Python-Markdown_ is quite modular, and
the syntax you are looking for may be provided by one of the many available
`Markdown Extensions`_. Alternatively, some folks have created Pelican plugins
that support Markdown variants, so that may be your best choice if there is a
particular variant you want to use when writing your content.
.. _Python-Markdown: https://github.com/Python-Markdown/markdown
.. _Markdown Extensions: https://python-markdown.github.io/extensions/

View file

@ -1,89 +0,0 @@
Getting started
###############
Installing
==========
You're ready? Let's go ! You can install pelican in a lot of different ways,
the simpler one is via `pip <http://pip.openplans.org/>`_::
$ pip install pelican
If you have the sources, you can install pelican using the distutils command
install. I recommend to do so in a virtualenv::
$ virtualenv .
$ source bin/activate
$ python setup.py install
Dependencies
============
At this time, pelican is dependent of the following python packages:
* feedgenerator, to generate the ATOM feeds.
* jinja2, for templating support.
* pygments, to have syntactic colorization
* docutils and Markdown
If you're not using python 2.7, you will also need `argparse`.
All those dependencies will be processed automatically if you install pelican
using setuptools/distribute or pip.
Files metadata
==============
Pelican tries to be smart enough to get the informations he needs from the
file system (for instance, about the category of your articles), but you need to
provide by hand some of those informations in your files.
You could provide the metadata in the restructured text files, using the
following syntax (give your file the `.rst` extension)::
My super title
##############
:date: 2010-10-03 10:20
:tags: thats, awesome
:category: yeah
:author: Alexis Metaireau
You can also use a markdown syntax (with a file ending in `.md`)::
Date: 2010-12-03
Title: My super title
Put you content here.
Note that none of those are mandatory: if the date is not specified, pelican will
rely on the mtime of your file, and the category can also be determined by the
directory where the rst file is. For instance, the category of
`python/foobar/myfoobar.rst` is `foobar`.
Generate your blog
==================
To launch pelican, just use the `pelican` command::
$ pelican /path/to/your/content/
And… that's all! You can see your weblog generated on the `content/` folder.
This one will just generate a simple output, with the default theme. It's not
really sexy, as it's a simple HTML output (without any style).
You can create your own style if you want, have a look to the help to see all
the options you can use::
$ pelican --help
Pages
=====
If you create a folder named `pages`, all the files in it will be used to
generate static pages.
Then, use the `DISPLAY_PAGES_ON_MENU` setting, which will add all the pages to
the menu.

156
docs/importer.rst Normal file
View file

@ -0,0 +1,156 @@
.. _import:
Importing an existing site
##########################
Description
===========
``pelican-import`` is a command-line tool for converting articles from other
software to reStructuredText or Markdown. The supported import formats are:
- Blogger XML export
- Dotclear export
- Medium export
- Tumblr API
- WordPress XML export
- RSS/Atom feed
The conversion from HTML to reStructuredText or Markdown relies on `Pandoc`_.
For Dotclear, if the source posts are written with Markdown syntax, they will
not be converted (as Pelican also supports Markdown).
.. note::
Unlike Pelican, Wordpress supports multiple categories per article. These
are imported as a comma-separated string. You have to resolve these
manually, or use a plugin such as `More Categories`_ that enables multiple
categories per article.
.. note::
Imported pages may contain links to images that still point to the original site.
So you might want to download those images into your local content and manually
re-link them from the relevant pages of your site.
Dependencies
============
``pelican-import`` has some dependencies not required by the rest of Pelican:
- *BeautifulSoup4* and *lxml*, for WordPress and Dotclear import. Can be
installed like any other Python package (``pip install BeautifulSoup4
lxml``).
- *Feedparser*, for feed import (``pip install feedparser``).
- *Pandoc*, see the `Pandoc site`_ for installation instructions on your
operating system.
.. _Pandoc: https://pandoc.org/
.. _Pandoc site: https://pandoc.org/installing.html
Usage
=====
::
pelican-import [-h] [--blogger] [--dotclear] [--tumblr] [--wpfile] [--feed]
[-o OUTPUT] [-m MARKUP] [--dir-cat] [--dir-page] [--strip-raw] [--wp-custpost]
[--wp-attach] [--disable-slugs] [-b BLOGNAME]
input|api_key
Positional arguments
--------------------
============= ============================================================================
``input`` The input file to read
``api_key`` (Tumblr only) api_key can be obtained from https://www.tumblr.com/oauth/apps
============= ============================================================================
Optional arguments
------------------
-h, --help Show this help message and exit
--blogger Blogger XML export (default: False)
--dotclear Dotclear export (default: False)
--medium Medium export (default: False)
--tumblr Tumblr API (default: False)
--wpfile WordPress XML export (default: False)
--feed Feed to parse (default: False)
-o OUTPUT, --output OUTPUT
Output path (default: content)
-m MARKUP, --markup MARKUP
Output markup format: ``rst``, ``markdown``, or ``asciidoc``
(default: ``rst``)
--dir-cat Put files in directories with categories name
(default: False)
--dir-page Put files recognised as pages in "pages/" sub-
directory (blogger and wordpress import only)
(default: False)
--filter-author Import only post from the specified author
--strip-raw Strip raw HTML code that can't be converted to markup
such as flash embeds or iframes (default: False)
--wp-custpost Put wordpress custom post types in directories. If
used with --dir-cat option directories will be created
as "/post_type/category/" (wordpress import only)
--wp-attach Download files uploaded to wordpress as attachments.
Files will be added to posts as a list in the post
header and links to the files within the post will be
updated. All files will be downloaded, even if they
aren't associated with a post. Files will be downloaded
with their original path inside the output directory,
e.g. "output/wp-uploads/date/postname/file.jpg".
(wordpress import only) (requires an internet
connection)
--disable-slugs Disable storing slugs from imported posts within
output. With this disabled, your Pelican URLs may not
be consistent with your original posts. (default:
False)
-b BLOGNAME, --blogname=BLOGNAME
Blog name used in Tumblr API
Examples
========
For Blogger::
$ pelican-import --blogger -o ~/output ~/posts.xml
For Dotclear::
$ pelican-import --dotclear -o ~/output ~/backup.txt
For Medium::
$ pelican-import --medium -o ~/output ~/medium-export/posts/
The Medium export is a zip file. Unzip it, and point this tool to the
"posts" subdirectory. For more information on how to export, see
https://help.medium.com/hc/en-us/articles/115004745787-Export-your-account-data.
For Tumblr::
$ pelican-import --tumblr -o ~/output --blogname=<blogname> <api_key>
For WordPress::
$ pelican-import --wpfile -o ~/output ~/posts.xml
For Medium (an example of using an RSS feed):
$ python -m pip install feedparser
$ pelican-import --feed https://medium.com/feed/@username
.. note::
The RSS feed may only return the most recent posts — not all of them.
Tests
=====
To test the module, one can use sample files:
- for WordPress: https://www.wpbeginner.com/wp-themes/how-to-add-dummy-content-for-theme-development-in-wordpress/
- for Dotclear: http://media.dotaddict.org/tda/downloads/lorem-backup.txt
.. _More Categories: https://github.com/pelican-plugins/more-categories

View file

@ -1,52 +1,74 @@
Pelican
#######
Pelican |release|
=================
Pelican is a simple weblog generator, writen in python.
Pelican is a static site generator, written in Python_. Highlights include:
* Write your weblog entries directly with your editor of choice (vim!) and
directly in restructured text, or markdown.
* A simple cli-tool to (re)generate the weblog.
* Easy to interface with DVCSes and web hooks
* Completely static output, so easy to host anywhere !
* Write your content directly with your editor of choice in reStructuredText_
or Markdown_ formats
* Includes a simple CLI tool to (re)generate your site
* Easy to interface with distributed version control systems and web hooks
* Completely static output is easy to host anywhere
Ready to get started? Check out the :doc:`Quickstart<quickstart>` guide.
Features
========
--------
Pelican currently supports:
Pelicans feature highlights include:
* blog articles
* comments, via an external service (disqus). Please notice that while
it's useful, it's an external service, and you'll not manage the
comments by yourself. It could potentially eat your data.
* theming support (themes are done using `jinja2 <http://jinjna.pocoo.org>`_)
* PDF generation of the articles/pages (optional).
* Articles (e.g., blog posts) and pages (e.g., "About", "Projects", "Contact")
* Integration with external services
* Site themes (created using Jinja2_ templates)
* Publication of articles in multiple languages
* Generation of Atom and RSS feeds
* Code syntax highlighting
* Import existing content from WordPress, Dotclear, or RSS feeds
* Fast rebuild times thanks to content caching and selective output writing
* Extensible via a rich plugin ecosystem: `Pelican Plugins`_
Why the name "Pelican" ?
========================
Why the name "Pelican"?
-----------------------
Heh, you didn't noticed? "Pelican" is an anagram for "Calepin" ;)
"Pelican" is an anagram for *calepin*, which means "notebook" in French. ;)
Source code
===========
-----------
You can access the source code via mercurial at http://hg.notmyidea.org/pelican/
or via git on http://github.com/ametaireau/pelican/
You can access the source code at: https://github.com/getpelican/pelican
Feedback !
==========
How to get help, contribute, or provide feedback
------------------------------------------------
If you want to see new features in Pelican, dont hesitate to tell me, to clone
the repository, etc. That's open source, dude!
Contact me at "alexis at notmyidea dot org" for any request/feedback !
See our :doc:`feedback and contribution submission guidelines <contribute>`.
Documentation
=============
-------------
.. toctree::
:maxdepth: 2
getting_started
quickstart
install
content
publish
settings
plugins
themes
pelican-themes
importer
faq
tips
contribute
internals
report
changelog
.. Links
.. _Python: https://www.python.org/
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
.. _Markdown: https://daringfireball.net/projects/markdown/
.. _Jinja2: https://palletsprojects.com/p/jinja/
.. _`Pelican documentation`: https://docs.getpelican.com/latest/
.. _`Pelican's internals`: https://docs.getpelican.com/en/latest/internals.html
.. _`Pelican Plugins`: https://github.com/pelican-plugins

122
docs/install.rst Normal file
View file

@ -0,0 +1,122 @@
Installing Pelican
##################
Pelican currently runs best on |min_python|; earlier versions of Python are not supported.
You can install Pelican via several different methods. The simplest is via Pip_::
python -m pip install pelican
Or, if you plan on using Markdown::
python -m pip install "pelican[markdown]"
(Keep in mind that some operating systems will require you to prefix the above
command with ``sudo`` in order to install Pelican system-wide.)
While the above is the simplest method, the recommended approach is to create a
virtual environment for Pelican via virtualenv_ before installing Pelican.
Assuming you have virtualenv_ installed, you can then open a new terminal
session and create a new virtual environment for Pelican::
virtualenv ~/virtualenvs/pelican
cd ~/virtualenvs/pelican
source bin/activate
Once the virtual environment has been created and activated, Pelican can be
installed via ``python -m pip install pelican`` as noted above. Alternatively, if you
have the project source, you can install Pelican using the setuptools method::
cd path-to-Pelican-source
python -m pip install .
If you have Git installed and prefer to install the latest bleeding-edge
version of Pelican rather than a stable release, use the following command::
python -m pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican"
Once Pelican is installed, you can run ``pelican --help`` to see basic usage
options. For more detail, refer to the :doc:`Publish<publish>` section.
Optional packages
-----------------
If you plan on using `Markdown <https://pypi.org/project/Markdown/>`_ as a
markup format, you can install Pelican with Markdown support::
python -m pip install "pelican[markdown]"
Typographical enhancements can be enabled in your settings file, but first the
requisite `Typogrify <https://pypi.org/project/typogrify/>`_ library must be
installed::
python -m pip install typogrify
Dependencies
------------
When Pelican is installed, the following dependent Python packages should be
automatically installed without any action on your part:
* `feedgenerator <https://pypi.org/project/feedgenerator/>`_, to generate the
Atom feeds
* `jinja2 <https://pypi.org/project/Jinja2/>`_, for templating support
* `pygments <https://pypi.org/project/Pygments/>`_, for syntax highlighting
* `docutils <https://pypi.org/project/docutils/>`_, for supporting
reStructuredText as an input format
* `blinker <https://pypi.org/project/blinker/>`_, an object-to-object and
broadcast signaling system
* `unidecode <https://pypi.org/project/Unidecode/>`_, for ASCII
transliterations of Unicode text
utilities
* `MarkupSafe <https://pypi.org/project/MarkupSafe/>`_, for a markup-safe
string implementation
* `python-dateutil <https://pypi.org/project/python-dateutil/>`_, to read
the date metadata
Upgrading
---------
If you installed a stable Pelican release via Pip_ and wish to upgrade to
the latest stable release, you can do so by adding ``--upgrade``::
python -m pip install --upgrade pelican
If you installed Pelican via distutils or the bleeding-edge method, simply
perform the same step to install the most recent version.
Kickstart your site
-------------------
Once Pelican has been installed, you can create a skeleton project via the
``pelican-quickstart`` command, which begins by asking some questions about
your site::
pelican-quickstart
If run inside an activated virtual environment, ``pelican-quickstart`` will
look for an associated project path inside ``$VIRTUAL_ENV/.project``. If that
file exists and contains a valid directory path, the new Pelican project will
be saved at that location. Otherwise, the default is the current working
directory. To set the new project path on initial invocation, use:
``pelican-quickstart --path /your/desired/directory``
Once you finish answering all the questions, your project will consist of the
following hierarchy (except for *pages* — shown in parentheses below — which
you can optionally add yourself if you plan to create non-chronological
content)::
yourproject/
├── content
│ └── (pages)
├── output
├── tasks.py
├── Makefile
├── pelicanconf.py # Main settings file
└── publishconf.py # Settings to use when ready to publish
The next step is to begin to adding content to the *content* folder that has
been created for you.
.. _Pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/en/latest/

View file

@ -1,81 +1,98 @@
Pelican internals
#################
This section describe how pelican is working internally. As you'll see, it's
quite simple, but a bit of documentation doesn't hurt :)
This section describe how Pelican works internally. As you'll see, it's quite
simple, but a bit of documentation doesn't hurt. :)
You can also find in the :doc:`report` section an excerpt of a report the
original author wrote with some software design information.
.. _report: :doc:`report`
Overall structure
=================
What `pelican` does, is taking a list of files, and processing them, to some
sort of output. Usually, the files are restructured text and markdown files,
and the output is a blog, but it can be anything you want.
What Pelican does is take a list of files and process them into some sort of
output. Usually, the input files are reStructuredText and Markdown files, and
the output is a blog, but both input and output can be anything you want.
I've separated the logic in different classes and concepts:
The logic is separated into different classes and concepts:
* `writers` are responsible of all the writing process of the
files. It's writing .html files, RSS feeds and so on. Since those operations
are commonly used, the object is created once, and then passed to the
generators.
* **Writers** are responsible for writing files: .html files, RSS feeds, and so
on. Since those operations are commonly used, the object is created once and
then passed to the generators.
* `readers` are used to read from various formats (Markdown, and Restructured
Text for now, but the system is extensible). Given a file, they return
metadata (author, tags, category etc) and content (HTML formated)
* **Readers** are used to read from various formats (HTML, Markdown and
reStructuredText for now, but the system is extensible). Given a file, they
return metadata (author, tags, category, etc.) and content (HTML-formatted).
* `generators` generate the different outputs. For instance, pelican comes with
`ArticlesGenerator` and `PageGenerator`, into others. Given
a configurations, they can do whatever they want. Most of the time it's
generating files from inputs.
* **Generators** generate the different outputs. For instance, Pelican comes
with ``ArticlesGenerator`` and ``PageGenerator``. Given a configuration, they
can do whatever they want. Most of the time, it's generating files from
inputs.
* `pelican` also uses `templates`, so it's easy to write you own theme. The
syntax is `jinja2`, and, trust me, really easy to learn, so don't hesitate
a second.
* Pelican also uses templates, so it's easy to write your own theme. The
syntax is `Jinja2 <https://palletsprojects.com/p/jinja/>`_ and is very easy to learn, so
don't hesitate to jump in and build your own theme.
How to implement a new reader ?
===============================
How to implement a new reader?
==============================
There is an awesome markup language you want to add to pelican ?
Well, the only thing you have to do is to create a class that have a `read`
method, that is returning an HTML content and some metadata.
Is there an awesome markup language you want to add to Pelican? Well, the only
thing you have to do is to create a class with a ``read`` method that returns
HTML content and some metadata.
Take a look to the Markdown reader::
Take a look at the Markdown reader::
class MarkdownReader(object):
from pelican.readers import BaseReader
from pelican.utils import pelican_open
from markdown import Markdown
def read(self, filename):
class MarkdownReader(BaseReader):
enabled = True
def read(self, source_path):
"""Parse content and metadata of markdown files"""
text = open(filename)
md = Markdown(extensions = ['meta', 'codehilite'])
content = md.convert(text)
metadatas = {}
with pelican_open(source_path) as text:
md_extensions = {'markdown.extensions.meta': {},
'markdown.extensions.codehilite': {}}
md = Markdown(extensions=md_extensions.keys(),
extension_configs=md_extensions)
content = md.convert(text)
metadata = {}
for name, value in md.Meta.items():
if name in _METADATAS_FIELDS:
meta = _METADATAS_FIELDS[name](value[0])
else:
meta = value[0]
metadatas[name.lower()] = meta
return content, metadatas
name = name.lower()
meta = self.process_metadata(name, value[0])
metadata[name] = meta
return content, metadata
Simple isn't it ?
Simple, isn't it?
How to implement a new generator ?
==================================
If your new reader requires additional Python dependencies, then you should
wrap their ``import`` statements in a ``try...except`` block. Then inside the
reader's class, set the ``enabled`` class attribute to mark import success or
failure. This makes it possible for users to continue using their favourite
markup method without needing to install modules for formats they don't use.
Generators have basically two important methods. You're not forced to create
both, only the existing ones will be called.
How to implement a new generator?
=================================
* `generate_context`, that is called in a first place, for all the generators.
Generators have two important methods. You're not forced to create both; only
the existing ones will be called.
* ``generate_context``, that is called first, for all the generators.
Do whatever you have to do, and update the global context if needed. This
context is shared between all generators, and will be passed to the
templates. For instance, the `PageGenerator` `generate_context` method find
all the pages, transform them into objects, and populate the context with
them. Be careful to *not* output anything using this context at this stage,
as it is likely to change by the effect of others generators.
templates. For instance, the ``PageGenerator`` ``generate_context`` method
finds all the pages, transforms them into objects, and populates the context
with them. Be careful *not* to output anything using this context at this
stage, as it is likely to change by the effect of other generators.
* `generate_output` is then called. And guess what is it made for ? Oh,
generating the output :) That's here that you may want to look at the context
and call the methods of the `writer` object, that is passed at the first
argument of this function. In the `PageGenerator` example, this method will
look at all the pages recorded in the global context, and output a file on
the disk (using the writer method `write_file`) for each page encountered.
* ``generate_output`` is then called. And guess what is it made for? Oh,
generating the output. :) It's here that you may want to look at the context
and call the methods of the ``writer`` object that is passed as the first
argument of this function. In the ``PageGenerator`` example, this method will
look at all the pages recorded in the global context and output a file on the
disk (using the writer method ``write_file``) for each page encountered.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,669 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-13 11:46+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.17.0\n"
#: ../../contribute.rst:2 848b6c0ec944440791d56b25e314a8ab
msgid "Contributing and feedback guidelines"
msgstr "项目贡献与意见反馈"
#: ../../contribute.rst:4 e8b8762778fd461db0934f07e4fc1fc5
msgid ""
"There are many ways to contribute to Pelican. You can improve the "
"documentation, add missing features, and fix bugs (or just report them). "
"You can also help out by reviewing and commenting on `existing issues "
"<https://github.com/getpelican/pelican/issues>`_."
msgstr ""
"有很多渠道可以参与到贡献项目中来例如帮助改进文档、添加缺失的特性、修复与报告bug。可以从查看 `已有 issues "
"<https://github.com/getpelican/pelican/issues>`_ 开始。"
#: ../../contribute.rst:9 103b2f2862c4469695e4c6aff2321a8d
msgid ""
"Don't hesitate to fork Pelican and submit an issue or pull request on "
"GitHub. When doing so, please consider the following guidelines."
msgstr "随时随地都可以fork Pelican或是在GitHub上提交issue或PR。"
#: ../../../CONTRIBUTING.rst:2 5ad44a6fdf0b45eaaa800023139694f8
msgid "Filing issues"
msgstr "提出issue"
#: ../../../CONTRIBUTING.rst:4 c7e2bb966f49419aba7ed7027a977043
msgid "Before you submit a new issue, try `asking for help`_ first."
msgstr "在你提交一个新的issue之前可以先尝试 `请求他人帮助`_ 。"
#: ../../../CONTRIBUTING.rst:5 a287bb06699b4db79d6dd7491bbe031b
msgid ""
"If determined to create a new issue, first search `Pelican Discussions`_ "
"and `existing issues`_ (open and closed) to see if your question has "
"already been answered previously."
msgstr ""
"当你决定要提出新的issue时先在 `Pelican的讨论版`_ 和 `已有issues`_ "
"中搜索一下开放关闭的issue都搜一下来看看你的问题是不是有人之前已经提出过。"
#: ../../../CONTRIBUTING.rst:14 d4a600f2338b458e822aba90e54d4cfd
msgid "How to get help"
msgstr "如何获取帮助"
#: ../../../CONTRIBUTING.rst:16 db3264afde384c2891d9be7205578556
msgid "Before you ask for help, please make sure you do the following:"
msgstr "在寻求帮助之前,请先尝试如下步骤:"
#: ../../../CONTRIBUTING.rst:18 3581147764244a548cd2898faaa7799a
msgid ""
"Read the documentation_ thoroughly. If in a hurry, at least use the "
"search field that is provided at top-left on the documentation_ pages. "
"Make sure you read the docs for the Pelican version you are using."
msgstr ""
"完整阅读 documentation_ 。如果你很急,至少先在 documentation_ "
"左上角的搜索栏中尝试搜索。确保你阅读的文档和使用的Pelican版本相匹配。"
#: ../../../CONTRIBUTING.rst:21 d8e467909ec64ba7900da93b3765bfa6
msgid ""
"Use a search engine (e.g., DuckDuckGo, Google) to search for a solution "
"to your problem. Someone may have already found a solution, perhaps in "
"the form of a ':pelican-doc:`plugins` or a specific combination of "
"settings."
msgstr ""
"使用搜索引擎(例如 DuckDuckGo、Google搜索遇到问题的解决方案。互联网上可能已经有人遇到过相同的问题解决方法可能包括使用某些 "
":pelican-doc:`plugins` 或配置一系列的设置选项。"
#: ../../../CONTRIBUTING.rst:25 2011839b36504c41b307cc9f817c4a46
msgid "Try reproducing the issue in a clean environment, ensuring you are using:"
msgstr "尝试在一个尽可能简单的环境中重现问题,并确保以下几点:"
#: ../../../CONTRIBUTING.rst:27 2d64217ea3e54dc58a371fc11a6ece8e
msgid ""
"latest Pelican release (or an up-to-date Git clone of Pelican ``main`` "
"branch)"
msgstr "使用最新版本的Pelican或是用Git克隆Pelican的main分支"
#: ../../../CONTRIBUTING.rst:28 721ca09c5a9a495b9fbb6aa86df8be28
msgid "latest releases of libraries used by Pelican"
msgstr "将Pelican使用的库升级到最新版本"
#: ../../../CONTRIBUTING.rst:29 bbe722bd2be748219d38c134f29569dd
msgid "no plugins or only those related to the issue"
msgstr "此环境中没有使用插件或是只使用和问题相关的插件"
#: ../../../CONTRIBUTING.rst:31 e9f337f01ca546be93bd1d18884a1685
msgid ""
"**NOTE:** The most common sources of problems are anomalies in (1) "
"themes, (2) plugins, (3) settings files, and (4) ``make``/``invoke`` "
"automation wrappers. If you can't reproduce your problem when using the "
"following steps to generate your site, then the problem is almost "
"certainly with one of the above-listed elements (and not Pelican "
"itself)::"
msgstr ""
"**注意:** 最常见的问题基本上都产生于主题、插件、设置文件和自动化工具 ``make``/``invoke`` "
"中。如果按照下述步骤生成站点后无法复现之前的问题那么几乎可以肯定问题出在这四个地方而不在Pelican本身"
#: ../../../CONTRIBUTING.rst:41 1420bb3dd096480289b3da1534d7bf64
msgid ""
"If you can generate your site without problems using the steps above, "
"then your problem is unlikely to be caused by Pelican itself, and "
"therefore please consider reaching out to the maintainers of the "
"plugins/theme you are using instead of raising the topic with the Pelican"
" core community."
msgstr "如果按照上述步骤能够正常生成站点那么你的问题不太可能是由Pelican本身导致的请考虑联系对应插件/主题的维护者而不是在Pelican内核的社区中提出问题。"
#: ../../../CONTRIBUTING.rst:46 bdb7575fa4c74c0891fd686794cc84fd
msgid ""
"If despite the above efforts you still cannot resolve your problem, be "
"sure to include in your inquiry the following information, preferably in "
"the form of links to content uploaded to a `paste service`_, GitHub "
"repository, or other publicly-accessible location:"
msgstr ""
"经过上面这些努力,若您仍无法解决问题,确保你的提问中包括如下信息,可以以 `paste service`_ "
"链接、GitHub仓库或者其他可公开获取的形式提供"
#: ../../../CONTRIBUTING.rst:51 b559dc6ca72649baa754cb14d1ac77ca
msgid ""
"Describe what version of Pelican you are running (output of ``pelican "
"--version`` or the HEAD commit hash if you cloned the repo) and how "
"exactly you installed it (the full command you used, e.g. ``python -m pip"
" install pelican``)."
msgstr ""
"描述正在运行的Pelican版本信息可以通过 ``pelican --version`` 命令得到如果clone的源仓库则可以查看HEAD "
"commit的哈希值以及你是如何安装Pelican的要包括使用到的命令例如 ``python -m pip install "
"pelican``"
#: ../../../CONTRIBUTING.rst:54 d09a0393a4c1462b878c1adf31a7537d
msgid ""
"If you are looking for a way to get some end result, prepare a detailed "
"description of what the end result should look like (preferably in the "
"form of an image or a mock-up page) and explain in detail what you have "
"done so far to achieve it."
msgstr "如果你希望产生某种特定的最终结果,请详细描述此最终结果是什么样的(最好以图片或者伪页面的形式),,并且细致讲述你做了哪些尝试。"
#: ../../../CONTRIBUTING.rst:58 720ee9dbccc74dccbabb994a2d36638d
msgid ""
"If you are trying to solve some issue, prepare a detailed description of "
"how to reproduce the problem. If the issue cannot be easily reproduced, "
"it cannot be debugged by developers or volunteers. Describe only the "
"**minimum steps** necessary to reproduce it (no extra plugins, etc.)."
msgstr ""
"如果你在尝试解决某些问题,请详细描述如何复现此问题。如果问题很难被复现,其他开发者和志愿者就很难进行调试。尽量只写出复现该问题的 **最少步骤**"
" (无额外插件)。"
#: ../../../CONTRIBUTING.rst:62 34bdc49c617643d8ae7adb6a433a88fe
msgid ""
"Upload your settings file or any other custom code that would enable "
"people to reproduce the problem or to see what you have already tried to "
"achieve the desired end result."
msgstr "上传你的配置文件以及所有自定义过的代码,这可以使得大家能够重现问题或者看到你已经做出的尝试。"
#: ../../../CONTRIBUTING.rst:65 03c88e23c7b54117aa69e003c8bbef6e
msgid ""
"Upload detailed and **complete** output logs and backtraces (remember to "
"add the ``--debug`` flag: ``pelican --debug content [...]``)"
msgstr ""
"上传详细 **完整** 的输出日志以及backtraces信息记得在执行pelican命令时加上 ``--debug`` 标记: "
"``pelican --debug content [...]`` "
#: ../../../CONTRIBUTING.rst:71 953240a12cd64be7b9375a4571193314
msgid ""
"Once the above preparation is ready, you can post your query as a new "
"thread in `Pelican Discussions`_. Remember to include all the information"
" you prepared."
msgstr "一旦做好了上述准备,就可以在 `Pelican Discussions`_ 中发起你的问题了。记得在请求中附上收集好的信息。"
#: ../../../CONTRIBUTING.rst:75 e9f48bdfc6c744f282c70da3ac581052
msgid "Contributing code"
msgstr "贡献代码"
#: ../../../CONTRIBUTING.rst:77 888be6bde2de42a49705f29443a519c1
msgid ""
"Before you submit a contribution, please ask whether it is desired so "
"that you don't spend a lot of time working on something that would be "
"rejected for a known reason. Consider also whether your new feature might"
" be better suited as a ':pelican-doc:`plugins` — you can `ask for help`_"
" to make that determination."
msgstr ""
"在提交代码修改前,请先询问是否需要此修改,以免你做的工作因为已知原因而被拒绝。想想要添加的新特性是否更适合以 :pelican-doc:`插件` "
"形式完成。可以通过 `如何获取帮助`_ 来帮助你作出决定。"
#: ../../../CONTRIBUTING.rst:82 6e1329bbd8354c30b8ffa07f18894d3f
msgid ""
"Also, if you intend to submit a pull request to address something for "
"which there is no existing issue, there is no need to create a new issue "
"and then immediately submit a pull request that closes it. You can submit"
" the pull request by itself."
msgstr "另外如果你的PR是为了解决一个目前没有在issue中出现过的问题那么就没有必要先创建一个新的issue而是可以直接提起PR。"
#: ../../../CONTRIBUTING.rst:87 bca476812a33487c98d6aa840820671b
msgid "Using Git and GitHub"
msgstr "使用Git与GitHub"
#: ../../../CONTRIBUTING.rst:89 51f8df6063a544baabf35ef3bae28e83
msgid ""
"`Create a new branch`_ specific to your change (as opposed to making your"
" commits in the ``main`` branch)."
msgstr "`创建一个新的分支`_ 来标记你做的修改(而不是直接在主分支中提交)。"
#: ../../../CONTRIBUTING.rst:91 6c419972402444d5976574902311e2d7
msgid ""
"**Don't put multiple unrelated fixes/features in the same branch / pull "
"request.** For example, if you're working on a new feature and find a "
"bugfix that doesn't *require* your new feature, **make a new distinct "
"branch and pull request** for the bugfix. Similarly, any proposed changes"
" to code style formatting should be in a completely separate pull "
"request."
msgstr ""
"**不要把多个无关联的修复/特性修改放在同一个分支/拉去请求中。** 如果当你在做新特性的时候发现了一个bug可以修复但修复这个bug "
"*不需要用到* 这个新特性, **那么请另外创建一个分支并拉取请求。** 类似的,任何对代码风格的格式化都应该在单独的请求中拉取。"
#: ../../../CONTRIBUTING.rst:96 ced35621749d426a8e39fdeb9b0f7c90
msgid ""
"Add a ``RELEASE.md`` file in the root of the project that contains the "
"release type (major, minor, patch) and a summary of the changes that will"
" be used as the release changelog entry. For example::"
msgstr ""
"在项目根目录下添加 ``RELEASE.md`` "
"文件在其中包含release的类型主要、次要、补丁以及对项目改变的概述这些内容会作为该release发布日志的一部分。下面是一个例子"
#: ../../../CONTRIBUTING.rst:104 ca6b2bf54f5248cbb7d90edb678478fc
msgid ""
"Check for unnecessary whitespace via ``git diff --check`` before "
"committing."
msgstr "在提交前使用 ``git diff --check`` 来检查是否有无意义的空白字符。"
#: ../../../CONTRIBUTING.rst:105 48776b48e4924398b7632b8f05141e78
msgid ""
"First line of your commit message should start with present-tense verb, "
"be 50 characters or less, and include the relevant issue number(s) if "
"applicable. *Example:* ``Ensure proper PLUGIN_PATH behavior. Refs #428.``"
" If the commit *completely fixes* an existing bug report, please use "
"``Fixes #585`` or ``Fix #585`` syntax (so the relevant issue is "
"automatically closed upon PR merge)."
msgstr ""
"commit信息的第一行应该以现在时动词开头并且第一行尽量保持在50字以下并且包含相关联issue的编号如果有的话。 例如: "
"``Ensure proper PLUGIN_PATH behavior. Refs #428.`` 如果此项提交 *完全修复* "
"了某项已报告的bug请使用例如 ``Fixes #585`` 或 ``Fix #585`` "
"的语法这样的话相关的issue会在PR合并后自动关闭。"
#: ../../../CONTRIBUTING.rst:110 75acb68d9eaa4230ae230f016bf77b6c
msgid ""
"After the first line of the commit message, add a blank line and then a "
"more detailed explanation (when relevant)."
msgstr "在第一行commit信息后添加一行空白行再进行更多相关的细节描述。"
#: ../../../CONTRIBUTING.rst:112 51e3a16f76364d91a9abf219c731ff80
msgid ""
"`Squash your commits`_ to eliminate merge commits and ensure a clean and "
"readable commit history."
msgstr "`压缩commit`_ 来消除合并commits确保你的commit历史记录是干净可读的。"
#: ../../../CONTRIBUTING.rst:114 01ddd9df01024d38a8de79122a91cc07
msgid ""
"After you have issued a pull request, the continuous integration (CI) "
"system will run the test suite on all supported Python versions and check"
" for code style compliance. If any of these checks fail, you should fix "
"them. (If tests fail on the CI system but seem to pass locally, ensure "
"that local test runs aren't skipping any tests.)"
msgstr "在你发出PR后持续集成CI系统会在所有支持的Python版本上运行测试套件并且检查代码风格的合规性。如果出现了错误你应该将其修复。如果没有通过CI系统上的测试但是本地测试通过了请再检查一下确保在本地进行了所有CI系统中的检查"
#: ../../../CONTRIBUTING.rst:121 bc27587df397410a9bb272f0851756a3
msgid "Contribution quality standards"
msgstr "贡献的质量标准"
#: ../../../CONTRIBUTING.rst:123 2cf100b3e98b43e5b841493887a1d8be
msgid ""
"Adhere to the project's code style standards. See: `Development "
"Environment`_"
msgstr "遵循项目的代码风格标准。详见 `开发环境`_"
#: ../../../CONTRIBUTING.rst:124 fffad000d6ca490291bd09cb18fcc75a
msgid ""
"Ensure your code is compatible with the `officially-supported Python "
"releases`_."
msgstr "确保你的代码可以兼容 `python的官方发布版本`_"
#: ../../../CONTRIBUTING.rst:125 907e4426cbc643fb9075e32be169ba42
msgid ""
"Add docs and tests for your changes. Undocumented and untested features "
"will not be accepted."
msgstr "请为你修改的内容添加文档与测试。未注有文档或没有对应测试的特性会被拒绝。"
#: ../../../CONTRIBUTING.rst:127 d2bcbeeb9c0541c2a5ac5ec589a16ca4
msgid ""
":pelican-doc:`Run all the tests <contribute>` **on all versions of Python"
" supported by Pelican** to ensure nothing was accidentally broken."
msgstr ""
"**在Pelican支持的所有Python版本上** :pelican-doc:`执行所有测试 <contribute>` "
",以确保没有意料之外的问题。"
#: ../../../CONTRIBUTING.rst:130 26daa76aea674039be278882a95422f5
msgid ""
"Check out our `Git Tips`_ page or `ask for help`_ if you need assistance "
"or have any questions about these guidelines."
msgstr "若需要帮助或对以上指南有任何疑惑,还可以查看我们的 `Git提示`_ 页面和 `请求帮助`_ 部分。"
#: ../../contribute.rst:15 b4a94275e9c14d8795fa54473ee2f05b
msgid "Setting up the development environment"
msgstr "配置开发环境"
#: ../../contribute.rst:17 a0eb6948883742d2a00665a576ef6aba
msgid ""
"While there are many ways to set up one's development environment, the "
"following instructions will utilize Pip_ and PDM_. These tools facilitate"
" managing virtual environments for separate Python projects that are "
"isolated from one another, so you can use different packages (and package"
" versions) for each."
msgstr ""
"在配置开发环境时往往有很多种方式,但下面的指南会使用 Pip_ 和 PDM_ "
"完成配置。这两个工具都可以用于管理虚拟环境使得不同的Python项目相互隔离这样就可以很方便的在不同的项目中使用不同的库以及不同的库版本。"
#: ../../contribute.rst:22 4c5c4d91e6964d709d01102e32310642
msgid "Please note that Python |min_python| is required for Pelican development."
msgstr "请注意要进行Pelican的开发至少需要Python |min_python|"
#: ../../contribute.rst:24 5419157e28984a618fc1f0df81deb620
msgid ""
"*(Optional)* If you prefer to `install PDM "
"<https://pdm.fming.dev/latest/#installation>`_ once for use with multiple"
" projects, you can install it via::"
msgstr ""
"*(可选)* 若您想要 `安装PDM <https://pdm.fming.dev/latest/#installation>`_ "
",可以使用下面这条命令:"
#: ../../contribute.rst:29 a9d08dc294cb4857a58d2c63eae98a15
msgid ""
"Point your web browser to the `Pelican repository`_ and tap the **Fork** "
"button at top-right. Then clone the source for your fork and add the "
"upstream project as a Git remote::"
msgstr ""
"在Web浏览器中进入 `Pelican的代码仓库`_ ,点击右上角的 **Fork** "
"按钮。然后克隆你自己的这份fork最后添加项目的原仓库为远程仓库upstream"
#: ../../contribute.rst:38 4c8ebbf9839441ca9364eeb1d25b180f
msgid ""
"While PDM can dynamically create and manage virtual environments, we're "
"going to manually create and activate a virtual environment::"
msgstr "通过下面的命令可以手动创建并激活一个虚拟环境:"
#: ../../contribute.rst:45 ../../contribute.rst:186
#: 2afe046c20814fe5b3de9a65606505f1 6ec60e6a37b642edb68af7ed1bc82c0b
msgid "Install the needed dependencies and set up the project::"
msgstr "安装必需的依赖并配置项目:"
#: ../../contribute.rst:50 59d5dabaab1d409c8873187e5664fe67
msgid "Your local environment should now be ready to go!"
msgstr "现在,你的本地开发环境就配置完成了!"
#: ../../contribute.rst:57 6fdce76f8ec64275b24366ff03cc6340
msgid "Development"
msgstr "开发"
#: ../../contribute.rst:59 1d1a814a5dba40bcb84ce824d6312805
msgid ""
"Once Pelican has been set up for local development, create a topic branch"
" for your bug fix or feature::"
msgstr "在配置好Pelican的本地开发环境后请先为你的bug修复或特性增加创建一个分支"
#: ../../contribute.rst:64 773cdd3a48894e11a62cb24b25ef4829
msgid ""
"Now you can make changes to Pelican, its documentation, and/or other "
"aspects of the project."
msgstr "在切换到新建的分支后就可以开始对Pelican的文档或其他内容做更改了。"
#: ../../contribute.rst:68 bb120553218b4d0699998fbaf00d32c0
msgid "Setting up ``git blame`` (optional)"
msgstr "配置 ``git blame`` (可选)"
#: ../../contribute.rst:70 644fae63e5ea4e66a24e35a7ada3524c
msgid ""
"``git blame`` annotates lines in a file with information about the pull "
"request that last modified it. Sweeping shallow changes (like formatting)"
" can make that information less useful, so we keep a list of such changes"
" to be ignored. Run the following command to set this up in your "
"repository, adding ``--global`` if you want this setting to apply to all "
"repositories::"
msgstr ""
"``git blame`` "
"会在文件中的行上标注有关最后一次修改该行的PR信息。对浅层变化如格式化进行批量更改可能会使这些信息变得不那么有用因此我们维护一个包含此类更改的列表以便忽略它们。运行以下命令在您的存储库中设置此配置如果希望此设置适用于所有存储库请添加"
" ``--global`` "
#: ../../contribute.rst:78 68b7031047e94e03b0e1b0ea39d0355e
msgid ""
"As noted in a `useful article`_ about ``git blame``, there are other "
"related settings you may find to be beneficial::"
msgstr "就像在 `这篇文章`_ 中提到的,还可以进行一些可能有用的额外设置:"
#: ../../contribute.rst:89 c33fd6178fb044dda7073f1fc2cce979
msgid "Running the test suite"
msgstr "运行测试套件"
#: ../../contribute.rst:91 5b51e49bc1ca42c6916c4dceed476057
msgid ""
"Each time you make changes to Pelican, there are two things to do "
"regarding tests: check that the existing tests pass, and add tests for "
"any new features or bug fixes. The tests are located in "
"``pelican/tests``, and you can run them via::"
msgstr ""
"每次对Pelican做出修改后在测试方面需要做两个工作检查是否能通过已有的测试、为新增特性或bug修复创建测试。请将自动化测试文件放在 "
"``pelican/tests`` 中,接着执行以下命令:"
#: ../../contribute.rst:98 0e03b29d89cc408e9374cb51f7147611
msgid ""
"(For more on Invoke, see ``invoke -l`` to list tasks, or "
"https://pyinvoke.org for documentation.)"
msgstr "(执行 ``invoke -l`` 会列出可以调用的测试任务,关于此的更多文档请参阅 https://pyinvoke.org "
#: ../../contribute.rst:101 70aad8c721c64d2b8d32488dd9da851e
msgid ""
"In addition to running the test suite, it is important to also ensure "
"that any lines you changed conform to code style guidelines. You can "
"check that via::"
msgstr "除了运行测试套件外,还要确保修改了的部分遵循代码风格指南。可以通过下面的命令检查代码风格:"
#: ../../contribute.rst:106 ../../contribute.rst:200
#: b0ff008dde5e4e0b892e0fc2fa959b6a
msgid ""
"If style violations are found, many of them can be addressed "
"automatically via::"
msgstr "若存在不合规范风格的代码,大多数情况下可以通过下述命令自动纠正:"
#: ../../contribute.rst:111 ebad1e2cb63a45d999d2d3e510711972
msgid ""
"If code style violations are found in lines you changed, correct those "
"lines and re-run the ``invoke lint`` command until they have all been "
"fixed. You do not need to address style violations, if any, for code "
"lines you did not touch."
msgstr "如果在修改过的代码中有地方违反了代码风格规范,请纠正并再次运行上述命令,直到全部纠正。但是若是发现违反代码风格的地方并不是你修改的,请忽略之,不要进行纠正。"
#: ../../contribute.rst:115 e208ada16ab8425e9fbbcd5f135f6574
msgid ""
"After making your changes and running the tests, you may see a test "
"failure mentioning that \"some generated files differ from the expected "
"functional tests output.\" If you have made changes that affect the HTML "
"output generated by Pelican, and the changes to that output are expected "
"and deemed correct given the nature of your changes, then you should "
"update the output used by the functional tests. To do so, **make sure you"
" have both** ``en_EN.utf8`` **and** ``fr_FR.utf8`` **locales installed**,"
" and then run the following command::"
msgstr ""
"在修改完代码运行测试的过程中你可能会看到测试失败中有提到“some generated files differ from the "
"expected functional tests output” "
"。这可能是由于你对代码的修改影响到了Pelican的HTML输出若输出的结果确实是你想要的请更新功能测试所用的输出用例。请确保你安装了 "
"``en_EN.utf8`` 和 ``fr_FR.utf8`` ,然后执行下述命令:"
#: ../../contribute.rst:125 a4a3e16c3e0345c99cb2d8b674627afa
msgid ""
"You may also find that some tests are skipped because some dependency "
"(e.g., Pandoc) is not installed. This does not automatically mean that "
"these tests have passed; you should at least verify that any skipped "
"tests are not affected by your changes."
msgstr "你还可能会发现有一些测试由于缺少依赖(例如 Pandoc而被跳过。这并不意味着通过了这些测试请至少确保对代码的修改不会影响到这些被跳过的测试。"
#: ../../contribute.rst:130 dd6db784c2534b0ea0842cb736dca7c3
msgid ""
"You should run the test suite under each of the supported versions of "
"Python. This is best done by creating a separate Python environment for "
"each version. Tox_ is a useful tool to automate running tests inside "
"``virtualenv`` environments."
msgstr ""
"你应该在Pelican支持的所有Python版本下运行测试套件。一般会通过为每一个Python版本创建一个虚拟环境来实现这一点。Tox_ "
"是一个用于在 ``virtualenv`` 环境中自动运行测试的工具。"
#: ../../contribute.rst:138 58fd644b4b7248ebb9c8ff899a2f90b1
msgid "Running a code coverage report"
msgstr "运行代码测试覆盖报告"
#: ../../contribute.rst:140 abe50ab68fef48dea42aa269743fc172
msgid ""
"Code is more likely to stay robust if it is tested. Coverage_ is a "
"library that measures how much of the code is tested. To run it::"
msgstr "经过测试的代码往往具有更好的健壮性。 Coverage_ 是一个用于衡量代码测试覆盖率的库执行下面的命令以调取之:"
#: ../../contribute.rst:145 9d5ba28c240f464c92db9869c01e3917
msgid ""
"This will show overall coverage, coverage per file, and even line-by-line"
" coverage. There is also an HTML report available::"
msgstr "该命令会展示总体覆盖率以及在每个文件上的覆盖率甚至还会展示每一行的覆盖情况。同样也会有一份HTML格式的报告供您查看"
#: ../../contribute.rst:153 45e095f0c0fd4a5b9f75027d12dd891f
msgid "Building the docs"
msgstr "构建文档"
#: ../../contribute.rst:155 e1e8bb56a9c8449a8da8e10fcf45da2a
msgid ""
"If you make changes to the documentation, you should build and inspect "
"your changes before committing them::"
msgstr "若你对文档进行过修改请在commit前完成构建和检查"
#: ../../contribute.rst:160 9482dc5bee484f0c9f05af197b49ed70
msgid ""
"Open http://localhost:8000 in your browser to review the documentation. "
"While the above task is running, any changes you make and save to the "
"documentation should automatically appear in the browser, as it live-"
"reloads when it detects changes to the documentation source files."
msgstr ""
"执行上述命令后请在Web浏览器中打开 http://localhost:8000 "
"来查看文档。在上述命令执行时,对文档做的任何修改应该会自动反映在浏览器中。"
#: ../../contribute.rst:166 82343c9684bb440eb260110d98bb0e59
msgid "Plugin development"
msgstr "插件开发"
#: ../../contribute.rst:168 8697f547344e4973ad34f9c619ddf22e
msgid ""
"To create a *new* Pelican plugin, please refer to the `plugin template`_ "
"repository for detailed instructions."
msgstr "要创建一个 *新的* Pelican插件请参阅 `插件模板`_ 仓库以获得更为详细的指导。"
#: ../../contribute.rst:171 3c505e3035c143c89efd3e648fe00e8e
msgid ""
"If you want to contribute to an *existing* Pelican plugin, follow the "
"steps above to set up Pelican for local development, and then create a "
"directory to store cloned plugin repositories::"
msgstr "若你想在 *已有* Pelican插件中做贡献请先按前文所述步骤配置Pelican的本地开发环境然后创建一个文件夹来存放克隆下来的插件仓库"
#: ../../contribute.rst:177 5523421ea2664b1ab0859216a1c8a463
msgid ""
"Assuming you wanted to contribute to the Simple Footnotes plugin, you "
"would first browse to the `Simple Footnotes`_ repository on GitHub and "
"tap the **Fork** button at top-right. Then clone the source for your fork"
" and add the upstream project as a Git remote::"
msgstr ""
"假设想要为Simple Footnotes插件做贡献你应该先查看并fork `Simple Footnotes`_ "
"的Github仓库然后克隆你自己fork的那一份再添加原仓库作为Git远程仓库upstream"
#: ../../contribute.rst:190 e5178eb4654a44919c743d37f00ff4c3
msgid "Create a topic branch for your plugin bug fix or feature::"
msgstr "同样地为你想要进行的bug修复或特性添加创建一个分支"
#: ../../contribute.rst:194 af04dad9f528473caa4c4c0f4c33042a
msgid ""
"After writing new tests for your plugin changes, run the plugin test "
"suite and check for code style compliance via::"
msgstr "完成修改并添加测试后,运行测试套件,并检查代码风格:"
#: ../../contribute.rst:205 06d00f61d5c344d587baa85116b3c1e0
msgid ""
"If style violations are found even after running the above auto-"
"formatters, you will need to make additional manual changes until "
"``invoke lint`` no longer reports any code style violations."
msgstr "如果在自动格式化后仍存在代码风格上的问题,请手动修正这些问题,直到执行 ``invoke lint`` 时不再报告问题。"
#: ../../contribute.rst:213 9a0831b06abd494fad469b7df71c489f
msgid "Submitting your changes"
msgstr "提交更改"
#: ../../contribute.rst:215 23b5d147059b4cea99a213f50d63097a
msgid ""
"Assuming linting validation and tests pass, add a ``RELEASE.md`` file in "
"the root of the project that contains the release type (major, minor, "
"patch) and a summary of the changes that will be used as the release "
"changelog entry. For example::"
msgstr ""
"通过了风格检查和所有测试后,请在项目的根目录下添加一个 ``RELEASE.md`` "
"文件其中应包含发布的类型major、minor、patch以及代码变更的摘要这份摘要会被用作更新日志的条目。下面是一个例子"
#: ../../contribute.rst:224 6794c41ebe2c4937ba4f3f8e16e7a9d9
msgid "Commit your changes and push your topic branch::"
msgstr "commit你的更改并push对应分支"
#: ../../contribute.rst:230 daa69b097fc14739be924714f8070cf6
msgid ""
"Finally, browse to your repository fork on GitHub and submit a pull "
"request."
msgstr "最后前往Github从你fork的仓库向原仓库提出PR。"
#: ../../contribute.rst:234 b71524be74c84517a12fcdecb51bc55e
msgid "Logging tips"
msgstr "日志技巧"
#: ../../contribute.rst:236 a0b70f864ce144eabe0f89d78844c395
msgid "Try to use logging with appropriate levels."
msgstr "请仔细斟酌合适的日志等级。"
#: ../../contribute.rst:238 3b44fa3ec9b3493e97c310207e5dce91
msgid "For logging messages that are not repeated, use the usual Python way::"
msgstr "对于不重复的日志消息,使用一般的方式即可:"
#: ../../contribute.rst:247 49d4e407310348838660e8c74c6e3fb6
#, python-format
msgid ""
"Do not format log messages yourself. Use ``%s`` formatting in messages "
"and pass arguments to logger. This is important, because the Pelican "
"logger will preprocess some arguments, such as exceptions."
msgstr ""
"请不要自己格式化日志消息,而是使用在日志消息中使用 ``%s`` "
"并向logger传入参数。请务必遵循这一规则因为Pelican的logger会自动预处理一些特殊的参数例如exception。"
#: ../../contribute.rst:252 4ac501dff8bc4554998d3f03486cce0e
msgid "Limiting extraneous log messages"
msgstr "限制低关联日志消息"
#: ../../contribute.rst:254 c4dfb487945341cda6c0858954a2ed40
msgid ""
"If the log message can occur several times, you may want to limit the log"
" to prevent flooding. In order to do that, use the ``extra`` keyword "
"argument for the logging message in the following format::"
msgstr "如果同一日志消息会重复多次,你会希望限制这些多余的内容。使用 ``extra`` 命名参数来实现这一点:"
#: ../../contribute.rst:261 4090a3bc71e3441e8a7efd639d36ec1e
msgid ""
"Optionally, you can also set ``'limit_args'`` as a tuple of arguments in "
"``extra`` dict if your generic message needs formatting."
msgstr "可选的,如果通用日志消息需要格式化,可以添加 ``'limit_args'`` 参数并将其对应值设为一个元组。"
#: ../../contribute.rst:264 dd6530ceb29d4a91902046a3d4e63af6
msgid ""
"Limit is set to ``5``, i.e, first four logs with the same ``'limit_msg'``"
" are outputted normally but the fifth one will be logged using "
"``'limit_msg'`` (and ``'limit_args'`` if present). After the fifth, "
"corresponding log messages will be ignored."
msgstr ""
"限制数默认设为了 ``5`` ,即前四个有相同 ``'limit_msg'`` 参数的日志消息会正常输出,但第五条这样的日志消息会呈现为 "
"``'limit_msg'`` 参数值本身( ``'limit_args'`` 同理)。第六条及之后的日志消息会被直接忽略。"
#: ../../contribute.rst:269 50bdb3405a964740aeb91a7d559ba9b5
msgid ""
"For example, if you want to log missing resources, use the following "
"code::"
msgstr "例如,如果你想要用日志记录资源缺失的信息,可以使用下面的代码:"
#: ../../contribute.rst:277 0303387eccd842f9aa57eb3192252dba
msgid "The log messages will be displayed as follows::"
msgstr "最终的日志消息看起来会像这样:"
#: ../../contribute.rst:287 281637c4520d4755993e8bfa46b0326b
msgid "Outputting traceback in the logs"
msgstr "在日志中输出traceback信息"
#: ../../contribute.rst:289 8bd9319a7a6c4f77bd651057d1cc7c75
msgid ""
"If you're logging inside an ``except`` block, you may want to provide the"
" traceback information as well. You can do that by setting ``exc_info`` "
"keyword argument to ``True`` during logging. However, doing so by default"
" can be undesired because tracebacks are long and can be confusing to "
"regular users. Try to limit them to ``--debug`` mode like the following::"
msgstr ""
"当在 ``except`` 块中进行日志记录时你可能会希望同时输出traceback信息。可以简单地将 ``exc_info`` 参数设为 "
"``True`` 来实现这一功能。但是通过此方法输出的traceback信息会非常长不便于理解。可以像下述代码一样将这些信息限制在 "
"``--debug`` 模式中:"
#~ msgid "latest Pelican release (or an up-to-date Git clone of Pelican master)"
#~ msgstr ""
#~ msgid ""
#~ "`Create a new branch`_ specific to "
#~ "your change (as opposed to making "
#~ "your commits in the master branch)."
#~ msgstr ""

View file

@ -0,0 +1,484 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-07 16:25+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.16.0\n"
#: ../../faq.rst:2 84467b3ab4b8411589855b3130e14406
msgid "Frequently Asked Questions (FAQ)"
msgstr "常见问题解答"
#: ../../faq.rst:4 54c28b1640fd4939b5f196fa377292eb
msgid "Here are some frequently asked questions about Pelican."
msgstr "以下是一些Pelican的常见问题解答。"
#: ../../faq.rst:7 a95f8f3dcb6741949ba9d4761199dd0a
msgid "What's the best way to communicate a problem, question, or suggestion?"
msgstr "交流问题、疑问或提建议的最佳方式是什么?"
#: ../../faq.rst:9 d93f8424407d42b2b3ce37b39baecd8a
msgid "Please read our :doc:`feedback guidelines <contribute>`."
msgstr "请参阅文档 :doc:`项目贡献与意见反馈 <contribute>` 。"
#: ../../faq.rst:12 9fea72b4670c4fe6a3d67e1ddb158f47
msgid "How can I help?"
msgstr "我可以帮上什么忙?"
#: ../../faq.rst:14 3f4b88cf5b814e678a552c821ae4b450
msgid ""
"There are several ways to help out. First, you can communicate any "
"Pelican suggestions or problems you might have via `Pelican Discussions "
"<https://github.com/getpelican/pelican/discussions>`_. Please first check"
" the existing list of discussions and issues (both open and closed) in "
"order to avoid submitting topics that have already been covered before."
msgstr ""
"有好多种方法可以提供帮助。首先,可以在 `Pelican讨论板块 "
"<https://github.com/getpelican/pelican/discussions>`_ "
"中提出任何关于Pelican的建议或是问题。在提问或建议之前请先查看已关闭或开放的issues中是否已有相关内容以避免内容上的重复。"
#: ../../faq.rst:20 ca9e66682caf43a481ca91ecace43ed0
msgid ""
"If you want to contribute, please fork `the Git repository "
"<https://github.com/getpelican/pelican/>`_, create a new feature branch, "
"make your changes, and issue a pull request. Someone will review your "
"changes as soon as possible. Please refer to the :doc:`How to Contribute "
"<contribute>` section for more details."
msgstr ""
"如果你想要对项目进行贡献请fork `Git仓库 <https://github.com/getpelican/pelican/>`_ "
"创建一个新的功能分支并在其中进行修改在修改完成后提出一个PR。项目组会尽快审核你的PR。关于此的更多内容请参见 "
":doc:`项目贡献与意见反馈 <contribute>` 一节。"
#: ../../faq.rst:26 f05e9b722b084a439cd6d99b3155910d
msgid ""
"You can also contribute by creating themes and improving the "
"documentation."
msgstr "你可以发起的贡献当然也包括创建主题和改进文档。"
#: ../../faq.rst:29 d40c58aeafe54bdaa389c3c05a0fd721
msgid "Is the Pelican settings file mandatory?"
msgstr "Pelican配置文件是必要的吗"
#: ../../faq.rst:31 96ef0c57471d4a669bd7f2a7f493c23b
msgid ""
"Configuration files are optional and are just an easy way to configure "
"Pelican. For basic operations, it's possible to specify options while "
"invoking Pelican via the command line. See ``pelican --help`` for more "
"information."
msgstr ""
"配置文件是可选的其本质是使您可以更方便地配置Pelican。对于一些基本的配置操作完全可以在命令行中指定调用 ``pelican "
"--help`` 可以查看pelican命令的更多信息。"
#: ../../faq.rst:36 e3752aec18514ce292ee4ebd0d95db37
msgid "Changes to the settings file take no effect"
msgstr "修改后的配置文件没有生效"
#: ../../faq.rst:38 3f5c632fd20446cf8dd70a5eb88dbbcf
msgid ""
"When experimenting with different settings (especially the metadata ones)"
" caching may interfere and the changes may not be visible. In such cases,"
" ensure that caching is disabled via ``LOAD_CONTENT_CACHE = False`` or "
"use the ``--ignore-cache`` command-line switch."
msgstr ""
"在尝试不同的配置时(尤其是尝试不同元数据时),缓存很可能会产生干扰,使得修改不可见。此时,确保配置了 ``LOAD_CONTENT_CACHE ="
" False`` 或在命令行中加上 ``--ignore-cache`` 以禁用缓存。"
#: ../../faq.rst:44 067892211d0d4f4bae85d65a0132eb1d
msgid "I'm creating my own theme. How do I use Pygments for syntax highlighting?"
msgstr "在自己创建主题时如何使用Pygments来调整语法高亮"
#: ../../faq.rst:46 b1e6ed1bea2e4b3cb3798131f30a828c
msgid ""
"Pygments adds some classes to the generated content. These classes are "
"used by themes to style code syntax highlighting via CSS. Specifically, "
"you can customize the appearance of your syntax highlighting via the "
"``.highlight pre`` class in your theme's CSS file. To see how various "
"styles can be used to render Django code, for example, use the style "
"selector drop-down at top-right on the `Pygments project demo site "
"<https://pygments.org/demo/>`_."
msgstr ""
"Pygments会为生成的内容添加一些CSS类。这些类会为主题所用主题会通过CSS来为代码添加语法高亮。具体来说你可以通过主题CSS文件中的 "
"``.highlight pre`` 类来自定义语法高亮的外观。在 `Pygments 项目的demo网站 "
"<https://pygments.org/demo/>`_ 上可以预览能够渲染的代码类型。"
#: ../../faq.rst:53 5dccc8ae367545b08bdce61e008e0a20
msgid ""
"You can use the following example commands to generate a starting CSS "
"file from a Pygments built-in style (in this case, \"monokai\") and then "
"copy the generated CSS file to your new theme::"
msgstr "你可以使用下面的命令来让Pygments使用内置风格此处为“monokai”生成一个初始CSS文件然后将此文件拷贝到新主题中"
#: ../../faq.rst:60 027edae1ebdf4d52b59171a26915c1ac
msgid "Don't forget to import your ``pygment.css`` file from your main CSS file."
msgstr "不要忘了在你的CSS主文件中引入 ``pygment.css`` 文件。"
#: ../../faq.rst:63 164af3be4dce45879963c5d3ee0cd264
msgid "How do I create my own theme?"
msgstr "如何创建我自己的主题?"
#: ../../faq.rst:65 7b1db6528b0a4735894868a229a5969d
msgid "Please refer to :ref:`theming-pelican`."
msgstr "请参阅 :ref:`theming-pelican` 。"
#: ../../faq.rst:68 b8e21f837e0744c49cfe8f0cb3a1d5ee
msgid "Can I override individual templates without forking the whole theme?"
msgstr "我只需要覆盖主题中单独的几个模板文件可不可以不fork整个主题"
#: ../../faq.rst:70 70fd7b5c55c246a6a25b20304bfdb616
msgid ""
"Yes, you can override existing templates of the theme that you are using,"
" or add new templates, via the ``THEME_TEMPLATES_OVERRIDES`` variable. "
"For example, to override the page template, you can define the location "
"for your templates like this::"
msgstr "当然可以,覆盖部分模板文件或是添加一些模板文件都是可以的,使用 ``THEME_TEMPLATES_OVERRIDES`` 变量即可。"
"例如若需要覆盖page的模板可以向这样定义你自己的模板文件位置"
#: ../../faq.rst:77 a96870f0cad74996bec2469ea0c2e9e1
msgid ""
"You can then define a custom template in ``templates/page.html``. See "
":ref:`settings/themes` for details."
msgstr "自定义的模板可以为 ``templates/page.html`` 。详情请参看 :ref:`settings/themes` 。"
#: ../../faq.rst:81 b832cd952cf44a0097f383825f0f295f
msgid "I want to use Markdown, but I got an error."
msgstr "我想要使用Markdown但是出错了。"
#: ../../faq.rst:83 32d9dbde7029412d852ab8e710112573
msgid ""
"If you try to generate Markdown content without first installing the "
"Markdown library, you may see a message that says ``No valid files found "
"in content``. Markdown is not a hard dependency for Pelican, so if you "
"have content in Markdown format, you will need to explicitly install the "
"Markdown library. You can do so by typing the following command, "
"prepending ``sudo`` if permissions require it::"
msgstr ""
"如果没有事先安装Markdown库在生成Markdown内容时会看到一条提示 ``No valid files found in "
"content`` "
"。虽然Markdown并不是必需依赖但如果你写的内容中含有Markdown格式就需要安装Markdown库了。输入下面的命令以安装Markdown库如果需要权限请在前面添加"
" ``sudo`` "
#: ../../faq.rst:93 46728a367ffe47d9afeb7608e9c0db5f
msgid "Can I use arbitrary metadata in my templates?"
msgstr "在模板中可以使用任意元数据吗?"
#: ../../faq.rst:95 9b7fbafc6d29429a88a079bfb74e3af5
msgid ""
"Yes. For example, to include a modified date in a Markdown post, one "
"could include the following at the top of the article::"
msgstr "当然可以。例如可以在Markdown帖子中包含一个“修改日期”加在文章开头即可"
#: ../../faq.rst:100 ce62442a4c9d4347bd6ae8a59476fcee
msgid ""
"For reStructuredText, this metadata should of course be prefixed with a "
"colon::"
msgstr "对于reStructuredText此元数据也应当以冒号为前缀"
#: ../../faq.rst:104 bf869a6da43e448a9cc512843aa4a183
msgid ""
"This metadata can then be accessed in templates such as ``article.html`` "
"via::"
msgstr "此元数据可以在模板中获取到,例如在 ``article.html`` 中,可以像这样获取:"
#: ../../faq.rst:110 b9c9a648b30942b996b124af9fd5a84c
msgid ""
"If you want to include metadata in templates outside the article context "
"(e.g., ``base.html``), the ``if`` statement should instead be::"
msgstr "如果您想在其他模板(例如 ``base.html`` )中获取此元数据,则 ``if`` 语句应改为:"
#: ../../faq.rst:116 b78a678a165d40f4823fac2b19bcafc1
msgid ""
"How do I make my output folder structure identical to my content "
"hierarchy?"
msgstr "如何使得输出目录的结构和content目录的结构保持一致"
#: ../../faq.rst:118 851d1019c070482991667cc024063d29
msgid "Try these settings::"
msgstr "可以尝试如下配置:"
#: ../../faq.rst:125 5195876e3f364a838d72b16c568263bc
msgid "How do I assign custom templates on a per-page basis?"
msgstr "如何为某个页面指定某个模板?"
#: ../../faq.rst:127 2ddd3cf1fbf048b1819bcfc9b3691a12
msgid ""
"It's as simple as adding an extra line of metadata to any page or article"
" that you want to have its own template. For example, this is how it "
"would be handled for content in reST format::"
msgstr "这非常简单在任何页面或者文章中都可以通过多添加一行元数据来指定特定模板。例如在reST中使用"
#: ../../faq.rst:133 6f5eb40b4a5e4f83ab9d1cb48fefad57
msgid "For content in Markdown format::"
msgstr "对于Markdown则使用"
#: ../../faq.rst:137 2e28d1bf074c437eb5017bf6f345bf71
msgid ""
"Then just make sure your theme contains the relevant template file (e.g. "
"``template_name.html``). If you just want to add a new custom template to"
" an existing theme, you can also provide it in a directory specified by "
"``THEME_TEMPLATES_OVERRIDES`` (see :ref:`settings/themes`)."
msgstr ""
#: ../../faq.rst:142 675e77f99f3c42bb8715c84a97c7a064
msgid "How can I override the generated URL of a specific page or article?"
msgstr "如何重写某一个页面或文章生成的URL"
#: ../../faq.rst:144 7e518b99b29d4787addc732d57e94ed1
msgid ""
"Include ``url`` and ``save_as`` metadata in any pages or articles that "
"you want to override the generated URL. Here is an example page in reST "
"format::"
msgstr "在任意页面或文章中都可以添加 ``url`` 和 ``save_as`` 元数据这样就可以重写URL了。下面以reST格式为例"
#: ../../faq.rst:153 903306ecaed3483591b4ed2dcba3d183
msgid ""
"With this metadata, the page will be written to "
"``override/url/index.html`` and Pelican will use the URL "
"``override/url/`` to link to this page."
msgstr ""
"有了这样的元数据,此页面会保存为 ``override/url/index.html`` Pelican会将 ``override/url/``"
" 作为链接到此页面的URL。"
#: ../../faq.rst:157 d80d84fcb6844e25a8452e29c4113181
msgid "How can I use a static page as my home page?"
msgstr "如何使用一个静态页面作为主页?"
#: ../../faq.rst:159 e17a2e2dd9014109888bab9286ee607c
msgid ""
"The override feature mentioned above can be used to specify a static page"
" as your home page. The following Markdown example could be stored in "
"``content/pages/home.md``::"
msgstr "上一个问题中提到的特性可以用于实现此需求。下面例子中的Markdown文件保存为 ``content/pages/home.md`` "
#: ../../faq.rst:169 b99ba0ca8656416cbdc38f3fa263b7eb
msgid ""
"If the original blog index is still wanted, it can then be saved in a "
"different location by setting ``INDEX_SAVE_AS = 'blog_index.html'`` for "
"the ``'index'`` direct template."
msgstr ""
"如果仍需要原来的博客主页(即 ``'index'`` 直接模板),可以通过设置 ``INDEX_SAVE_AS = "
"'blog_index.html'`` 将其存储在其他位置。"
#: ../../faq.rst:174 fca4725a57dd451fb3b0fb9df78f69b5
msgid "What if I want to disable feed generation?"
msgstr "可以禁用订阅源生成吗?"
#: ../../faq.rst:176 e9c08140e2ed44f189a7a156db027a3e
msgid ""
"To disable feed generation, all feed settings should be set to ``None``. "
"All but three feed settings already default to ``None``, so if you want "
"to disable all feed generation, you only need to specify the following "
"settings::"
msgstr ""
"要禁用订阅源,所有订阅源相关的配置都应被设为 ``None`` 。其中有三项设置默认为 ``None`` "
",因此如果要彻底不生成订阅源,你只需要指定下面这些设置:"
#: ../../faq.rst:186 7820a481af4c4f44a40fb3ae80768a1d
msgid ""
"The word ``None`` should not be surrounded by quotes. Please note that "
"``None`` and ``''`` are not the same thing."
msgstr "``None`` 两侧不需要加引号。请注意 ``None`` 和 ``''`` 不是同一个东西。"
#: ../../faq.rst:190 4fa2ffbf1c274ec396a0d756762c260d
msgid ""
"I'm getting a warning about feeds generated without SITEURL being set "
"properly"
msgstr "Pelican警告说由于SITEURL设置不正确无法正常生成订阅源"
#: ../../faq.rst:192 8d52f14f6b03476897dfb15c188a961a
msgid ""
"`RSS and Atom feeds require all URL links to be absolute "
"<https://validator.w3.org/feed/docs/rss2.html#comments>`_. In order to "
"properly generate links in Pelican you will need to set ``SITEURL`` to "
"the full path of your site."
msgstr ""
"`RSS和Atom订阅源要求所有URL都要链接到绝对地址 "
"<https://validator.w3.org/feed/docs/rss2.html#comments>`_ "
"。为了使得Pelican能正确生成链接你需要将站点的 ``SITEURL`` 设置为完整路径。"
#: ../../faq.rst:197 1412ceb735d44a30b58db3241248e7ec
msgid ""
"Feeds are still generated when this warning is displayed, but links "
"within may be malformed and thus the feed may not validate."
msgstr "虽然Pelican提出了警告但是仍会生成订阅源但其中的链接可能是无效的这会导致订阅源不可用。"
#: ../../faq.rst:201 20cadccc527e4ebda08eac9ed34f5055
msgid "Can I force Atom feeds to show only summaries instead of article content?"
msgstr "可以让Atom订阅源只显示摘要不显示文章内容吗"
#: ../../faq.rst:203 9c45ba2ec5c6402e86e89661b943d1ad
msgid ""
"Instead of having to open a separate browser window to read articles, the"
" overwhelming majority of folks who use feed readers prefer to read "
"content within the feed reader itself. Mainly for that reason, Pelican "
"does not support restricting Atom feeds to only contain summaries. Unlike"
" Atom feeds, the RSS feed specification does not include a separate "
"``content`` field, so by default Pelican publishes RSS feeds that only "
"contain summaries (but can optionally be set to instead publish full "
"content RSS feeds). So the default feed generation behavior provides "
"users with a choice: subscribe to Atom feeds for full content or to RSS "
"feeds for just the summaries."
msgstr ""
"绝大多数使用订阅源阅读器的人都更喜欢直接在阅读器中阅读文章内容而不是另外再打开窗口来阅读。因此Pelican不支持使Atom只包含摘要。但是由于RSS不包含单独的"
" ``content`` "
"字段因此Pelican在发布RSS时默认只包含摘要当然也可以设置为包含文章内容。Pelican在订阅源生成上的如此行为就可以让用户自行选择订阅类型包含了完整内容的Atom或是只包含摘要的RSS。"
#: ../../faq.rst:214 bf0d4ca837f74d9ab6618db6306c6a70
msgid "Is Pelican only suitable for blogs?"
msgstr "Pelican只适合用于博客吗"
#: ../../faq.rst:216 49697f375cfc49b08f5d0c2297d15028
msgid ""
"No. Pelican can be easily configured to create and maintain any type of "
"static site. This may require a little customization of your theme and "
"Pelican configuration. For example, if you are building a launch site for"
" your product and do not need tags on your site, you could remove the "
"relevant HTML code from your theme. You can also disable generation of "
"tag-related pages via::"
msgstr "不是的。Pelican可以方便地用于创建维护任何静态站点为此你需要对主题和配置做一些定制。例如如果要为你的产品构建一个宣传网站即不需要使用标签特性从主题中移除与标签相关的HTML代码即可。另外还可以通过下面的设置来禁用标签相关页面的生成"
#: ../../faq.rst:226 0a59dd7209554237912579b362d07788
msgid ""
"Why does Pelican always write all HTML files even with content caching "
"enabled?"
msgstr "启用内容缓存后为什么Pelican仍会每次都写入所有HTML文件"
#: ../../faq.rst:228 6291b82d02fc4450a79d1200b5d04f62
msgid ""
"In order to reliably determine whether the HTML output is different "
"before writing it, a large part of the generation environment including "
"the template contexts, imported plugins, etc. would have to be saved and "
"compared, at least in the form of a hash (which would require special "
"handling of unhashable types), because of all the possible combinations "
"of plugins, pagination, etc. which may change in many different ways. "
"This would require a lot more processing time and memory and storage "
"space. Simply writing the files each time is a lot faster and a lot more "
"reliable."
msgstr "为了确定HTML输出确实和之前的不同模板上下文、插件等很多生成环境都需要保存并比较某种哈希值对于不可哈希的内容类型还需要进行一些额外处理。另外由于插件、分页等内容的存在输出的HTML很可能会与之前不同。因此考虑到处理时间和存储空间每次都重新写入全部HTML会更快更可靠。"
#: ../../faq.rst:237 5cc5e1361f914c92b0670030f0c83f5d
msgid ""
"However, this means that the modification time of the files changes every"
" time, so a ``rsync`` based upload will transfer them even if their "
"content hasn't changed. A simple solution is to make ``rsync`` use the "
"``--checksum`` option, which will make it compare the file checksums in a"
" much faster way than Pelican would."
msgstr ""
"然而,这样的机制会使得在每次生成站点后,文件的修改时间都会变化,因此基于 ``rsync`` "
"上传时会把没有变化的内容也进行上传。一个简便的解决方法就是给 ``rsync`` 加上 ``--checksum`` "
"选项这会比Pelican在生成时进行校验更快。"
#: ../../faq.rst:244 b24c40be89b94f3b980cbbda38d46115
msgid "How to process only a subset of all articles?"
msgstr "如何只处理一部分文章?"
#: ../../faq.rst:246 fa34a90481f44ace83ee16401543ce09
msgid ""
"It is often useful to process only e.g. 10 articles for debugging "
"purposes. This can be achieved by explicitly specifying only the "
"filenames of those articles in ``ARTICLE_PATHS``. A list of such "
"filenames could be found using a command similar to ``cd content; find "
"-name '*.md' | head -n 10``."
msgstr ""
"简便起见,在调试时可能只需要处理几篇文章。可以直接在配置项 ``ARTICLE_PATHS`` 中添加需要处理文章的文件名。可以通过像 ``cd "
"content; find -name '*.md' | head -n 10`` 这样的命令获取文章文件名的列表。"
#: ../../faq.rst:252 0fa566e3aa084cb9b04e0cee32684222
msgid "My tag cloud is missing/broken since I upgraded Pelican"
msgstr "在升级Pelican后标签云消失或不可用了"
#: ../../faq.rst:254 0bd1304a12c24f048b227c68391b148c
msgid ""
"In an ongoing effort to streamline Pelican, tag cloud generation has been"
" moved out of Pelican core and into a separate `plugin "
"<https://github.com/pelican-plugins/tag-cloud>`_. See the :ref:`plugins` "
"documentation for further information about the Pelican plugin system."
msgstr ""
"我们一直致力于精简Pelican标签云生成的功能已经从Pelican核心中移除转而放到了一个单独的 `tag-cloud插件 "
"<https://github.com/pelican-plugins/tag-cloud>`_ 中。查看 :ref:`plugins` "
"文档获取更多关于Pelican插件系统的信息。"
#: ../../faq.rst:260 1833dfba94c74f4bb9e9f0a112ed3e0f
msgid "Since I upgraded Pelican my pages are no longer rendered"
msgstr "升级Pelican后一些页面没有被渲染"
#: ../../faq.rst:262 576e5c2338ba4c43a51bb562301ad0c2
msgid ""
"Pages were available to themes as lowercase ``pages`` and uppercase "
"``PAGES``. To bring this inline with the :ref:`templates-variables` "
"section, ``PAGES`` has been removed. This is quickly resolved by updating"
" your theme to iterate over ``pages`` instead of ``PAGES``. Just "
"replace::"
msgstr ""
"在以前的版本中,主题通过小写的 ``pages`` 和大写的 ``PAGES`` 都能获取到页面。为了使之与 :ref:`templates-"
"variables` 一节中的内容保持一致,大写的 ``PAGES`` 被删除了。只要将主题中的 ``PAGES`` 替换为 ``pages`` "
",问题即可解决。例如将原先的:"
#: ../../faq.rst:269 355512b9f6b34ece9b6baed128b2ca4d
msgid "with something like::"
msgstr "替换为:"
#: ../../faq.rst:274 99ef769943fe41c4a37ca951e905b2ba
msgid "How can I stop Pelican from trying to parse my static files as content?"
msgstr "如何避免让Pelican将我的静态文件解析为内容文件译者注例如要将一个HTML文件作为静态文件"
#: ../../faq.rst:276 4efb20c5b82d41afb07151599fa189dd
msgid ""
"Pelican's article and page generators run before it's static generator. "
"That means if you use a setup similar to the default configuration, where"
" a static source directory is defined inside a ``*_PATHS`` setting, all "
"files that have a valid content file ending (``.html``, ``.rst``, "
"``.md``, ...) will be treated as articles or pages before they get "
"treated as static files."
msgstr ""
"Pelican的文章与页面生成器会先于静态文件生成器运行。这意味着若使用默认配置即静态资源文件夹定义在某个 ``*_PATHS`` "
"配置项中,所有以有效内容文件后缀结尾的文件( ``.html`` 、 ``.rst`` 、 ``.md`` "
"等)都会被视为文章或者页面,而不是静态文件。"
#: ../../faq.rst:282 d959eb6a67fe440caa70105e1692bf93
msgid ""
"To circumvent this issue either use the appropriate ``*_EXCLUDES`` "
"setting or disable the offending reader via ``READERS`` if you don't need"
" it."
msgstr ""
"为了避免这个问题,使用合适的 ``*_EXCLUDES`` 配置,在必要时还可以通过 ``READERS`` "
"配置项来直接禁用产生问题的reader。"
#: ../../faq.rst:286 5e64dc4b6fad4e7ea07278f5a2529e89
msgid "Why is [arbitrary Markdown syntax] not supported?"
msgstr "为什么不是所有的Markdown语法都支持"
#: ../../faq.rst:288 6872a70ec1434c41a78d465271761c69
msgid ""
"Pelican does not directly handle Markdown processing and instead "
"delegates that task to the Python-Markdown_ project, the core of which "
"purposefully follows the original Markdown syntax rules and not the "
"myriad Markdown \"flavors\" that have subsequently propagated. That said,"
" Python-Markdown_ is quite modular, and the syntax you are looking for "
"may be provided by one of the many available `Markdown Extensions`_. "
"Alternatively, some folks have created Pelican plugins that support "
"Markdown variants, so that may be your best choice if there is a "
"particular variant you want to use when writing your content."
msgstr ""
"Pelican并不直接对Markdown进行处理而是将此任务交给 Python-Markdown_ "
"项目此项目的核心有意只遵循原始的Markdown语法规则而不服从之后传播开的大量Markdown风格。另外 Python-Markdown_"
" 是相当模块化的,你想要使用的语法可能已经有现成的 `Markdown扩展`_ "
"进行了实现。或者也有人创建了支持Markdown变体的Pelican插件如果你想要用某种Markdown变体可以在这些地方寻找支持。"
#~ msgid ""
#~ "Then just make sure your theme "
#~ "contains the relevant template file "
#~ "(e.g. ``template_name.html``)."
#~ msgstr "确保对应的模板文件在主题中存在即可(例如 ``template_name.html`` )。"

View file

@ -0,0 +1,321 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 19:06+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"
#: ../../importer.rst:4 2e58a5582f664ba0af49aac4480bc799
msgid "Importing an existing site"
msgstr "导入已有站点"
#: ../../importer.rst:7 5182de0b717543c7a4813491755b720a
msgid "Description"
msgstr "简介"
#: ../../importer.rst:9 29a8bae0ba78486894ed4c286cd2f3b4
msgid ""
"``pelican-import`` is a command-line tool for converting articles from "
"other software to reStructuredText or Markdown. The supported import "
"formats are:"
msgstr ""
"命令行工具 ``pelican-import`` 用于将其他软件生成的文章转换成reStructuredText"
"或Markdown格式。支持导入下面这些格式"
#: ../../importer.rst:12 c670f6055ad24d818132d74951c9928c
msgid "Blogger XML export"
msgstr "Blogger XML export"
#: ../../importer.rst:13 d31ddaa8c7d54a268b379f706164de39
msgid "Dotclear export"
msgstr "Dotclear export"
#: ../../importer.rst:14 5102eb70c58240b2ad4d508a196b176e
msgid "Medium export"
msgstr "Medium export"
#: ../../importer.rst:15 2cfcdf575387417bae3a9938aa55b0e6
msgid "Tumblr API"
msgstr "Tumblr API"
#: ../../importer.rst:16 42233d68a4bc46339b284681bdbdd19c
msgid "WordPress XML export"
msgstr "WordPress XML export"
#: ../../importer.rst:17 0170dad08a80435b99a39ccaf887c5bb
msgid "RSS/Atom feed"
msgstr "RSS/Atom feed"
#: ../../importer.rst:19 077a8220f4a84dd297ec5aa7cff15a24
msgid ""
"The conversion from HTML to reStructuredText or Markdown relies on "
"`Pandoc`_. For Dotclear, if the source posts are written with Markdown "
"syntax, they will not be converted (as Pelican also supports Markdown)."
msgstr ""
"从HTML转换到reStructuredText或Markdown是依赖 `Pandoc`_ "
"完成的。对于Dotclear若原帖子是由Markdown语法写的则无需转换"
"因为Pelican本就支持Markdown。"
#: ../../importer.rst:25 e9b94b6029204b82b009d3ef23c19814
msgid ""
"Unlike Pelican, Wordpress supports multiple categories per article. These"
" are imported as a comma-separated string. You have to resolve these "
"manually, or use a plugin such as `More Categories`_ that enables "
"multiple categories per article."
msgstr ""
"和Pelican不同在Wordpress中可以将一篇文章同时放在多个分类中。在导入时各个分类"
"会以逗号分隔,你必须自己手动进行处理。或者也可以使用例如 `More Categories`_ "
"这样的插件,使得文章可以同时存在于多个分类中。"
#: ../../importer.rst:32 f7add19b68754b6e8a617a1d50dee759
msgid ""
"Imported pages may contain links to images that still point to the "
"original site. So you might want to download those images into your local"
" content and manually re-link them from the relevant pages of your site."
msgstr ""
"要导入的内容中可能会包含指向原站点的图片链接,你可能希望将他们全部下载下来,然后再"
"重新手动调整这些链接。"
#: ../../importer.rst:37 22cc1a514c4f42efbcf9afc3d987c42e
msgid "Dependencies"
msgstr "依赖"
#: ../../importer.rst:39 6139199770a24fc7af7ca7e556d18d5f
msgid ""
"``pelican-import`` has some dependencies not required by the rest of "
"Pelican:"
msgstr ""
"``pelican-import`` 需要用到一些其他依赖,这些依赖只会被 ``pelican-import`` 用到:"
#: ../../importer.rst:41 0e8eb04bb07f4752880b873e73e7f7e5
msgid ""
"*BeautifulSoup4* and *lxml*, for WordPress and Dotclear import. Can be "
"installed like any other Python package (``pip install BeautifulSoup4 "
"lxml``)."
msgstr ""
"为了能够导入WordPress和Dotclear的内容需要 *BeautifulSoup4* 与 *lxml* 。"
"安装方法与其他Python包相同 ``pip install BeautifulSoup4 lxml`` "
#: ../../importer.rst:44 7d31c1ad4ecb4014a3ef240436b9b3e1
msgid "*Feedparser*, for feed import (``pip install feedparser``)."
msgstr "为了能够导入订阅源,需要 *Feedparser* ``pip install feedparser`` "
#: ../../importer.rst:45 db7a18b1a4534a17956c9d030dddff56
msgid ""
"*Pandoc*, see the `Pandoc site`_ for installation instructions on your "
"operating system."
msgstr ""
"还需要 *Pandoc* ,参照 `Pandoc官方网站`_ 进行安装。"
#: ../../importer.rst:53 9952881aed104ef0ac82af5339e6b149
msgid "Usage"
msgstr "用法"
#: ../../importer.rst:63 83dbe43e4d2e4d8eaf3e37724ac119e3
msgid "Positional arguments"
msgstr "位置参数"
#: ../../importer.rst:65 4a12692744024752be75d82ed74d369d
msgid "``input``"
msgstr "``input``"
#: ../../importer.rst:65 52f62f22221f4c3d964df5aced3d2a2b
msgid "The input file to read"
msgstr "需要读取的输入文件"
#: ../../importer.rst:66 acc46432d5c14ea8a5e27e6ec2b84d18
msgid "``api_key``"
msgstr "``api_key``"
#: ../../importer.rst:66 29dd358bf2fe49d8a218c56ca376f6a6
msgid ""
"(Tumblr only) api_key can be obtained from "
"https://www.tumblr.com/oauth/apps"
msgstr ""
"只会在Tumblr中用到从 https://www.tumblr.com/oauth/apps 中获取到的api_key"
#: ../../importer.rst:70 a81b90d51a9f4c28adc09038715cf5c2
msgid "Optional arguments"
msgstr "可选参数"
#: ../../importer.rst:72 d4d5211b75aa4103b06ad7685368af06
msgid "Show this help message and exit"
msgstr "显示此帮助信息并退出 ``pelican-import`` "
#: ../../importer.rst:73 a7bae87fe16644f4b5da7d32fdc05f95
msgid "Blogger XML export (default: False)"
msgstr "输入是否为Blogger XML格式默认False"
#: ../../importer.rst:74 e8c133125ed04120bcc3737fa2a0ba60
msgid "Dotclear export (default: False)"
msgstr "输入是否为Dotclear格式默认False"
#: ../../importer.rst:75 caffd159f92a4f36aadedec398823ac3
msgid "Medium export (default: False)"
msgstr "输入是否为Medium格式默认False"
#: ../../importer.rst:76 f1bcaccf8e2f43f6894f2f0540c9d7ba
msgid "Tumblr API (default: False)"
msgstr "输入是否为Tumblr API格式默认False"
#: ../../importer.rst:77 6131f8fa00294515a028f4bb1a3a3053
msgid "WordPress XML export (default: False)"
msgstr "输入是否为WordPress XML格式默认False"
#: ../../importer.rst:78 dad00ee0aebb4550acae995ecdbb622f
msgid "Feed to parse (default: False)"
msgstr "输入是否为订阅源格式默认False"
#: ../../importer.rst:80 0ca3cbbc57c64b5b88444ccde94f94ce
msgid "Output path (default: content)"
msgstr "输出路径默认content"
#: ../../importer.rst:82 baa2762a4ee745028e29865720ca299d
msgid ""
"Output markup format: ``rst``, ``markdown``, or ``asciidoc`` (default: "
"``rst``)"
msgstr ""
"输出格式,可选值为: ``rst`` 、 ``markdown`` 、 ``asciidoc`` (默认: ``rst`` "
#: ../../importer.rst:84 53232a317a58422d8f070c245d3b7409
msgid "Put files in directories with categories name (default: False)"
msgstr "是否要将输出文件按分类名放到各文件夹中默认False"
#: ../../importer.rst:86 f72e1895d9fc4facb90ddffb53b31a0a
msgid ""
"Put files recognised as pages in \"pages/\" sub- directory (blogger and "
"wordpress import only) (default: False)"
msgstr ""
"将识别为页面的文件放入“pages/” 子文件夹中仅在blogger和wordpress中有用默认False"
#: ../../importer.rst:89 3f9315af4f1e4ced8ece96fca71cb1e7
msgid "Import only post from the specified author"
msgstr "仅导入某个作者的帖子"
#: ../../importer.rst:90 0b34125f0bb744b089fe77b86b3e50f7
msgid ""
"Strip raw HTML code that can't be converted to markup such as flash "
"embeds or iframes (default: False)"
msgstr ""
"删除无法转换的HTML代码例如嵌入的flash或iframe默认False"
#: ../../importer.rst:92 f899a119b708450bbd38913f813255c2
msgid ""
"Put wordpress custom post types in directories. If used with --dir-cat "
"option directories will be created as \"/post_type/category/\" (wordpress"
" import only)"
msgstr ""
"将wordpress中的自定义类型博文放到对应文件夹中。如果同时还使用了 --dir-cat 选项,"
"输出转换后文件时会创建诸如“/post_type/category/” 的文件夹只在wordpress中有效"
#: ../../importer.rst:95 627c041fab81460eafd4f5fe361bcd1a
msgid ""
"Download files uploaded to wordpress as attachments. Files will be added "
"to posts as a list in the post header and links to the files within the "
"post will be updated. All files will be downloaded, even if they aren't "
"associated with a post. Files will be downloaded with their original path"
" inside the output directory, e.g. \"output/wp-"
"uploads/date/postname/file.jpg\". (wordpress import only) (requires an "
"internet connection)"
msgstr ""
"下载作为附件上传到WordPress的文件。文件会以列表形式添加到帖子的开头并且到这些"
"文件的链接都会进行更新。另外,即使某些文件没有在任何帖子中用到,也同样会被下载。"
"文件会被下载到输出文件夹下,并保持原始路径,例如"
"“output/wp-uploads/date/postname/file.jpg” 。仅在wordpress中有效"
"且需要互联网连接)"
#: ../../importer.rst:104 11162d8c497b4108a38c2a60af4a4215
msgid ""
"Disable storing slugs from imported posts within output. With this "
"disabled, your Pelican URLs may not be consistent with your original "
"posts. (default: False)"
msgstr ""
"不保存导入推文的slug会导致Pelican的URL和原推文不一致。默认False"
#: ../../importer.rst:109 f4f4b6e918d3498e927b59c5d0bae05a
msgid "Blog name used in Tumblr API"
msgstr "Tumblr API中使用的博客名"
#: ../../importer.rst:113 16e0f9bd1c6e4b338673f1800e6a4995
msgid "Examples"
msgstr "例子"
#: ../../importer.rst:115 0cf17b9fd72940c391a1bb8bf7de534b
msgid "For Blogger::"
msgstr "导入Blogger"
#: ../../importer.rst:119 3fc79daf9e9e4f5ba1a121faaabd0c9e
msgid "For Dotclear::"
msgstr "导入Dotclear"
#: ../../importer.rst:123 328ff8145b464fa2ab59505a8bc3236a
msgid "For Medium::"
msgstr "导入Medium"
#: ../../importer.rst:127 8ca5f721833142249b6d798efcb77458
msgid ""
"The Medium export is a zip file. Unzip it, and point this tool to the "
"\"posts\" subdirectory. For more information on how to export, see "
"https://help.medium.com/hc/en-us/articles/115004745787-Export-your-"
"account-data."
msgstr ""
"Medium中导出的是一个zip文件。请先解压之然后再将其中的“posts”子目录传给此工具。 "
"https://help.medium.com/hc/en-us/articles/115004745787-Export-your-account-data "
"中有更详细的导出指导。"
#: ../../importer.rst:131 516a83a4d8cf4570a9a6fff416e5cf5a
msgid "For Tumblr::"
msgstr "导入Tumblr"
#: ../../importer.rst:135 8fcab620c0d44bb29a120d8d781f4daa
msgid "For WordPress::"
msgstr "导入WordPress"
#: ../../importer.rst:139 a929213eb21f4118b9adbb6199bd78ea
msgid "For Medium (an example of using an RSS feed):"
msgstr "导入Medium例子中使用了RSS订阅源"
#: ../../importer.rst:141 5e23c5d167ef4db1994f4323ac3d120e
msgid ""
"$ python -m pip install feedparser $ pelican-import --feed "
"https://medium.com/feed/@username"
msgstr ""
"$ python -m pip install feedparser $ pelican-import --feed "
"https://medium.com/feed/@username"
#: ../../importer.rst:146 b44dfe0f807049899c0560c6bf62c386
msgid "The RSS feed may only return the most recent posts — not all of them."
msgstr "RSS订阅源可能只会返回最新的帖子而不是所有帖子。"
#: ../../importer.rst:149 575426ff787d4647b3aa2469b8b52412
msgid "Tests"
msgstr "测试"
#: ../../importer.rst:151 036d2119412b41f3a3cb69cec74ecc81
msgid "To test the module, one can use sample files:"
msgstr "可以使用下面的文件作为样例进行测试:"
#: ../../importer.rst:153 482b30f9aab54717bb14218ae5fa8ea6
msgid ""
"for WordPress: https://www.wpbeginner.com/wp-themes/how-to-add-dummy-"
"content-for-theme-development-in-wordpress/"
msgstr ""
"WordPress https://www.wpbeginner.com/wp-themes/how-to-add-dummy-content-"
"for-theme-development-in-wordpress/"
#: ../../importer.rst:154 6cb1bd10d37e4993aabece8aaed20171
msgid "for Dotclear: http://media.dotaddict.org/tda/downloads/lorem-backup.txt"
msgstr "Dotclear http://media.dotaddict.org/tda/downloads/lorem-backup.txt"

View file

@ -0,0 +1,134 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 19:06+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"
#: ../../index.rst:2 160b5c32c524404ba295da4e89124739
msgid "Pelican |release|"
msgstr "Pelican |release|"
#: ../../index.rst:4 19170a80b4274f71b77062c7a6b90726
msgid ""
"Pelican is a static site generator, written in Python_. Highlights "
"include:"
msgstr ""
"Pelican是一个用 Python_ 写的静态站点生成器,它有诸多亮点:"
#: ../../index.rst:6 6ab42a346f2c46d789cd46655195f2d3
msgid ""
"Write your content directly with your editor of choice in "
"reStructuredText_ or Markdown_ formats"
msgstr ""
"你可以直接在自己的编辑器中用 reStructuredText_ 或 Markdown_ 完成内容创作"
#: ../../index.rst:8 dbd17888530e43ce8bdfc1594947032c
msgid "Includes a simple CLI tool to (re)generate your site"
msgstr "自带了一个简单的命令行工具,你可以用它来生成你的站点"
#: ../../index.rst:9 2bbe72bda8db457a88f3d3a94d16cc0c
msgid "Easy to interface with distributed version control systems and web hooks"
msgstr "易于与分布式版本控制系统和webhook交互"
#: ../../index.rst:10 24af69b083024f2a9c4f162d54fa57c6
msgid "Completely static output is easy to host anywhere"
msgstr "生成的站点是完全静态的,可以在任何主机上轻松地部署"
#: ../../index.rst:12 1e2090f3f19d49a19a6c50524e4cd0b7
msgid "Ready to get started? Check out the :doc:`Quickstart<quickstart>` guide."
msgstr "准备好开始体验了吗?请查看 :doc:`快速入门<quickstart>` 指南。"
#: ../../index.rst:15 481a352565e84c848e018de507fbe9af
msgid "Features"
msgstr "特性"
#: ../../index.rst:17 6c7b5d9b43ca42f1b1df139e7f884d26
msgid "Pelicans feature highlights include:"
msgstr "Pelican在特性上也有很多亮点"
#: ../../index.rst:19 464e5e8ea8324fab9c5496b317a6db97
msgid ""
"Articles (e.g., blog posts) and pages (e.g., \"About\", \"Projects\", "
"\"Contact\")"
msgstr ""
"可以生成文章(例如博客推文)和页面(例如“关于”、“联系我们”、“项目”)"
#: ../../index.rst:20 c7cc4fe6ea8145feb0ace7d0965e2634
msgid "Integration with external services"
msgstr "可以和外部服务集成"
#: ../../index.rst:21 ceb2c8a629024157946eba53638d7eb1
msgid "Site themes (created using Jinja2_ templates)"
msgstr "可以使用主题(主题使用 Jinja2_ 模板引擎创建)"
#: ../../index.rst:22 51c3defcba6c4d31a77c3aade6826f1a
msgid "Publication of articles in multiple languages"
msgstr "可以为同一篇文章发布多种语言版本"
#: ../../index.rst:23 6f7cbfae94c54318a904e9725ce73677
msgid "Generation of Atom and RSS feeds"
msgstr "可以生成Atom和Rss订阅源"
#: ../../index.rst:24 3d667d2ed98a489788f6c38a4e4a6752
msgid "Code syntax highlighting"
msgstr "可以渲染代码高亮"
#: ../../index.rst:25 bf1a1f91b821464182471a3760a59d4f
msgid "Import existing content from WordPress, Dotclear, or RSS feeds"
msgstr "可以从WordPress、Dotclear或Rss订阅源导入已有的内容"
#: ../../index.rst:26 bd82641c549645cb8b4cd3187800397c
msgid "Fast rebuild times thanks to content caching and selective output writing"
msgstr "得益于内容缓存和选择性生成设计,可以快速重新生成站点"
#: ../../index.rst:27 8dec47d1ab13410c9b99db0709c860a3
msgid "Extensible via a rich plugin ecosystem: `Pelican Plugins`_"
msgstr "可扩展性强,有丰富的插件生态: `Pelican Plugins`_"
#: ../../index.rst:30 c7e090d7d2e04ff1ac1844e56209d75b
msgid "Why the name \"Pelican\"?"
msgstr "为什么叫做“Pelican”"
#: ../../index.rst:32 8c31222af5e24ba69acb5dd07a5b5d56
msgid ""
"\"Pelican\" is an anagram for *calepin*, which means \"notebook\" in "
"French. ;)"
msgstr ""
"“Pelican”是法语词笔记本 *calepin* 读音的回文。;)"
#: ../../index.rst:35 188f72b2bb644f978180eba22009ebc6
msgid "Source code"
msgstr "源码"
#: ../../index.rst:37 2c8804f173fb4aa8973fb4d2413c263b
msgid "You can access the source code at: https://github.com/getpelican/pelican"
msgstr "在这里可以获取Pelican的源码 https://github.com/getpelican/pelican"
#: ../../index.rst:40 06ab21b7cde94cee92193199ddc69775
msgid "How to get help, contribute, or provide feedback"
msgstr "如何获取帮助、贡献内容或是提供反馈"
#: ../../index.rst:42 7fdcc2bcaac04317a6f4114f1d9c327f
msgid ""
"See our :doc:`feedback and contribution submission guidelines "
"<contribute>`."
msgstr ""
"请查看文档 :doc:`反馈意见和贡献的提交指南 <contribute>`。"
#: ../../index.rst:45 3d15499d76e1489d8e8782c65f73bb29
msgid "Documentation"
msgstr "文档"

View file

@ -0,0 +1,220 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-13 11:46+0800\n"
"PO-Revision-Date: 2024-06-25 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.17.0\n"
#: ../../install.rst:2 e735e1393d63466092c9fc0a5ee4117d
msgid "Installing Pelican"
msgstr "安装Pelican"
#: ../../install.rst:4 e34bdf7c1bbb4c75a47f8bd16e626c67
msgid ""
"Pelican currently runs best on |min_python|; earlier versions of Python "
"are not supported."
msgstr "Pelican需要 |min_python| 以上版本的Python不支持更低版本。"
#: ../../install.rst:6 ff98ade47da6403e84dd1b2209896d9c
msgid ""
"You can install Pelican via several different methods. The simplest is "
"via Pip_::"
msgstr "有多种方法可以安装Pelican最简单的就是通过 Pip_"
#: ../../install.rst:10 ae2fcb82534e4a3f81980f69ed94c9ad
msgid "Or, if you plan on using Markdown::"
msgstr "如果您需要使用Markdown请使用下面的命令安装"
#: ../../install.rst:14 ed597b1eb47949efba0f1781ef7bbd1f
msgid ""
"(Keep in mind that some operating systems will require you to prefix the "
"above command with ``sudo`` in order to install Pelican system-wide.)"
msgstr "(在某些操作系统中,需要在命令前加 ``sudo`` 才能在整个系统上安装Pelican"
#: ../../install.rst:17 04d6784f06dd40e7bff76bf6476aaba1
msgid ""
"While the above is the simplest method, the recommended approach is to "
"create a virtual environment for Pelican via virtualenv_ before "
"installing Pelican. Assuming you have virtualenv_ installed, you can then"
" open a new terminal session and create a new virtual environment for "
"Pelican::"
msgstr ""
"尽管上面是最简单的安装方法,但我们推荐使用虚拟环境 virtualenv_ 完成Pelican的安装。当您安装好 virtualenv_ "
"后打开一个新的命令行并为Pelican创建一个虚拟环境"
#: ../../install.rst:26 08aae819315e48a194a065a3fc3dddad
msgid ""
"Once the virtual environment has been created and activated, Pelican can "
"be installed via ``python -m pip install pelican`` as noted above. "
"Alternatively, if you have the project source, you can install Pelican "
"using the setuptools method::"
msgstr ""
"当创建并激活虚拟环境后,使用之前提到过的命令 ``python -m pip install pelican`` "
"就可以安装Pelican了。或者如果您想要从源码安装可以使用setuptools"
#: ../../install.rst:33 368febf14ca740e19fa470b0f832dea1
msgid ""
"If you have Git installed and prefer to install the latest bleeding-edge "
"version of Pelican rather than a stable release, use the following "
"command::"
msgstr "如果安装过Git并且您希望安装Pelican的最最新版本而不是稳定版请使用下面的命令"
#: ../../install.rst:38 2498d09099194317a62e67b907bdd5d3
msgid ""
"Once Pelican is installed, you can run ``pelican --help`` to see basic "
"usage options. For more detail, refer to the :doc:`Publish<publish>` "
"section."
msgstr ""
"当您安装好Pelican可以执行 ``pelican --help`` 命令来查看一些基本用法。在 :doc:`发布站点<publish>` "
"章节中可以了解更多信息。"
#: ../../install.rst:42 4ef93669753e4bb89252a8c9852e7a71
msgid "Optional packages"
msgstr "可选包"
#: ../../install.rst:44 190eabcd8f3a437cbf895ecee25aff4d
msgid ""
"If you plan on using `Markdown <https://pypi.org/project/Markdown/>`_ as "
"a markup format, you can install Pelican with Markdown support::"
msgstr ""
"如您希望使用 `Markdown <https://pypi.org/project/Markdown/>`_ "
"来写作执行下面的命令来安装Markdown支持"
#: ../../install.rst:49 fa8fc8ff397a412f839bc2805696aa45
msgid ""
"Typographical enhancements can be enabled in your settings file, but "
"first the requisite `Typogrify <https://pypi.org/project/typogrify/>`_ "
"library must be installed::"
msgstr ""
"Pelican还支持排版增强若您需要使用请先安装 `Typogrify "
"<https://pypi.org/project/typogrify/>`_ 库,稍后您可以在设置文件中启用它。"
#: ../../install.rst:56 74911273a6934154bad4fadbc0d1f28b
msgid "Dependencies"
msgstr "依赖"
#: ../../install.rst:58 77d44b11ae7e4945b119fd473bb53e67
msgid ""
"When Pelican is installed, the following dependent Python packages should"
" be automatically installed without any action on your part:"
msgstr "当Pelican安装完成后下面的所有Python依赖应该都会自动安装无需另外做任何操作"
#: ../../install.rst:61 22bdf13ed0a3482fb66f10486518261c
msgid ""
"`feedgenerator <https://pypi.org/project/feedgenerator/>`_, to generate "
"the Atom feeds"
msgstr "`feedgenerator <https://pypi.org/project/feedgenerator/>`_用于生成Atom feeds"
#: ../../install.rst:63 21ddc5ce3bed4f9cab2a454e8319a8c4
msgid "`jinja2 <https://pypi.org/project/Jinja2/>`_, for templating support"
msgstr "`jinja2 <https://pypi.org/project/Jinja2/>`_用于模板系统"
#: ../../install.rst:64 9302b2919a4f4de0927060911f69f5ed
msgid "`pygments <https://pypi.org/project/Pygments/>`_, for syntax highlighting"
msgstr "`pygments <https://pypi.org/project/Pygments/>`_用于语法高亮"
#: ../../install.rst:65 c6e45ac0f3ea4f91953fb2dfc66d29d9
msgid ""
"`docutils <https://pypi.org/project/docutils/>`_, for supporting "
"reStructuredText as an input format"
msgstr "`docutils <https://pypi.org/project/docutils/>`_用于reStructuredText格式"
#: ../../install.rst:67 aea17a424f3c4e8eab50172b6653fe16
msgid ""
"`blinker <https://pypi.org/project/blinker/>`_, an object-to-object and "
"broadcast signaling system"
msgstr "`blinker <https://pypi.org/project/blinker/>`_对象-对象的信号广播系统"
#: ../../install.rst:69 5da4c8d1fdf349c2afe23ffc9d832816
msgid ""
"`unidecode <https://pypi.org/project/Unidecode/>`_, for ASCII "
"transliterations of Unicode text utilities"
msgstr ""
"`unidecode "
"<https://pypi.org/project/Unidecode/>`_用于将Unicode文本转为ASCII字符的音译"
#: ../../install.rst:72 ff81051def5544e1b5d66532453aed25
msgid ""
"`MarkupSafe <https://pypi.org/project/MarkupSafe/>`_, for a markup-safe "
"string implementation"
msgstr "`MarkupSafe <https://pypi.org/project/MarkupSafe/>`_用于转义字符的安全处理"
#: ../../install.rst:74 0222b4cdfdcb48839f5f6b092071db99
msgid ""
"`python-dateutil <https://pypi.org/project/python-dateutil/>`_, to read "
"the date metadata"
msgstr ""
"`python-dateutil <https://pypi.org/project/python-"
"dateutil/>`_用于读取日期相关的元数据"
#: ../../install.rst:78 49117127302b49b39bd5b86abae18709
msgid "Upgrading"
msgstr "更新升级"
#: ../../install.rst:80 93962c7d303f4c9fa5ad9d43f86ea50a
msgid ""
"If you installed a stable Pelican release via Pip_ and wish to upgrade to"
" the latest stable release, you can do so by adding ``--upgrade``::"
msgstr "若是通过 Pip_ 安装了稳定版本的Pelican可以通过在安装命令中添加 ``--upgrade`` 来升级到最新版:"
#: ../../install.rst:85 1ac1fa009f9e4245ae7f975bda7d5a22
msgid ""
"If you installed Pelican via distutils or the bleeding-edge method, "
"simply perform the same step to install the most recent version."
msgstr "若是通过distutils安装或是通过Git安装了测试版的Pelican重新进行一遍和安装时同样的步骤即可。"
#: ../../install.rst:89 7845fa285f0b4dcd8e881c9edd61f80c
msgid "Kickstart your site"
msgstr "启动网站"
#: ../../install.rst:91 488ad84175cb45f6a6bb26cec24c1f10
msgid ""
"Once Pelican has been installed, you can create a skeleton project via "
"the ``pelican-quickstart`` command, which begins by asking some questions"
" about your site::"
msgstr ""
"Pelican安装完成后通过 ``pelican-quickstart`` "
"命令创建项目的整体框架,在运行这个命令时,您需要输入一些与站点相关的信息:"
#: ../../install.rst:97 63a773d35b91455b944206337e527a3a
msgid ""
"If run inside an activated virtual environment, ``pelican-quickstart`` "
"will look for an associated project path inside "
"``$VIRTUAL_ENV/.project``. If that file exists and contains a valid "
"directory path, the new Pelican project will be saved at that location. "
"Otherwise, the default is the current working directory. To set the new "
"project path on initial invocation, use: ``pelican-quickstart --path "
"/your/desired/directory``"
msgstr ""
"如果是在虚拟环境中执行 ``pelican-quickstart`` ,系统会自动在 ``$VIRTUAL_ENV/.project`` "
"目录中查找这个命令。若这个这个命令存在并且路径是正确的一个新的Pelican项目就会在目标位置创建。否则会默认在当前的工作目录下创建这个项目。若要在初始化时指定项目路径请使用"
" ``pelican-quickstart --path /your/desired/directory``。"
#: ../../install.rst:104 b7cdf15328074880bb4fc69dcb7bd26f
msgid ""
"Once you finish answering all the questions, your project will consist of"
" the following hierarchy (except for *pages* — shown in parentheses below"
" — which you can optionally add yourself if you plan to create non-"
"chronological content)::"
msgstr ""
"当您回答完所有问题后,项目就会成功创建。项目中会包含下述的一些层级结构(除了用括号括起来的 "
"*pages*。如果有一些内容不需要按时间排序您可以将它们放在pages所在的位置"
#: ../../install.rst:118 05e4fe3b0d0a4c998fba451692a68725
msgid ""
"The next step is to begin to adding content to the *content* folder that "
"has been created for you."
msgstr "接下来就可以开始往 *content* 目录中添加自己创作的内容了。"

View file

@ -0,0 +1,172 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 19:06+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"
#: ../../internals.rst:2 5d90a7c7f9dd42b5ba1fdfc05c5e9c3c
msgid "Pelican internals"
msgstr "Pelican内部机制"
#: ../../internals.rst:4 fa53597118244e8585b3b0a9fb4336c0
msgid ""
"This section describe how Pelican works internally. As you'll see, it's "
"quite simple, but a bit of documentation doesn't hurt. :)"
msgstr ""
"这一节描述了Pelican的内部运行机制。你会发现Pelican的内部其实并不复杂。 :)"
#: ../../internals.rst:7 c9a34db098f34796b80ee62896702be2
msgid ""
"You can also find in the :doc:`report` section an excerpt of a report the"
" original author wrote with some software design information."
msgstr "你可以在 :doc:`report` 一节中找到原作者用软件设计相关内容报告的节选。"
#: ../../internals.rst:13 ac2af84842574bef9a791b416e21834e
msgid "Overall structure"
msgstr "总体结构"
#: ../../internals.rst:15 fb7aea45b8f74c9c877bf2640d47aaac
msgid ""
"What Pelican does is take a list of files and process them into some sort"
" of output. Usually, the input files are reStructuredText and Markdown "
"files, and the output is a blog, but both input and output can be "
"anything you want."
msgstr ""
"Pelican做的事情其实很简单获取一个文件列表并将它们处理为某种输出。通常输入文件是"
"reStructuredText和Markdown文件输出是一个博客但事实上输入和输出都可以是你想要的"
"任何内容。"
#: ../../internals.rst:19 599649d1e9da4355ab02b50ea4fbdb19
msgid "The logic is separated into different classes and concepts:"
msgstr "系统的整体逻辑可以分为几个不同的类和概念:"
#: ../../internals.rst:21 8ec0821a726e4ade8046921cc09b3ea3
msgid ""
"**Writers** are responsible for writing files: .html files, RSS feeds, "
"and so on. Since those operations are commonly used, the object is "
"created once and then passed to the generators."
msgstr ""
"**Writers** 负责完成 html、RSS订阅源等等内容的文件写入。因为这些操作都是比较常用的"
"这个类只会被创建一次然后再传给Generators。"
#: ../../internals.rst:25 63c9a61869884147a8752e9be188e0e9
msgid ""
"**Readers** are used to read from various formats (HTML, Markdown and "
"reStructuredText for now, but the system is extensible). Given a file, "
"they return metadata (author, tags, category, etc.) and content (HTML-"
"formatted)."
msgstr ""
"**Readers** 用于读取不同格式的文件目前支持HTML、Markdown、reStructuredText"
"但可以继续扩展)。向**Readers**输入一个文件,它会返回文档的元数据(作者、标签、"
"分类等等与HTML格式的文档正文内容。"
#: ../../internals.rst:29 d9bc146ae213415b804cd93ebf43e340
msgid ""
"**Generators** generate the different outputs. For instance, Pelican "
"comes with ``ArticlesGenerator`` and ``PageGenerator``. Given a "
"configuration, they can do whatever they want. Most of the time, it's "
"generating files from inputs."
msgstr ""
"**Generators** 用以生成不同的输出Pelican自带了 ``ArticlesGenerator`` 和 "
"``PageGenerator`` 。给定一套配置信息, **Generators** 可以做几乎任何事。"
"但大多数情况下,它的工作就是从输入生成文件。"
#: ../../internals.rst:34 49ef39e8677a4529a3ee226faae1526b
msgid ""
"Pelican also uses templates, so it's easy to write your own theme. The "
"syntax is `Jinja2 <https://palletsprojects.com/p/jinja/>`_ and is very "
"easy to learn, so don't hesitate to jump in and build your own theme."
msgstr ""
"Pelican使用了模板引擎因此可以较为简单地编写自定义主题。模板语法使用的是易于学习的 "
"`Jinja2 <https://palletsprojects.com/p/jinja/>`_ ,因此快去构建你自己的主题吧。"
#: ../../internals.rst:39 1aef766f93d549afa332fad4278c4063
msgid "How to implement a new reader?"
msgstr "如何实现一个新的reader"
#: ../../internals.rst:41 abbbfc19ccea4e3ea3716179981e3c1d
msgid ""
"Is there an awesome markup language you want to add to Pelican? Well, the"
" only thing you have to do is to create a class with a ``read`` method "
"that returns HTML content and some metadata."
msgstr ""
"若是希望为Pelican添加一个标记语言只需要创建一个类实现 ``read`` 方法,并在其中"
"返回元数据和以HTML表示的正文内容。"
#: ../../internals.rst:45 1e9fc1bcc9444db4b751f1c621280a32
msgid "Take a look at the Markdown reader::"
msgstr "可以看一看Markdown的reader"
#: ../../internals.rst:71 cbc4f49384964be3a0a68b1083100839
msgid "Simple, isn't it?"
msgstr "是不是很简单呢?"
#: ../../internals.rst:73 02643c7e485d49e39344570ba5639a60
msgid ""
"If your new reader requires additional Python dependencies, then you "
"should wrap their ``import`` statements in a ``try...except`` block. "
"Then inside the reader's class, set the ``enabled`` class attribute to "
"mark import success or failure. This makes it possible for users to "
"continue using their favourite markup method without needing to install "
"modules for formats they don't use."
msgstr ""
"如果新创建的reader需要额外的Python依赖应该把 ``import`` 放在 ``try...except`` "
"块中。在reader类中设置类属性 ``enabled`` 来标记import是否成功。这使得用户能"
"继续使用他们喜欢的标记语言而无需安装用不到的模块。"
#: ../../internals.rst:80 02deeeac368b4dbc8c7b1025275d5bd5
msgid "How to implement a new generator?"
msgstr "如何实现一个新的generator"
#: ../../internals.rst:82 f7e5c28efbdb40c0bac7b985e8264310
msgid ""
"Generators have two important methods. You're not forced to create both; "
"only the existing ones will be called."
msgstr ""
"generator有两个重要方法。不一定两个都要创建若只创建了一个就会自动调用存在的方法。"
#: ../../internals.rst:85 01f2801461e043e7882167907e337d2c
msgid ""
"``generate_context``, that is called first, for all the generators. Do "
"whatever you have to do, and update the global context if needed. This "
"context is shared between all generators, and will be passed to the "
"templates. For instance, the ``PageGenerator`` ``generate_context`` "
"method finds all the pages, transforms them into objects, and populates "
"the context with them. Be careful *not* to output anything using this "
"context at this stage, as it is likely to change by the effect of other "
"generators."
msgstr ""
"``generate_context`` 会优先被调用,其中可以完成任何你想要做的事,如果需要的话,还要"
"更新全局上下文。全局上下文会在所有generator间共享并在之后传给模板。例如 "
"``PageGenerator`` 的 ``generate_context`` 方法会找寻所有页面,并将他们转换为对象,"
"再将上下文传入其中。注意,请 *不要* 在此阶段使用该上下文输出任何内容,因为其他"
"generator还会继续影响上下文。"
#: ../../internals.rst:93 3241d04af8944c48bf162963a774000c
msgid ""
"``generate_output`` is then called. And guess what is it made for? Oh, "
"generating the output. :) It's here that you may want to look at the "
"context and call the methods of the ``writer`` object that is passed as "
"the first argument of this function. In the ``PageGenerator`` example, "
"this method will look at all the pages recorded in the global context and"
" output a file on the disk (using the writer method ``write_file``) for "
"each page encountered."
msgstr ""
"``generate_output`` 会在 ``generate_context`` 之后被调用,用于生成要输出的内容。"
"此时就需要使用上下文并调用 ``writer`` 对象的方法,此 ``writer`` 就是传入 "
"``generate_output`` 方法的第一个参数。``PageGenerator`` 的 ``generate_output`` "
"方法中会使用writer的 ``write_file`` 方法为全局上下文中的每一个页面输出一个文件。"

View file

@ -0,0 +1,206 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 19:06+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"
#: ../../pelican-themes.rst:2 1fce54d5389b41f4a588e9b23b646aee
msgid "pelican-themes"
msgstr "pelican-themes"
#: ../../pelican-themes.rst:7 6158b329ed7b469286405115e2ed7fa0
msgid "Description"
msgstr "简介"
#: ../../pelican-themes.rst:9 3df74d6d079945f7a4e0062ed5ea3eed
msgid ""
"``pelican-themes`` is a command line tool for managing themes for "
"Pelican. See :ref:`settings/themes` for settings related to themes."
msgstr ""
"``pelican-themes`` 是一个命令行工具用于管理Pelican主题。有关主题的配置"
"请参考 :ref:`设置章节中的主题 <settings/themes>` 。"
#: ../../pelican-themes.rst:14 03eb76faf4544c8dbf478752096c7d7c
msgid "Usage"
msgstr "用法"
#: ../../pelican-themes.rst:16 d5dcdc6c26094f5695061f9c53633589
msgid "pelican-themes [-h] [-l] [-i theme path [theme path ...]]"
msgstr "pelican-themes [-h] [-l] [-i theme path [theme path ...]]"
#: ../../pelican-themes.rst:17 99b7a21ca612425da217b72b8c0c9b64
msgid "[-r theme name [theme name ...]]"
msgstr "[-r theme name [theme name ...]]"
#: ../../pelican-themes.rst:18 1f64db909173426dabee822aea3b269b
msgid "[-s theme path [theme path ...]] [-v] [--version]"
msgstr "[-s theme path [theme path ...]] [-v] [--version]"
#: ../../pelican-themes.rst:21 63ef4d44a1db4176b4c3866671a93603
msgid "Optional arguments:"
msgstr "可选参数:"
#: ../../pelican-themes.rst:24 348360945a0943ffa8122aad16bf0ec1
msgid "Show the help and exit"
msgstr "显示帮助信息并退出"
#: ../../pelican-themes.rst:26 aaec8d28264b45b7aac617b7140b5b13
msgid "Show the themes already installed"
msgstr "显示已安装的主题"
#: ../../pelican-themes.rst:28 c8d44b6ac6754f4e8e10a39848f042d0
msgid "One or more themes to install"
msgstr "安装一个或多个主题"
#: ../../pelican-themes.rst:30 18077fbf428e476aa218464fb0f18d8d
msgid "One or more themes to remove"
msgstr "移除一个或多个主题"
#: ../../pelican-themes.rst:32 e328d59886be45a6ae9530a0f2bea3ca
msgid ""
"Same as ``--install``, but create a symbolic link instead of copying the "
"theme. Useful for theme development"
msgstr ""
"和 ``--install`` 相同,区别在于此选项仅会创建一个符号链接到给定的目录,"
"而不会将主题完整拷贝。一般用于主题的开发"
#: ../../pelican-themes.rst:35 481c7a32a5e6400d83c9e2e56e6b94a4
msgid "Verbose output"
msgstr "开启详细输出"
#: ../../pelican-themes.rst:37 d7889dd20ac643ecad73e464ec4cfa55
msgid "Print the version of this script"
msgstr "显示此工具的版本信息"
#: ../../pelican-themes.rst:42 5c3d3aabd5304e8f9a6f0593824f1da6
msgid "Examples"
msgstr "例子"
#: ../../pelican-themes.rst:46 4d6ff63aae06482dbf22f41d4111b001
msgid "Listing the installed themes"
msgstr "列出已安装主题"
#: ../../pelican-themes.rst:48 91a9e942ea36479999586426afead753
msgid ""
"With ``pelican-themes``, you can see the available themes by using the "
"``-l`` or ``--list`` option:"
msgstr ""
"在 ``pelican-themes`` 中使用 ``-l`` 或 ``--list`` 选项,查看可用主题:"
#: ../../pelican-themes.rst:62 7a2f7dc98fcc45cabc4639576d503c28
msgid ""
"In this example, we can see there are three themes available: "
"``notmyidea``, ``simple``, and ``two-column``."
msgstr ""
"在上面的例子中,可以看到有三个主题可供使用: ``notmyidea`` 、 "
"``simple`` 、和 ``two-column`` 。"
#: ../../pelican-themes.rst:65 8c03dfa908114d92b8a9aeb6673555ce
msgid ""
"``two-column`` is followed by an ``@`` because this theme is not copied "
"to the Pelican theme path, but is instead just linked to it (see "
"`Creating symbolic links`_ for details about creating symbolic links)."
msgstr ""
"主题 ``two-column`` 后有一个 ``@`` 这是因为该主题没有被拷贝到Pelican的主题"
"路径下,而只是为其创建了一个符号链接 (详见 `创建符号链接`_ )。"
#: ../../pelican-themes.rst:69 bc91e8c3ff4a44dd9234d0ab186d8515
msgid ""
"Note that you can combine the ``--list`` option with the ``-v`` or "
"``--verbose`` option to get more verbose output, like this:"
msgstr ""
"当然,你可以将 ``--list`` 选项和 ``-v`` 或 ``--verbose`` 结合起来,从而"
"得到更详细的输出:"
#: ../../pelican-themes.rst:81 0b407ed71e6a4b428f5a582b58a47f3c
msgid "Installing themes"
msgstr "安装主题"
#: ../../pelican-themes.rst:83 e95f78a5c3b844b9a6fd2924f455748f
msgid ""
"You can install one or more themes using the ``-i`` or ``--install`` "
"option. This option takes as argument the path(s) of the theme(s) you "
"want to install, and can be combined with the ``--verbose`` option:"
msgstr ""
"使用 ``-i`` 或 ``--install`` 选项可以安装一个或多个主题。此选项将一个"
"或多个到达主题的路径作为参数,同样可以结合 ``--verbose`` 选项:"
#: ../../pelican-themes.rst:103 5b20e90396564e08860b2b3a569e7166
msgid "Removing themes"
msgstr "移除主题"
#: ../../pelican-themes.rst:105 2415bf89e3804c9dbdc34814b0132b8c
msgid ""
"The ``pelican-themes`` command can also remove themes from the Pelican "
"themes path. The ``-r`` or ``--remove`` option takes as argument the "
"name(s) of the theme(s) you want to remove, and can be combined with the "
"``--verbose`` option."
msgstr ""
"``pelican-themes`` 命令同样可用于移除Pelican主题文件夹下的主题。 ``-r`` 或 "
"``--remove`` 选项以一个或多个主题的名称为参数,同样也可以结合 ``--verbose`` "
"选项使用。"
#: ../../pelican-themes.rst:122 9ea5149543a648049444220a4041da69
msgid "Creating symbolic links"
msgstr "创建符号链接"
#: ../../pelican-themes.rst:124 17cdf3146683485ea72db5fbd9c1f60a
msgid ""
"``pelican-themes`` can also install themes by creating symbolic links "
"instead of copying entire themes into the Pelican themes path."
msgstr ""
"``pelican-themes`` 也可以通过创建符号链接来安装主题,如此便无需完整拷贝主题。"
#: ../../pelican-themes.rst:127 1d2c60b41c374936a9986a852d50e898
msgid ""
"To symbolically link a theme, you can use the ``-s`` or ``--symlink``, "
"which works exactly as the ``--install`` option:"
msgstr ""
"使用 ``-s`` 或 ``--symlink`` 选项来为主题创建符号链接,用法和 ``--install`` 选项相同:"
#: ../../pelican-themes.rst:134 66707a8607f549199dca6f93586d2d87
msgid ""
"In this example, the ``two-column`` theme is now symbolically linked to "
"the Pelican themes path, so we can use it, but we can also modify it "
"without having to reinstall it after each modification."
msgstr ""
"在上面的例子中, ``two-column`` 主题就已经在Pelican主题目录下创建了符号链接"
"也可以正常使用。如此,当我们修改主题后就无需重新进行安装。"
#: ../../pelican-themes.rst:138 93ec27a473b04bca9d2930a7cb6b609c
msgid "This is useful for theme development:"
msgstr "这对主题的开发是很有用的:"
#: ../../pelican-themes.rst:155 66d808308aa64fc9afcef8bdf03bca8b
msgid "Doing several things at once"
msgstr "同时执行多个操作"
#: ../../pelican-themes.rst:157 ace10a2c2f4d4adab9ade60631e82c38
msgid ""
"The ``--install``, ``--remove`` and ``--symlink`` options are not "
"mutually exclusive, so you can combine them in the same command line to "
"do more than one operation at time, like this:"
msgstr ""
"``--install`` 、 ``--remove`` 和 ``--symlink`` 可以同时使用,不会冲突,"
"因此可以在同一行命令中同时做多个操作:"
#: ../../pelican-themes.rst:169 e7adbac04b6a40fd986c02e834cc1756
msgid ""
"In this example, the theme ``notmyidea-cms`` is replaced by the theme "
"``notmyidea-cms-fr``"
msgstr ""
"在上面的例子中,用 ``notmyidea-cms-fr`` 替换了 ``notmyidea-cms`` 主题。"

View file

@ -0,0 +1,669 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-13 11:46+0800\n"
"PO-Revision-Date: 2024-06-26 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.17.0\n"
#: ../../plugins.rst:4 3df58bcad1a64350a8e763d87d7470e3
msgid "Plugins"
msgstr "插件"
#: ../../plugins.rst:6 5e0f2aa517254778a71d1e742b051645
msgid ""
"Beginning with version 3.0, Pelican supports plugins. Plugins are a way "
"to add features to Pelican without having to directly modify the Pelican "
"core."
msgstr "Pelican从3.0版本开始支持插件。通过插件不必直接修改Pelican的核心代码就可以给Pelican添加新功能。"
#: ../../plugins.rst:10 40ad4aad1dc54b929f6059031edae0d9
msgid "How to use plugins"
msgstr "如何使用插件"
#: ../../plugins.rst:12 8fc9f8cba76b4bb9930d80b5b985885a
msgid ""
"Starting with version 4.5, Pelican moved to a new plugin structure "
"utilizing namespace packages that can be easily installed via Pip_. "
"Plugins supporting this structure will install under the namespace "
"package ``pelican.plugins`` and can be automatically discovered by "
"Pelican. To see a list of Pip-installed namespace plugins that are active"
" in your environment, run::"
msgstr ""
"Pelican从4.5版本开始使用了一种全新的插件结构,利用了命名空间包,并且可以轻松地通过 Pip_ "
"进行安装。支持此结构地插件都会被安装在命名空间包 ``pelican.plugins`` "
"下因此Pelican可以自动发现他们。下面的命令可以用于查看环境中用Pip安装的所有插件"
#: ../../plugins.rst:20 de052285e7f645a9ab551433f3c07d46
msgid ""
"If you leave the ``PLUGINS`` setting as default (``None``), Pelican will "
"automatically discover namespace plugins and register them. If, on the "
"other hand, you specify a ``PLUGINS`` setting as a list of plugins, this "
"auto-discovery will be disabled. At that point, only the plugins you "
"specify will be registered, and you must explicitly list any namespace "
"plugins as well."
msgstr ""
"若将 ``PLUGINS`` 配置项设为默认的 ``None`` Pelican会自动发现命名空间中的插件并且将他们全部加载若你在 "
"``PLUGINS`` 设置项中指定了一系列的插件Pelican就不会去自动发现插件也就是说你需要显式地指定所有要使用的插件。"
#: ../../plugins.rst:26 a9675be841b84df584e67087cd23ab34
msgid ""
"If you are using the ``PLUGINS`` setting, you can specify plugins in two "
"ways. The first method specifies plugins as a list of strings. Namespace "
"plugins can be specified either by their full names "
"(``pelican.plugins.myplugin``) or by their short names (``myplugin``)::"
msgstr ""
"在配置 ``PLUGINS`` 时,有两种方式。一是用字符串列表指定插件的名称,可以是包含命名空间的完整名称(例如 "
"``pelican.plugins.myplugin`` ),也可以是简短名称( ``myplugin``"
#: ../../plugins.rst:35 188bf617180b4a7b9bc09f3fb1c201ae
msgid ""
"Alternatively, you can import them in your settings file and pass the "
"modules::"
msgstr "二是在设置文件中先import进来再将import进的模块放在 ``PLUGINS`` 设置项中:"
#: ../../plugins.rst:43 2d5db874810245a98b59ab080a0df1a5
msgid ""
"When experimenting with different plugins (especially the ones that deal "
"with metadata and content) caching may interfere and the changes may not "
"be visible. In such cases disable caching with ``LOAD_CONTENT_CACHE = "
"False`` or use the ``--ignore-cache`` command-line switch."
msgstr ""
"在尝试不同的插件时(尤其是那些处理元数据和内容的插件),缓存可能会相互干扰,一些更改不会生效。发生这种情况时,就需要通过设置 "
"``LOAD_CONTENT_CACHE = False`` 或使用 ``--ignore-cache`` 命令行选项禁用缓存。"
#: ../../plugins.rst:48 7421f93c1d714c9c853fc9311681515a
msgid ""
"If your plugins are not in an importable path, you can specify a list of "
"paths via the ``PLUGIN_PATHS`` setting. As shown in the following "
"example, paths in the ``PLUGIN_PATHS`` list can be absolute or relative "
"to the settings file::"
msgstr ""
"如果插件处于无法直接进行import的路径可以在 ``PLUGIN_PATHS`` 配置项中指定这些路径。如下例所示, "
"``PLUGIN_PATHS`` 中的路径可以是绝对的,也可以是相对于设置文件的:"
#: ../../plugins.rst:56 b8406038d0284d3fbef9d3de1fa7fd9f
msgid "Where to find plugins"
msgstr "在哪儿下载插件"
#: ../../plugins.rst:57 b07653ce77194a998630a55ae9511de5
msgid ""
"Namespace plugins can be found in the `pelican-plugins organization`_ as "
"individual repositories. Legacy plugins are located in the `pelican-"
"plugins repository`_ and will be gradually phased out in favor of the "
"namespace versions."
msgstr ""
"新的命名空间插件可以在GitHub的 `pelican-plugins 组织`_ "
"中找到每个插件都是一个独立的仓库。而老的插件则可以在GitHub的 `pelican-plugins 仓库`_ "
"中找到。这些老的插件会逐步淘汰并转移到新的命名空间版本。"
#: ../../plugins.rst:65 5c55fa6f3d664be2a49b8256dc2f6a2e
msgid ""
"Please note that while we do our best to review and maintain these "
"plugins, they are submitted by the Pelican community and thus may have "
"varying levels of support and interoperability."
msgstr "请注意尽管我们尽全力审查和维护这些插件但这些插件是Pelican社区提交的因此支持性和互操作性程度各不相同。"
#: ../../plugins.rst:70 25339a713a97492c88b0e60024ac34b8
msgid "How to create plugins"
msgstr "如何创建插件"
#: ../../plugins.rst:72 62b6b4a1a5f0486e8b3a39d6a7050f0a
msgid ""
"Plugins are based on the concept of signals. Pelican sends signals, and "
"plugins subscribe to those signals. The list of available signals is "
"documented in a subsequent section."
msgstr "插件是基于信号这一概念的。Pelican会发送信号插件则订阅这些信号。可用的信号在下一节会贴出来。"
#: ../../plugins.rst:76 f8f74b0257be46a1878e72e126166bd0
msgid ""
"The only rule to follow for plugins is to define a ``register`` callable,"
" in which you map the signals to your plugin logic. Let's take a simple "
"example::"
msgstr ""
"对于插件来说,唯一需要遵循的规则就是一定要定义一个可调用的 ``register`` ,在 ``register`` "
"中需要将信号映射到插件逻辑上。下面是一个简单的例子:"
#: ../../plugins.rst:93 163eebc74421416da2ad497830c42771
msgid ""
"Signal receivers are weakly-referenced and thus must not be defined "
"within your ``register`` callable or they will be garbage-collected "
"before the signal is emitted."
msgstr "信号接收器在Pelican中是弱引用的因此不能将它定义在可调用的 ``register`` 中,否则接收器在信号发送之前就会被回收。"
#: ../../plugins.rst:97 bb63bd2d24e341a1a4f7dfa118648d9a
msgid ""
"If multiple plugins connect to the same signal, plugins will be invoked "
"in the order they are registered. When the ``PLUGINS`` setting is "
"defined, plugin invocation order will be the order in which the plugins "
"are listed in the ``PLUGINS`` setting. If you rely on auto-discovered "
"namespace plugins and have no ``PLUGINS`` setting defined, plugins will "
"be invoked in the same order that they are discovered (the same order as "
"listed in the output of the ``pelican-plugins`` command). If you want to "
"specify the order explicitly, disable auto-discovery by defining "
"``PLUGINS`` in the desired order."
msgstr ""
"对于关联到同一个信号的多个插件,将按照它们注册的前后顺序执行。但若设置了 ``PLUGINS`` "
"配置项则会以此配置项中的顺序为准。如果您使用了无需PLUGINS设置的新版命名空间插件它们将按照被探测到的顺序进行连接与 pelican-"
"plugins 输出的顺序相同)。若您此时仍想要显式指定顺序,设置 ``PLUGINS`` 配置项即可。"
#: ../../plugins.rst:107 062aa3a3402141cfbd376d4fee1b5b34
msgid "Namespace plugin structure"
msgstr "命名空间插件的结构"
#: ../../plugins.rst:109 e6968290620d4de3b71ff62d5abba91f
msgid ""
"Namespace plugins must adhere to a certain structure in order to function"
" properly. They need to be installable (i.e. contain ``setup.py`` or "
"equivalent) and have a folder structure as follows::"
msgstr "命名空间插件必须遵循特定的结构才能正常工作。这些插件需要是可安装的(即包含 ``setup.py`` 或其他等效文件),并且遵循下述文件夹结构:"
#: ../../plugins.rst:122 b9782f71fae14bce9854b8b5056407d8
msgid ""
"It is crucial that ``pelican`` or ``pelican/plugins`` folder **not** "
"contain an ``__init__.py`` file. In fact, it is best to have those "
"folders empty besides the listed folders in the above structure and keep "
"your plugin related files contained solely in the "
"``pelican/plugins/myplugin`` folder to avoid any issues."
msgstr ""
"非常关键的一点就是, ``pelican`` 和 ``pelican/plugins`` 文件夹下都 **不能** 包含 "
"``__init__.py`` 文件。事实上,这两个文件夹下最好是只有上面列出的文件夹,并且保证与插件相关的文件都仅包含在 "
"``pelican/plugins/myplugin`` 文件夹中,以避免奇奇怪怪的问题。"
#: ../../plugins.rst:128 8440bc91329c498c90fadab556391a84
msgid ""
"To easily set up the proper structure, a `cookiecutter template for "
"plugins`_ is provided. Refer to that project's README for instructions on"
" how to use it."
msgstr "为了让大家更容易就能建立正确的结构,我们为插件提供了一个 `cookiecutter模板`_ 使用方法参考此项目README文件中的指示即可。"
#: ../../plugins.rst:134 bb029c6c9ea14a2dac684d516fb9a1eb
msgid "List of signals"
msgstr "信号列表"
#: ../../plugins.rst:136 968d92d9b3bb4491ad9c0e4a015e73f9
msgid "Here is the list of currently implemented signals:"
msgstr "下面是目前已经实现了的信号:"
#: ../../plugins.rst:139 f2db011f146d40bf9f07ec6b09c7c6d0
msgid "Signal"
msgstr "信号"
#: ../../plugins.rst:139 32f683cb25c74315ac803c62868bd7b2
msgid "Arguments"
msgstr "参数"
#: ../../plugins.rst:139 d02ae4c30dec40ae8bd894fda051562d
msgid "Description"
msgstr "描述"
#: ../../plugins.rst:141 d526b9cb6c3c409f9b2d243082dfbdc3
msgid "initialized"
msgstr "initialized"
#: ../../plugins.rst:141 ../../plugins.rst:142 ../../plugins.rst:160
#: ../../plugins.rst:163 0ab3e30cf009477980c4c619e0a7dc5e
#: 8cf4a2d70a234250a4d9f63e4e8cb49f a600f769faef42d99333442745c7b498
#: a69e7ba2df7a47658b2f0e4ade60d455
msgid "pelican object"
msgstr "pelican object"
#: ../../plugins.rst:142 3aff44965eec41269a45fd0b84b8b5d7
msgid "finalized"
msgstr "finalized"
#: ../../plugins.rst:142 6a3bd6c773b245af9151ff5669ef7f84
msgid ""
"invoked after all the generators are executed and just before pelican "
"exits useful for custom post processing actions, such as: - minifying "
"js/css assets. - notify/ping search engines with an updated sitemap."
msgstr "所有generator执行完成后调用即pelican退出之前。这对于自定义后处理操作是非常有用的例如可以简化js/css资源、向搜索引擎告知更新后的sitemap。"
#: ../../plugins.rst:146 eecb5a5dc1b84f94a830db617122f365
msgid "generator_init"
msgstr "generator_init"
#: ../../plugins.rst:146 b01311f8da704b55b38e23149c60bc22
msgid "generator"
msgstr "generator"
#: ../../plugins.rst:146 a3c477e7a8d04e94af4ee7a82c873ef2
msgid "invoked in the Generator.__init__"
msgstr "在Generator.__init__中调用"
#: ../../plugins.rst:147 246a49eb99d34589ac409e5613f27069
msgid "all_generators_finalized"
msgstr "all_generators_finalized"
#: ../../plugins.rst:147 0dafe1a8f7224b1bbe1af3ebeeac0b31
msgid "generators"
msgstr "generators"
#: ../../plugins.rst:147 9d5130f91ac748e58d96cfba7711e8f6
msgid "invoked after all the generators are executed and before writing output"
msgstr "在所有generator执行完后写入输出内容前调用"
#: ../../plugins.rst:148 3a7f543549164bb684f47daa5b1b9bd1
msgid "readers_init"
msgstr "readers_init"
#: ../../plugins.rst:148 0946829014734c53a0b1e389df853daf
msgid "readers"
msgstr "readers"
#: ../../plugins.rst:148 380ba486fff24555b3c312bee4645d23
msgid "invoked in the Readers.__init__"
msgstr "在Readers.__init__中调用"
#: ../../plugins.rst:149 ../../plugins.rst:203 04aa2b44a0b84da9b62b952b627a2b5c
#: e725d629327b48e3a7dffad1d07d81d2
msgid "article_generator_context"
msgstr "article_generator_context"
#: ../../plugins.rst:149 f0c440ead7fc46e2a90685c3fdffb5d4
msgid "article_generator, metadata"
msgstr "article_generator, metadata"
#: ../../plugins.rst:150 ../../plugins.rst:205 2ed41de1aaed481195aeacbc841459be
#: e9e159b6d49d4cd29ebbe6eb6e0bb3b1
msgid "article_generator_preread"
msgstr "article_generator_preread"
#: ../../plugins.rst:150 ../../plugins.rst:152 ../../plugins.rst:153
#: ../../plugins.rst:156 37277bd83e254f47b6df91ba6790f79e
#: 9d3b745b96114ff7931cbcc372901c3e b89f87d254984ec59e25045227c708bf
#: d38f0e2931b84b82adcc5aca5a4c2233
msgid "article_generator"
msgstr "article_generator"
#: ../../plugins.rst:150 7a45243569e84c1e9d5d49b5c1a7b86a
msgid ""
"invoked before a article is read in ArticlesGenerator.generate_context; "
"use if code needs to do something before every article is parsed"
msgstr "在ArticlesGenerator.generate_context读取文章之前调用若代码需要在解析每篇文章前执行某些操作就可以使用此信号。"
#: ../../plugins.rst:152 87c8e4ad4a104cb889172025f1b0229b
msgid "article_generator_init"
msgstr "article_generator_init"
#: ../../plugins.rst:152 46c1e5fbb90a4668afda3d66e4520689
msgid "invoked in the ArticlesGenerator.__init__"
msgstr "在ArticlesGenerator.__init__中调用"
#: ../../plugins.rst:153 de4b631d41e946c485ebb813e3dd6b62
msgid "article_generator_pretaxonomy"
msgstr "article_generator_pretaxonomy"
#: ../../plugins.rst:153 697a45a251fe4188b1f32cec631427b9
msgid ""
"invoked before categories and tags lists are created useful when e.g. "
"modifying the list of articles to be generated so that removed articles "
"are not leaked in categories or tags"
msgstr "在创建类别和标签列表之前调用。例如,当需要变更要生成的文章列表时可以使用,如此可以避免一些已移除文章在分类或标签列表中泄露。"
#: ../../plugins.rst:156 ../../plugins.rst:204 051dcac75cbf4f5ea3a665e6da642324
#: 2360e283fdd142ab8d65792581522e72
msgid "article_generator_finalized"
msgstr "article_generator_finalized"
#: ../../plugins.rst:156 0c3c808d5b7044018f8566ccc6dd3010
msgid "invoked at the end of ArticlesGenerator.generate_context"
msgstr "在ArticlesGenerator.generate_context的最后调用"
#: ../../plugins.rst:157 60d78048da4843a7a0307218c078d151
msgid "article_generator_write_article"
msgstr "article_generator_write_article"
#: ../../plugins.rst:157 2ac0d0e7306a4d5086bb2e8b7b17ffb1
msgid "article_generator, content"
msgstr "article_generator, content"
#: ../../plugins.rst:157 565551e010964925b10a3b5734913119
msgid "invoked before writing each article, the article is passed as content"
msgstr "在写入每篇文章前调用,文章以内容的形式作为参数传入。"
#: ../../plugins.rst:158 fd7918c3200f4714b028c8d0a200df98
msgid "article_writer_finalized"
msgstr "article_writer_finalized"
#: ../../plugins.rst:158 e54633543dbf4e5fb2dd4c1bfc09b1c1
msgid "article_generator, writer"
msgstr "article_generator, writer"
#: ../../plugins.rst:158 965e61a0fd6347faa2d7224a50a98b76
msgid ""
"invoked after all articles and related pages have been written, but "
"before the article generator is closed."
msgstr "在所有文章及相关联页面写入完成后在文章generator关闭前调用。"
#: ../../plugins.rst:160 30df01c5c11a4ed58b006d78b007c68d
msgid "get_generators"
msgstr "get_generators"
#: ../../plugins.rst:160 758447f5e55a4738a14486b0e962034d
msgid ""
"invoked in Pelican.get_generator_classes, can return a Generator, or "
"several generators in a tuple or in a list."
msgstr "在Pelican.get_generator_classes中调用可以返回一个Generator也可以以一个元组或列表的形式返回多个generator。"
#: ../../plugins.rst:163 730e948388a24435be216830e0af5be6
msgid "get_writer"
msgstr "get_writer"
#: ../../plugins.rst:163 df9f9fef24984c4bad07b8834e79352f
msgid "invoked in Pelican.get_writer, can return a custom Writer."
msgstr "在Pelican.get_writer前调用可以返回一个自定义Writer。"
#: ../../plugins.rst:165 ../../plugins.rst:206 1c172b26e92543d2be488a88cceaf576
#: 252231854c504621b28243dfba9d88ab
msgid "page_generator_context"
msgstr "page_generator_context"
#: ../../plugins.rst:165 a830e240c6564552ba4952bc657120a9
msgid "page_generator, metadata"
msgstr "page_generator, metadata"
#: ../../plugins.rst:166 ../../plugins.rst:207 09add2ea39344ad8936296a07cfd8e82
#: 0fc3cf365d9d418b8225e8f1f5da76d0
msgid "page_generator_preread"
msgstr "page_generator_preread"
#: ../../plugins.rst:166 ../../plugins.rst:168 ../../plugins.rst:169
#: 3c31cfe2f4744cd987f1638a4b82e5de a80ec8c388cb477abbcfc4f558d34df7
#: d485c4f9c2c443748234827727cc887e
msgid "page_generator"
msgstr "page_generator"
#: ../../plugins.rst:166 4d8b96aa6ebf47d885cd978c336679ff
msgid ""
"invoked before a page is read in PageGenerator.generate_context; use if "
"code needs to do something before every page is parsed."
msgstr "在PageGenerator.generate_context读取页面前调用若代码需要在解析每个页面前执行某些操作就可以使用此信号。"
#: ../../plugins.rst:168 ../../plugins.rst:209 06adf06d2b204100b9f80850b84bdff0
#: c0988434a401410e8cf6b4528e6d2870
msgid "page_generator_init"
msgstr "page_generator_init"
#: ../../plugins.rst:168 d359da10912949fa999dc3ad5215be66
msgid "invoked in the PagesGenerator.__init__"
msgstr "在PagesGenerator.__init__中调用"
#: ../../plugins.rst:169 ../../plugins.rst:208 0994b38b87704caea04ef0671a7b1c67
#: a97cf5f236a64959aa09838dbe03dfdc
msgid "page_generator_finalized"
msgstr "page_generator_finalized"
#: ../../plugins.rst:169 4cfdfe952daf4e3ea5ea1c8b2cf7a664
msgid "invoked at the end of PagesGenerator.generate_context"
msgstr "在PagesGenerator.generate_context的最后调用"
#: ../../plugins.rst:170 7e2504584a1b4fa4ae88c5002bcbb26f
msgid "page_generator_write_page"
msgstr "page_generator_write_page"
#: ../../plugins.rst:170 ea204a5fe703472ea5afea283135b94d
msgid "page_generator, content"
msgstr "page_generator, content"
#: ../../plugins.rst:170 22dd198fe6dc498f944e2c0e2c595c6c
msgid "invoked before writing each page, the page is passed as content"
msgstr "在写入每个页面前调用,页面以内容形式作为参数传入"
#: ../../plugins.rst:171 84d5def2c4fc4a2489d2b4fc1fa445df
msgid "page_writer_finalized"
msgstr "page_writer_finalized"
#: ../../plugins.rst:171 c55d65276a4e49c58c34d12cc062c90d
msgid "page_generator, writer"
msgstr "page_generator, writer"
#: ../../plugins.rst:171 b2a3d1c7c2864a08829833bc16b3223e
msgid ""
"invoked after all pages have been written, but before the page generator "
"is closed."
msgstr "调用于所有页面写入完成后在页面generator关闭前。"
#: ../../plugins.rst:173 ../../plugins.rst:210 097c5b3dc1d34a5eb7c1b4ae67179b3e
#: a420152f887e4977bdd26a5fa7230915
msgid "static_generator_context"
msgstr "static_generator_context"
#: ../../plugins.rst:173 1bbacfe960644e4a902b9c866e3fffce
msgid "static_generator, metadata"
msgstr "static_generator, metadata"
#: ../../plugins.rst:174 ../../plugins.rst:211 c1242bcf76fc40568f67a2ce4e70c0bb
#: f407aa94870645c891bb349edc3ae9a4
msgid "static_generator_preread"
msgstr "static_generator_preread"
#: ../../plugins.rst:174 ../../plugins.rst:177 ../../plugins.rst:178
#: 36f5be5c982b42d097c0465f542e490f cf0ebefd743246dd9db1b37a8c6a43a8
#: d5cd54887d904bcca02b0df4f22580e9
msgid "static_generator"
msgstr "static_generator"
#: ../../plugins.rst:174 1b2fbadf156644429e66ad2e64d26658
msgid ""
"invoked before a static file is read in StaticGenerator.generate_context;"
" use if code needs to do something before every static file is added to "
"the staticfiles list."
msgstr "在StaticGenerator.generate_context读取静态文件前调用若代码需要在每个静态文件加入静态文件列表前进行一些修改就可以使用此信号。"
#: ../../plugins.rst:177 654377fe53434f77b3ba294b5689d1d4
msgid "static_generator_init"
msgstr "static_generator_init"
#: ../../plugins.rst:177 e9b3cbbde7a6443a81d025d1a4fe6145
msgid "invoked in the StaticGenerator.__init__"
msgstr "在StaticGenerator.__init__中调用"
#: ../../plugins.rst:178 202be739e43444f48f122d3e5f657a45
msgid "static_generator_finalized"
msgstr "static_generator_finalized"
#: ../../plugins.rst:178 06080672fd614d39a79aa6d3a783087f
msgid "invoked at the end of StaticGenerator.generate_context"
msgstr "在StaticGenerator.generate_context的最后调用"
#: ../../plugins.rst:179 ce174fb4533143518c13b16ab6dbe4c8
msgid "content_object_init"
msgstr "content_object_init"
#: ../../plugins.rst:179 5089a38bad1447cab62f350df8e76f31
msgid "content_object"
msgstr "content_object"
#: ../../plugins.rst:179 d105f652be424f5cad8bfaf7be69ec4b
msgid "invoked at the end of Content.__init__"
msgstr "在Content.__init__的最后调用"
#: ../../plugins.rst:180 dbda8a11bca744a4ba5fc51d044f1d6e
msgid "content_written"
msgstr "content_written"
#: ../../plugins.rst:180 c8ba95ebcc2e4c79ae79717a730fe504
msgid "path, context"
msgstr "path, context"
#: ../../plugins.rst:180 6d9caed8fa24400a86f8ede1c3ecb260
msgid "invoked each time a content file is written."
msgstr "每一次内容文件写入后调用。"
#: ../../plugins.rst:181 73a4265b050c4b32be186bb2cec59f30
msgid "feed_generated"
msgstr "feed_generated"
#: ../../plugins.rst:181 78fa3603986f417286f2e7440f5aff57
msgid "context, feed"
msgstr "context, feed"
#: ../../plugins.rst:181 13dcd9e5fb2f408db72b87b88877596b
msgid ""
"invoked each time a feed gets generated. Can be used to modify a feed "
"object before it gets written."
msgstr "每个feed生成前调用。可以用于在feed写入前修改之。"
#: ../../plugins.rst:183 3a959768d5704e459940cbfcf8e1459c
msgid "feed_written"
msgstr "feed_written"
#: ../../plugins.rst:183 86844bee049a445e87db283bdf325338
msgid "path, context, feed"
msgstr "path, context, feed"
#: ../../plugins.rst:183 e79185da7cb54bf5aa59a46846222391
msgid "invoked each time a feed file is written."
msgstr "每一个feed文件写入后调用。"
#: ../../plugins.rst:188 0fe0539bad1c4fcbbebbdaa98d328ee9
msgid ""
"Avoid ``content_object_init`` signal if you intend to read ``summary`` or"
" ``content`` properties of the content object. That combination can "
"result in unresolved links when :ref:`ref-linking-to-internal-content` "
"(see `pelican-plugins bug #314`_). Use ``_summary`` and ``_content`` "
"properties instead, or, alternatively, run your plugin at a later stage "
"(e.g. ``all_generators_finalized``)."
msgstr ""
"请避免使用 ``content_object_init`` 信号读取content对象的 ``summary`` 或 ``content`` "
"属性,这可能导致在 :ref:`ref-linking-to-internal-content` 时无法解析链接(请参阅 `pelican-"
"plugins bug #314`_ )。请改用 ``_summary`` 和 ``_content`` 属性,或者就在后续阶段再运行插件(例如 "
"``all_generators_finalized`` 时)。"
#: ../../plugins.rst:197 77ca681d0d7a4a9ea42f7eebf683f024
msgid ""
"After Pelican 3.2, signal names were standardized. Older plugins may "
"need to be updated to use the new names:"
msgstr "Pelican3.2之后,信号名都进行了标准化,较老的插件可能需要进行更新:"
#: ../../plugins.rst:201 c83f9215c5964ba49cb5ed849c777495
msgid "Old name"
msgstr "旧名称"
#: ../../plugins.rst:201 167435de345b443fa51c27b355121e14
msgid "New name"
msgstr "新名称"
#: ../../plugins.rst:203 bcdf136cbb2c4dedbd90f6e56f584c6b
msgid "article_generate_context"
msgstr "article_generate_context"
#: ../../plugins.rst:204 60fe5b91f4a54f0997f93d927b0d81c4
msgid "article_generate_finalized"
msgstr "article_generate_finalized"
#: ../../plugins.rst:205 31252537627f4042b7f7b4e0a4a33aeb
msgid "article_generate_preread"
msgstr "article_generate_preread"
#: ../../plugins.rst:206 719da4844a0a4b6fbb2cf2d9b7e51deb
msgid "pages_generate_context"
msgstr "pages_generate_context"
#: ../../plugins.rst:207 f7c865fd6824473aad024fc606235b48
msgid "pages_generate_preread"
msgstr "pages_generate_preread"
#: ../../plugins.rst:208 74c47460bacf4fd68f2536580efb1480
msgid "pages_generator_finalized"
msgstr "pages_generator_finalized"
#: ../../plugins.rst:209 b403e7f978c24d989d99587579f31d3c
msgid "pages_generator_init"
msgstr "pages_generator_init"
#: ../../plugins.rst:210 94e5184530c94cc48d00fd819fffd649
msgid "static_generate_context"
msgstr "static_generate_context"
#: ../../plugins.rst:211 00ca2c730ad840f584d3f9dd30daf0cd
msgid "static_generate_preread"
msgstr "static_generate_preread"
#: ../../plugins.rst:215 f8044e028ccd4d64954e24375a739cd2
msgid "Recipes"
msgstr "具体使用方法举例"
#: ../../plugins.rst:217 0c441d12047240199025f2d3ac954167
msgid ""
"We eventually realised some of the recipes to create plugins would be "
"best shared in the documentation somewhere, so here they are!"
msgstr "下面分享了一些创建插件的具体方法,请享用!"
#: ../../plugins.rst:221 bb96f2da7b3340cb9ed56ee1ad59796b
msgid "How to create a new reader"
msgstr "如何创建一个新的reader"
#: ../../plugins.rst:223 49dbbbd2c5ca4798a1b9d67b48630d36
msgid ""
"One thing you might want is to add support for your very own input "
"format. While it might make sense to add this feature in Pelican core, we"
" wisely chose to avoid this situation and instead have the different "
"readers defined via plugins."
msgstr "你可能需要添加对输入文件格式的特殊支持。这似乎可以作为Pelican核心的一个功能但我们选择避免将此功能放在核心中而是通过插件实现不同的reader。"
#: ../../plugins.rst:228 af8936c711204a0aa7c85835124065c5
msgid ""
"The rationale behind this choice is mainly that plugins are really easy "
"to write and don't slow down Pelican itself when they're not active."
msgstr "做出这个决定主要是因为实现这样的格式支持插件非常容易而且这样在不需要此功能时也不会影响Pelican自身的速度。"
#: ../../plugins.rst:231 11dac8bd71994c18a289086ec95a0273
msgid "No more talking — here is an example::"
msgstr "多说无益,下面是一个具体例子:"
#: ../../plugins.rst:267 f6bf903ae8de4ac183ecea699de568dc
msgid "Adding a new generator"
msgstr "添加新的generator"
#: ../../plugins.rst:269 50d39b45550446a493a6d5d6eb971103
msgid ""
"Adding a new generator is also really easy. You might want to have a look"
" at :doc:`internals` for more information on how to create your own "
"generator."
msgstr "添加一个generator也非常简单你可能会想要看一看 :doc:`internals` 其中有关于如何创建generator的内容。"
#: ../../plugins.rst:283 1b4bc8c2b02645dd81b06ffdbd759c36
msgid "Adding a new writer"
msgstr "添加新的writer"
#: ../../plugins.rst:285 ac526121b895429d8412605bca594684
msgid ""
"Adding a writer will allow you to output additional file formats to disk,"
" or change how the existing formats are written to disk. Note that only "
"one writer will be active at a time, so be sure to either subclass the "
"built-in Writer, or completely re-implement it."
msgstr "添加writer可以让你将其他文件格式输出到磁盘或者可以改变现有格式写入磁盘的方式。请注意一次只能启用一个writer因此请确保继承了内置的Writer并且完全重新实现之。"
#: ../../plugins.rst:290 4335016710cd417ca9b8068cb7a45d51
msgid "Here is a basic example of how to set up your own writer::"
msgstr "下面是启用你的自定义writer的一个基本例子"
#: ../../plugins.rst:310 c65b371d4bf740c49dfe190407c9af69
msgid "Using Plugins to Inject Content"
msgstr "使用插件添加内容"
#: ../../plugins.rst:312 9f180f86d09f43d7aff4607bb7deb6f1
msgid ""
"You can programmatically inject articles or pages using plugins. This can"
" be useful if you plan to fetch articles from an API, for example."
msgstr "可以通过插件以可编程的方式添加文章或页面。如果你打算从某些API获取文章这就会很有用。"
#: ../../plugins.rst:315 a65dd6bb4d0e48438dcf6d545bfaa053
msgid ""
"Following is a simple example of how one can build a plugin that injects "
"a custom article, using the ``article_generator_pretaxonomy`` signal::"
msgstr "下面是一个简单的示例,说明了如何使用 ``article_generator_pretaxonomy`` 信号构建一个添加自定义文章的插件:"

View file

@ -0,0 +1,329 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 19:06+0800\n"
"PO-Revision-Date: 2024-06-25 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"
#: ../../publish.rst:2 65617cfb871b492589d55186b708a1ce
msgid "Publish your site"
msgstr "发布站点"
#: ../../publish.rst:7 dc4c9b1c1afd477d906b892dc592bdcd
msgid "Site generation"
msgstr "站点生成"
#: ../../publish.rst:9 610c37360e2b49ec8ea630ddc224d2b7
msgid ""
"Once Pelican is installed and you have some content (e.g., in Markdown or"
" reST format), you can convert your content into HTML via the ``pelican``"
" command, specifying the path to your content and (optionally) the path "
"to your :doc:`settings<settings>` file::"
msgstr ""
"您应该已经安装好Pelican并且已经创作了一些内容了吧以Markdown或是reST格式"
"现在就可以将这些内容通过 ``pelican`` 命令转换为HTML了在转换时需要指定"
"创作内容存放的路径;如果有需要, :doc:`配置<settings>` 文件的路径也可单独指定:"
#: ../../publish.rst:16 6f353c84f5204d2b84c49d1557010b19
msgid ""
"The above command will generate your site and save it in the ``output/`` "
"folder, using the default theme to produce a simple site. The default "
"theme consists of very simple HTML without styling and is provided so "
"folks may use it as a basis for creating their own themes."
msgstr ""
"上面的指令会在 ``output/`` 目录下生成站点,使用的是默认的主题。默认主题只使用"
"一些简单的HTML并且不包含样式大家往往以这个简单主题为基础来创作自己的主题。"
#: ../../publish.rst:21 bb5064d57ed144e6b85d7d3d0938f91c
msgid ""
"You can also tell Pelican to watch for your modifications, instead of "
"manually re-running it every time you want to see your changes. To enable"
" this, run the ``pelican`` command with the ``-r`` or ``--autoreload`` "
"option. On non-Windows environments, this option can also be combined "
"with the ``-l`` or ``--listen`` option to simultaneously both auto-"
"regenerate *and* serve the output at http://localhost:8000::"
msgstr ""
"你也可以让Pelican来监听对源内容文件的修改而不是在每次修改内容后重新手动执行命令"
"来生成站点。在执行 ``pelican`` 命令时,加上 ``-r`` 或者 ``--autoreload`` 选项"
"就可以做到这一点。在非Windows环境下这个选项还可以和 ``-l`` 或 ``--listen`` "
"搭配使用,这样就可以在自动重生成站点的基础上,同时提供在 http://localhost:8000 "
"上的访问:"
#: ../../publish.rst:30 40089a6762204e27bd16afaa038a8277
msgid ""
"Pelican has other command-line switches available. Have a look at the "
"help to see all the options you can use::"
msgstr ""
"Pelican还有一些其他的命令行选项。可以在帮助中看到所有可用选项"
#: ../../publish.rst:36 4484bb6f6e2b4bd49027c98be4fa2cd8
msgid "Viewing the generated files"
msgstr "浏览生成的文件"
#: ../../publish.rst:38 4dc83b844c964bcab17af21fabd5e6b2
msgid ""
"The files generated by Pelican are static files, so you don't actually "
"need anything special to view them. You can use your browser to open the "
"generated HTML files directly::"
msgstr ""
"Pelican生成的文件都是静态的也就是说不需要使用什么特殊的手段就可以浏览。"
"您可以直接使用浏览器打开生成的HTML文件"
#: ../../publish.rst:44 c5774634f7da4f64bb7c7d0adbcdb65b
msgid ""
"Because the above method may have trouble locating your CSS and other "
"linked assets, running Pelican's simple built-in web server will often "
"provide a more reliable previewing experience::"
msgstr ""
"事实上上面所说的直接打开的方式可能会使CSS或其他链接上出现问题"
"可以运行Pelican自带的简易web服务器如此便可以获得可靠的预览体验"
#: ../../publish.rst:50 b2eab6914b854b40bd769433fbad21b7
msgid ""
"Once the web server has been started, you can preview your site at: "
"http://localhost:8000/"
msgstr ""
"当web服务器启动后可以访问 http://localhost:8000/ 来预览您的站点。"
#: ../../publish.rst:54 3b7344cad46a4dfaa01c067dd1f4009b
msgid "Deployment"
msgstr "部署"
#: ../../publish.rst:56 de2815c211b84291a985a1d808ffbfe7
msgid ""
"After you have generated your site, previewed it in your local "
"development environment, and are ready to deploy it to production, you "
"might first re-generate your site with any production-specific settings "
"(e.g., analytics, feeds, etc.) that you may have defined::"
msgstr ""
"当您生成好站点后,可以在本地先进行预览,确认无误后,在部署前可能还需使用"
"生产环境特定的配置文件重新生成站点:"
#: ../../publish.rst:63 56e568114b72443ebcf1f741f07504dc
msgid ""
"To base your publish configuration on top of your ``pelicanconf.py``, you"
" can import your ``pelicanconf`` settings by including the following line"
" in your ``publishconf.py``::"
msgstr ""
"您可以基于 ``pelicanconf.py`` 进行设置文件的配置, 在 ``publishconf.py`` "
"中import ``pelicanconf`` 就可实现(译者注:配置文件其实本质上就是一些"
"Python变量因此import后就可以全部引入"
#: ../../publish.rst:69 b9e1243ed9ba409890d86ef8ff85499d
msgid ""
"If you have generated a ``publishconf.py`` using ``pelican-quickstart``, "
"this line is included by default."
msgstr ""
"如果 ``publishconf.py`` 是通过 ``pelican-quickstart`` 生成的,上面这行默认就有。"
#: ../../publish.rst:72 39671d42b0bb4c828fc51c63c351402c
msgid ""
"The steps for deploying your site will depend on where it will be hosted."
" If you have SSH access to a server running Nginx or Apache, you might "
"use the ``rsync`` tool to transmit your site files::"
msgstr ""
"部署站点的方法步骤取决于网站托管的位置。对于使用SSH访问的运行着Nginx或"
"Apache的服务器您可能需要使用 ``rsync`` 工具来传输站点文件:"
#: ../../publish.rst:78 523ed256e0164a968d8580310e4a9304
msgid ""
"There are many other deployment options, some of which can be configured "
"when first setting up your site via the ``pelican-quickstart`` command. "
"See the :doc:`Tips<tips>` page for detail on publishing via GitHub Pages."
msgstr ""
"还有很多其他的部署方式供您选择,有一些在第一次通过 ``pelican-quickstart`` "
"命令建立站点时就已经配置。在 :doc:`小技巧<tips>` 中可以查看如何通过"
"Github Pages部署站点。"
#: ../../publish.rst:83 c44ecc79922d419b8627706a6694dd8c
msgid "Automation"
msgstr "自动化"
#: ../../publish.rst:85 b892dcba14a84306aa6b39295b5f81e3
msgid ""
"While the ``pelican`` command is the canonical way to generate your site,"
" automation tools can be used to streamline the generation and "
"publication flow. One of the questions asked during the ``pelican-"
"quickstart`` process pertains to whether you want to automate site "
"generation and publication. If you answered \"yes\" to that question, a "
"``tasks.py`` and ``Makefile`` will be generated in the root of your "
"project. These files, pre-populated with certain information gleaned from"
" other answers provided during the ``pelican-quickstart`` process, are "
"meant as a starting point and should be customized to fit your particular"
" needs and usage patterns. If you find one or both of these automation "
"tools to be of limited utility, these files can be deleted at any time "
"and will not affect usage of the canonical ``pelican`` command."
msgstr ""
"``pelican`` 命令是生成站点的标准方法,但同时也有自动化工具可以用来简化生成与"
"发布流程。在 ``pelican-quickstart`` 的过程中,其中一个问题就是是否启用自动站点"
"生成与发布。若您选择了 “yes”在项目的根目录中就会生成 ``tasks.py`` "
"和 ``Makefile`` 。这些文件中预填充了一些从 ``pelican-quickstart`` 过程中"
"收集的信息,您应该从这个生成好的文件出发,再根据实际需要进一步修改。"
"另外,如果您认为这些自动化脚本文件没什么用,完全可以将他们删除,这不会对标准命令 "
"``pelican`` 产生任何影响。"
#: ../../publish.rst:98 4c49ca3a24e3462a984dda738875ed4e
msgid ""
"Following are automation tools that \"wrap\" the ``pelican`` command and "
"can simplify the process of generating, previewing, and uploading your "
"site."
msgstr ""
"下面是一些自动化工具,其中包装了 ``pelican`` 命令,可以用于简化生成、预览和"
"上传站点的过程。"
#: ../../publish.rst:102 103fb7405038442aae62b62ea0fcdbe5
msgid "Invoke"
msgstr "Invoke"
#: ../../publish.rst:104 d3e46bf8da96489e923f6497e8932538
msgid ""
"The advantage of Invoke_ is that it is written in Python and thus can be "
"used in a wide range of environments. The downside is that it must be "
"installed separately. Use the following command to install Invoke, "
"prefixing with ``sudo`` if your environment requires it::"
msgstr ""
"Invoke_ 工具使用Python作为编程语言并且能够用在很多不同的环境中。它需要使用"
"下面的命令单独安装,在某些操作系统中可能需要在前面加上 ``sudo`` "
#: ../../publish.rst:111 786359d08e8f45598df7b1c45e32ca0a
msgid ""
"Take a moment to open the ``tasks.py`` file that was generated in your "
"project root. You will see a number of commands, any one of which can be "
"renamed, removed, and/or customized to your liking. Using the out-of-the-"
"box configuration, you can generate your site via::"
msgstr ""
"可以打开 ``tasks.py`` 文件看看其中的代码,可以尝试更改和删除其中的命令,"
"也可以按照您的喜好自行进行其他修改。生成好的文件是开箱即用的,您可以通过"
"下面的命令生成站点:"
#: ../../publish.rst:118 ../../publish.rst:166 04c6045b58c24bc1a1fd594cdcf4ef5c
#: 1e9cf29276ec4446b1b0f4a55a1ef4b8
msgid ""
"If you'd prefer to have Pelican automatically regenerate your site every "
"time a change is detected (which is handy when testing locally), use the "
"following command instead::"
msgstr ""
"若您希望Pelican在检测到变化时自动重新生成站点在本地测试的时候很实用"
"可以使用下面的命令:"
#: ../../publish.rst:124 ../../publish.rst:172 fabe0ce08eca4c5ebd9ca65898dab138
#: ff42351e29b944a59e8df22b1cbb20f5
msgid ""
"To serve the generated site so it can be previewed in your browser at "
"http://localhost:8000/::"
msgstr ""
"下面的命令则可以让您在生成后通过浏览器访问 http://localhost:8000/ 来预览站点"
#: ../../publish.rst:129 e1b12a6c64b246f89aea105b8d7febbc
msgid ""
"To serve the generated site with automatic browser reloading every time a"
" change is detected, first ``python -m pip install livereload``, then use"
" the following command::"
msgstr ""
"在每次检测到修改重生成站点后,可以让浏览器自动进行重载。先运行 "
"``python -m pip install livereload`` 安装,再运行下面的这条命令就可以实现:"
#: ../../publish.rst:135 bf0d6c7770fe4a399b81b9ebdd48fa4e
msgid ""
"If during the ``pelican-quickstart`` process you answered \"yes\" when "
"asked whether you want to upload your site via SSH, you can use the "
"following command to publish your site via rsync over SSH::"
msgstr ""
"如果在 ``pelican-quickstart`` 过程中对是否要通过SSH上传站点问题回答了“yes”"
"您就可以使用下面的命令借助rsync在SSH上发布站点"
#: ../../publish.rst:141 9bea9f82ce164ee5ba07349a4c4d58ea
msgid ""
"These are just a few of the commands available by default, so feel free "
"to explore ``tasks.py`` and see what other commands are available. More "
"importantly, don't hesitate to customize ``tasks.py`` to suit your "
"specific needs and preferences."
msgstr ""
"默认就可以使用的命令远不止这些,在 ``tasks.py`` 中可以找到更多可用的命令。"
"更重要的是,当您有特定需求和偏好时,直接修改 ``tasks.py`` 即可。"
#: ../../publish.rst:147 06a6e7232c6243d79ab9f43ddc28590d
msgid "Make"
msgstr "Make"
#: ../../publish.rst:149 a2a5b589cf804fcd83ee2d0fbf98c12d
msgid ""
"A ``Makefile`` is also automatically created for you when you say \"yes\""
" to the relevant question during the ``pelican-quickstart`` process. The "
"advantage of this method is that the ``make`` command is built into most "
"POSIX systems and thus doesn't require installing anything else in order "
"to use it. The downside is that non-POSIX systems (e.g., Windows) do not "
"include ``make``, and installing it on those systems can be a non-trivial"
" task."
msgstr ""
"``Makefile`` 也是自动生成的。在大多数POSIX系统中都内置了 ``make`` 命令,"
"无需安装即可使用。但在非POSIX系统例如Windows中并没有 ``make`` ,在这些"
"系统中安装 ``make`` 则往往比较麻烦。"
#: ../../publish.rst:156 68c38c3eb34e4e6ca9cd4a2d3646d5cb
msgid ""
"If you want to use ``make`` to generate your site using the settings in "
"``pelicanconf.py``, run::"
msgstr ""
"使用 ``make`` 命令是以 ``pelicanconf.py`` 作为配置文件来生成站点的:"
#: ../../publish.rst:161 133e6e1ebf92412a85eedbe56e0b91af
msgid ""
"To generate the site for production, using the settings in "
"``publishconf.py``, run::"
msgstr ""
"使用 ``publishconf.py`` 作为配置文件来为生产环境生成站点:"
#: ../../publish.rst:177 f4e250949c2145ceb03b65c875767abc
msgid ""
"Normally you would need to run ``make regenerate`` and ``make serve`` in "
"two separate terminal sessions, but you can run both at once via::"
msgstr ""
"一般来说, ``make regenerate`` 和 ``make serve`` 需要在分别在单独的终端会话中"
"运行,下面的命令相当于同时运行上述两个命令:"
#: ../../publish.rst:182 1f83bbcf60134eef959370bb5ca402d9
msgid ""
"The above command will simultaneously run Pelican in regeneration mode as"
" well as serve the output at http://localhost:8000."
msgstr ""
"上面的命令会让Pelican在重生成模式下持续运行同样地您可以通过 "
"http://localhost:8000 访问生成的站点。"
#: ../../publish.rst:185 9274a68b1e3b4639bf638a044eda613d
msgid ""
"When you're ready to publish your site, you can upload it via the "
"method(s) you chose during the ``pelican-quickstart`` questionnaire. For "
"this example, we'll use rsync over ssh::"
msgstr ""
"当准备好发布站点时,可以使用在 ``pelican-quickstart`` 过程中选择的方法进行上传。"
"下面的例子使用rsync在ssh上完成这一工作"
#: ../../publish.rst:191 9d7e7927c183491f981aacebe14e5bf1
msgid "That's it! Your site should now be live."
msgstr "OK您的站点现在已经可以访问了。"
#: ../../publish.rst:193 8f570acd5f494f5b9645fdbca6db6fbb
msgid ""
"(The default ``Makefile`` and ``devserver.sh`` scripts use the ``python``"
" and ``pelican`` executables to complete its tasks. If you want to use "
"different executables, such as ``python3``, you can set the ``PY`` and "
"``PELICAN`` environment variables, respectively, to override the default "
"executable names.)"
msgstr ""
"(默认的 ``Makefile`` 和 ``devserver.sh`` 脚本执行 ``python`` 和 ``pelican`` "
"来完成任务。若您希望使用其他的可执行文件,例如 ``python3`` ,设置环境变量 ``PY`` "
"和 ``PELICAN`` 来覆盖默认的可执行文件名)"

View file

@ -0,0 +1,151 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 19:06+0800\n"
"PO-Revision-Date: 2024-06-25 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"
#: ../../quickstart.rst:2 e5f32d61440744aab3f878488ef9e1e3
msgid "Quickstart"
msgstr "快速开始"
#: ../../quickstart.rst:4 d3762ec7c3934f85b25b04cf4024a90c
msgid ""
"Reading through all the documentation is highly recommended, but for the "
"truly impatient, following are some quick steps to get started."
msgstr ""
"强烈建议将所有文档完整地看一遍,但如果您目前没空,下面的步骤可以帮助您快速开始"
"使用Pelican。"
#: ../../quickstart.rst:8 c5982d5ecf7c445590254370b84995be
msgid "Installation"
msgstr "安装"
#: ../../quickstart.rst:10 fda7d08c05f14e2fa0c07a4a1d216db5
msgid ""
"Install Pelican (and optionally Markdown if you intend to use it) on "
"Python |min_python| by running the following command in your preferred "
"terminal, prefixing with ``sudo`` if permissions warrant::"
msgstr ""
"在命令行中执行下面的命令以安装Pelican如果您需要Markdown支持的话也可以同时安装之。"
"Pelican需要使用 |min_python| 以上版本的Python。在必要情况下请在命令前加上 ``sudo`` 。"
#: ../../quickstart.rst:17 9db650d9dc9d4ac48df4dd9fc0a246ac
msgid "Create a project"
msgstr "创建项目"
#: ../../quickstart.rst:19 2e9a72a878754604abdb27d9ec37937e
msgid ""
"First, choose a name for your project, create an appropriately-named "
"directory for your site, and switch to that directory::"
msgstr ""
"首先,给您的项目想个名字,并以合适的名字创建一个文件夹来存放您的站点。"
"接着,进入这个新创建的文件夹:"
#: ../../quickstart.rst:25 da759420dd8440b485936a5a054f142a
msgid ""
"Create a skeleton project via the ``pelican-quickstart`` command, which "
"begins by asking some questions about your site::"
msgstr ""
"通过 ``pelican-quickstart`` 命令创建一个项目的框架,执行这个命令后,"
"您需要输入一些站点相关的信息:"
#: ../../quickstart.rst:30 eb2d702c9f5a4981a93f805e98674cfe
msgid ""
"For questions that have default values denoted in brackets, feel free to "
"use the Return key to accept those default values [#tzlocal_fn]_. When "
"asked for your URL prefix, enter your domain name as indicated (e.g., "
"``https://example.com``)."
msgstr ""
"对于那些在括号中写了默认值的问题,完全可以直接回车以使用预设值 [#tzlocal_fn]_。"
"在输入站点URL的前缀prefix请根据提示的格式输入站点的域名例如 "
"``https://example.com``)。"
#: ../../quickstart.rst:36 66d29d63cce0488a8ec9e43ce97035f9
msgid "Create an article"
msgstr "创作文章"
#: ../../quickstart.rst:38 03af35552ef84e4491b46d8bf8c0f51e
msgid ""
"You cannot run Pelican until you have created some content. Use your "
"preferred text editor to create your first article with the following "
"content::"
msgstr ""
"您可以使用喜欢的文本编辑器来创建第一篇文章。下面是一个样例,可以将它作为您的第一篇文章:"
#: ../../quickstart.rst:47 165d46a3f9da4f949375c70115fdeb3b
msgid ""
"Given that this example article is in Markdown format, save it as "
"``~/projects/yoursite/content/keyboard-review.md``."
msgstr ""
"上面这篇文章是以Markdown的格式完成的一定要将其保存在站点目录的content文件夹下例如 "
"``~/projects/yoursite/content/keyboard-review.md``。"
#: ../../quickstart.rst:51 5cc306848439434f81708eddee812f0e
msgid "Generate your site"
msgstr "生成站点"
#: ../../quickstart.rst:53 03037d0c3b0b4a64b957f8284f008c9d
msgid ""
"From your project root directory, run the ``pelican`` command to generate"
" your site::"
msgstr ""
"在项目的根目录下,直接运行命令 ``pelican`` 就可以生成您自己的站点了:"
#: ../../quickstart.rst:57 abadae17b6f94e36b8603bad69f6e24f
msgid ""
"Your site has now been generated inside the ``output/`` directory. (You "
"may see a warning related to feeds, but that is normal when developing "
"locally and can be ignored for now.)"
msgstr ""
"站点会生成在 ``output/`` 目录下。此时可能会显示和feeds有关的警告这和当前的"
"本地开发环境有关,目前可以忽略之)"
#: ../../quickstart.rst:62 7cf36e609f544f02a0c800f8412cf79c
msgid "Preview your site"
msgstr "预览站点"
#: ../../quickstart.rst:64 1a64015c5cc9401bac0a6ac953164fb3
msgid ""
"Open a new terminal session, navigate to your project root directory, and"
" run the following command to launch Pelican's web server::"
msgstr ""
"打开一个新的命令行进入刚才项目的根目录执行下面的命令以运行一个Pelican web服务器"
#: ../../quickstart.rst:69 eb286b4785304d22a46e90884d26de07
msgid "Preview your site by navigating to http://localhost:8000/ in your browser."
msgstr "打开浏览器,进入 http://localhost:8000/ 就可以看到刚刚生成的站点了。"
#: ../../quickstart.rst:71 1dc30b5cb267402c9da251303ff59dbf
msgid ""
"Continue reading the other documentation sections for more detail, and "
"check out the Pelican wiki's Tutorials_ page for links to community-"
"published tutorials."
msgstr ""
"请继续阅读文档中的其他部分来了解Pelican的更多用法也可以前往Pelican的"
"wiki 教程_ 页面获取社区发布的教程。"
#: ../../quickstart.rst:78 6c135ea1cbb44400b446c0f9074e0fc5
msgid "Footnotes"
msgstr "脚注"
#: ../../quickstart.rst:80 911df4217fd94e6184502153ed0e53dc
msgid ""
"You can help localize default fields by installing the optional `tzlocal "
"<https://pypi.org/project/tzlocal/>`_ module."
msgstr ""
"您可以安装可选模块 `tzlocal <https://pypi.org/project/tzlocal/>`_ 来"
"本地化默认字段。"

View file

@ -0,0 +1,249 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 19:06+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"
#: ../../report.rst:2 bc25575efa494c7b9455e02eb5c514ab
msgid "Some history about Pelican"
msgstr "Pelican的一些历史"
#: ../../report.rst:6 959bbe068d2e4fd19e48be22706070d2
msgid ""
"This page comes from a report the original author (Alexis Métaireau) "
"wrote right after writing Pelican, in December 2010. The information may "
"not be up-to-date."
msgstr ""
"此页面来自原作者 Alexis Métaireau 在2010年12月完成Pelican后作的一篇报告因此"
"其中涉及的具体内容可能和最新的Pelican有些出入。"
#: ../../report.rst:10 598beb4776eb4a7bb1c928979752b1f1
msgid ""
"Pelican is a simple static blog generator. It parses markup files "
"(Markdown or reStructuredText for now) and generates an HTML folder with "
"all the files in it. I've chosen to use Python to implement Pelican "
"because it seemed to be simple and to fit to my needs. I did not wanted "
"to define a class for each thing, but still wanted to keep my things "
"loosely coupled. It turns out that it was exactly what I wanted. From "
"time to time, thanks to the feedback of some users, it took me a very few"
" time to provide fixes on it. So far, I've re-factored the Pelican code "
"by two times; each time took less than 30 minutes."
msgstr ""
"Pelican是一个简单的静态博客生成器。它解析标记文件目前主要是Markdown和"
"reStructuredText并生成一个文件夹其中包含了对应于标记文件的HTML。由于Python"
"很简单并且符合需求我选择使用Python来实现Pelican。我不想为每个东西定义一个类"
"但同时又想要各部件之间低耦合。事实证明,这正是我想要的。在发展过程中,多亏了用户"
"给的反馈我花了些时间修复了一些问题。到目前为止我已经将Pelican的代码重构了两次"
"每次重构都不会超过30分钟。"
#: ../../report.rst:21 1709ab99c3144cb692afd1d1bc388921
msgid "Use case"
msgstr "使用场景"
#: ../../report.rst:23 119f315a8e6c409d98783a636ac2147c
msgid ""
"I was previously using WordPress, a solution you can host on a web server"
" to manage your blog. Most of the time, I prefer using markup languages "
"such as Markdown or reStructuredText to type my articles. To do so, I use"
" vim. I think it is important to let the people choose the tool they want"
" to write the articles. In my opinion, a blog manager should just allow "
"you to take any kind of input and transform it to a weblog. That's what "
"Pelican does. You can write your articles using the tool you want, and "
"the markup language you want, and then generate a static HTML weblog."
msgstr ""
"我之前使用的是WordPress你可以将它部署在Web服务器上来管理博客。大多数时候"
"我更喜欢使用Markdown或reStructuredText等标记语言来撰写文章。为此我一般用vim"
"来写这些文章。我认为让大家自行选择用于写文章的工具是很重要的。在我看来,博客管理器"
"应该能够接受任何类型的输入并将其转换为博客站。Pelican就采取这一思想。您可以选择自己"
"喜欢的工具以及标记语言来撰写文章然后生成静态的HTML博客站。"
#: ../../report.rst:34 1a087a07690c4c35873a7f4ce18ba52b
msgid ""
"To be flexible enough, Pelican has template support, so you can easily "
"write your own themes if you want to."
msgstr ""
"为了足够的灵活性Pelican中支持使用模板这样你就可以编写自己的主题了。"
#: ../../report.rst:38 fca5a0962a0d4c27aa163f2aec94b1cf
msgid "Design process"
msgstr "设计过程"
#: ../../report.rst:40 073dd0b024fa4701acc0078b84c45648
msgid ""
"Pelican came from a need I have. I started by creating a single file "
"application, and I have make it grow to support what it does by now. To "
"start, I wrote a piece of documentation about what I wanted to do. Then, "
"I created the content I wanted to parse (the reStructuredText files) and "
"started experimenting with the code. Pelican was 200 lines long and "
"contained almost ten functions and one class when it was first usable."
msgstr ""
"Pelican来源于我的需求。从单文件应用程序出发不断成长为现在功能丰富的应用。首先我"
"写了一份需求文档然后创建了我想要解析的内容reStructuredText文件并开始"
"实验性的编写代码。Pelican的第一个能够使用的版本包含了200行代码、10个函数以及1个类。"
#: ../../report.rst:47 f407fc9ad9434f1082014eeca8c4cc89
msgid ""
"I have been facing different problems all over the time and wanted to add"
" features to Pelican while using it. The first change I have done was to "
"add the support of a settings file. It is possible to pass the options to"
" the command line, but can be tedious if there is a lot of them. In the "
"same way, I have added the support of different things over time: Atom "
"feeds, multiple themes, multiple markup support, etc. At some point, it "
"appears that the \"only one file\" mantra was not good enough for "
"Pelican, so I decided to rework a bit all that, and split this in "
"multiple different files."
msgstr ""
"我不断遇到各种问题在使用过程中还想要往Pelican中添加功能。在对代码的第一次修改中"
"添加了对配置文件的支持。虽然可以在命令行中往里传入选项,但当配置项多起来后,就会变得"
"异常冗长。同样地Pelican支持了越来越多的功能Atom订阅源、多主体支持、多标记语言"
"支持等等。在某一时刻单文件应用已经不适合Pelican了因此我决定多做些工作将应用分离"
"到多个文件中。"
#: ../../report.rst:56 57b3d1ba492646e28e20396b78df8ea0
msgid "Ive separated the logic in different classes and concepts:"
msgstr "我将系统整体逻辑分为如下几个类和概念:"
#: ../../report.rst:58 2d4090dba6674569a7e1088919185aa5
msgid ""
"*writers* are responsible of all the writing process of the files. They "
"are responsible of writing .html files, RSS feeds and so on. Since those "
"operations are commonly used, the object is created once, and then passed"
" to the generators."
msgstr ""
"**Writers** 负责文件的写入工作,即负责完成 html、RSS订阅源等文件的写入。因为这些"
"操作都是比较常用的这个类只会被创建一次然后再传给Generators。"
#: ../../report.rst:63 a4cff6dceb8f430791edaeb3b2280924
msgid ""
"*readers* are used to read from various formats (Markdown and "
"reStructuredText for now, but the system is extensible). Given a file, "
"they return metadata (author, tags, category, etc) and content (HTML "
"formatted)."
msgstr ""
"**Readers** 用于读取不同格式的文件目前支持Markdown、reStructuredText"
"但可以继续扩展)。向 **Readers** 输入一个文件,它会返回文档的元数据(作者、标签、"
"分类等等与HTML格式的文档正文内容。"
#: ../../report.rst:67 6ed9719c06c2477ea05ea30e4806ad14
msgid ""
"*generators* generate the different outputs. For instance, Pelican comes "
"with an ArticlesGenerator and PagesGenerator, into others. Given a "
"configuration, they can do whatever you want them to do. Most of the time"
" it's generating files from inputs (user inputs and files)."
msgstr ""
"**Generators** 用以生成不同的输出Pelican自带了 ``ArticlesGenerator`` 和 "
"``PageGenerator`` 。给定一套配置信息, **Generators** 可以做几乎任何事。"
"但大多数情况下,它的工作就是从输入生成文件。"
#: ../../report.rst:72 cb5129c105b04d788a908f580a83e7e1
msgid ""
"I also deal with contents objects. They can be ``Articles``, ``Pages``, "
"``Quotes``, or whatever you want. They are defined in the ``contents.py``"
" module and represent some content to be used by the program."
msgstr ""
"同样,还要处理正文对象。正文对象可以是 ``Articles`` 、 ``Pages`` 、 ``Quotes`` "
"或者其他你想要的类型。这些对象在 ``contents.py`` 模块中完成定义,同时代表了应用中"
"使用到的内容。"
#: ../../report.rst:77 4123da2b628448359aa9ed20b2ca87d2
msgid "In more detail"
msgstr "更细节的内容"
#: ../../report.rst:79 8482492940524edf8244fc220553cd3c
msgid "Here is an overview of the classes involved in Pelican."
msgstr "以下是Pelican中涉及的类的概述。"
#: ../../report.rst:83 a8a39a1ccc154604b8bb000dff44982d
msgid ""
"The interface does not really exist, and I have added it only to clarify "
"the whole picture. I do use duck typing and not interfaces."
msgstr ""
"上图中的接口事实上并不存在,我是为了整张图的完整性才加上去的。在实际实现中,使用了"
"鸭子类型而不是接口。"
#: ../../report.rst:86 889dfae0dc4242f0b21ce831c7172001
msgid "Internally, the following process is followed:"
msgstr "应用内部按以下流程进行处理:"
#: ../../report.rst:88 fc5cbf8ca65c456c90c56c00cf5ab93f
msgid ""
"First of all, the command line is parsed, and some content from the user "
"is used to initialize the different generator objects."
msgstr ""
"首先解析命令行并根据用户给入的一些内容来初始化不同的generator对象。"
#: ../../report.rst:91 5d0c1dc643364248820fad76c204f663
msgid ""
"A ``context`` is created. It contains the settings from the command line "
"and a settings file if provided."
msgstr ""
"创建一个 ``context`` ,其中包含了来自命令行和文件的配置信息。"
#: ../../report.rst:93 36725875f2c14e0bb8fc60b16afa1367
msgid ""
"The ``generate_context`` method of each generator is called, updating the"
" context."
msgstr ""
"调用各generator对象的 ``generate_context`` 方法来更新 ``context`` 。"
#: ../../report.rst:95 d50a4b2e38884eb38f1b66fdf7fb1eda
msgid ""
"The writer is created and given to the ``generate_output`` method of each"
" generator."
msgstr ""
"创建 **Writers** 并将其给入generator的 ``generate_output`` 方法。"
#: ../../report.rst:98 da8d9096940044f2849112fb5efcb4cb
msgid ""
"I make two calls because it is important that when the output is "
"generated by the generators, the context will not change. In other words,"
" the first method ``generate_context`` should modify the context, whereas"
" the second ``generate_output`` method should not."
msgstr ""
"由于当generator生成输出时并不会改变上下文我进行了两次调用。换句话说第一个方法 "
"``generate_context`` 会修改上下文,而第二个方法 ``generate_output`` 不会。"
#: ../../report.rst:103 a6350edba931463fb92ae51dd9bc253a
msgid ""
"Then, it is up to the generators to do what the want, in the "
"``generate_context`` and ``generate_content`` method. Taking the "
"``ArticlesGenerator`` class will help to understand some others concepts."
" Here is what happens when calling the ``generate_context`` method:"
msgstr ""
"然后事情就取决于各generator在 ``generate_context`` 和 ``generate_content`` "
"中做的操作了。拿 ``ArticlesGenerator`` 举例可以帮助理解其他的一些概念。下面是调用 "
"``generate_context`` 方法后会发生的事情:"
#: ../../report.rst:108 4b99ddf2cf344d0b8fbd080c15adfb64
msgid ""
"Read the folder “path”, looking for restructured text files, load each of"
" them, and construct a content object (``Article``) with it. To do so, "
"use ``Reader`` objects."
msgstr ""
"读取文件夹路径查找并加载每个restructured文件并为每个文件构建一个正文内容对象 "
"``Article`` )。此工作是由 ``Reader`` 对象完成的。"
#: ../../report.rst:111 176a7a5896904f2e9929623ef652660b
msgid "Update the ``context`` with all those articles."
msgstr "根据所有的文章更新 ``context`` 。"
#: ../../report.rst:113 bb88942c85004c4c9e0b55a72076b18f
msgid ""
"Then, the ``generate_content`` method uses the ``context`` and the "
"``writer`` to generate the wanted output."
msgstr ""
"然后, ``generate_content`` 方法使用 ``context`` 和 ``writer`` 来生成想要的输出。"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-24 19:06+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"
#: ../../_templates/page.html:68 697aead398874e06aa15cfd74d134745
msgid "Back to top"
msgstr "返回顶部"
#: ../../_templates/page.html:101 f91a64e54aae49c2bd09a944ea693193
msgid "Next"
msgstr "下一节"
#: ../../_templates/page.html:113 6c3ad069077b4e2cb6e1f77cc2962881
msgid "Previous"
msgstr "前一节"
#: ../../_templates/page.html:116 e83e03d0b50c4065a9f87db25a23b3ee
msgid "Home"
msgstr "首页"
#: ../../_templates/page.html:129 1d0fdb4c0b4e420283101ba5c21ac985
#, python-format
msgid "<a href=\"%(path)s\">Copyright</a> &#169; %(copyright)s"
msgstr "<a href=\"%(path)s\">Copyright</a> &#169; %(copyright)s"
#: ../../_templates/page.html:133 0a35c662e6574da48f7ac5c6b2c82874
#, python-format
msgid ""
"Copyright &#169; %(copyright)s, <a "
"href=\"https://justinmayer.com\">Justin Mayer</a>, Alexis Metaireau, and "
"contributors"
msgstr ""
"Copyright &#169; %(copyright)s, <a "
"href=\"https://justinmayer.com\">Justin Mayer</a>, Alexis Metaireau, and "
"contributors"
#: ../../_templates/page.html:141 07b89372db484251bfcd3b54e0845bf0
#, python-format
msgid "Last updated on %(last_updated)s"
msgstr "最后更新于 %(last_updated)s"
#: ../../_templates/page.html:187 2eb9f1b479a7405290a91d8e1962f265
msgid "On this page"
msgstr "本页目录"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,723 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 20102024
# This file is distributed under the same license as the PELICAN package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PELICAN 4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-07 16:25+0800\n"
"PO-Revision-Date: 2024-06-27 19:00+0800\n"
"Last-Translator: GeorgeHu <dhxxhch@163.com>\n"
"Language: zh_CN\n"
"Language-Team: zh_CN <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.16.0\n"
#: ../../tips.rst:2 9c4618aaecd44b0d93537cb760e227fa
msgid "Tips"
msgstr "小技巧"
#: ../../tips.rst:4 f49ab5e1ef034ca29140bac3832e8e1c
msgid "Here are some tips about Pelican that you might find useful."
msgstr "以下是一些实用的小技巧。"
#: ../../tips.rst:7 ../../tips.rst:309 95bea35d0347495bb551fe9486bcd29d
#: b64b7ed713b64f588ea7488c6d0b0441
msgid "Custom 404 Pages"
msgstr "自定义404页面"
#: ../../tips.rst:9 d59dc30de5954aa1abc7c46fbac596c6
msgid ""
"When a browser requests a resource that the web server cannot find, the "
"web server usually displays a generic \"File not found\" (404) error page"
" that can be stark and unsightly. One way to provide an error page that "
"matches the theme of your site is to create a custom 404 page (*not* an "
"article), such as this Markdown-formatted example stored in "
"``content/pages/404.md``::"
msgstr ""
"当浏览器请求的资源无法在服务器中找到时web服务器常常会显示一个通用的“File not found "
"404”的错误页面这可能会不太美观。为了能使用一个与站点主题相匹配的404页面注意是页面而 **不是** "
"文章例如下面这个Markdown格式的例子将此文件存为了 ``content/pages/404.md`` "
#: ../../tips.rst:22 416f9b3eeaac4af8bdc9f32b7cdcba39
msgid ""
"The next step is to configure your web server to display this custom page"
" instead of its default 404 page. For Nginx, add the following to your "
"configuration file's ``location`` block::"
msgstr ""
"接下来就是要配置web服务器使其显示此自定义页面而不是默认的404页面。例如对于Nginx在配置文件的 ``location`` "
"块中添加下面的命令:"
#: ../../tips.rst:28 5d52fbcc9d9d4603b3f9d97360face10
msgid "For Apache::"
msgstr "对于Apache"
#: ../../tips.rst:32 5413c6bcff6a41688ffcede94b9955e4
msgid ""
"For Amazon S3, first navigate to the ``Static Site Hosting`` menu in the "
"bucket settings on your AWS console. From there::"
msgstr "对于Amazon S3实例先在控制台的设置中找到 ``Static Site Hosting`` ,并添加:"
#: ../../tips.rst:38 9b02aa39367a4c33918bddef02d1788d
msgid "Publishing to GitHub Pages"
msgstr "发布到GitHub Pages"
#: ../../tips.rst:40 ca3f1deb69a04d40a89576f580d63781
msgid ""
"If you use `GitHub <https://github.com/>`_ for your Pelican site you can "
"publish your site to `GitHub Pages <https://pages.github.com/>`_ for "
"free. Your site will be published to ``https://<username>.github.io`` if "
"it's a user or organization site or to "
"``https://<username>.github.io/<repository>`` if it's a project site. "
"It's also possible to `use a custom domain with GitHub Pages "
"<https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-"
"github-pages-site>`_."
msgstr ""
"如果将Pelican站点放在了 `GitHub <https://github.com/>`_ 上,那么你就可以将站点免费发布在 `GitHub "
"Pages <https://pages.github.com/>`_ 上。如果是用户或组织的站点,发布的地址为 "
"``https://<username>.github.io`` ;如果是某个项目的站点,发布的地址则为 "
"``https://<username>.github.io/<repository>`` 。当然也可以 `在GitHub "
"Pages上使用自定义域名 <https://docs.github.com/en/pages/configuring-a-custom-"
"domain-for-your-github-pages-site>`_ 。"
#: ../../tips.rst:46 5962c3cb4a0b41289d6b08b9edd2fdee
msgid ""
"There are `two ways to publish a site to GitHub Pages "
"<https://docs.github.com/en/pages/getting-started-with-github-"
"pages/configuring-a-publishing-source-for-your-github-pages-site>`_:"
msgstr ""
"总的来说,有 `两种将站点发布到GitHub Pages的方法 <https://docs.github.com/en/pages"
"/getting-started-with-github-pages/configuring-a-publishing-source-for-"
"your-github-pages-site>`_ "
#: ../../tips.rst:48 ad6f071b3cdc4529a41776f799347da0
msgid ""
"**Publishing from a branch:** run ``pelican`` locally and push the output"
" directory to a special branch of your GitHub repo. GitHub will then "
"publish the contents of this branch to your GitHub Pages site."
msgstr ""
"**从某一分支发布:** 在本地运行 ``pelican`` "
"后将输出文件夹push到GitHub仓库的某一分支。GitHub就会将该分支的内容发布到GitHub Pages上。"
#: ../../tips.rst:51 6237e147cf4142d9b172588964ec00d2
msgid ""
"**Publishing with a custom GitHub Actions workflow:** just push the "
"source files of your Pelican site to your GitHub repo's default branch "
"and have a custom GitHub Actions workflow run ``pelican`` for you to "
"generate the output directory and publish it to your GitHub Pages site. "
"This way you don't need to run ``pelican`` locally. You can even edit "
"your site's source files using GitHub's web interface and any changes "
"that you commit will be published."
msgstr ""
"**从自定义GitHub Actions工作流发布** 将内容源文件推送到GitHub仓库的默认分支然后在GitHub "
"Actions工作流中执行 ``pelican`` 以生成输出文件夹最后将其发布到你的GitHub Pages站点。此种方法下就无需在本地执行 "
"``pelican`` 命令了。甚至可以直接在GitHub的网页中在线修改站点内容源文件。"
#: ../../tips.rst:60 f2655b8ab23147e58fd68e2385a7624a
msgid "Publishing a Project Site to GitHub Pages from a Branch"
msgstr "从某一分支发布项目站点到GitHub Pages"
#: ../../tips.rst:62 1a156c5a8019400d86a33ce306b521ac
msgid ""
"To publish a Pelican site as a Project Page you need to *push* the "
"content of the ``output`` dir generated by Pelican to a repository's "
"``gh-pages`` branch on GitHub."
msgstr ""
"要将Pelican站点发布为项目页面你需要将Pelican生成的 ``output`` 目录 **push** 到GitHub仓库的 ``gh-"
"pages`` 分支。"
#: ../../tips.rst:66 22caeeba90b24dbe9f0305370de074fc
msgid ""
"The excellent `ghp-import <https://github.com/davisp/ghp-import>`_, which"
" can be installed with ``pip``, makes this process really easy."
msgstr ""
"可通过 ``pip`` 安装的 `ghp-import <https://github.com/davisp/ghp-import>`_ "
"使这一步变得非常简单。"
#: ../../tips.rst:69 6ea08af050644b58ae5255dafb4f4d8b
msgid ""
"For example, if the source of your Pelican site is contained in a GitHub "
"repository, and if you want to publish that Pelican site in the form of "
"Project Pages to this repository, you can then use the following::"
msgstr "例如当Pelican站点的源文件已经包含在GitHub仓库中时可以将其作为此仓库的项目页面"
#: ../../tips.rst:77 355b81e8a2194cf9b91bee0f4ee6dca9
msgid ""
"The ``ghp-import output`` command updates the local ``gh-pages`` branch "
"with the content of the ``output`` directory (creating the branch if it "
"doesn't already exist). The ``git push origin gh-pages`` command updates "
"the remote ``gh-pages`` branch, effectively publishing the Pelican site."
msgstr ""
"``ghp-import output`` 命令会用 ``output`` 目录下的内容更新本地的 ``gh-pages`` "
"分支(如果此分支不存在则会先创建)。接着再用 ``git push origin gh-pages`` 命令更新远程分支 ``gh-"
"pages`` 如此就能够发布Pelican站点了。"
#: ../../tips.rst:84 8a3fd725eba44fa99541376722601cce
msgid ""
"The ``github`` target of the Makefile (and the ``gh_pages`` task of "
"``tasks.py``) created by the ``pelican-quickstart`` command publishes the"
" Pelican site as Project Pages, as described above."
msgstr ""
"``pelican-quickstart`` 在Makefile文件中所生成的 ``github`` 目标(以及为 ``gh_pages`` "
"任务生成的 ``tasks.py`` 使得Pelican站点能像上面描述的那样被发布为项目页面。"
#: ../../tips.rst:89 e8ebf23099ed45e7a65d23b9a7e4ccbd
msgid "Publishing a User Site to GitHub Pages from a Branch"
msgstr "从某一分支发布用户站点到GitHub Pages"
#: ../../tips.rst:91 7dc8ae1992b7411d9d6db7cc4a0127cb
msgid ""
"To publish a Pelican site in the form of User Pages, you need to *push* "
"the content of the ``output`` dir generated by Pelican to the ``main`` "
"branch of your ``<username>.github.io`` repository on GitHub."
msgstr ""
"要以用户页面形式发布Pelican站点你需要将Pelican生成的 ``output`` 目录内容 **push** 到 "
"``<username>.github.io`` 仓库的 ``master`` 分支上。"
#: ../../tips.rst:95 da706340ef5f4d18bfb183596a4196c9
msgid "Again, you can take advantage of ``ghp-import``::"
msgstr "同样的,此处也可以使用 ``ghp-import`` "
#: ../../tips.rst:101 61aa6f0d9fdf407682d3f781ae5475c6
msgid ""
"The ``git push`` command pushes the local ``gh-pages`` branch (freshly "
"updated by the ``ghp-import`` command) to the ``elemoine.github.io`` "
"repository's ``main`` branch on GitHub."
msgstr ""
"``git push`` 命令将本地的 ``gh-pages`` 分支(此分支在刚刚通过 ``ghp-import`` "
"命令进行了更新push到了GitHub仓库 ``elemoine.github.io`` 的 ``master`` 分支。"
#: ../../tips.rst:107 f74afbf668a1472d901fe0a16472ab98
msgid ""
"To publish your Pelican site as User Pages, feel free to adjust the "
"``github`` target of the Makefile."
msgstr "要将Pelican站点发布为用户页面可以根据需要修改Makefile中的 ``github`` 目标。"
#: ../../tips.rst:110 d69dcdb58a4b4b38aa8b8bf8e4fd733a
msgid ""
"Another option for publishing to User Pages is to generate the output "
"files in the root directory of the project."
msgstr "发布用户页面的另一种方法就是将输出文件生成在项目的根目录下。"
#: ../../tips.rst:113 4991892f24df40b982faf01ddb292175
msgid ""
"For example, your main project folder is ``<username>.github.io`` and you"
" can create the Pelican project in a subdirectory called ``Pelican``. "
"Then from inside the ``Pelican`` folder you can run::"
msgstr ""
"例如,项目的主文件夹是 ``<username>.github.io`` ,你可以在子目录 ``Pelican`` "
"中创建一个Pelican项目。然后你可以在这个 ``Pelican`` 文件夹中执行下面的命令:"
#: ../../tips.rst:119 ca5939f8c58b44b69ebfb2f953a4a73b
msgid ""
"Now you can push the whole project ``<username>.github.io`` to the main "
"branch of your GitHub repository::"
msgstr "接着可以将整个项目 ``<username>.github.io`` push到GitHub仓库的master分支中"
#: ../../tips.rst:124 54962439805d47abb121ca9454e7a4cc
msgid "(assuming origin is set to your remote repository)."
msgstr "此处假设远程仓库命名为origin。"
#: ../../tips.rst:127 b3fe320a90904fbda8c7ed8c7bddbd6e
msgid "Publishing to GitHub Pages Using a Custom GitHub Actions Workflow"
msgstr "使用自定义GitHub Actions工作流将站点发布GitHub Pages中"
#: ../../tips.rst:129 3b368bc0a307473dae560671fd9527be
msgid ""
"Pelican-powered sites can be published to GitHub Pages via a `custom "
"workflow "
"<https://github.com/getpelican/pelican/blob/main/.github/workflows/github_pages.yml>`_."
" To use it:"
msgstr ""
"Pelican已经给你准备了一份 `自定义工作流 "
"<https://github.com/getpelican/pelican/blob/main/.github/workflows/github_pages.yml>`_"
" ,你可以直接使用此工作流发布站点:"
#: ../../tips.rst:133 a7b1be522b694d9a8beb186b4603a7aa
msgid ""
"Enable GitHub Pages in your repo: go to **Settings → Pages** and choose "
"**GitHub Actions** for the **Source** setting."
msgstr ""
"首先为仓库开启GitHub Pages **Settings → Pages** 中有个 **Source** 设置项,将其选择为 "
"**GitHub Actions** 。"
#: ../../tips.rst:136 9cc114d8a6b44ff49fa7fecbdbcd012f
msgid ""
"Commit a ``.github/workflows/pelican.yml`` file to your repo with these "
"contents:"
msgstr "往你的仓库中commit一个 ``.github/workflows/pelican.yml`` 文件,文件内容如下:"
#: ../../tips.rst:155 f7d029425d7047deae43e9506c7f4779
msgid ""
"You may want to replace the ``@main`` with the ID of a specific commit in"
" this repo in order to pin the version of the reusable workflow that "
"you're using: ``uses: "
"getpelican/pelican/.github/workflows/github_pages.yml@<COMMIT_ID>``. If "
"you do this you might want to get Dependabot to send you automated pull "
"requests to update that commit ID whenever new versions of this workflow "
"are published, like so:"
msgstr ""
"你可能想要将 ``@main`` 替换为这个仓库中某个特定commit的ID以便将你使用的可重用工作流的版本固定下来此时可以使用 "
"``uses: "
"getpelican/pelican/.github/workflows/github_pages.yml@<COMMIT_ID>`` "
"。在这种情况下你可能想让Dependabot自动向你发送PR以便在发布新版本的工作流时更新commit ID如下所示:"
#: ../../tips.rst:172 fd060b5d5d824ab8825b384d37872894
msgid ""
"See `GitHub's docs about using Dependabot to keep your actions up to date"
" <https://docs.github.com/en/code-security/dependabot/working-with-"
"dependabot/keeping-your-actions-up-to-date-with-dependabot>`_."
msgstr ""
"请参阅 `GitHub文档 <https://docs.github.com/en/code-security/dependabot"
"/working-with-dependabot/keeping-your-actions-up-to-date-with-"
"dependabot>`_ 了解如何使用Dependabot使您的action保持最新。"
#: ../../tips.rst:174 1b862876e15c4fcd898c4d9b3ba616c5
msgid ""
"Go to the **Actions** tab in your repo "
"(``https://github.com/<username>/<repository>/actions``) and you should "
"see a **Deploy to GitHub Pages** action running."
msgstr ""
"选中仓库的 **Actions** 标签栏( "
"``https://github.com/<username>/<repository>/actions`` ),此时你应该会看到已经有一个名为 "
"**Deploy to GitHub Pages** 的action正在运行。"
#: ../../tips.rst:178 f8413793636140f9b017abad379b3429
msgid ""
"Once the action completes you should see your Pelican site deployed at "
"your repo's GitHub Pages URL: ``https://<username>.github.io`` for a user"
" or organization site or ``https://<username>.github.io/<repository>>`` "
"for a project site."
msgstr ""
"当此action执行完成就能够通过仓库的GitHub Pages地址 ``https://<username>.github.io`` "
"看到部署好了的用户或组织站点了,对于项目站点,可通过 ``https://<username>.github.io/<repository>`` "
"访问。"
#: ../../tips.rst:183 d792bb046c474f70aa98b2c16a5b1254
msgid "Notes:"
msgstr "注意事项:"
#: ../../tips.rst:185 89472d2b7231439faf9e51eda07d8323
msgid ""
"You don't need to set ``SITEURL`` or ``FEED_DOMAIN`` in your Pelican "
"settings: the workflow will set them correctly for you"
msgstr "无需在Pelican配置文件中设置 ``SITEURL`` ,工作流会帮你进行设置。"
#: ../../tips.rst:188 ea2b632160804a6e9bf1b4cecb7de716
msgid ""
"You don't need to commit your ``--output`` / ``OUTPUT_PATH`` directory "
"(``output/``) to git: the workflow will run ``pelican`` to build the "
"output directory for you on GitHub Actions"
msgstr ""
"无需commit ``--output`` 或 ``OUTPUT_PATH`` 所指定的目录( ``output/`` ):工作流会自己执行 "
"``pelican`` 命令来构建输出目录。"
#: ../../tips.rst:192 fd9fb772fba844f099cac781f2b0642f
msgid ""
"See `GitHub's docs about reusable workflows "
"<https://docs.github.com/en/actions/using-workflows/reusing-workflows>`_ "
"for more information."
msgstr ""
"更多信息请参阅 `GitHub可重用工作流文档 <https://docs.github.com/en/actions/using-"
"workflows/reusing-workflows>`_ 。"
#: ../../tips.rst:195 f9c527704af24f6da0b4229b7882a25b
msgid ""
"A number of optional inputs can be added to the ``with:`` block when "
"calling the workflow, for example:"
msgstr "有一些可选输入可以添加到工作流的 ``with:`` 块中:"
#: ../../tips.rst:206 956f5bae1fc64096acd2a2540a29004c
msgid "Here's the complete list of workflow inputs:"
msgstr "下面是工作流可用输入参数的完整列表:"
#: ../../tips.rst:209 eb37c894d7bc4278ab1a92e3b82c5603
msgid "Name"
msgstr "名称"
#: ../../tips.rst:209 446faf9e7d544e6aa47d4a1eca506c01
msgid "Required"
msgstr "是否必需"
#: ../../tips.rst:209 de96e4f5cd09488296f97f569fe1fb90
msgid "Description"
msgstr "描述"
#: ../../tips.rst:209 181bbfff09144f5b9c241b2fc79c989d
msgid "Type"
msgstr "值的类型"
#: ../../tips.rst:209 c3d44d1e7be6421a83bae2f5dc6e578f
msgid "Default"
msgstr "默认值"
#: ../../tips.rst:211 305d9d73681b4c6c80161cc906d60bbd
msgid "``settings``"
msgstr "``settings``"
#: ../../tips.rst:211 dbe6210f19914ae3b11e4caec7a945f0
msgid "Yes"
msgstr "是"
#: ../../tips.rst:211 bbd2306b324d4b5eae513cb7a7683286
msgid ""
"The path to your Pelican settings file (``pelican``'s ``--settings`` "
"option), for example: ``\"publishconf.py\"``"
msgstr ""
"Pelican配置文件的路径会被用于 ``pelican`` 命令的 ``--settings`` 选项),例如 "
"``\"publishconf.py\"`` 。"
#: ../../tips.rst:211 ../../tips.rst:216 ../../tips.rst:223 ../../tips.rst:227
#: ../../tips.rst:231 ../../tips.rst:237 ../../tips.rst:243
#: 073e18d8ae29406eb05040d4e3a9ae60 7d43e6cfb091410ebec7464da05b61b4
#: 8837cc8935f148fb80f05cc5d3d53629 b2da1f7640f948039230cd835c49accd
#: bfe3d052cdc443bb81fed82e77acf3c1 c93816e00a254ef69c69f05833e8762b
#: ee35302c7e034070af1d234ab919c32a
msgid "string"
msgstr "string"
#: ../../tips.rst:216 4eab6faa96244f13a09754112a783f2f
msgid "``requirements``"
msgstr "``requirements``"
#: ../../tips.rst:216 ../../tips.rst:223 ../../tips.rst:227 ../../tips.rst:231
#: ../../tips.rst:237 ../../tips.rst:243 ../../tips.rst:249
#: 197d6ee11fce4a50996a0c458cfdbdad 2086d667b9b1475cb0f002924cdfde12
#: 25e940621f5b48c9af487d898d7f93cf 5664232c9fdd46c7b8278b8ecef8e3b1
#: 6693126a0da74c61b67e14ca8e535ec3 7f8a93a2048140748fa73537bfae2a54
#: 85fd40a29f31490bb23b20f05e574aaa
msgid "No"
msgstr "否"
#: ../../tips.rst:216 9d5bdd70e7da4794805180cc758ebe37
msgid ""
"The Python requirements to install, for example to enable markdown and "
"typogrify use: ``\"pelican[markdown] typogrify\"`` or if you have a "
"requirements file: ``\"-r requirements.txt\"``"
msgstr ""
"需要安装的Python模块例如要开启markdown和typogrify可指定 ``\"pelican[markdown] "
"typogrify\"`` 或者可以指定一个requirements文件 ``\"-r requirements.txt\"`` "
#: ../../tips.rst:216 03ad0b322a714032bcce9f56ce66318d
msgid "``\"pelican\"``"
msgstr "``\"pelican\"``"
#: ../../tips.rst:223 e568553782b443dbacecaa7ded4c391c
msgid "``output-path``"
msgstr "``output-path``"
#: ../../tips.rst:223 2920ae9de5a64ae1ad82bd2287fa7c1e
msgid "Where to output the generated files (``pelican``'s ``--output`` option)"
msgstr "生成文件的输出位置(会被用于 ``pelican`` 命令的 ``--output`` 选项)"
#: ../../tips.rst:223 41b90747f0954a5799c8baf4a59d99fd
msgid "``\"output/\"``"
msgstr "``\"output/\"``"
#: ../../tips.rst:227 e2cc62185182463abc5140244a808e6d
msgid "``theme``"
msgstr "``theme``"
#: ../../tips.rst:227 cd3b78d03dcd4554a8ce10a873f5ff9f
msgid ""
"The GitHub repo URL of a custom theme to use, for example: "
"``\"https://github.com/seanh/sidecar.git\"``"
msgstr "要使用的自定义主题的GitHub仓库URL例如 ``\"https://github.com/seanh/sidecar.git\"``"
#: ../../tips.rst:227 d94f331173334fb2a84b1caadffb72df
msgid "``\"\"``"
msgstr "``\"\"``"
#: ../../tips.rst:231 44ceb2743481486b95c1c739d543f15d
msgid "``python``"
msgstr "``python``"
#: ../../tips.rst:231 4b5cddab44d24c7c8560e16991b784c7
msgid ""
"The version of Python to use to build the site, for example: ``\"3.12\"``"
" (to use the most recent version of Python 3.12, this is faster) or "
"``\"3.12.1\"`` (to use an exact version, slower)"
msgstr "构建站点时使用的Python版本例如 ``\"3.12\"`` 或 ``\"3.12.1\"``"
#: ../../tips.rst:231 919c0e36e8ff40bcbcc4480081b49ce5
msgid "``\"3.12\"``"
msgstr "``\"3.12\"``"
#: ../../tips.rst:237 842af56c539f4a74a97c7a5b1525eb35
msgid "``siteurl``"
msgstr "``siteurl``"
#: ../../tips.rst:237 7fc0777d6e174d6f8d757926a61aa3c8
msgid ""
"The base URL of your web site (Pelican's ``SITEURL`` setting). If not "
"passed this will default to the URL of your GitHub Pages site, which is "
"correct in most cases."
msgstr "站点的基URL会用于配置项 ``SITEURL`` 。若未指定默认值为GitHub Pages站点的URL这适用于大部分情况。"
#: ../../tips.rst:237 ../../tips.rst:243 082f65333e224d71817b82b1e4f515c4
#: 3d786e828a4745db849bdb8f47738db8
msgid "The URL of your GitHub Pages site."
msgstr "GitHub Pages站点的URL"
#: ../../tips.rst:243 e5adb69f985547b7b3cc2bd3f31d4cc3
msgid "``feed_domain``"
msgstr "``feed_domain``"
#: ../../tips.rst:243 c88f037c9f1f4148bef6347228257f7d
msgid ""
"The domain to be prepended to feed URLs (Pelican's ``FEED_DOMAIN`` "
"setting). If not passed this will default to the URL of your GitHub Pages"
" site, which is correct in most cases."
msgstr ""
"订阅源URL前要附加的域名会用于配置项 ``FEED_DOMAIN`` 。若未指定默认值为GitHub "
"Pages站点的URL这适用于大部分情况。"
#: ../../tips.rst:249 358c5aa434cd4ad09beab02df88413d5
msgid "``deploy``"
msgstr "``deploy``"
#: ../../tips.rst:249 b8748aeace5a448d9382e225be98f90c
msgid ""
"This is used to determine whether you will deploy the site or not to "
"GitHub Pages. This is most useful if you want to test a change to your "
"website in a pull request before deploying those change."
msgstr "此项配置用于表示是否要将站点部署至GitHub Pages。当对站点做了更改并且在正式部署前进行测试就可以用到此项。"
#: ../../tips.rst:249 034006b9b71b4cb486f230b8aad873ce
msgid "bool"
msgstr "bool"
#: ../../tips.rst:249 078ac613a8b74703af98c75bb5a007c1
msgid "``true``"
msgstr "``true``"
#: ../../tips.rst:257 e63cf881e3204be8b52ee5d8635ba4cf
msgid "Testing Your Build in a GitHub Pull Request"
msgstr "在Github拉取请求时进行测试"
#: ../../tips.rst:259 a2f6bd3420eb46a08f54efda35a6eaf4
msgid ""
"If you want to test your build in a pull request before deploying to "
"GitHub, your workflow might look something like this:"
msgstr "如果想在正式部署到 GitHub 前在PR中进行测试下面是一个可用的 workflow 示例"
#: ../../tips.rst:288 84393693279741efa82c5ee6b27cbd28
msgid ""
"The ``on`` section of the workflow defines the events that will trigger "
"the workflow. In this example, the workflow will run on pushes to the "
"main branch, pull requests to the main branch, and manual runs of the "
"workflow."
msgstr "工作流的 ``on`` 部分定义了工作流的触发器。在此示例中工作流将在main分支收到push、有PR提起到主分支以及"
"手动运行工作流时执行。"
#: ../../tips.rst:290 cd3c13b2af974a32aa4291d07fc11e9c
msgid ""
"``workflow_dispatch`` defines the deploy boolean to be true by default. "
"This means that if you run the workflow manually, it will deploy the "
"site."
msgstr "``workflow_dispatch`` 将 deploy 的默认值设为 true。也就是说当手动运行工作流时更改的内容就会正式部署。"
#: ../../tips.rst:292 5402cd211d5b4aa8a244c916bb381a5b
msgid ""
"The ``deploy`` input for the job is using a set of standard GitHub "
"workflow variables to control when ``deploy`` will either be true or "
"false (you can customize this to your needs)."
msgstr "job中的 ``deploy`` 使用了一些 GitHub workflow 变量来计算 ``deploy`` 值为 true 还是 false您可以根据需要自定义。"
#: ../../tips.rst:294 d084908e3a0749f0b802b43626cfe2c4
msgid ""
"In this example, the ``deploy`` will be true if the event is a push to "
"the main branch (or merging into main from a PR) or a manual run of the "
"workflow. If the event is a pull request, the ``deploy`` will be false "
"and it will only build an artifact for the site."
msgstr "在此示例中,如果触发事件是推送到主分支(或从 PR 合并到主分支)或手动运行工作流,则 deploy 将为 true"
"如果触发事件只是Pull Request则 ``deploy`` 将为 false并且此时只会为站点构建一个artifact。"
#: ../../tips.rst:297 85e70fc3faa04208979f7bbe92b025ef
msgid "\"Insecure content\" warnings from browsers"
msgstr "浏览器报“不安全的内容Insecure content”警告"
#: ../../tips.rst:299 34f7075cf31f416da2aeb529c616d97d
msgid ""
"If your site uses ``https://`` and is broken because the browser is "
"blocking network requests (for example for CSS files) due to \"insecure "
"content\" this may be because GitHub Pages is generating ``http://`` URLs"
" for your site."
msgstr ""
"当站点使用 ``https://`` "
"时可能会损坏无法正常显示这是由于浏览器阻拦了一些对“不安全内容”的网络请求。可能的原因之一是GitHub Pages给你的站点生成了 "
"``http://`` URL。"
#: ../../tips.rst:303 47271df82577424c8e2c31a9e76a553a
msgid ""
"To fix this go into your site repo's settings and enable the **Enforce "
"HTTPS** setting: go to **Settings → Pages** and check **Enforce HTTPS**. "
"Then re-run the workflow to re-deploy your site. Alternatively, you can "
"use the workflow's ``siteurl`` and ``feed_domain`` settings."
msgstr ""
"要想解决这一问题,需要为站点所在仓库开启 **强制使用HTTPS** :点击 **Settings → Pages** 并在其中勾选 "
"**Enforce HTTPS** ,接着再重新执行工作流以重新部署站点。也可以尝试通过配置 ``siteurl`` 与 "
"``feed_domain`` 解决问题。"
#: ../../tips.rst:311 e69189ef4a8440fb8940d8012b4f19d6
msgid ""
"GitHub Pages will display the custom 404 page described above, as noted "
"in the relevant `GitHub docs "
"<https://help.github.com/articles/custom-404-pages/>`_."
msgstr ""
"如果按前述进行配置GitHub Pages是能够正确显示自定义的404页面的相关内容在 `GitHub的文档中 "
"<https://help.github.com/articles/custom-404-pages/>`_ 也有提到。"
#: ../../tips.rst:315 1b8c2457f44a4d61a033363830b8bd90
msgid "Update your site on each commit"
msgstr "在每次commit后都更新站点"
#: ../../tips.rst:317 476dbdb670924c02a962e78d6a7854c1
msgid ""
"To automatically update your Pelican site on each commit, you can create "
"a post-commit hook. For example, you can add the following to "
"``.git/hooks/post-commit``::"
msgstr ""
"要想在每次commit后自动更新Pelican站点你可以创建一个post-commit钩子。例如可以将下面的内容保存为 "
"``.git/hooks/post-commit`` "
#: ../../tips.rst:324 36dc5f05eaf84573acada36c59d8d2fc
msgid "Copy static files to the root of your site"
msgstr "将静态文件拷贝到站点根目录"
#: ../../tips.rst:326 4a0722ad68e944ee80e6378259cc1dd6
msgid ""
"To use a `custom domain <https://help.github.com/articles/setting-up-a"
"-custom-domain-with-pages>`_ with GitHub Pages, you need to put the "
"domain of your site (e.g., ``blog.example.com``) inside a ``CNAME`` file "
"at the root of your site. To do this, create the ``content/extra/`` "
"directory and add a ``CNAME`` file to it. Then use the ``STATIC_PATHS`` "
"setting to tell Pelican to copy this file to your output directory. For "
"example::"
msgstr ""
"要将 `自定义域名 <https://help.github.com/articles/setting-up-a-custom-domain-"
"with-pages>`_ 与GitHub Pages一起使用需要将站点的域名例如 ``blog.example.com`` "
")添加到站点根目录的 ``CNAME`` 文件中。为此,请创建 ``content/extra/`` 目录,并在里面添加一个 ``CNAME`` "
"文件。然后使用Pelican的 ``STATIC_PATHS`` 来告诉Pelican将此文件复制到输出目录"
#: ../../tips.rst:337 8ad906848762400d9e2462034d151a16
msgid "Note: use forward slashes, ``/``, even on Windows."
msgstr "请注意:务必使用正斜杠 ``/`` 在Windows上也是。"
#: ../../tips.rst:339 7b109f4944064382babc9158567c8e82
msgid ""
"You can also use the ``EXTRA_PATH_METADATA`` mechanism to place a "
"``favicon.ico`` or ``robots.txt`` at the root of any site."
msgstr ""
"利用 ``EXTRA_PATH_METADATA`` 机制,你可以将 ``favicon.ico`` 或 ``robots.txt`` "
"也拷贝到站点的根目录下。"
#: ../../tips.rst:343 678eea0644b5400496ad9173d05368d5
msgid "How to add YouTube or Vimeo Videos"
msgstr "如何添加YouTube或Vimeo视频"
#: ../../tips.rst:345 ca57b327dd6b432d82cdc91193bde6bb
msgid ""
"The easiest way is to paste the embed code of the video from these sites "
"directly into your source content."
msgstr "最简单的方法是将这些网站的视频嵌入代码直接粘贴到您的源内容文件中。"
#: ../../tips.rst:348 0a4f27e2edbe494ab52f73595646986e
msgid ""
"Alternatively, you can also use Pelican plugins like ``liquid_tags``, "
"``pelican_youtube``, or ``pelican_vimeo`` to embed videos in your "
"content."
msgstr ""
"或者,您还可以使用例如 ``liquid_tags`` 、``pelican_youtube`` 或 ``pelican_vimeo`` "
"等Pelican插件将视频嵌入。"
#: ../../tips.rst:351 e73517b72da347738421784b776b1f1c
msgid ""
"Moreover, markup languages like reST and Markdown have plugins that let "
"you embed videos in the markup. You can use `reST video directive "
"<https://gist.github.com/dbrgn/2922648>`_ for reST or `mdx_video plugin "
"<https://github.com/italomaia/mdx-video>`_ for Markdown."
msgstr ""
"此外像reST和 Markdown这样的标记语言都有对应插件可以让你在其中嵌入视频。可以使用 `reST的视频指令 "
"<https://gist.github.com/dbrgn/2922648>`_ 或者 `Markdown的mdx_video插件 "
"<https://github.com/italomaia/mdx-video>`_ 。"
#: ../../tips.rst:358 b9d27cda716048b2ab7c13646d7faf09
msgid "Develop Locally Using SSL"
msgstr "在本地使用SSL进行开发"
#: ../../tips.rst:360 50df9ec072aa47eabbae132fd8f5cb68
msgid "Here's how you can set up your local pelican server to support SSL."
msgstr "以下描述了如何在本地Pelican服务器上配置SSL。"
#: ../../tips.rst:362 9b5045375a874c4d9c29f7109f05c539
msgid ""
"First, create a self-signed certificate and key using ``openssl`` (this "
"creates ``cert.pem`` and ``key.pem``)::"
msgstr "首先,通过 ``openssl`` 创建自签名的证书和密钥,这会生成 ``cert.pem`` 和 ``key.pem`` 文件:"
#: ../../tips.rst:366 2f1cfa536fc540f69d671f8a118769d7
msgid ""
"And use this command to launch the server (the server starts within your "
"``output`` directory)::"
msgstr "接着使用下面的命令来开启服务器(此服务器会在 ``output`` 目录下开启):"
#: ../../tips.rst:370 029ea2b0e4fe4b0f814158ae33e3a8ff
msgid "If you are using ``develop-server.sh``, add this to the top::"
msgstr "如果你使用的是 ``develop-server.sh`` 脚本,在脚本的开头添加:"
#: ../../tips.rst:375 c2784fdd9fdb433799d57f903d0e49d8
msgid "and modify the ``pelican.server`` line as follows::"
msgstr "然后修改按照下述修改 ``pelican.server`` 一行:"
#~ msgid ""
#~ "To publish a Pelican site in the"
#~ " form of User Pages, you need "
#~ "to *push* the content of the "
#~ "``output`` dir generated by Pelican to"
#~ " the ``master`` branch of your "
#~ "``<username>.github.io`` repository on GitHub."
#~ msgstr ""
#~ msgid ""
#~ "The ``git push`` command pushes the "
#~ "local ``gh-pages`` branch (freshly "
#~ "updated by the ``ghp-import`` command)"
#~ " to the ``elemoine.github.io`` repository's "
#~ "``master`` branch on GitHub."
#~ msgstr ""
#~ msgid ""
#~ "Now you can push the whole project"
#~ " ``<username>.github.io`` to the master "
#~ "branch of your GitHub repository::"
#~ msgstr ""
#~ msgid ""
#~ "Pelican-powered sites can be published"
#~ " to GitHub Pages via a `custom "
#~ "workflow "
#~ "<https://github.com/getpelican/pelican/blob/master/.github/workflows/github_pages.yml>`_."
#~ " To use it:"
#~ msgstr ""
#~ msgid ""
#~ "You may want to replace the "
#~ "``@master`` with the ID of a "
#~ "specific commit in this repo in "
#~ "order to pin the version of the"
#~ " reusable workflow that you're using: "
#~ "``uses: "
#~ "getpelican/pelican/.github/workflows/github_pages.yml@<COMMIT_ID>``."
#~ " If you do this you might want"
#~ " to get Dependabot to send you "
#~ "automated pull requests to update that"
#~ " commit ID whenever new versions of"
#~ " this workflow are published, like "
#~ "so:"
#~ msgstr ""

170
docs/pelican-themes.rst Normal file
View file

@ -0,0 +1,170 @@
pelican-themes
##############
Description
===========
``pelican-themes`` is a command line tool for managing themes for Pelican. See
:ref:`settings/themes` for settings related to themes.
Usage
"""""
| pelican-themes [-h] [-l] [-i theme path [theme path ...]]
| [-r theme name [theme name ...]]
| [-s theme path [theme path ...]] [-v] [--version]
Optional arguments:
"""""""""""""""""""
-h, --help Show the help and exit
-l, --list Show the themes already installed
-i theme_path, --install theme_path One or more themes to install
-r theme_name, --remove theme_name One or more themes to remove
-s theme_path, --symlink theme_path Same as ``--install``, but create a symbolic link instead of copying the theme.
Useful for theme development
-v, --verbose Verbose output
--version Print the version of this script
Examples
========
Listing the installed themes
""""""""""""""""""""""""""""
With ``pelican-themes``, you can see the available themes by using the ``-l``
or ``--list`` option:
.. code-block:: console
$ pelican-themes -l
notmyidea
two-column@
simple
$ pelican-themes --list
notmyidea
two-column@
simple
In this example, we can see there are three themes available: ``notmyidea``,
``simple``, and ``two-column``.
``two-column`` is followed by an ``@`` because this theme is not copied to
the Pelican theme path, but is instead just linked to it (see `Creating
symbolic links`_ for details about creating symbolic links).
Note that you can combine the ``--list`` option with the ``-v`` or
``--verbose`` option to get more verbose output, like this:
.. code-block:: console
$ pelican-themes -v -l
/usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/notmyidea
/usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/two-column (symbolic link to `/home/skami/Dev/Python/pelican-themes/two-column')
/usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/simple
Installing themes
"""""""""""""""""
You can install one or more themes using the ``-i`` or ``--install`` option.
This option takes as argument the path(s) of the theme(s) you want to install,
and can be combined with the ``--verbose`` option:
.. code-block:: console
# pelican-themes --install ~/Dev/Python/pelican-themes/notmyidea-cms --verbose
.. code-block:: console
# pelican-themes --install ~/Dev/Python/pelican-themes/notmyidea-cms\
~/Dev/Python/pelican-themes/martyalchin \
--verbose
.. code-block:: console
# pelican-themes -vi ~/Dev/Python/pelican-themes/two-column
Removing themes
"""""""""""""""
The ``pelican-themes`` command can also remove themes from the Pelican themes
path. The ``-r`` or ``--remove`` option takes as argument the name(s) of the
theme(s) you want to remove, and can be combined with the ``--verbose`` option.
.. code-block:: console
# pelican-themes --remove two-column
.. code-block:: console
# pelican-themes -r martyachin notmyidea-cmd -v
Creating symbolic links
"""""""""""""""""""""""
``pelican-themes`` can also install themes by creating symbolic links instead
of copying entire themes into the Pelican themes path.
To symbolically link a theme, you can use the ``-s`` or ``--symlink``, which
works exactly as the ``--install`` option:
.. code-block:: console
# pelican-themes --symlink ~/Dev/Python/pelican-themes/two-column
In this example, the ``two-column`` theme is now symbolically linked to the
Pelican themes path, so we can use it, but we can also modify it without having
to reinstall it after each modification.
This is useful for theme development:
.. code-block:: console
$ sudo pelican-themes -s ~/Dev/Python/pelican-themes/two-column
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ firefox /tmp/out/index.html
$ vim ~/Dev/Pelican/pelican-themes/two-column/static/css/main.css
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ cp /tmp/bg.png ~/Dev/Pelican/pelican-themes/two-column/static/img/bg.png
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ vim ~/Dev/Pelican/pelican-themes/two-column/templates/index.html
$ pelican ~/Blog/content -o /tmp/out -t two-column
Doing several things at once
""""""""""""""""""""""""""""
The ``--install``, ``--remove`` and ``--symlink`` options are not mutually
exclusive, so you can combine them in the same command line to do more than one
operation at time, like this:
.. code-block:: console
# pelican-themes --remove notmyidea-cms two-column \
--install ~/Dev/Python/pelican-themes/notmyidea-cms-fr \
--symlink ~/Dev/Python/pelican-themes/two-column \
--verbose
In this example, the theme ``notmyidea-cms`` is replaced by the theme
``notmyidea-cms-fr``

348
docs/plugins.rst Normal file
View file

@ -0,0 +1,348 @@
.. _plugins:
Plugins
#######
Beginning with version 3.0, Pelican supports plugins. Plugins are a way to add
features to Pelican without having to directly modify the Pelican core.
How to use plugins
==================
Starting with version 4.5, Pelican moved to a new plugin structure utilizing
namespace packages that can be easily installed via Pip_. Plugins supporting
this structure will install under the namespace package ``pelican.plugins`` and
can be automatically discovered by Pelican. To see a list of Pip-installed
namespace plugins that are active in your environment, run::
pelican-plugins
If you leave the ``PLUGINS`` setting as default (``None``), Pelican will
automatically discover namespace plugins and register them. If, on the other
hand, you specify a ``PLUGINS`` setting as a list of plugins, this
auto-discovery will be disabled. At that point, only the plugins you specify
will be registered, and you must explicitly list any namespace plugins as well.
If you are using the ``PLUGINS`` setting, you can specify plugins in two ways.
The first method specifies plugins as a list of strings. Namespace plugins can
be specified either by their full names (``pelican.plugins.myplugin``) or by
their short names (``myplugin``)::
PLUGINS = ['package.myplugin',
'namespace_plugin1',
'pelican.plugins.namespace_plugin2']
Alternatively, you can import them in your settings file and pass the modules::
from package import myplugin
from pelican.plugins import namespace_plugin1, namespace_plugin2
PLUGINS = [myplugin, namespace_plugin1, namespace_plugin2]
.. note::
When experimenting with different plugins (especially the ones that deal
with metadata and content) caching may interfere and the changes may not be
visible. In such cases disable caching with ``LOAD_CONTENT_CACHE = False``
or use the ``--ignore-cache`` command-line switch.
If your plugins are not in an importable path, you can specify a list of paths
via the ``PLUGIN_PATHS`` setting. As shown in the following example, paths in
the ``PLUGIN_PATHS`` list can be absolute or relative to the settings file::
PLUGIN_PATHS = ["plugins", "/srv/pelican/plugins"]
PLUGINS = ["assets", "liquid_tags", "sitemap"]
Where to find plugins
=====================
Namespace plugins can be found in the `pelican-plugins organization`_ as
individual repositories. Legacy plugins are located in the `pelican-plugins
repository`_ and will be gradually phased out in favor of the namespace
versions.
.. _pelican-plugins organization: https://github.com/pelican-plugins
.. _pelican-plugins repository: https://github.com/getpelican/pelican-plugins
Please note that while we do our best to review and maintain these plugins,
they are submitted by the Pelican community and thus may have varying levels of
support and interoperability.
How to create plugins
=====================
Plugins are based on the concept of signals. Pelican sends signals, and plugins
subscribe to those signals. The list of available signals is documented in a
subsequent section.
The only rule to follow for plugins is to define a ``register`` callable, in
which you map the signals to your plugin logic. Let's take a simple example::
import logging
from pelican import signals
log = logging.getLogger(__name__)
def test(sender):
log.debug("%s initialized !!", sender)
def register():
signals.initialized.connect(test)
.. note::
Signal receivers are weakly-referenced and thus must not be defined within
your ``register`` callable or they will be garbage-collected before the
signal is emitted.
If multiple plugins connect to the same signal, plugins will be invoked in the
order they are registered. When the ``PLUGINS`` setting is defined, plugin
invocation order will be the order in which the plugins are listed in the
``PLUGINS`` setting. If you rely on auto-discovered namespace plugins and have
no ``PLUGINS`` setting defined, plugins will be invoked in the same order that
they are discovered (the same order as listed in the output of the
``pelican-plugins`` command). If you want to specify the order explicitly,
disable auto-discovery by defining ``PLUGINS`` in the desired order.
Namespace plugin structure
--------------------------
Namespace plugins must adhere to a certain structure in order to function
properly. They need to be installable (i.e. contain ``setup.py`` or equivalent)
and have a folder structure as follows::
myplugin
├── pelican
│   └── plugins
│   └── myplugin
│   ├── __init__.py
│   └── ...
├── ...
└── setup.py
It is crucial that ``pelican`` or ``pelican/plugins`` folder **not**
contain an ``__init__.py`` file. In fact, it is best to have those folders
empty besides the listed folders in the above structure and keep your
plugin related files contained solely in the ``pelican/plugins/myplugin``
folder to avoid any issues.
To easily set up the proper structure, a `cookiecutter template for plugins`_
is provided. Refer to that project's README for instructions on how to use it.
.. _cookiecutter template for plugins: https://github.com/getpelican/cookiecutter-pelican-plugin
List of signals
===============
Here is the list of currently implemented signals:
================================= ============================ ===========================================================================
Signal Arguments Description
================================= ============================ ===========================================================================
initialized pelican object
finalized pelican object invoked after all the generators are executed and just before pelican exits
useful for custom post processing actions, such as:
- minifying js/css assets.
- notify/ping search engines with an updated sitemap.
generator_init generator invoked in the Generator.__init__
all_generators_finalized generators invoked after all the generators are executed and before writing output
readers_init readers invoked in the Readers.__init__
article_generator_context article_generator, metadata
article_generator_preread article_generator invoked before a article is read in ArticlesGenerator.generate_context;
use if code needs to do something before every article is parsed
article_generator_init article_generator invoked in the ArticlesGenerator.__init__
article_generator_pretaxonomy article_generator invoked before categories and tags lists are created
useful when e.g. modifying the list of articles to be generated
so that removed articles are not leaked in categories or tags
article_generator_finalized article_generator invoked at the end of ArticlesGenerator.generate_context
article_generator_write_article article_generator, content invoked before writing each article, the article is passed as content
article_writer_finalized article_generator, writer invoked after all articles and related pages have been written, but before
the article generator is closed.
get_generators pelican object invoked in Pelican.get_generator_classes,
can return a Generator, or several
generators in a tuple or in a list.
get_writer pelican object invoked in Pelican.get_writer,
can return a custom Writer.
page_generator_context page_generator, metadata
page_generator_preread page_generator invoked before a page is read in PageGenerator.generate_context;
use if code needs to do something before every page is parsed.
page_generator_init page_generator invoked in the PagesGenerator.__init__
page_generator_finalized page_generator invoked at the end of PagesGenerator.generate_context
page_generator_write_page page_generator, content invoked before writing each page, the page is passed as content
page_writer_finalized page_generator, writer invoked after all pages have been written, but before the page generator
is closed.
static_generator_context static_generator, metadata
static_generator_preread static_generator invoked before a static file is read in StaticGenerator.generate_context;
use if code needs to do something before every static file is added to the
staticfiles list.
static_generator_init static_generator invoked in the StaticGenerator.__init__
static_generator_finalized static_generator invoked at the end of StaticGenerator.generate_context
content_object_init content_object invoked at the end of Content.__init__
content_written path, context invoked each time a content file is written.
feed_generated context, feed invoked each time a feed gets generated. Can be used to modify a feed
object before it gets written.
feed_written path, context, feed invoked each time a feed file is written.
================================= ============================ ===========================================================================
.. warning::
Avoid ``content_object_init`` signal if you intend to read ``summary`` or
``content`` properties of the content object. That combination can result in
unresolved links when :ref:`ref-linking-to-internal-content` (see
`pelican-plugins bug #314`_). Use ``_summary`` and ``_content`` properties
instead, or, alternatively, run your plugin at a later stage (e.g.
``all_generators_finalized``).
.. note::
After Pelican 3.2, signal names were standardized. Older plugins may need
to be updated to use the new names:
========================== ===========================
Old name New name
========================== ===========================
article_generate_context article_generator_context
article_generate_finalized article_generator_finalized
article_generate_preread article_generator_preread
pages_generate_context page_generator_context
pages_generate_preread page_generator_preread
pages_generator_finalized page_generator_finalized
pages_generator_init page_generator_init
static_generate_context static_generator_context
static_generate_preread static_generator_preread
========================== ===========================
Recipes
=======
We eventually realised some of the recipes to create plugins would be best
shared in the documentation somewhere, so here they are!
How to create a new reader
--------------------------
One thing you might want is to add support for your very own input format.
While it might make sense to add this feature in Pelican core, we wisely chose
to avoid this situation and instead have the different readers defined via
plugins.
The rationale behind this choice is mainly that plugins are really easy to
write and don't slow down Pelican itself when they're not active.
No more talking — here is an example::
from pelican import signals
from pelican.readers import BaseReader
# Create a new reader class, inheriting from the pelican.reader.BaseReader
class NewReader(BaseReader):
enabled = True # Yeah, you probably want that :-)
# The list of file extensions you want this reader to match with.
# If multiple readers were to use the same extension, the latest will
# win (so the one you're defining here, most probably).
file_extensions = ['yeah']
# You need to have a read method, which takes a filename and returns
# some content and the associated metadata.
def read(self, filename):
metadata = {'title': 'Oh yeah',
'category': 'Foo',
'date': '2012-12-01'}
parsed = {}
for key, value in metadata.items():
parsed[key] = self.process_metadata(key, value)
return "Some content", parsed
def add_reader(readers):
readers.reader_classes['yeah'] = NewReader
# This is how pelican works.
def register():
signals.readers_init.connect(add_reader)
Adding a new generator
----------------------
Adding a new generator is also really easy. You might want to have a look at
:doc:`internals` for more information on how to create your own generator.
::
def get_generators(pelican_object):
# define a new generator here if you need to
return MyGenerator
def register():
signals.get_generators.connect(get_generators)
Adding a new writer
-------------------
Adding a writer will allow you to output additional file formats to disk, or
change how the existing formats are written to disk. Note that only one writer
will be active at a time, so be sure to either subclass the built-in Writer, or
completely re-implement it.
Here is a basic example of how to set up your own writer::
from pelican.writers import Writer
from pelican import signals
class MyWriter(Writer):
# define new writer functionality
pass
def add_writer(pelican_object):
# use pelican_instance to setup stuff if needed
return MyWriter
def register():
signals.get_writer.connect(add_writer)
Using Plugins to Inject Content
-------------------------------
You can programmatically inject articles or pages using plugins. This can be
useful if you plan to fetch articles from an API, for example.
Following is a simple example of how one can build a plugin that injects a
custom article, using the ``article_generator_pretaxonomy`` signal::
import datetime
from pelican import signals
from pelican.contents import Article
from pelican.readers import BaseReader
def addArticle(articleGenerator):
settings = articleGenerator.settings
# Author, category, and tags are objects, not strings, so they need to
# be handled using BaseReader's process_metadata() function.
baseReader = BaseReader(settings)
content = "I am the body of an injected article!"
newArticle = Article(content, {
"title": "Injected Article!",
"date": datetime.datetime.now(),
"category": baseReader.process_metadata("category", "fromAPI"),
"tags": baseReader.process_metadata("tags", "tagA, tagB")
})
articleGenerator.articles.insert(0, newArticle)
def register():
signals.article_generator_pretaxonomy.connect(addArticle)
.. _Pip: https://pip.pypa.io/
.. _pelican-plugins bug #314: https://github.com/getpelican/pelican-plugins/issues/314

198
docs/publish.rst Normal file
View file

@ -0,0 +1,198 @@
Publish your site
#################
.. _site_generation:
Site generation
===============
Once Pelican is installed and you have some content (e.g., in Markdown or reST
format), you can convert your content into HTML via the ``pelican`` command,
specifying the path to your content and (optionally) the path to your
:doc:`settings<settings>` file::
pelican /path/to/your/content/ [-s path/to/your/settings.py]
The above command will generate your site and save it in the ``output/``
folder, using the default theme to produce a simple site. The default theme
consists of very simple HTML without styling and is provided so folks may use
it as a basis for creating their own themes.
You can also tell Pelican to watch for your modifications, instead of manually
re-running it every time you want to see your changes. To enable this, run the
``pelican`` command with the ``-r`` or ``--autoreload`` option. On non-Windows
environments, this option can also be combined with the ``-l`` or ``--listen``
option to simultaneously both auto-regenerate *and* serve the output at
http://localhost:8000::
pelican --autoreload --listen
Pelican has other command-line switches available. Have a look at the help to
see all the options you can use::
pelican --help
Viewing the generated files
---------------------------
The files generated by Pelican are static files, so you don't actually need
anything special to view them. You can use your browser to open the generated
HTML files directly::
firefox output/index.html
Because the above method may have trouble locating your CSS and other linked
assets, running Pelican's simple built-in web server will often provide a more
reliable previewing experience::
pelican --listen
Once the web server has been started, you can preview your site at:
http://localhost:8000/
Deployment
==========
After you have generated your site, previewed it in your local development
environment, and are ready to deploy it to production, you might first
re-generate your site with any production-specific settings (e.g., analytics,
feeds, etc.) that you may have defined::
pelican content -s publishconf.py
To base your publish configuration on top of your ``pelicanconf.py``, you can
import your ``pelicanconf`` settings by including the following line in your
``publishconf.py``::
from pelicanconf import *
If you have generated a ``publishconf.py`` using ``pelican-quickstart``, this
line is included by default.
The steps for deploying your site will depend on where it will be hosted. If
you have SSH access to a server running Nginx or Apache, you might use the
``rsync`` tool to transmit your site files::
rsync -avc --delete output/ host.example.com:/var/www/your-site/
There are many other deployment options, some of which can be configured when
first setting up your site via the ``pelican-quickstart`` command. See the
:doc:`Tips<tips>` page for detail on publishing via GitHub Pages.
Automation
==========
While the ``pelican`` command is the canonical way to generate your site,
automation tools can be used to streamline the generation and publication flow.
One of the questions asked during the ``pelican-quickstart`` process pertains
to whether you want to automate site generation and publication. If you
answered "yes" to that question, a ``tasks.py`` and ``Makefile`` will be
generated in the root of your project. These files, pre-populated with certain
information gleaned from other answers provided during the
``pelican-quickstart`` process, are meant as a starting point and should be
customized to fit your particular needs and usage patterns. If you find one or
both of these automation tools to be of limited utility, these files can
be deleted at any time and will not affect usage of the canonical ``pelican``
command.
Following are automation tools that "wrap" the ``pelican`` command and can
simplify the process of generating, previewing, and uploading your site.
Invoke
------
The advantage of Invoke_ is that it is written in Python and thus can be used
in a wide range of environments. The downside is that it must be installed
separately. Use the following command to install Invoke, prefixing with
``sudo`` if your environment requires it::
python -m pip install invoke
Take a moment to open the ``tasks.py`` file that was generated in your project
root. You will see a number of commands, any one of which can be renamed,
removed, and/or customized to your liking. Using the out-of-the-box
configuration, you can generate your site via::
invoke build
If you'd prefer to have Pelican automatically regenerate your site every time a
change is detected (which is handy when testing locally), use the following
command instead::
invoke regenerate
To serve the generated site so it can be previewed in your browser at
http://localhost:8000/::
invoke serve
To serve the generated site with automatic browser reloading every time a
change is detected, first ``python -m pip install livereload``, then use the
following command::
invoke livereload
If during the ``pelican-quickstart`` process you answered "yes" when asked
whether you want to upload your site via SSH, you can use the following command
to publish your site via rsync over SSH::
invoke publish
These are just a few of the commands available by default, so feel free to
explore ``tasks.py`` and see what other commands are available. More
importantly, don't hesitate to customize ``tasks.py`` to suit your specific
needs and preferences.
Make
----
A ``Makefile`` is also automatically created for you when you say "yes" to the
relevant question during the ``pelican-quickstart`` process. The advantage of
this method is that the ``make`` command is built into most POSIX systems and
thus doesn't require installing anything else in order to use it. The downside
is that non-POSIX systems (e.g., Windows) do not include ``make``, and
installing it on those systems can be a non-trivial task.
If you want to use ``make`` to generate your site using the settings in
``pelicanconf.py``, run::
make html
To generate the site for production, using the settings in ``publishconf.py``,
run::
make publish
If you'd prefer to have Pelican automatically regenerate your site every time a
change is detected (which is handy when testing locally), use the following
command instead::
make regenerate
To serve the generated site so it can be previewed in your browser at
http://localhost:8000/::
make serve
Normally you would need to run ``make regenerate`` and ``make serve`` in two
separate terminal sessions, but you can run both at once via::
make devserver
The above command will simultaneously run Pelican in regeneration mode as well
as serve the output at http://localhost:8000.
When you're ready to publish your site, you can upload it via the method(s) you
chose during the ``pelican-quickstart`` questionnaire. For this example, we'll
use rsync over ssh::
make rsync_upload
That's it! Your site should now be live.
(The default ``Makefile`` and ``devserver.sh`` scripts use the ``python`` and
``pelican`` executables to complete its tasks. If you want to use different
executables, such as ``python3``, you can set the ``PY`` and ``PELICAN``
environment variables, respectively, to override the default executable names.)
.. _Invoke: https://www.pyinvoke.org/

82
docs/quickstart.rst Normal file
View file

@ -0,0 +1,82 @@
Quickstart
##########
Reading through all the documentation is highly recommended, but for the truly
impatient, following are some quick steps to get started.
Installation
------------
Install Pelican (and optionally Markdown if you intend to use it) on Python
|min_python| by running the following command in your preferred terminal, prefixing
with ``sudo`` if permissions warrant::
python -m pip install "pelican[markdown]"
Create a project
----------------
First, choose a name for your project, create an appropriately-named directory
for your site, and switch to that directory::
mkdir -p ~/projects/yoursite
cd ~/projects/yoursite
Create a skeleton project via the ``pelican-quickstart`` command, which begins
by asking some questions about your site::
pelican-quickstart
For questions that have default values denoted in brackets, feel free to use
the Return key to accept those default values [#tzlocal_fn]_. When asked for
your URL prefix, enter your domain name as indicated (e.g.,
``https://example.com``).
Create an article
-----------------
You cannot run Pelican until you have created some content. Use your preferred
text editor to create your first article with the following content::
Title: My First Review
Date: 2010-12-03 10:20
Category: Review
Following is a review of my favorite mechanical keyboard.
Given that this example article is in Markdown format, save it as
``~/projects/yoursite/content/keyboard-review.md``.
Generate your site
------------------
From your project root directory, run the ``pelican`` command to generate your site::
pelican content
Your site has now been generated inside the ``output/`` directory. (You may see
a warning related to feeds, but that is normal when developing locally and can
be ignored for now.)
Preview your site
-----------------
Open a new terminal session, navigate to your project root directory, and
run the following command to launch Pelican's web server::
pelican --listen
Preview your site by navigating to http://localhost:8000/ in your browser.
Continue reading the other documentation sections for more detail, and check
out the Pelican wiki's Tutorials_ page for links to community-published
tutorials.
.. _Tutorials: https://github.com/getpelican/pelican/wiki/Tutorials
Footnotes
---------
.. [#tzlocal_fn] You can help localize default fields by installing the
optional `tzlocal <https://pypi.org/project/tzlocal/>`_
module.

114
docs/report.rst Normal file
View file

@ -0,0 +1,114 @@
Some history about Pelican
##########################
.. warning::
This page comes from a report the original author (Alexis Métaireau) wrote
right after writing Pelican, in December 2010. The information may not be
up-to-date.
Pelican is a simple static blog generator. It parses markup files (Markdown or
reStructuredText for now) and generates an HTML folder with all the files in
it. I've chosen to use Python to implement Pelican because it seemed to be
simple and to fit to my needs. I did not wanted to define a class for each
thing, but still wanted to keep my things loosely coupled. It turns out that it
was exactly what I wanted. From time to time, thanks to the feedback of some
users, it took me a very few time to provide fixes on it. So far, I've
re-factored the Pelican code by two
times; each time took less than 30 minutes.
Use case
========
I was previously using WordPress, a solution you can host on a web server to
manage your blog. Most of the time, I prefer using markup languages such as
Markdown or reStructuredText to type my articles. To do so, I use vim. I think
it is important to let the people choose the tool they want to write the
articles. In my opinion, a blog manager should just allow you to take any kind
of input and transform it to a weblog. That's what Pelican does. You can write
your articles using the tool you want, and the markup language you want, and
then generate a static HTML weblog.
.. image:: _static/overall.png
To be flexible enough, Pelican has template support, so you can easily write
your own themes if you want to.
Design process
==============
Pelican came from a need I have. I started by creating a single file
application, and I have make it grow to support what it does by now. To start,
I wrote a piece of documentation about what I wanted to do. Then, I created the
content I wanted to parse (the reStructuredText files) and started
experimenting with the code. Pelican was 200 lines long and contained almost
ten functions and one class when it was first usable.
I have been facing different problems all over the time and wanted to add
features to Pelican while using it. The first change I have done was to add the
support of a settings file. It is possible to pass the options to the command
line, but can be tedious if there is a lot of them. In the same way, I have
added the support of different things over time: Atom feeds, multiple themes,
multiple markup support, etc. At some point, it appears that the "only one
file" mantra was not good enough for Pelican, so I decided to rework a bit all
that, and split this in multiple different files.
Ive separated the logic in different classes and concepts:
* *writers* are responsible of all the writing process of the files.
They are responsible of writing .html files, RSS feeds and so on. Since those
operations are commonly used, the object is created once, and then passed to
the generators.
* *readers* are used to read from various formats (Markdown and
reStructuredText for now, but the system is extensible). Given a file, they
return metadata (author, tags, category, etc) and content (HTML formatted).
* *generators* generate the different outputs. For instance, Pelican
comes with an ArticlesGenerator and PagesGenerator, into others. Given a
configuration, they can do whatever you want them to do. Most of the time
it's generating files from inputs (user inputs and files).
I also deal with contents objects. They can be ``Articles``, ``Pages``,
``Quotes``, or whatever you want. They are defined in the ``contents.py``
module and represent some content to be used by the program.
In more detail
==============
Here is an overview of the classes involved in Pelican.
.. image:: _static/uml.jpg
The interface does not really exist, and I have added it only to clarify the
whole picture. I do use duck typing and not interfaces.
Internally, the following process is followed:
* First of all, the command line is parsed, and some content from the user is
used to initialize the different generator objects.
* A ``context`` is created. It contains the settings from the command line and
a settings file if provided.
* The ``generate_context`` method of each generator is called, updating
the context.
* The writer is created and given to the ``generate_output`` method of each
generator.
I make two calls because it is important that when the output is generated by
the generators, the context will not change. In other words, the first method
``generate_context`` should modify the context, whereas the second
``generate_output`` method should not.
Then, it is up to the generators to do what the want, in the
``generate_context`` and ``generate_content`` method. Taking the
``ArticlesGenerator`` class will help to understand some others concepts. Here
is what happens when calling the ``generate_context`` method:
* Read the folder “path”, looking for restructured text files, load each of
them, and construct a content object (``Article``) with it. To do so, use
``Reader`` objects.
* Update the ``context`` with all those articles.
Then, the ``generate_content`` method uses the ``context`` and the ``writer``
to generate the wanted output.

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,32 @@
How to create themes for pelican
################################
.. _theming-pelican:
Themes
######
There is a community-managed repository of `Pelican Themes`_ for people to share
and use.
Please note that while we do our best to review and merge theme contributions,
they are submitted by the Pelican community and thus may have varying levels of
support and interoperability.
Creating Themes
~~~~~~~~~~~~~~~
To generate its HTML output, Pelican uses the `Jinja
<https://palletsprojects.com/p/jinja/>`_ templating engine due to its flexibility and
straightforward syntax. If you want to create your own theme, feel free to take
inspiration from the `"simple" theme
<https://github.com/getpelican/pelican/tree/main/pelican/themes/simple/templates>`_.
To generate your site using a theme you have created (or downloaded manually
and then modified), you can specify that theme via the ``-t`` flag::
pelican content -s pelicanconf.py -t /projects/your-site/themes/your-theme
If you'd rather not specify the theme on every invocation, you can define
``THEME`` in your settings to point to the location of your preferred theme.
Pelican uses the great `jinja2 <http://jinjna.pocoo.org>`_ templating engine to
generate it's HTML output.
Structure
=========
@ -10,92 +34,635 @@ Structure
To make your own theme, you must follow the following structure::
├── static
   ├── css
   └── images
├── css
└── images
└── templates
├── archives.html // to display archives
├── article.html // processed for each article
├── categories.html // must list all the categories
├── category.html // processed for each category
├── index.html // the index. List all the articles
├── page.html // processed for each page
├── tag.html // processed for each tag
└── tags.html // must list all the tags. Can be a tag cloud.
├── archives.html // to display archives
├── article.html // processed for each article
├── author.html // processed for each author
├── authors.html // must list all the authors
├── categories.html // must list all the categories
├── category.html // processed for each category
├── index.html // the index (list all the articles)
├── page.html // processed for each page
├── period_archives.html // to display time-period archives
├── tag.html // processed for each tag
└── tags.html // must list all the tags. Can be a tag cloud.
* `static` contains all the static content. It will be copied on the output
`theme/static` folder then. I've put the css and image folders, but they are
just examples. Put what you need here.
* `static` contains all the static assets, which will be copied to the output
`theme` folder. The above filesystem layout includes CSS and image folders,
but those are just examples. Put what you need here.
* `templates` contains all the templates that will be used to generate the content.
I've just put the mandatory templates here, you can define your own if it helps
you to organize yourself while doing the theme.
Templates and variables
* `templates` contains all the templates that will be used to generate the
content. The template files listed above are mandatory; you can add your own
templates if it helps you keep things organized while creating your theme.
.. _templates-variables:
Templates and Variables
=======================
It's using a simple syntax, that you can embbed into your html pages.
This document describes which templates should exists on a theme, and which
variables will be passed to each template, while generating it.
The idea is to use a simple syntax that you can embed into your HTML pages.
This document describes which templates should exist in a theme, and which
variables will be passed to each template at generation time.
All templates will receive the variables defined in your settings file, if they
are in caps. You can access them directly.
All templates will receive the variables defined in your settings file, as long
as they are in all-caps. You can access them directly.
Common variables
.. _common_variables:
Common Variables
----------------
All of those settings will be given to all templates.
All of these settings will be available to all templates.
============= ===================================================
=============== ===================================================
Variable Description
============= ===================================================
articles That's the list of articles, ordsered desc. by date
all the elements are `Article` objects, so you can
access their properties (e.g. title, summary, author
etc.
dates The same list of article, but ordered by date,
ascending
tags A dict containing each tags (keys), and the list of
relative articles.
categories A dict containing each category (keys), and the
list of relative articles.
=============== ===================================================
output_file The name of the file currently being generated. For
instance, when Pelican is rendering the home page,
output_file will be "index.html".
articles The list of articles, ordered descending by date.
All the elements are `Article` objects, so you can
access their attributes (e.g. title, summary, author
etc.). Sometimes this is shadowed (for instance, in
the tags page). You will then find info about it
in the `all_articles` variable.
dates The same list of articles, but ordered by date,
ascending.
hidden_articles The list of hidden articles
drafts The list of draft articles
period_archives A dictionary containing elements related to
time-period archives (if enabled). See the section
:ref:`Listing and Linking to Period Archives
<period_archives_variable>` for details.
authors A list of (author, articles) tuples, containing all
the authors and corresponding articles (values)
categories A list of (category, articles) tuples, containing
all the categories and corresponding articles (values)
tags A list of (tag, articles) tuples, containing all
the tags and corresponding articles (values)
pages The list of pages
============= ===================================================
hidden_pages The list of hidden pages
draft_pages The list of draft pages
=============== ===================================================
Sorting
-------
URL wrappers (currently categories, tags, and authors), have comparison methods
that allow them to be easily sorted by name::
{% for tag, articles in tags|sort %}
If you want to sort based on different criteria, `Jinja's sort command`__ has a
number of options.
__ https://jinja.palletsprojects.com/en/latest/templates/#sort
Date Formatting
---------------
Pelican formats the date according to your settings and locale
(``DATE_FORMATS``/``DEFAULT_DATE_FORMAT``) and provides a ``locale_date``
attribute. On the other hand, the ``date`` attribute will be a `datetime`_
object. If you need custom formatting for a date different than your settings,
use the Jinja filter ``strftime`` that comes with Pelican. Usage is same as
Python `strftime`_ format, but the filter will do the right thing and format
your date according to the locale given in your settings::
{{ article.date|strftime('%d %B %Y') }}
.. _datetime: https://docs.python.org/3/library/datetime.html#datetime-objects
.. _strftime: https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior
Checking Loaded Plugins
-----------------------
Pelican provides a ``plugin_enabled`` Jinja test for checking if a certain plugin
is enabled. This test accepts a plugin name as a string and will return a Boolean.
Namespace plugins can be specified by full name (``pelican.plugins.plugin_name``)
or short name (``plugin_name``). The following example uses the ``webassets`` plugin
to minify CSS if the plugin is enabled and otherwise falls back to regular CSS::
{% if "webassets" is plugin_enabled %}
{% assets filters="cssmin", output="css/style.min.css", "css/style.scss" %}
<link rel="stylesheet" href="{{SITEURL}}/{{ASSET_URL}}">
{% endassets %}
{% else %}
<link rel="stylesheet" href="{{SITEURL}}/css/style.css}">
{% endif %}
index.html
----------
This is the home page or index of your blog, generated at ``index.html``.
If pagination is active, subsequent pages will reside in
``index{number}.html``.
====================== ===================================================
Variable Description
====================== ===================================================
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
articles_previous_page The previous page of articles (``None`` if page does
not exist)
articles_next_page The next page of articles (``None`` if page does
not exist)
dates_paginator A paginator object for the article list, ordered by
date, ascending.
dates_page The current page of articles, ordered by date,
ascending.
dates_previous_page The previous page of articles, ordered by date,
ascending (``None`` if page does not exist)
dates_next_page The next page of articles, ordered by date,
ascending (``None`` if page does not exist)
page_name 'index' -- useful for pagination links
====================== ===================================================
author.html
-------------
This template will be processed for each of the existing authors, with output
generated according to the ``AUTHOR_SAVE_AS`` setting (`Default:`
``author/{slug}.html``). If pagination is active, subsequent pages will by
default reside at ``author/{slug}{number}.html``.
====================== ===================================================
Variable Description
====================== ===================================================
author The name of the author being processed
articles Articles by this author
dates Articles by this author, but ordered by date,
ascending
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
articles_previous_page The previous page of articles (``None`` if page does
not exist)
articles_next_page The next page of articles (``None`` if page does
not exist)
dates_paginator A paginator object for the article list, ordered by
date, ascending.
dates_page The current page of articles, ordered by date,
ascending.
dates_previous_page The previous page of articles, ordered by date,
ascending (``None`` if page does not exist)
dates_next_page The next page of articles, ordered by date,
ascending (``None`` if page does not exist)
page_name AUTHOR_URL where everything after `{slug}` is
removed -- useful for pagination links
====================== ===================================================
category.html
-------------
This template will be processed for each of the existing categories, and will
finally remain at output/category/`category_name`.html.
This template will be processed for each of the existing categories, with
output generated according to the ``CATEGORY_SAVE_AS`` setting (`Default:`
``category/{slug}.html``). If pagination is active, subsequent pages will by
default reside at ``category/{slug}{number}.html``.
====================== ===================================================
Variable Description
====================== ===================================================
category The name of the category being processed
articles Articles for this category
dates Articles for this category, but ordered by date,
ascending
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
articles_previous_page The previous page of articles (``None`` if page does
not exist)
articles_next_page The next page of articles (``None`` if page does
not exist)
dates_paginator A paginator object for the list of articles,
ordered by date, ascending
dates_page The current page of articles, ordered by date,
ascending
dates_previous_page The previous page of articles, ordered by date,
ascending (``None`` if page does not exist)
dates_next_page The next page of articles, ordered by date,
ascending (``None`` if page does not exist)
page_name CATEGORY_URL where everything after `{slug}` is
removed -- useful for pagination links
====================== ===================================================
============= ===================================================
Variable Description
============= ===================================================
articles The articles of this category
category The name of the category being processed
============= ===================================================
article.html
-------------
This template will be processed for each article. .html files will be outputed
in output/`article_name`.html. Here are the specific variables it gets.
This template will be processed for each article, with output generated
according to the ``ARTICLE_SAVE_AS`` setting (`Default:` ``{slug}.html``). The
following variables are available when rendering.
============= ===================================================
Variable Description
============= ===================================================
article The article object to be displayed
category The name of the category of the current article
category The name of the category for the current article
============= ===================================================
tag.html
--------
Any metadata that you put in the header of the article source file will be
available as fields on the ``article`` object. The field name will be the same
as the name of the metadata field, except in all-lowercase characters.
For each tag, this template will be processed. It will create .html files in
/output/tag/`tag_name`.html
For example, you could add a field called `FacebookImage` to your article
metadata, as shown below:
.. code-block:: md
Title: I love Python more than music
Date: 2013-11-06 10:06
Tags: personal, python
Category: Tech
Slug: python-je-l-aime-a-mourir
Author: Francis Cabrel
FacebookImage: http://franciscabrel.com/images/pythonlove.png
This new metadata will be made available as `article.facebookimage` in your
`article.html` template. This would allow you, for example, to specify an image
for the Facebook open graph tags that will change for each article:
.. code-block:: html+jinja
<meta property="og:image" content="{{ article.facebookimage }}"/>
page.html
---------
This template will be processed for each page, with output generated according
to the ``PAGE_SAVE_AS`` setting (`Default:` ``pages/{slug}.html``). The
following variables are available when rendering.
============= ===================================================
Variable Description
============= ===================================================
tag The name of the tag being processed
articles Articles related to this tag
page The page object to be displayed. You can access its
title, slug, and content.
============= ===================================================
tag.html
--------
This template will be processed for each tag, with output generated according
to the ``TAG_SAVE_AS`` setting (`Default:` ``tag/{slug}.html``). If pagination
is active, subsequent pages will by default reside at
``tag/{slug}{number}.html``.
====================== ===================================================
Variable Description
====================== ===================================================
tag The name of the tag being processed
articles Articles related to this tag
dates Articles related to this tag, but ordered by date,
ascending
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
articles_previous_page The previous page of articles (``None`` if page does
not exist)
articles_next_page The next page of articles (``None`` if page does
not exist)
dates_paginator A paginator object for the list of articles,
ordered by date, ascending
dates_page The current page of articles, ordered by date,
ascending
dates_previous_page The previous page of articles, ordered by date,
ascending (``None`` if page does not exist)
dates_next_page The next page of articles, ordered by date,
ascending (``None`` if page does not exist)
page_name TAG_URL where everything after `{slug}` is removed
-- useful for pagination links
====================== ===================================================
period_archives.html
--------------------
This template will be processed for each year of your posts if a path for
``YEAR_ARCHIVE_SAVE_AS`` is defined, each month if ``MONTH_ARCHIVE_SAVE_AS`` is
defined, and each day if ``DAY_ARCHIVE_SAVE_AS`` is defined.
=================== ===================================================
Variable Description
=================== ===================================================
period A tuple of the form (`year`, `month`, `day`) that
indicates the current time period. `year` and `day`
are numbers while `month` is a string. This tuple
only contains `year` if the time period is a
given year. It contains both `year` and `month`
if the time period is over years and months and
so on.
period_num A tuple of the form (``year``, ``month``, ``day``),
as in ``period``, except all values are numbers.
=================== ===================================================
You can see an example of how to use `period` in the `"simple" theme
period_archives.html template
<https://github.com/getpelican/pelican/blob/main/pelican/themes/simple/templates/period_archives.html>`_.
.. _period_archives_variable:
Listing and Linking to Period Archives
""""""""""""""""""""""""""""""""""""""
The ``period_archives`` variable can be used to generate a list of links to
the set of period archives that Pelican generates. As a :ref:`common variable
<common_variables>`, it is available for use in any template, so you
can implement such an index in a custom direct template, or in a sidebar
visible across different site pages.
``period_archives`` is a dict that may contain ``year``, ``month``, and/or
``day`` keys, depending on which ``*_ARCHIVE_SAVE_AS`` settings are enabled.
The corresponding value is a list of dicts, where each dict in turn represents
a time period (ordered according to the ``NEWEST_FIRST_ARCHIVES`` setting)
with the following keys and values:
=================== ===================================================
Key Value
=================== ===================================================
period The same tuple as described in
``period_archives.html``, e.g.
``(2023, 'June', 18)``.
period_num The same tuple as described in
``period_archives.html``, e.g. ``(2023, 6, 18)``.
url The URL to the period archive page, e.g.
``posts/2023/06/18/``. This is controlled by the
corresponding ``*_ARCHIVE_URL`` setting.
save_as The path to the save location of the period archive
page file, e.g. ``posts/2023/06/18/index.html``.
This is used internally by Pelican and is usually
not relevant to themes.
articles A list of :ref:`Article <object-article>` objects
that fall under the time period.
dates Same list as ``articles``, but ordered according
to the ``NEWEST_FIRST_ARCHIVES`` setting.
=================== ===================================================
Here is an example of how ``period_archives`` can be used in a template:
.. code-block:: html+jinja
<ul>
{% for archive in period_archives.month %}
<li>
<a href="{{ SITEURL }}/{{ archive.url }}">
{{ archive.period | reverse | join(' ') }} ({{ archive.articles|count }})
</a>
</li>
{% endfor %}
</ul>
You can change ``period_archives.month`` in the ``for`` statement to
``period_archives.year`` or ``period_archives.day`` as appropriate, depending
on the time period granularity desired.
Objects
=======
Detail objects attributes that are available and useful in templates. Not all
attributes are listed here, this is a selection of attributes considered useful
in a template.
.. _object-article:
Article
-------
The string representation of an Article is the `source_path` attribute.
====================== ===================================================
Attribute Description
====================== ===================================================
author The :ref:`Author <object-author_cat_tag>` of
this article.
authors A list of :ref:`Authors <object-author_cat_tag>`
of this article.
category The :ref:`Category <object-author_cat_tag>`
of this article.
content The rendered content of the article.
date Datetime object representing the article date.
date_format Either default date format or locale date format.
default_template Default template name.
in_default_lang Boolean representing if the article is written
in the default language.
lang Language of the article.
locale_date Date formatted by the `date_format`.
metadata Article header metadata `dict`.
save_as Location to save the article page.
slug Page slug.
source_path Full system path of the article source file.
relative_source_path Relative path from PATH_ to the article source file.
status The article status, can be any of 'published' or
'draft'.
summary Rendered summary content.
tags List of :ref:`Tag <object-author_cat_tag>`
objects.
template Template name to use for rendering.
title Title of the article.
translations List of translations
:ref:`Article <object-article>` objects.
url URL to the article page.
====================== ===================================================
.. _PATH: settings.html#PATH
.. _object-author_cat_tag:
Author / Category / Tag
-----------------------
The string representation of those objects is the `name` attribute.
=================== ===================================================
Attribute Description
=================== ===================================================
name Name of this object [1]_.
page_name Author page name.
save_as Location to save the author page.
slug Page slug.
url URL to the author page.
=================== ===================================================
.. [1] for Author object, coming from `:authors:` or `AUTHOR`.
.. _object-page:
Page
----
The string representation of a Page is the `source_path` attribute.
===================== ===================================================
Attribute Description
===================== ===================================================
author The :ref:`Author <object-author_cat_tag>` of
this page.
content The rendered content of the page.
date Datetime object representing the page date.
date_format Either default date format or locale date format.
default_template Default template name.
in_default_lang Boolean representing if the article is written
in the default language.
lang Language of the article.
locale_date Date formatted by the `date_format`.
metadata Page header metadata `dict`.
save_as Location to save the page.
slug Page slug.
source_path Full system path of the page source file.
relative_source_path Relative path from PATH_ to the page source file.
status The page status, can be any of 'published', 'hidden' or
'draft'.
summary Rendered summary content.
tags List of :ref:`Tag <object-author_cat_tag>`
objects.
template Template name to use for rendering.
title Title of the page.
translations List of translations
:ref:`Article <object-article>` objects.
url URL to the page.
===================== ===================================================
.. _PATH: settings.html#PATH
Feeds
=====
The feed variables changed in 3.0. Each variable now explicitly lists ATOM or
RSS in the name. ATOM is still the default. Old themes will need to be updated.
Here is a complete list of the feed variables::
AUTHOR_FEED_ATOM
AUTHOR_FEED_RSS
CATEGORY_FEED_ATOM
CATEGORY_FEED_RSS
FEED_ALL_ATOM
FEED_ALL_RSS
FEED_ATOM
FEED_RSS
TAG_FEED_ATOM
TAG_FEED_RSS
TRANSLATION_FEED_ATOM
TRANSLATION_FEED_RSS
Inheritance
===========
Since version 3.0, Pelican supports inheritance from the ``simple`` theme, so
you can re-use the ``simple`` theme templates in your own themes.
If one of the mandatory files in the ``templates/`` directory of your theme is
missing, it will be replaced by the matching template from the ``simple``
theme. So if the HTML structure of a template in the ``simple`` theme is right
for you, you don't have to write a new template from scratch.
You can also extend templates from the ``simple`` theme in your own themes by
using the ``{% extends %}`` directive as in the following example:
.. code-block:: html+jinja
{% extends "!simple/index.html" %} <!-- extends the ``index.html`` template from the ``simple`` theme -->
{% extends "index.html" %} <!-- "regular" extending -->
Example
-------
With this system, it is possible to create a theme with just two files.
base.html
"""""""""
The first file is the ``templates/base.html`` template:
.. code-block:: html+jinja
{% extends "!simple/base.html" %}
{% block head %}
{{ super() }}
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/style.css" />
{% endblock %}
1. On the first line, we extend the ``base.html`` template from the ``simple``
theme, so we don't have to rewrite the entire file.
2. On the third line, we open the ``head`` block which has already been defined
in the ``simple`` theme.
3. On the fourth line, the function ``super()`` keeps the content previously
inserted in the ``head`` block.
4. On the fifth line, we append a stylesheet to the page.
5. On the last line, we close the ``head`` block.
This file will be extended by all the other templates, so the stylesheet will
be linked from all pages.
style.css
"""""""""
The second file is the ``static/css/style.css`` CSS stylesheet:
.. code-block:: css
body {
font-family : monospace ;
font-size : 100% ;
background-color : white ;
color : #111 ;
width : 80% ;
min-width : 400px ;
min-height : 200px ;
padding : 1em ;
margin : 5% 10% ;
border : thin solid gray ;
border-radius : 5px ;
display : block ;
}
a:link { color : blue ; text-decoration : none ; }
a:hover { color : blue ; text-decoration : underline ; }
a:visited { color : blue ; }
h1 a { color : inherit !important }
h2 a { color : inherit !important }
h3 a { color : inherit !important }
h4 a { color : inherit !important }
h5 a { color : inherit !important }
h6 a { color : inherit !important }
pre {
margin : 2em 1em 2em 4em ;
}
#menu li {
display : inline ;
}
#post-list {
margin-bottom : 1em ;
margin-top : 1em ;
}
Download
""""""""
You can download this example theme :download:`here <_static/theme-basic.zip>`.
.. Links
.. _`Pelican Themes`: https://github.com/getpelican/pelican-themes

377
docs/tips.rst Normal file
View file

@ -0,0 +1,377 @@
Tips
####
Here are some tips about Pelican that you might find useful.
Custom 404 Pages
================
When a browser requests a resource that the web server cannot find, the web
server usually displays a generic "File not found" (404) error page that can be
stark and unsightly. One way to provide an error page that matches the theme of
your site is to create a custom 404 page (*not* an article), such as this
Markdown-formatted example stored in ``content/pages/404.md``::
Title: Not Found
Status: hidden
Save_as: 404.html
The requested item could not be located. Perhaps you might want to check
the [Archives](/archives.html)?
The next step is to configure your web server to display this custom page
instead of its default 404 page. For Nginx, add the following to your
configuration file's ``location`` block::
error_page 404 /404.html;
For Apache::
ErrorDocument 404 /404.html
For Amazon S3, first navigate to the ``Static Site Hosting`` menu in the bucket
settings on your AWS console. From there::
Error Document: 404.html
Publishing to GitHub Pages
==========================
If you use `GitHub <https://github.com/>`_ for your Pelican site you can
publish your site to `GitHub Pages <https://pages.github.com/>`_ for free.
Your site will be published to ``https://<username>.github.io`` if it's a user or
organization site or to ``https://<username>.github.io/<repository>`` if it's a
project site. It's also possible to `use a custom domain with GitHub Pages <https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site>`_.
There are `two ways to publish a site to GitHub Pages <https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site>`_:
1. **Publishing from a branch:** run ``pelican`` locally and push the output
directory to a special branch of your GitHub repo. GitHub will then publish
the contents of this branch to your GitHub Pages site.
2. **Publishing with a custom GitHub Actions workflow:** just push the source
files of your Pelican site to your GitHub repo's default branch and have a
custom GitHub Actions workflow run ``pelican`` for you to generate the
output directory and publish it to your GitHub Pages site. This way you
don't need to run ``pelican`` locally. You can even edit your site's source
files using GitHub's web interface and any changes that you commit will be
published.
Publishing a Project Site to GitHub Pages from a Branch
-------------------------------------------------------
To publish a Pelican site as a Project Page you need to *push* the content of
the ``output`` dir generated by Pelican to a repository's ``gh-pages`` branch
on GitHub.
The excellent `ghp-import <https://github.com/davisp/ghp-import>`_, which can
be installed with ``pip``, makes this process really easy.
For example, if the source of your Pelican site is contained in a GitHub
repository, and if you want to publish that Pelican site in the form of Project
Pages to this repository, you can then use the following::
$ pelican content -o output -s pelicanconf.py
$ ghp-import output -b gh-pages
$ git push origin gh-pages
The ``ghp-import output`` command updates the local ``gh-pages`` branch with
the content of the ``output`` directory (creating the branch if it doesn't
already exist). The ``git push origin gh-pages`` command updates the remote
``gh-pages`` branch, effectively publishing the Pelican site.
.. note::
The ``github`` target of the Makefile (and the ``gh_pages`` task of
``tasks.py``) created by the ``pelican-quickstart`` command publishes the
Pelican site as Project Pages, as described above.
Publishing a User Site to GitHub Pages from a Branch
----------------------------------------------------
To publish a Pelican site in the form of User Pages, you need to *push* the
content of the ``output`` dir generated by Pelican to the ``main`` branch of
your ``<username>.github.io`` repository on GitHub.
Again, you can take advantage of ``ghp-import``::
$ pelican content -o output -s pelicanconf.py
$ ghp-import output -b gh-pages
$ git push git@github.com:elemoine/elemoine.github.io.git gh-pages:main
The ``git push`` command pushes the local ``gh-pages`` branch (freshly updated
by the ``ghp-import`` command) to the ``elemoine.github.io`` repository's
``main`` branch on GitHub.
.. note::
To publish your Pelican site as User Pages, feel free to adjust the
``github`` target of the Makefile.
Another option for publishing to User Pages is to generate the output files in
the root directory of the project.
For example, your main project folder is ``<username>.github.io`` and you can
create the Pelican project in a subdirectory called ``Pelican``. Then from
inside the ``Pelican`` folder you can run::
$ pelican content -o .. -s pelicanconf.py
Now you can push the whole project ``<username>.github.io`` to the main
branch of your GitHub repository::
$ git push origin main
(assuming origin is set to your remote repository).
Publishing to GitHub Pages Using a Custom GitHub Actions Workflow
-----------------------------------------------------------------
Pelican-powered sites can be published to GitHub Pages via a `custom workflow
<https://github.com/getpelican/pelican/blob/main/.github/workflows/github_pages.yml>`_.
To use it:
1. Enable GitHub Pages in your repo: go to **Settings → Pages** and choose
**GitHub Actions** for the **Source** setting.
2. Commit a ``.github/workflows/pelican.yml`` file to your repo with these contents:
.. code-block:: yaml
name: Deploy to GitHub Pages
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
deploy:
uses: "getpelican/pelican/.github/workflows/github_pages.yml@main"
permissions:
contents: "read"
pages: "write"
id-token: "write"
with:
settings: "publishconf.py"
You may want to replace the ``@main`` with the ID of a specific commit in
this repo in order to pin the version of the reusable workflow that you're using:
``uses: getpelican/pelican/.github/workflows/github_pages.yml@<COMMIT_ID>``.
If you do this you might want to get Dependabot to send you automated pull
requests to update that commit ID whenever new versions of this workflow are
published, like so:
.. code-block:: yaml
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
See `GitHub's docs about using Dependabot to keep your actions up to date <https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot>`_.
3. Go to the **Actions** tab in your repo
(``https://github.com/<username>/<repository>/actions``) and you should see a
**Deploy to GitHub Pages** action running.
4. Once the action completes you should see your Pelican site deployed at your
repo's GitHub Pages URL: ``https://<username>.github.io`` for a user or
organization site or ``https://<username>.github.io/<repository>>`` for a
project site.
Notes:
* You don't need to set ``SITEURL`` or ``FEED_DOMAIN`` in your Pelican
settings: the workflow will set them correctly for you
* You don't need to commit your ``--output`` / ``OUTPUT_PATH`` directory
(``output/``) to git: the workflow will run ``pelican`` to build the output
directory for you on GitHub Actions
See `GitHub's docs about reusable workflows <https://docs.github.com/en/actions/using-workflows/reusing-workflows>`_
for more information.
A number of optional inputs can be added to the ``with:`` block when calling
the workflow, for example:
.. code-block:: yaml
with:
settings: "publishconf.py"
requirements: "pelican[markdown] typogrify"
theme: "https://github.com/seanh/sidecar.git"
python: "3.12"
Here's the complete list of workflow inputs:
+------------------+----------+--------------------------------------------+--------+---------------+
| Name | Required | Description | Type | Default |
+==================+==========+============================================+========+===============+
| ``settings`` | Yes | The path to your Pelican settings | string | |
| | | file (``pelican``'s | | |
| | | ``--settings`` option), | | |
| | | for example: ``"publishconf.py"`` | | |
+------------------+----------+--------------------------------------------+--------+---------------+
| ``requirements`` | No | The Python requirements to | string | ``"pelican"`` |
| | | install, for example to enable | | |
| | | markdown and typogrify use: | | |
| | | ``"pelican[markdown] typogrify"`` | | |
| | | or if you have a requirements | | |
| | | file: ``"-r requirements.txt"`` | | |
+------------------+----------+--------------------------------------------+--------+---------------+
| ``output-path`` | No | Where to output the generated | string | ``"output/"`` |
| | | files (``pelican``'s ``--output`` | | |
| | | option) | | |
+------------------+----------+--------------------------------------------+--------+---------------+
| ``theme`` | No | The GitHub repo URL of a custom | string | ``""`` |
| | | theme to use, for example: | | |
| | | ``"https://github.com/seanh/sidecar.git"`` | | |
+------------------+----------+--------------------------------------------+--------+---------------+
| ``python`` | No | The version of Python to use to build the | string | ``"3.12"`` |
| | | site, for example: ``"3.12"`` (to use the | | |
| | | most recent version of Python 3.12, this | | |
| | | is faster) or ``"3.12.1"`` (to use an | | |
| | | exact version, slower) | | |
+------------------+----------+--------------------------------------------+--------+---------------+
| ``siteurl`` | No | The base URL of your web site (Pelican's | string | The URL of |
| | | ``SITEURL`` setting). If not passed this | | your GitHub |
| | | will default to the URL of your GitHub | | Pages site. |
| | | Pages site, which is correct in most | | |
| | | cases. | | |
+------------------+----------+--------------------------------------------+--------+---------------+
| ``feed_domain`` | No | The domain to be prepended to feed URLs | string | The URL of |
| | | (Pelican's ``FEED_DOMAIN`` setting). If | | your GitHub |
| | | not passed this will default to the URL of | | Pages site. |
| | | your GitHub Pages site, which is correct | | |
| | | in most cases. | | |
+------------------+----------+--------------------------------------------+--------+---------------+
| ``deploy`` | No | This is used to determine whether you will | bool | ``true`` |
| | | deploy the site or not to GitHub Pages. | | |
| | | This is most useful if you want to test a | | |
| | | change to your website in a pull request | | |
| | | before deploying those change. | | |
+------------------+----------+--------------------------------------------+--------+---------------+
Testing Your Build in a GitHub Pull Request
"""""""""""""""""""""""""""""""""""""""""""
If you want to test your build in a pull request before deploying to GitHub, your workflow might look something like this:
.. code-block:: yaml
name: Build and Deploy Site
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
inputs:
deploy:
required: false
default: true
description: "Whether to deploy the site. If checked, then build the site and deploy it. If not checked, then just test that the site builds successfully but don't deploy anything."
type: boolean
jobs:
deploy:
uses: "getpelican/pelican/.github/workflows/github_pages.yml@main"
permissions:
id-token: write
contents: read
pages: write
with:
settings: "publishconf.py"
requirements: "-r requirements.txt"
deploy: ${{ (github.event_name == 'workflow_dispatch' && inputs.deploy == true) || (github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch) }}
The ``on`` section of the workflow defines the events that will trigger the workflow. In this example, the workflow will run on pushes to the main branch, pull requests to the main branch, and manual runs of the workflow.
``workflow_dispatch`` defines the deploy boolean to be true by default. This means that if you run the workflow manually, it will deploy the site.
The ``deploy`` input for the job is using a set of standard GitHub workflow variables to control when ``deploy`` will either be true or false (you can customize this to your needs).
In this example, the ``deploy`` will be true if the event is a push to the main branch (or merging into main from a PR) or a manual run of the workflow. If the event is a pull request, the ``deploy`` will be false and it will only build an artifact for the site.
"Insecure content" warnings from browsers
"""""""""""""""""""""""""""""""""""""""""
If your site uses ``https://`` and is broken because the browser is blocking
network requests (for example for CSS files) due to "insecure content" this
may be because GitHub Pages is generating ``http://`` URLs for your site.
To fix this go into your site repo's settings and enable the **Enforce HTTPS** setting:
go to **Settings → Pages** and check **Enforce HTTPS**.
Then re-run the workflow to re-deploy your site.
Alternatively, you can use the workflow's ``siteurl`` and ``feed_domain`` settings.
Custom 404 Pages
----------------
GitHub Pages will display the custom 404 page described above, as noted in the
relevant `GitHub docs <https://help.github.com/articles/custom-404-pages/>`_.
Update your site on each commit
-------------------------------
To automatically update your Pelican site on each commit, you can create a
post-commit hook. For example, you can add the following to
``.git/hooks/post-commit``::
pelican content -o output -s pelicanconf.py && ghp-import output && git push origin gh-pages
Copy static files to the root of your site
------------------------------------------
To use a `custom domain
<https://help.github.com/articles/setting-up-a-custom-domain-with-pages>`_ with
GitHub Pages, you need to put the domain of your site (e.g.,
``blog.example.com``) inside a ``CNAME`` file at the root of your site. To do
this, create the ``content/extra/`` directory and add a ``CNAME`` file to it.
Then use the ``STATIC_PATHS`` setting to tell Pelican to copy this file to your
output directory. For example::
STATIC_PATHS = ['images', 'extra/CNAME']
EXTRA_PATH_METADATA = {'extra/CNAME': {'path': 'CNAME'},}
Note: use forward slashes, ``/``, even on Windows.
You can also use the ``EXTRA_PATH_METADATA`` mechanism to place a
``favicon.ico`` or ``robots.txt`` at the root of any site.
How to add YouTube or Vimeo Videos
==================================
The easiest way is to paste the embed code of the video from these sites
directly into your source content.
Alternatively, you can also use Pelican plugins like ``liquid_tags``,
``pelican_youtube``, or ``pelican_vimeo`` to embed videos in your content.
Moreover, markup languages like reST and Markdown have plugins that let you
embed videos in the markup. You can use `reST video directive
<https://gist.github.com/dbrgn/2922648>`_ for reST or `mdx_video plugin
<https://github.com/italomaia/mdx-video>`_ for Markdown.
Develop Locally Using SSL
==================================
Here's how you can set up your local pelican server to support SSL.
First, create a self-signed certificate and key using ``openssl`` (this creates ``cert.pem`` and ``key.pem``)::
$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
And use this command to launch the server (the server starts within your ``output`` directory)::
python -m pelican.server 8443 --key=../key.pem --cert=../cert.pem
If you are using ``develop-server.sh``, add this to the top::
CERT="$BASEDIR/cert.pem"
KEY="$BASEDIR/key.pem"
and modify the ``pelican.server`` line as follows::
$PY -m pelican.server $port --ssl --cert="$CERT" --key="$KEY" &

View file

@ -1,113 +1,687 @@
import argparse
import importlib.metadata
import json
import logging
import multiprocessing
import os
import pprint
import sys
import time
import traceback
from collections.abc import Iterable
# Combines all paths to `pelican` package accessible from `sys.path`
# Makes it possible to install `pelican` and namespace plugins into different
# locations in the file system (e.g. pip with `-e` or `--user`)
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
# pelican.log has to be the first pelican module to be loaded
# because logging.setLoggerClass has to be called before logging.getLogger
from pelican.log import console, DEFAULT_LOG_HANDLER # noqa: I001
from pelican.log import init as init_logging
from pelican.generators import (
ArticlesGenerator,
PagesGenerator,
SourceFileGenerator,
StaticGenerator,
TemplatePagesGenerator,
)
from pelican.plugins import signals
from pelican.plugins._utils import get_plugin_name, load_plugins
from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
from pelican.settings import read_settings
from pelican.utils import clean_output_dir
from pelican.utils import clean_output_dir, maybe_pluralize, wait_for_changes
from pelican.writers import Writer
from pelican.generators import (ArticlesGenerator, PagesGenerator,
StaticGenerator, PdfGenerator)
VERSION = "2.5.2"
try:
__version__ = importlib.metadata.version("pelican")
except Exception:
__version__ = "unknown"
DEFAULT_CONFIG_NAME = "pelicanconf.py"
logger = logging.getLogger(__name__)
def init_params(settings=None, path=None, theme=None, output_path=None,
markup=None, keep=False):
"""Read the settings, and performs some checks on the environment
before doing anything else.
"""
if settings is None:
settings = {}
settings = read_settings(settings)
path = path or settings['PATH']
if path.endswith('/'):
path = path[:-1]
class Pelican:
def __init__(self, settings):
"""Pelican initialization
# define the default settings
theme = theme or settings['THEME']
output_path = output_path or settings['OUTPUT_PATH']
output_path = os.path.realpath(output_path)
markup = markup or settings['MARKUP']
keep = keep or settings['KEEP_OUTPUT_DIRECTORY']
Performs some checks on the environment before doing anything else.
"""
# find the theme in pelican.theme if the given one does not exists
if not os.path.exists(theme):
theme_path = os.sep.join([os.path.dirname(
os.path.abspath(__file__)), "themes/%s" % theme])
if os.path.exists(theme_path):
theme = theme_path
# define the default settings
self.settings = settings
self.path = settings["PATH"]
self.theme = settings["THEME"]
self.output_path = settings["OUTPUT_PATH"]
self.ignore_files = settings["IGNORE_FILES"]
self.delete_outputdir = settings["DELETE_OUTPUT_DIRECTORY"]
self.output_retention = settings["OUTPUT_RETENTION"]
self.init_path()
self.init_plugins()
signals.initialized.send(self)
def init_path(self):
if not any(p in sys.path for p in ["", os.curdir]):
logger.debug("Adding current directory to system path")
sys.path.insert(0, "")
def init_plugins(self):
self.plugins = []
for plugin in load_plugins(self.settings):
name = get_plugin_name(plugin)
logger.debug("Registering plugin `%s`", name)
try:
plugin.register()
self.plugins.append(plugin)
except Exception as e:
logger.error(
"Cannot register plugin `%s`\n%s",
name,
e,
stacklevel=2,
)
if self.settings.get("DEBUG", False):
console.print_exception()
self.settings["PLUGINS"] = [get_plugin_name(p) for p in self.plugins]
def run(self):
"""Run the generators and return"""
start_time = time.time()
context = self.settings.copy()
# Share these among all the generators and content objects
# They map source paths to Content objects or None
context["generated_content"] = {}
context["static_links"] = set()
context["static_content"] = {}
context["localsiteurl"] = self.settings["SITEURL"]
generators = [
cls(
context=context,
settings=self.settings,
path=self.path,
theme=self.theme,
output_path=self.output_path,
)
for cls in self._get_generator_classes()
]
# Delete the output directory if (1) the appropriate setting is True
# and (2) that directory is not the parent of the source directory
if self.delete_outputdir and os.path.commonpath(
[os.path.realpath(self.output_path)]
) != os.path.commonpath(
[os.path.realpath(self.output_path), os.path.realpath(self.path)]
):
clean_output_dir(self.output_path, self.output_retention)
for p in generators:
if hasattr(p, "generate_context"):
p.generate_context()
if hasattr(p, "check_disabled_readers"):
p.check_disabled_readers()
# for plugins that create/edit the summary
logger.debug("Signal all_generators_finalized.send(<generators>)")
signals.all_generators_finalized.send(generators)
# update links in the summary, etc
for p in generators:
if hasattr(p, "refresh_metadata_intersite_links"):
p.refresh_metadata_intersite_links()
writer = self._get_writer()
for p in generators:
if hasattr(p, "generate_output"):
p.generate_output(writer)
signals.finalized.send(self)
articles_generator = next(
g for g in generators if isinstance(g, ArticlesGenerator)
)
pages_generator = next(g for g in generators if isinstance(g, PagesGenerator))
pluralized_articles = maybe_pluralize(
(len(articles_generator.articles) + len(articles_generator.translations)),
"article",
"articles",
)
pluralized_drafts = maybe_pluralize(
(
len(articles_generator.drafts)
+ len(articles_generator.drafts_translations)
),
"draft",
"drafts",
)
pluralized_hidden_articles = maybe_pluralize(
(
len(articles_generator.hidden_articles)
+ len(articles_generator.hidden_translations)
),
"hidden article",
"hidden articles",
)
pluralized_pages = maybe_pluralize(
(len(pages_generator.pages) + len(pages_generator.translations)),
"page",
"pages",
)
pluralized_hidden_pages = maybe_pluralize(
(
len(pages_generator.hidden_pages)
+ len(pages_generator.hidden_translations)
),
"hidden page",
"hidden pages",
)
pluralized_draft_pages = maybe_pluralize(
(
len(pages_generator.draft_pages)
+ len(pages_generator.draft_translations)
),
"draft page",
"draft pages",
)
console.print(
f"Done: Processed {pluralized_articles}, {pluralized_drafts}, {pluralized_hidden_articles}, {pluralized_pages}, {pluralized_hidden_pages} and {pluralized_draft_pages} in {time.time() - start_time:.2f} seconds."
)
def _get_generator_classes(self):
discovered_generators = [
(ArticlesGenerator, "internal"),
(PagesGenerator, "internal"),
]
if self.settings["TEMPLATE_PAGES"]:
discovered_generators.append((TemplatePagesGenerator, "internal"))
if self.settings["OUTPUT_SOURCES"]:
discovered_generators.append((SourceFileGenerator, "internal"))
for receiver, values in signals.get_generators.send(self):
if not isinstance(values, Iterable):
values = (values,)
for generator in values:
if generator is None:
continue # plugin did not return a generator
discovered_generators.append((generator, receiver.__module__))
# StaticGenerator must run last, so it can identify files that
# were skipped by the other generators, and so static files can
# have their output paths overridden by the {attach} link syntax.
discovered_generators.append((StaticGenerator, "internal"))
generators = []
for generator, origin in discovered_generators:
if not isinstance(generator, type):
logger.error("Generator %s (%s) cannot be loaded", generator, origin)
continue
logger.debug("Found generator: %s (%s)", generator.__name__, origin)
generators.append(generator)
return generators
def _get_writer(self):
writers = [w for _, w in signals.get_writer.send(self) if isinstance(w, type)]
num_writers = len(writers)
if num_writers == 0:
return Writer(self.output_path, settings=self.settings)
if num_writers > 1:
logger.warning("%s writers found, using only first one", num_writers)
writer = writers[0]
logger.debug("Found writer: %s (%s)", writer.__name__, writer.__module__)
return writer(self.output_path, settings=self.settings)
class PrintSettings(argparse.Action):
def __call__(self, parser, namespace, values, option_string):
del option_string # Unused argument
init_logging(name=__name__)
try:
instance, settings = get_instance(namespace)
except Exception as e:
logger.critical("%s: %s", e.__class__.__name__, e)
console.print_exception()
sys.exit(getattr(e, "exitcode", 1))
if values:
# One or more arguments provided, so only print those settings
for setting in values:
if setting in settings:
# Only add newline between setting name and value if dict
if isinstance(settings[setting], (dict, tuple, list)):
setting_format = "\n{}:\n{}"
else:
setting_format = "\n{}: {}"
console.print(
setting_format.format(
setting, pprint.pformat(settings[setting])
)
)
else:
console.print(f"\n{setting} is not a recognized setting.")
break
else:
raise Exception("Impossible to find the theme %s" % theme)
# No argument was given to --print-settings, so print all settings
console.print(settings)
# get the list of files to parse
if not path:
raise Exception('you need to specify a path to search the docs on !')
return settings, path, theme, output_path, markup, keep
parser.exit()
def run_generators(generators, settings, path, theme, output_path, markup, keep):
"""Run the generators and return"""
context = settings.copy()
generators = [p(context, settings, path, theme, output_path, markup, keep)
for p in generators]
for p in generators:
if hasattr(p, 'generate_context'):
p.generate_context()
# erase the directory if it is not the source
if output_path not in os.path.realpath(path) and not keep:
clean_output_dir(output_path)
writer = Writer(output_path)
for p in generators:
if hasattr(p, 'generate_output'):
p.generate_output(writer)
class ParseOverrides(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
del parser, option_string # Unused arguments
overrides = {}
for item in values:
try:
k, v = item.split("=", 1)
except ValueError:
raise ValueError(
"Extra settings must be specified as KEY=VALUE pairs "
f"but you specified {item}"
) from None
try:
overrides[k] = json.loads(v)
except json.decoder.JSONDecodeError:
raise ValueError(
f"Invalid JSON value: {v}. "
"Values specified via -e / --extra-settings flags "
"must be in JSON notation. "
"Use -e KEY='\"string\"' to specify a string value; "
"-e KEY=null to specify None; "
"-e KEY=false (or true) to specify False (or True)."
) from None
setattr(namespace, self.dest, overrides)
def run_pelican(settings, path, theme, output_path, markup, delete):
"""Run pelican with the given parameters"""
params = init_params(settings, path, theme, output_path, markup, delete)
generators = [ArticlesGenerator, PagesGenerator, StaticGenerator]
if params[0]['PDF_GENERATOR']: # param[0] is settings
processors.append(PdfGenerator)
run_generators(generators, *params)
LOG_HANDLERS = {"plain": None, "rich": DEFAULT_LOG_HANDLER}
def main():
parser = argparse.ArgumentParser(description="""A tool to generate a
static blog, with restructured text input files.""")
def parse_arguments(argv=None):
parser = argparse.ArgumentParser(
description="A tool to generate a static blog, "
" with restructured text input files.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(dest='path',
help='Path where to find the content files')
parser.add_argument('-t', '--theme-path', dest='theme',
help='Path where to find the theme templates. If not specified, it will'
'use the default one included with pelican.')
parser.add_argument('-o', '--output', dest='output',
help='Where to output the generated files. If not specified, a directory'
' will be created, named "output" in the current path.')
parser.add_argument('-m', '--markup', default=None, dest='markup',
help='the list of markup language to use (rst or md). Please indicate them'
'separated by commas')
parser.add_argument('-s', '--settings', dest='settings',
help='the settings of the application. Default to None.')
parser.add_argument('-k', '--keep-output-directory', dest='keep',
action='store_true',
help='Keep the output directory and just update all the generated files.'
'Default is to delete the output directory.')
parser.add_argument('--version', action='version', version=VERSION,
help="Print the pelican version and exit")
args = parser.parse_args()
parser.add_argument(
dest="path",
nargs="?",
help="Path where to find the content files.",
default=None,
)
# Split the markup languages only if some have been given. Otherwise, populate
# the variable with None.
markup = [a.strip().lower() for a in args.markup.split(',')] if args.markup else None
parser.add_argument(
"-t",
"--theme-path",
dest="theme",
help="Path where to find the theme templates. If not "
"specified, it will use the default one included with "
"pelican.",
)
run_pelican(args.settings, args.path, args.theme, args.output, markup, args.keep)
parser.add_argument(
"-o",
"--output",
dest="output",
help="Where to output the generated files. If not "
"specified, a directory will be created, named "
'"output" in the current path.',
)
parser.add_argument(
"-s",
"--settings",
dest="settings",
help="The settings of the application, this is "
f"automatically set to {DEFAULT_CONFIG_NAME} if a file exists with this "
"name.",
)
parser.add_argument(
"-d",
"--delete-output-directory",
dest="delete_outputdir",
action="store_true",
default=None,
help="Delete the output directory.",
)
parser.add_argument(
"-v",
"--verbose",
action="store_const",
const=logging.INFO,
dest="verbosity",
help="Show all messages.",
)
parser.add_argument(
"-q",
"--quiet",
action="store_const",
const=logging.CRITICAL,
dest="verbosity",
help="Show only critical errors.",
)
parser.add_argument(
"-D",
"--debug",
action="store_const",
const=logging.DEBUG,
dest="verbosity",
help="Show all messages, including debug messages.",
)
parser.add_argument(
"--version",
action="version",
version=__version__,
help="Print the pelican version and exit.",
)
parser.add_argument(
"-r",
"--autoreload",
dest="autoreload",
action="store_true",
help="Relaunch pelican each time a modification occurs on the content files.",
)
parser.add_argument(
"--print-settings",
dest="print_settings",
nargs="*",
action=PrintSettings,
metavar="SETTING_NAME",
help="Print current configuration settings and exit. "
"Append one or more setting name arguments to see the "
"values for specific settings only.",
)
parser.add_argument(
"--relative-urls",
dest="relative_paths",
action="store_true",
help="Use relative urls in output, useful for site development",
)
parser.add_argument(
"--cache-path",
dest="cache_path",
help=(
"Directory in which to store cache files. "
'If not specified, defaults to "cache".'
),
)
parser.add_argument(
"--ignore-cache",
action="store_true",
dest="ignore_cache",
help="Ignore content cache from previous runs by not loading cache files.",
)
parser.add_argument(
"--fatal",
metavar="errors|warnings",
choices=("errors", "warnings"),
default="",
help=(
"Exit the program with non-zero status if any errors/warnings encountered."
),
)
parser.add_argument(
"--log-handler",
default="rich",
choices=LOG_HANDLERS,
help=(
"Which handler to use to format log messages. "
"The `rich` handler prints output in columns."
),
)
parser.add_argument(
"--logs-dedup-min-level",
default="WARNING",
choices=("DEBUG", "INFO", "WARNING", "ERROR"),
help=(
"Only enable log de-duplication for levels equal"
" to or above the specified value"
),
)
parser.add_argument(
"-l",
"--listen",
dest="listen",
action="store_true",
help="Serve content files via HTTP and port 8000.",
)
parser.add_argument(
"-p",
"--port",
dest="port",
type=int,
help="Port to serve HTTP files at. (default: 8000)",
)
parser.add_argument(
"-b",
"--bind",
dest="bind",
help="IP to bind to when serving files via HTTP (default: 127.0.0.1)",
)
parser.add_argument(
"-e",
"--extra-settings",
dest="overrides",
help="Specify one or more SETTING=VALUE pairs to "
"override settings. VALUE must be in JSON notation: "
"specify string values as SETTING='\"some string\"'; "
"booleans as SETTING=true or SETTING=false; "
"None as SETTING=null.",
nargs="*",
action=ParseOverrides,
default={},
)
args = parser.parse_args(argv)
if args.port is not None and not args.listen:
logger.warning("--port without --listen has no effect")
if args.bind is not None and not args.listen:
logger.warning("--bind without --listen has no effect")
return args
if __name__ == '__main__':
main()
def get_config(args):
"""Builds a config dictionary based on supplied `args`."""
config = {}
if args.path:
config["PATH"] = os.path.abspath(os.path.expanduser(args.path))
if args.output:
config["OUTPUT_PATH"] = os.path.abspath(os.path.expanduser(args.output))
if args.theme:
abstheme = os.path.abspath(os.path.expanduser(args.theme))
config["THEME"] = abstheme if os.path.exists(abstheme) else args.theme
if args.delete_outputdir is not None:
config["DELETE_OUTPUT_DIRECTORY"] = args.delete_outputdir
if args.ignore_cache:
config["LOAD_CONTENT_CACHE"] = False
if args.cache_path:
config["CACHE_PATH"] = args.cache_path
if args.relative_paths:
config["RELATIVE_URLS"] = args.relative_paths
if args.port is not None:
config["PORT"] = args.port
if args.bind is not None:
config["BIND"] = args.bind
config["DEBUG"] = args.verbosity == logging.DEBUG
config.update(args.overrides)
return config
def get_instance(args):
config_file = args.settings
if config_file is None and os.path.isfile(DEFAULT_CONFIG_NAME):
config_file = DEFAULT_CONFIG_NAME
args.settings = DEFAULT_CONFIG_NAME
settings = read_settings(config_file, override=get_config(args))
cls = settings["PELICAN_CLASS"]
if isinstance(cls, str):
module, cls_name = cls.rsplit(".", 1)
module = __import__(module)
cls = getattr(module, cls_name)
return cls(settings), settings
def autoreload(args, excqueue=None):
console.print(
" --- AutoReload Mode: Monitoring `content`, `theme` and"
" `settings` for changes. ---"
)
pelican, settings = get_instance(args)
settings_file = os.path.abspath(args.settings)
while True:
try:
pelican.run()
changed_files = wait_for_changes(args.settings, settings)
changed_files = {c[1] for c in changed_files}
if settings_file in changed_files:
pelican, settings = get_instance(args)
console.print(
"\n-> Modified: {}. re-generating...".format(", ".join(changed_files))
)
except KeyboardInterrupt:
if excqueue is not None:
excqueue.put(None)
return
raise
except Exception as e:
if args.verbosity == logging.DEBUG:
if excqueue is not None:
excqueue.put(traceback.format_exception_only(type(e), e)[-1])
else:
raise
logger.warning(
'Caught exception:\n"%s".', e, exc_info=settings.get("DEBUG", False)
)
def listen(server, port, output, excqueue=None):
# set logging level to at least "INFO" (so we can see the server requests)
if logger.level < logging.INFO:
logger.setLevel(logging.INFO)
RootedHTTPServer.allow_reuse_address = True
try:
httpd = RootedHTTPServer(output, (server, port), ComplexHTTPRequestHandler)
except OSError as e:
logging.error("Could not listen on port %s, server %s.", port, server)
if excqueue is not None:
excqueue.put(traceback.format_exception_only(type(e), e)[-1])
return
try:
console.print(f"Serving site at: http://{server}:{port} - Tap CTRL-C to stop")
httpd.serve_forever()
except Exception as e:
if excqueue is not None:
excqueue.put(traceback.format_exception_only(type(e), e)[-1])
return
except KeyboardInterrupt:
httpd.socket.close()
if excqueue is not None:
return
raise
def main(argv=None):
args = parse_arguments(argv)
logs_dedup_min_level = getattr(logging, args.logs_dedup_min_level)
init_logging(
level=args.verbosity,
fatal=args.fatal,
name=__name__,
handler=LOG_HANDLERS[args.log_handler],
logs_dedup_min_level=logs_dedup_min_level,
)
logger.debug("Pelican version: %s", __version__)
logger.debug("Python version: %s", sys.version.split()[0])
try:
pelican, settings = get_instance(args)
if args.autoreload and args.listen:
excqueue = multiprocessing.Queue()
p1 = multiprocessing.Process(target=autoreload, args=(args, excqueue))
p2 = multiprocessing.Process(
target=listen,
args=(
settings.get("BIND"),
settings.get("PORT"),
settings.get("OUTPUT_PATH"),
excqueue,
),
)
try:
p1.start()
p2.start()
exc = excqueue.get()
if exc is not None:
logger.critical(exc)
finally:
p1.terminate()
p2.terminate()
elif args.autoreload:
autoreload(args)
elif args.listen:
listen(
settings.get("BIND"), settings.get("PORT"), settings.get("OUTPUT_PATH")
)
else:
with console.status("Generating..."):
pelican.run()
except KeyboardInterrupt:
logger.warning("Keyboard interrupt received. Exiting.")
except Exception as e:
logger.critical("%s: %s", e.__class__.__name__, e)
if args.verbosity == logging.DEBUG:
console.print_exception()
sys.exit(getattr(e, "exitcode", 1))

8
pelican/__main__.py Normal file
View file

@ -0,0 +1,8 @@
"""
python -m pelican module entry point to run via python -m
"""
from . import main
if __name__ == "__main__":
main()

139
pelican/cache.py Normal file
View file

@ -0,0 +1,139 @@
import gzip
import hashlib
import logging
import os
import pickle
from pelican.utils import mkdir_p
logger = logging.getLogger(__name__)
class FileDataCacher:
"""Class that can cache data contained in files"""
def __init__(self, settings, cache_name, caching_policy, load_policy):
"""Load the specified cache within CACHE_PATH in settings
only if *load_policy* is True,
May use gzip if GZIP_CACHE ins settings is True.
Sets caching policy according to *caching_policy*.
"""
self.settings = settings
self._cache_path = os.path.join(self.settings["CACHE_PATH"], cache_name)
self._cache_data_policy = caching_policy
if self.settings["GZIP_CACHE"]:
self._cache_open = gzip.open
else:
self._cache_open = open
if load_policy:
try:
with self._cache_open(self._cache_path, "rb") as fhandle:
self._cache = pickle.load(fhandle)
except (OSError, UnicodeDecodeError) as err:
logger.debug(
"Cannot load cache %s (this is normal on first "
"run). Proceeding with empty cache.\n%s",
self._cache_path,
err,
)
self._cache = {}
except pickle.PickleError as err:
logger.warning(
"Cannot unpickle cache %s, cache may be using "
"an incompatible protocol (see pelican "
"caching docs). "
"Proceeding with empty cache.\n%s",
self._cache_path,
err,
)
self._cache = {}
else:
self._cache = {}
def cache_data(self, filename, data):
"""Cache data for given file"""
if self._cache_data_policy:
self._cache[filename] = data
def get_cached_data(self, filename, default=None):
"""Get cached data for the given file
if no data is cached, return the default object
"""
return self._cache.get(filename, default)
def save_cache(self):
"""Save the updated cache"""
if self._cache_data_policy:
try:
mkdir_p(self.settings["CACHE_PATH"])
with self._cache_open(self._cache_path, "wb") as fhandle:
pickle.dump(self._cache, fhandle)
except (OSError, pickle.PicklingError, TypeError) as err:
logger.warning(
"Could not save cache %s\n ... %s", self._cache_path, err
)
class FileStampDataCacher(FileDataCacher):
"""Subclass that also caches the stamp of the file"""
def __init__(self, settings, cache_name, caching_policy, load_policy):
"""This subclass additionally sets filestamp function
and base path for filestamping operations
"""
super().__init__(settings, cache_name, caching_policy, load_policy)
method = self.settings["CHECK_MODIFIED_METHOD"]
if method == "mtime":
self._filestamp_func = os.path.getmtime
else:
try:
hash_func = getattr(hashlib, method)
def filestamp_func(filename):
"""return hash of file contents"""
with open(filename, "rb") as fhandle:
return hash_func(fhandle.read()).digest()
self._filestamp_func = filestamp_func
except AttributeError as err:
logger.warning("Could not get hashing function\n\t%s", err)
self._filestamp_func = None
def cache_data(self, filename, data):
"""Cache stamp and data for the given file"""
stamp = self._get_file_stamp(filename)
super().cache_data(filename, (stamp, data))
def _get_file_stamp(self, filename):
"""Check if the given file has been modified
since the previous build.
depending on CHECK_MODIFIED_METHOD
a float may be returned for 'mtime',
a hash for a function name in the hashlib module
or an empty bytes string otherwise
"""
try:
return self._filestamp_func(filename)
except (OSError, TypeError) as err:
logger.warning("Cannot get modification stamp for %s\n\t%s", filename, err)
return ""
def get_cached_data(self, filename, default=None):
"""Get the cached data for the given filename
if the file has not been modified.
If no record exists or file has been modified, return default.
Modification is checked by comparing the cached
and current file stamp.
"""
stamp, data = super().get_cached_data(filename, (None, default))
if stamp != self._get_file_stamp(filename):
return default
return data

View file

@ -1,59 +1,692 @@
from pelican.utils import slugify, truncate_html_words
import copy
import datetime
import locale
import logging
import os
import re
from html import unescape
from typing import Any, Optional
from urllib.parse import ParseResult, unquote, urljoin, urlparse, urlunparse
try:
from zoneinfo import ZoneInfo
except ModuleNotFoundError:
from backports.zoneinfo import ZoneInfo
class Page(object):
"""Represents a page
Given a content, and metadatas, create an adequate object.
from pelican.plugins import signals
from pelican.settings import DEFAULT_CONFIG, Settings
# Import these so that they're available when you import from pelican.contents.
from pelican.urlwrappers import Author, Category, Tag, URLWrapper # NOQA
from pelican.utils import (
deprecated_attribute,
memoized,
path_to_url,
posixize_path,
sanitised_join,
set_date_tzinfo,
slugify,
truncate_html_paragraphs,
truncate_html_words,
)
logger = logging.getLogger(__name__)
class Content:
"""Represents a content.
:param content: the string to parse, containing the original content.
:param metadata: the metadata associated to this page (optional).
:param settings: the settings dictionary (optional).
:param source_path: The location of the source of this content (if any).
:param context: The shared context between generators.
:param string: the string to parse, containing the original content.
:param markup: the markup language to use while parsing.
"""
mandatory_properties = ('title',)
def __init__(self, content, metadatas={}, settings={}, filename=None):
self.content = content
self.status = "published" # default value
for key, value in metadatas.items():
setattr(self, key, value)
default_template: Optional[str] = None
mandatory_properties: tuple[str, ...] = ()
if not hasattr(self, 'author'):
if 'AUTHOR' in settings:
self.author = settings['AUTHOR']
@deprecated_attribute(old="filename", new="source_path", since=(3, 2, 0))
def filename():
return None
if filename:
self.filename = filename
def __init__(
self,
content: str,
metadata: Optional[dict[str, Any]] = None,
settings: Optional[Settings] = None,
source_path: Optional[str] = None,
context: Optional[dict[Any, Any]] = None,
):
if metadata is None:
metadata = {}
if settings is None:
settings = copy.deepcopy(DEFAULT_CONFIG)
def check_properties(self):
"""test that each mandatory property is set."""
self.settings = settings
self._content = content
if context is None:
context = {}
self._context = context
self.translations = []
local_metadata = {}
local_metadata.update(metadata)
# set metadata as attributes
for key, value in local_metadata.items():
if key in ("save_as", "url"):
key = "override_" + key
setattr(self, key.lower(), value)
# also keep track of the metadata attributes available
self.metadata = local_metadata
# default template if it's not defined in page
self.template = self._get_template()
# First, read the authors from "authors", if not, fallback to "author"
# and if not use the settings defined one, if any.
if not hasattr(self, "author"):
if hasattr(self, "authors"):
self.author = self.authors[0]
elif "AUTHOR" in settings:
self.author = Author(settings["AUTHOR"], settings)
if not hasattr(self, "authors") and hasattr(self, "author"):
self.authors = [self.author]
# XXX Split all the following code into pieces, there is too much here.
# manage languages
self.in_default_lang = True
if "DEFAULT_LANG" in settings:
default_lang = settings["DEFAULT_LANG"].lower()
if not hasattr(self, "lang"):
self.lang = default_lang
self.in_default_lang = self.lang == default_lang
# create the slug if not existing, generate slug according to
# setting of SLUG_ATTRIBUTE
if not hasattr(self, "slug"):
if settings["SLUGIFY_SOURCE"] == "title" and hasattr(self, "title"):
value = self.title
elif settings["SLUGIFY_SOURCE"] == "basename" and source_path is not None:
value = os.path.basename(os.path.splitext(source_path)[0])
else:
value = None
if value is not None:
self.slug = slugify(
value,
regex_subs=settings.get("SLUG_REGEX_SUBSTITUTIONS", []),
preserve_case=settings.get("SLUGIFY_PRESERVE_CASE", False),
use_unicode=settings.get("SLUGIFY_USE_UNICODE", False),
)
self.source_path = source_path
self.relative_source_path = self.get_relative_source_path()
# manage the date format
if not hasattr(self, "date_format"):
if hasattr(self, "lang") and self.lang in settings["DATE_FORMATS"]:
self.date_format = settings["DATE_FORMATS"][self.lang]
else:
self.date_format = settings["DEFAULT_DATE_FORMAT"]
if isinstance(self.date_format, tuple):
locale_string = self.date_format[0]
locale.setlocale(locale.LC_ALL, locale_string)
self.date_format = self.date_format[1]
# manage timezone
default_timezone = settings.get("TIMEZONE", "UTC")
timezone = getattr(self, "timezone", default_timezone)
self.timezone = ZoneInfo(timezone)
if hasattr(self, "date"):
self.date = set_date_tzinfo(self.date, timezone)
self.locale_date = self.date.strftime(self.date_format)
if hasattr(self, "modified"):
self.modified = set_date_tzinfo(self.modified, timezone)
self.locale_modified = self.modified.strftime(self.date_format)
# manage status
if not hasattr(self, "status"):
# Previous default of None broke comment plugins and perhaps others
self.status = getattr(self, "default_status", "")
# store the summary metadata if it is set
if "summary" in metadata:
self._summary = metadata["summary"]
signals.content_object_init.send(self)
def __str__(self) -> str:
return self.source_path or repr(self)
def _has_valid_mandatory_properties(self) -> bool:
"""Test mandatory properties are set."""
for prop in self.mandatory_properties:
if not hasattr(self, prop):
raise NameError(prop)
@property
def url(self):
return '%s.html' % self.slug
@property
def slug(self):
return slugify(self.title)
@property
def summary(self):
return truncate_html_words(self.content, 50)
class Article(Page):
mandatory_properties = ('title', 'date', 'category')
class Quote(Page):
base_properties = ('author', 'date')
def is_valid_content(content, f):
try:
content.check_properties()
logger.error(
"Skipping %s: could not find information about '%s'", self, prop
)
return False
return True
except NameError as e:
print u" [info] Skipping %s: impossible to find informations about '%s'" % (f, e)
def _has_valid_save_as(self) -> bool:
"""Return true if save_as doesn't write outside output path, false
otherwise."""
try:
output_path = self.settings["OUTPUT_PATH"]
except KeyError:
# we cannot check
return True
try:
sanitised_join(output_path, self.save_as)
except RuntimeError: # outside output_dir
logger.error(
"Skipping %s: file %r would be written outside output path",
self,
self.save_as,
)
return False
return True
def _has_valid_status(self) -> bool:
if hasattr(self, "allowed_statuses"):
if self.status not in self.allowed_statuses:
logger.error(
"Unknown status '%s' for file %s, skipping it. (Not in %s)",
self.status,
self,
self.allowed_statuses,
)
return False
# if undefined we allow all
return True
def is_valid(self) -> bool:
"""Validate Content"""
# Use all() to not short circuit and get results of all validations
return all(
[
self._has_valid_mandatory_properties(),
self._has_valid_save_as(),
self._has_valid_status(),
]
)
@property
def url_format(self) -> dict[str, Any]:
"""Returns the URL, formatted with the proper values"""
metadata = copy.copy(self.metadata)
path = self.metadata.get("path", self.get_relative_source_path())
metadata.update(
{
"path": path_to_url(path),
"slug": getattr(self, "slug", ""),
"lang": getattr(self, "lang", "en"),
"date": getattr(self, "date", datetime.datetime.now()),
"author": self.author.slug if hasattr(self, "author") else "",
"category": self.category.slug if hasattr(self, "category") else "",
}
)
return metadata
def _expand_settings(self, key: str, klass: Optional[str] = None) -> str:
if not klass:
klass = self.__class__.__name__
fq_key = (f"{klass}_{key}").upper()
return str(self.settings[fq_key]).format(**self.url_format)
def get_url_setting(self, key: str) -> str:
if hasattr(self, "override_" + key):
return getattr(self, "override_" + key)
key = key if self.in_default_lang else f"lang_{key}"
return self._expand_settings(key)
def _link_replacer(self, siteurl: str, m: re.Match) -> str:
what = m.group("what")
value = urlparse(m.group("value"))
path = value.path
origin = m.group("path")
# urllib.parse.urljoin() produces `a.html` for urljoin("..", "a.html")
# so if RELATIVE_URLS are enabled, we fall back to os.path.join() to
# properly get `../a.html`. However, os.path.join() produces
# `baz/http://foo/bar.html` for join("baz", "http://foo/bar.html")
# instead of correct "http://foo/bar.html", so one has to pick a side
# as there is no silver bullet.
if self.settings["RELATIVE_URLS"]:
joiner = os.path.join
else:
joiner = urljoin
# However, it's not *that* simple: urljoin("blog", "index.html")
# produces just `index.html` instead of `blog/index.html` (unlike
# os.path.join()), so in order to get a correct answer one needs to
# append a trailing slash to siteurl in that case. This also makes
# the new behavior fully compatible with Pelican 3.7.1.
if not siteurl.endswith("/"):
siteurl += "/"
# XXX Put this in a different location.
if what in {"filename", "static", "attach"}:
def _get_linked_content(key: str, url: ParseResult) -> Optional[Content]:
nonlocal value
def _find_path(path: str) -> Optional[Content]:
if path.startswith("/"):
path = path[1:]
else:
# relative to the source path of this content
path = self.get_relative_source_path( # type: ignore
os.path.join(self.relative_dir, path)
)
return self._context[key].get(path, None)
# try path
result = _find_path(url.path)
if result is not None:
return result
# try unquoted path
result = _find_path(unquote(url.path))
if result is not None:
return result
# try html unescaped url
unescaped_url = urlparse(unescape(url.geturl()))
result = _find_path(unescaped_url.path)
if result is not None:
value = unescaped_url
return result
# check if a static file is linked with {filename}
if what == "filename" and key == "generated_content":
linked_content = _get_linked_content("static_content", value)
if linked_content:
logger.warning(
"{filename} used for linking to static"
" content %s in %s. Use {static} instead",
value.path,
self.get_relative_source_path(),
)
return linked_content
return None
if what == "filename":
key = "generated_content"
else:
key = "static_content"
linked_content = _get_linked_content(key, value)
if linked_content:
if what == "attach":
linked_content.attach_to(self) # type: ignore
origin = joiner(siteurl, linked_content.url)
origin = origin.replace("\\", "/") # for Windows paths.
else:
logger.warning(
"Unable to find '%s', skipping url replacement.",
value.geturl(),
extra={
"limit_msg": (
"Other resources were not found and their urls not replaced"
)
},
)
elif what == "category":
origin = joiner(siteurl, Category(path, self.settings).url)
elif what == "tag":
origin = joiner(siteurl, Tag(path, self.settings).url)
elif what == "index":
origin = joiner(siteurl, self.settings["INDEX_SAVE_AS"])
elif what == "author":
origin = joiner(siteurl, Author(path, self.settings).url)
else:
logger.warning(
"Replacement Indicator %r not recognized in %r, skipping replacement",
what,
origin,
)
# keep all other parts, such as query, fragment, etc.
parts = list(value)
parts[2] = origin
origin = urlunparse(parts)
return "".join((m.group("markup"), m.group("quote"), origin, m.group("quote")))
def _get_intrasite_link_regex(self) -> re.Pattern:
intrasite_link_regex = self.settings["INTRASITE_LINK_REGEX"]
regex = rf"""
(?P<markup><[^\>]+ # match tag with all url-value attributes
(?:href|src|poster|data|cite|formaction|action|content)\s*=\s*)
(?P<quote>["\']) # require value to be quoted
(?P<path>{intrasite_link_regex}(?P<value>.*?)) # the url value
(?P=quote)"""
return re.compile(regex, re.X)
def _update_content(self, content: str, siteurl: str) -> str:
"""Update the content attribute.
Change all the relative paths of the content to relative paths
suitable for the output content.
:param content: content resource that will be passed to the templates.
:param siteurl: siteurl which is locally generated by the writer in
case of RELATIVE_URLS.
"""
if not content:
return content
hrefs = self._get_intrasite_link_regex()
return hrefs.sub(lambda m: self._link_replacer(siteurl, m), content)
def get_static_links(self) -> set[str]:
static_links = set()
hrefs = self._get_intrasite_link_regex()
for m in hrefs.finditer(self._content):
what = m.group("what")
value = urlparse(m.group("value"))
path = value.path
if what not in {"static", "attach"}:
continue
if path.startswith("/"):
path = path[1:]
else:
# relative to the source path of this content
path = self.get_relative_source_path(
os.path.join(self.relative_dir, path)
)
path = path.replace("%20", " ") # type: ignore
static_links.add(path)
return static_links
def get_siteurl(self) -> str:
return self._context.get("localsiteurl", "")
@memoized
def get_content(self, siteurl: str) -> str:
if hasattr(self, "_get_content"):
content = self._get_content()
else:
content = self._content
return self._update_content(content, siteurl)
@property
def content(self) -> str:
return self.get_content(self.get_siteurl())
@memoized
def get_summary(self, _siteurl: str) -> str:
"""Returns the summary of an article.
This is based on the summary metadata if set, otherwise truncate the
content.
"""
if "summary" in self.metadata:
return self.metadata["summary"]
content = self.content
max_paragraphs = self.settings.get("SUMMARY_MAX_PARAGRAPHS")
if max_paragraphs is not None:
content = truncate_html_paragraphs(self.content, max_paragraphs)
if self.settings["SUMMARY_MAX_LENGTH"] is None:
return content
return truncate_html_words(
content,
self.settings["SUMMARY_MAX_LENGTH"],
self.settings["SUMMARY_END_SUFFIX"],
)
@property
def summary(self) -> str:
return self.get_summary(self.get_siteurl())
def _get_summary(self) -> str:
"""deprecated function to access summary"""
logger.warning(
"_get_summary() has been deprecated since 3.6.4. "
"Use the summary decorator instead"
)
return self.summary
@summary.setter
def summary(self, value: str):
"""Dummy function"""
@property
def status(self) -> str:
return self._status
@status.setter
def status(self, value: str) -> None:
# TODO maybe typecheck
self._status = value.lower()
@property
def url(self) -> str:
return self.get_url_setting("url")
@property
def save_as(self) -> str:
return self.get_url_setting("save_as")
def _get_template(self) -> str:
if hasattr(self, "template") and self.template is not None:
return self.template
else:
return self.default_template
def get_relative_source_path(
self, source_path: Optional[str] = None
) -> Optional[str]:
"""Return the relative path (from the content path) to the given
source_path.
If no source path is specified, use the source path of this
content object.
"""
if not source_path:
source_path = self.source_path
if source_path is None:
return None
return posixize_path(
os.path.relpath(
os.path.abspath(os.path.join(self.settings["PATH"], source_path)),
os.path.abspath(self.settings["PATH"]),
)
)
@property
def relative_dir(self) -> str:
return posixize_path(
os.path.dirname(
os.path.relpath(
os.path.abspath(self.source_path),
os.path.abspath(self.settings["PATH"]),
)
)
)
def refresh_metadata_intersite_links(self) -> None:
for key in self.settings["FORMATTED_FIELDS"]:
if key in self.metadata and key != "summary":
value = self._update_content(self.metadata[key], self.get_siteurl())
self.metadata[key] = value
setattr(self, key.lower(), value)
# _summary is an internal variable that some plugins may be writing to,
# so ensure changes to it are picked up, and write summary back to it
if "summary" in self.settings["FORMATTED_FIELDS"]:
if hasattr(self, "_summary"):
self.metadata["summary"] = self._summary
if "summary" in self.metadata:
self.metadata["summary"] = self._update_content(
self.metadata["summary"], self.get_siteurl()
)
self._summary = self.metadata["summary"]
class SkipStub(Content):
"""Stub class representing content that should not be processed in any way."""
def __init__(
self, content, metadata=None, settings=None, source_path=None, context=None
):
del content, metadata, settings, context # Unused arguments
self.source_path = source_path
def is_valid(self):
return False
@property
def content(self):
raise NotImplementedError("Stub content should not be read")
@property
def save_as(self):
raise NotImplementedError("Stub content cannot be saved")
class Page(Content):
mandatory_properties = ("title",)
allowed_statuses = ("published", "hidden", "draft", "skip")
default_status = "published"
default_template = "page"
def _expand_settings(self, key: str) -> str:
klass = "draft_page" if self.status == "draft" else None
return super()._expand_settings(key, klass)
class Article(Content):
mandatory_properties = ("title", "date", "category")
allowed_statuses = ("published", "hidden", "draft", "skip")
default_status = "published"
default_template = "article"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# handle WITH_FUTURE_DATES (designate article to draft based on date)
if not self.settings["WITH_FUTURE_DATES"] and hasattr(self, "date"):
if self.date.tzinfo is None:
now = datetime.datetime.now()
else:
now = datetime.datetime.now(datetime.timezone.utc)
if self.date > now:
self.status = "draft"
# if we are a draft and there is no date provided, set max datetime
if not hasattr(self, "date") and self.status == "draft":
self.date = datetime.datetime.max.replace(tzinfo=self.timezone)
def _expand_settings(self, key: str) -> str:
klass = "draft" if self.status == "draft" else "article"
return super()._expand_settings(key, klass)
class Static(Content):
mandatory_properties = ("title",)
default_status = "published"
default_template = None
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self._output_location_referenced = False
@deprecated_attribute(old="filepath", new="source_path", since=(3, 2, 0))
def filepath():
return None
@deprecated_attribute(old="src", new="source_path", since=(3, 2, 0))
def src():
return None
@deprecated_attribute(old="dst", new="save_as", since=(3, 2, 0))
def dst():
return None
@property
def url(self) -> str:
# Note when url has been referenced, so we can avoid overriding it.
self._output_location_referenced = True
return super().url
@property
def save_as(self) -> str:
# Note when save_as has been referenced, so we can avoid overriding it.
self._output_location_referenced = True
return super().save_as
def attach_to(self, content: Content) -> None:
"""Override our output directory with that of the given content object."""
# Determine our file's new output path relative to the linking
# document. If it currently lives beneath the linking
# document's source directory, preserve that relationship on output.
# Otherwise, make it a sibling.
linking_source_dir = os.path.dirname(content.source_path)
tail_path = os.path.relpath(self.source_path, linking_source_dir)
if tail_path.startswith(os.pardir + os.sep):
tail_path = os.path.basename(tail_path)
new_save_as = os.path.join(os.path.dirname(content.save_as), tail_path)
# We do not build our new url by joining tail_path with the linking
# document's url, because we cannot know just by looking at the latter
# whether it points to the document itself or to its parent directory.
# (An url like 'some/content' might mean a directory named 'some'
# with a file named 'content', or it might mean a directory named
# 'some/content' with a file named 'index.html'.) Rather than trying
# to figure it out by comparing the linking document's url and save_as
# path, we simply build our new url from our new save_as path.
new_url = path_to_url(new_save_as)
def _log_reason(reason: str) -> None:
logger.warning(
"The {attach} link in %s cannot relocate "
"%s because %s. Falling back to "
"{filename} link behavior instead.",
content.get_relative_source_path(),
self.get_relative_source_path(),
reason,
extra={"limit_msg": "More {attach} warnings silenced."},
)
# We never override an override, because we don't want to interfere
# with user-defined overrides that might be in EXTRA_PATH_METADATA.
if hasattr(self, "override_save_as") or hasattr(self, "override_url"):
if new_save_as != self.save_as or new_url != self.url:
_log_reason("its output location was already overridden")
return
# We never change an output path that has already been referenced,
# because we don't want to break links that depend on that path.
if self._output_location_referenced:
if new_save_as != self.save_as or new_url != self.url:
_log_reason("another link already referenced its location")
return
self.override_save_as = new_save_as
self.override_url = new_url

File diff suppressed because it is too large Load diff

173
pelican/log.py Normal file
View file

@ -0,0 +1,173 @@
import logging
import warnings
from collections import defaultdict
from rich.console import Console
from rich.logging import RichHandler
__all__ = ["init"]
console = Console()
class LimitFilter(logging.Filter):
"""
Remove duplicates records, and limit the number of records in the same
group.
Groups are specified by the message to use when the number of records in
the same group hit the limit.
E.g.: log.warning(('43 is not the answer', 'More erroneous answers'))
"""
LOGS_DEDUP_MIN_LEVEL = logging.WARNING
_ignore = set()
_raised_messages = set()
_threshold = 5
_group_count = defaultdict(int)
def filter(self, record):
# don't limit log messages for anything above "warning"
if record.levelno > self.LOGS_DEDUP_MIN_LEVEL:
return True
# extract group
group = record.__dict__.get("limit_msg", None)
group_args = record.__dict__.get("limit_args", ())
# ignore record if it was already raised
message_key = (record.levelno, record.getMessage())
if message_key in self._raised_messages:
return False
else:
self._raised_messages.add(message_key)
# ignore LOG_FILTER records by templates or messages
# when "debug" isn't enabled
logger_level = logging.getLogger().getEffectiveLevel()
if logger_level > logging.DEBUG:
template_key = (record.levelno, record.msg)
message_key = (record.levelno, record.getMessage())
if template_key in self._ignore or message_key in self._ignore:
return False
# check if we went over threshold
if group:
key = (record.levelno, group)
self._group_count[key] += 1
if self._group_count[key] == self._threshold:
record.msg = group
record.args = group_args
elif self._group_count[key] > self._threshold:
return False
return True
class LimitLogger(logging.Logger):
"""
A logger which adds LimitFilter automatically
"""
limit_filter = LimitFilter()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.enable_filter()
def disable_filter(self):
self.removeFilter(LimitLogger.limit_filter)
def enable_filter(self):
self.addFilter(LimitLogger.limit_filter)
class FatalLogger(LimitLogger):
warnings_fatal = False
errors_fatal = False
def warning(self, *args, stacklevel=1, **kwargs):
"""
Displays a logging warning.
Wrapping it here allows Pelican to filter warnings, and conditionally
make warnings fatal.
Args:
stacklevel (int): the stacklevel that would be used to display the
calling location, except for this function. Adjusting the
stacklevel allows you to see the "true" calling location of the
warning, rather than this wrapper location.
"""
stacklevel += 1
super().warning(*args, stacklevel=stacklevel, **kwargs)
if FatalLogger.warnings_fatal:
raise RuntimeError("Warning encountered")
def error(self, *args, stacklevel=1, **kwargs):
"""
Displays a logging error.
Wrapping it here allows Pelican to filter errors, and conditionally
make errors non-fatal.
Args:
stacklevel (int): the stacklevel that would be used to display the
calling location, except for this function. Adjusting the
stacklevel allows you to see the "true" calling location of the
error, rather than this wrapper location.
"""
stacklevel += 1
super().error(*args, stacklevel=stacklevel, **kwargs)
if FatalLogger.errors_fatal:
raise RuntimeError("Error encountered")
logging.setLoggerClass(FatalLogger)
# force root logger to be of our preferred class
logging.getLogger().__class__ = FatalLogger
DEFAULT_LOG_HANDLER = RichHandler(console=console)
def init(
level=None,
fatal="",
handler=DEFAULT_LOG_HANDLER,
name=None,
logs_dedup_min_level=None,
):
FatalLogger.warnings_fatal = fatal.startswith("warning")
FatalLogger.errors_fatal = bool(fatal)
LOG_FORMAT = "%(message)s"
logging.basicConfig(
level=level,
format=LOG_FORMAT,
datefmt="[%H:%M:%S]",
handlers=[handler] if handler else [],
)
logger = logging.getLogger(name)
if level:
logger.setLevel(level)
if logs_dedup_min_level:
LimitFilter.LOGS_DEDUP_MIN_LEVEL = logs_dedup_min_level
def log_warnings():
logging.captureWarnings(True)
warnings.simplefilter("default", DeprecationWarning)
init(logging.DEBUG, name="py.warnings")
if __name__ == "__main__":
init(level=logging.DEBUG, name=__name__)
root_logger = logging.getLogger(__name__)
root_logger.debug("debug")
root_logger.info("info")
root_logger.warning("warning")
root_logger.error("error")
root_logger.critical("critical")

171
pelican/paginator.py Normal file
View file

@ -0,0 +1,171 @@
import functools
import logging
import os
from collections import namedtuple
from math import ceil
logger = logging.getLogger(__name__)
PaginationRule = namedtuple( # noqa: PYI024
"PaginationRule",
"min_page URL SAVE_AS",
)
class Paginator:
def __init__(self, name, url, object_list, settings, per_page=None):
self.name = name
self.url = url
self.object_list = object_list
self.settings = settings
if per_page:
self.per_page = per_page
self.orphans = settings["DEFAULT_ORPHANS"]
else:
self.per_page = len(object_list)
self.orphans = 0
self._num_pages = self._count = None
def page(self, number):
"Returns a Page object for the given 1-based page number."
bottom = (number - 1) * self.per_page
top = bottom + self.per_page
if top + self.orphans >= self.count:
top = self.count
return Page(
self.name,
self.url,
self.object_list[bottom:top],
number,
self,
self.settings,
)
def _get_count(self):
"Returns the total number of objects, across all pages."
if self._count is None:
self._count = len(self.object_list)
return self._count
count = property(_get_count)
def _get_num_pages(self):
"Returns the total number of pages."
if self._num_pages is None:
hits = max(1, self.count - self.orphans)
self._num_pages = ceil(hits / (float(self.per_page) or 1))
return self._num_pages
num_pages = property(_get_num_pages)
def _get_page_range(self):
"""
Returns a 1-based range of pages for iterating through within
a template for loop.
"""
return list(range(1, self.num_pages + 1))
page_range = property(_get_page_range)
class Page:
def __init__(self, name, url, object_list, number, paginator, settings):
self.full_name = name
self.name, self.extension = os.path.splitext(name)
dn, fn = os.path.split(name)
self.base_name = dn if fn in ("index.htm", "index.html") else self.name
self.base_url = url
self.object_list = object_list
self.number = number
self.paginator = paginator
self.settings = settings
def __repr__(self):
return f"<Page {self.number} of {self.paginator.num_pages}>"
def has_next(self):
return self.number < self.paginator.num_pages
def has_previous(self):
return self.number > 1
def has_other_pages(self):
return self.has_previous() or self.has_next()
def next_page_number(self):
return self.number + 1
def previous_page_number(self):
return self.number - 1
def start_index(self):
"""
Returns the 1-based index of the first object on this page,
relative to total objects in the paginator.
"""
# Special case, return zero if no items.
if self.paginator.count == 0:
return 0
return (self.paginator.per_page * (self.number - 1)) + 1
def end_index(self):
"""
Returns the 1-based index of the last object on this page,
relative to total objects found (hits).
"""
# Special case for the last page because there can be orphans.
if self.number == self.paginator.num_pages:
return self.paginator.count
return self.number * self.paginator.per_page
def _from_settings(self, key):
"""Returns URL information as defined in settings. Similar to
URLWrapper._from_settings, but specialized to deal with pagination
logic."""
rule = None
# find the last matching pagination rule
for p in self.settings["PAGINATION_PATTERNS"]:
if p.min_page == -1:
if not self.has_next():
rule = p
break
elif p.min_page <= self.number:
rule = p
if not rule:
return ""
prop_value = getattr(rule, key)
if not isinstance(prop_value, str):
logger.warning("%s is set to %s", key, prop_value)
return prop_value
# URL or SAVE_AS is a string, format it with a controlled context
context = {
"save_as": self.full_name,
"url": self.base_url,
"name": self.name,
"base_name": self.base_name,
"extension": self.extension,
"number": self.number,
}
ret = prop_value.format(**context)
# Remove a single leading slash, if any. This is done for backwards
# compatibility reasons. If a leading slash is needed (for URLs
# relative to server root or absolute URLs without the scheme such as
# //blog.my.site/), it can be worked around by prefixing the pagination
# pattern by an additional slash (which then gets removed, preserving
# the other slashes). This also means the following code *can't* be
# changed to lstrip() because that would remove all leading slashes and
# thus make the workaround impossible. See
# test_custom_pagination_pattern() for a verification of this.
if ret.startswith("/"):
ret = ret[1:]
return ret
url = property(functools.partial(_from_settings, key="URL"))
save_as = property(functools.partial(_from_settings, key="SAVE_AS"))

138
pelican/plugins/_utils.py Normal file
View file

@ -0,0 +1,138 @@
import importlib
import importlib.machinery
import importlib.util
import inspect
import logging
import pkgutil
import sys
logger = logging.getLogger(__name__)
def iter_namespace(ns_pkg):
# Specifying the second argument (prefix) to iter_modules makes the
# returned name an absolute name instead of a relative one. This allows
# import_module to work without having to do additional modification to
# the name.
return pkgutil.iter_modules(ns_pkg.__path__, ns_pkg.__name__ + ".")
def get_namespace_plugins(ns_pkg=None):
if ns_pkg is None:
import pelican.plugins as ns_pkg # noqa: PLC0415
return {
name: importlib.import_module(name)
for finder, name, ispkg in iter_namespace(ns_pkg)
if ispkg
}
def list_plugins(ns_pkg=None):
from pelican.log import init as init_logging # noqa: PLC0415
init_logging(logging.INFO)
ns_plugins = get_namespace_plugins(ns_pkg)
if ns_plugins:
logger.info("Plugins found:\n" + "\n".join(ns_plugins))
else:
logger.info("No plugins are installed")
def plugin_enabled(name, plugin_list=None):
if plugin_list is None or not plugin_list:
# no plugins are loaded
return False
if name in plugin_list:
# search name as is
return True
if f"pelican.plugins.{name}" in plugin_list:
# check if short name is a namespace plugin
return True
return False
def load_legacy_plugin(plugin, plugin_paths):
if "." in plugin:
# it is in a package, try to resolve package first
package, _, _ = plugin.rpartition(".")
load_legacy_plugin(package, plugin_paths)
# Try to find plugin in PLUGIN_PATHS
spec = importlib.machinery.PathFinder.find_spec(plugin, plugin_paths)
if spec is None:
# If failed, try to find it in normal importable locations
spec = importlib.util.find_spec(plugin)
if spec is None:
raise ImportError(f"Cannot import plugin `{plugin}`")
else:
# Avoid loading the same plugin twice
if spec.name in sys.modules:
return sys.modules[spec.name]
# create module object from spec
mod = importlib.util.module_from_spec(spec)
# place it into sys.modules cache
# necessary if module imports itself at some point (e.g. packages)
sys.modules[spec.name] = mod
try:
# try to execute it inside module object
spec.loader.exec_module(mod)
except Exception: # problem with import
try:
# remove module from sys.modules since it can't be loaded
del sys.modules[spec.name]
except KeyError:
pass
raise
# if all went well, we have the plugin module
return mod
def load_plugins(settings):
logger.debug("Finding namespace plugins")
namespace_plugins = get_namespace_plugins()
if namespace_plugins:
logger.debug("Namespace plugins found:\n" + "\n".join(namespace_plugins))
plugins = []
if settings.get("PLUGINS") is not None:
for plugin in settings["PLUGINS"]:
if isinstance(plugin, str):
logger.debug("Loading plugin `%s`", plugin)
# try to find in namespace plugins
if plugin in namespace_plugins:
plugin = namespace_plugins[plugin]
elif f"pelican.plugins.{plugin}" in namespace_plugins:
plugin = namespace_plugins[f"pelican.plugins.{plugin}"]
# try to import it
else:
try:
plugin = load_legacy_plugin(
plugin, settings.get("PLUGIN_PATHS", [])
)
except ImportError as e:
logger.error("Cannot load plugin `%s`\n%s", plugin, e)
continue
plugins.append(plugin)
else:
plugins = list(namespace_plugins.values())
return plugins
def get_plugin_name(plugin):
"""
Plugins can be passed as module objects, however this breaks caching as
module objects cannot be pickled. To work around this, all plugins are
stringified post-initialization.
"""
if inspect.isclass(plugin):
return plugin.__qualname__
if inspect.ismodule(plugin):
return plugin.__name__
return type(plugin).__qualname__

View file

@ -0,0 +1,53 @@
from blinker import Signal, signal
from ordered_set import OrderedSet
# Signals will call functions in the order of connection, i.e. plugin order
Signal.set_class = OrderedSet
# Run-level signals:
initialized = signal("pelican_initialized")
get_generators = signal("get_generators")
all_generators_finalized = signal("all_generators_finalized")
get_writer = signal("get_writer")
finalized = signal("pelican_finalized")
# Reader-level signals
readers_init = signal("readers_init")
# Generator-level signals
generator_init = signal("generator_init")
article_generator_init = signal("article_generator_init")
article_generator_pretaxonomy = signal("article_generator_pretaxonomy")
article_generator_finalized = signal("article_generator_finalized")
article_generator_write_article = signal("article_generator_write_article")
article_writer_finalized = signal("article_writer_finalized")
page_generator_init = signal("page_generator_init")
page_generator_finalized = signal("page_generator_finalized")
page_generator_write_page = signal("page_generator_write_page")
page_writer_finalized = signal("page_writer_finalized")
static_generator_init = signal("static_generator_init")
static_generator_finalized = signal("static_generator_finalized")
# Page-level signals
article_generator_preread = signal("article_generator_preread")
article_generator_context = signal("article_generator_context")
page_generator_preread = signal("page_generator_preread")
page_generator_context = signal("page_generator_context")
static_generator_preread = signal("static_generator_preread")
static_generator_context = signal("static_generator_context")
content_object_init = signal("content_object_init")
# Writers signals
content_written = signal("content_written")
feed_generated = signal("feed_generated")
feed_written = signal("feed_written")

View file

@ -1,70 +1,825 @@
from docutils import core
from markdown import Markdown
import datetime
import logging
import os
import re
from collections import OrderedDict
from html import escape
from html.parser import HTMLParser
from io import StringIO
# import the directives to have pygments support
import rstdirectives
import docutils
import docutils.core
import docutils.io
from docutils.parsers.rst.languages import get_language as get_docutils_lang
from docutils.writers.html4css1 import HTMLTranslator, Writer
from pelican.utils import get_date, open
from pelican import rstdirectives # NOQA
from pelican.cache import FileStampDataCacher
from pelican.contents import Author, Category, Page, SkipStub, Tag
from pelican.plugins import signals
from pelican.utils import file_suffix, get_date, pelican_open, posixize_path
try:
from markdown import Markdown
except ImportError:
Markdown = False
# Metadata processors have no way to discard an unwanted value, so we have
# them return this value instead to signal that it should be discarded later.
# This means that _filter_discardable_metadata() must be called on processed
# metadata dicts before use, to remove the items with the special value.
_DISCARD = object()
DUPLICATES_DEFINITIONS_ALLOWED = {
"tags": False,
"date": False,
"modified": False,
"status": False,
"category": False,
"author": False,
"save_as": False,
"url": False,
"authors": False,
"slug": False,
}
METADATA_PROCESSORS = {
"tags": lambda x, y: ([Tag(tag, y) for tag in ensure_metadata_list(x)] or _DISCARD),
"date": lambda x, _y: get_date(x.replace("_", " ")),
"modified": lambda x, _y: get_date(x),
"status": lambda x, _y: x.strip() or _DISCARD,
"category": lambda x, y: _process_if_nonempty(Category, x, y),
"author": lambda x, y: _process_if_nonempty(Author, x, y),
"authors": lambda x, y: (
[Author(author, y) for author in ensure_metadata_list(x)] or _DISCARD
),
"slug": lambda x, _y: x.strip() or _DISCARD,
}
logger = logging.getLogger(__name__)
_METADATAS_FIELDS = {'tags': lambda x: x.split(', '),
'date': lambda x: get_date(x),
'category': lambda x: x,
'author': lambda x: x,
'status': lambda x:x.strip(),}
def ensure_metadata_list(text):
"""Canonicalize the format of a list of authors or tags. This works
the same way as Docutils' "authors" field: if it's already a list,
those boundaries are preserved; otherwise, it must be a string;
if the string contains semicolons, it is split on semicolons;
otherwise, it is split on commas. This allows you to write
author lists in either "Jane Doe, John Doe" or "Doe, Jane; Doe, John"
format.
Regardless, all list items undergo .strip() before returning, and
empty items are discarded.
"""
if isinstance(text, str):
if ";" in text:
text = text.split(";")
else:
text = text.split(",")
return list(OrderedDict.fromkeys([v for v in (w.strip() for w in text) if v]))
class RstReader(object):
def _process_if_nonempty(processor, name, settings):
"""Removes extra whitespace from name and applies a metadata processor.
If name is empty or all whitespace, returns _DISCARD instead.
"""
name = name.strip()
return processor(name, settings) if name else _DISCARD
def _filter_discardable_metadata(metadata):
"""Return a copy of a dict, minus any items marked as discardable."""
return {name: val for name, val in metadata.items() if val is not _DISCARD}
class BaseReader:
"""Base class to read files.
This class is used to process static files, and it can be inherited for
other types of file. A Reader class must have the following attributes:
- enabled: (boolean) tell if the Reader class is enabled. It
generally depends on the import of some dependency.
- file_extensions: a list of file extensions that the Reader will process.
- extensions: a list of extensions to use in the reader (typical use is
Markdown).
"""
enabled = True
file_extensions = ["static"]
extensions = None
def __init__(self, settings):
self.settings = settings
def process_metadata(self, name, value):
if name in METADATA_PROCESSORS:
return METADATA_PROCESSORS[name](value, self.settings)
return value
def read(self, source_path):
"No-op parser"
del source_path # Unused argument
content = None
metadata = {}
return content, metadata
def disabled_message(self) -> str:
"""Message about why this plugin was disabled."""
return ""
class _FieldBodyTranslator(HTMLTranslator):
def __init__(self, document):
super().__init__(document)
self.compact_p = None
def astext(self):
return "".join(self.body)
def visit_field_body(self, node):
pass
def depart_field_body(self, node):
pass
def render_node_to_html(document, node, field_body_translator_class):
visitor = field_body_translator_class(document)
node.walkabout(visitor)
return visitor.astext()
class PelicanHTMLWriter(Writer):
def __init__(self):
super().__init__()
self.translator_class = PelicanHTMLTranslator
class PelicanHTMLTranslator(HTMLTranslator):
def visit_abbreviation(self, node):
attrs = {}
if node.hasattr("explanation"):
attrs["title"] = node["explanation"]
self.body.append(self.starttag(node, "abbr", "", **attrs))
def depart_abbreviation(self, node):
del node # Unused argument
self.body.append("</abbr>")
def visit_image(self, node):
# set an empty alt if alt is not specified
# avoids that alt is taken from src
node["alt"] = node.get("alt", "")
return HTMLTranslator.visit_image(self, node)
class RstReader(BaseReader):
"""Reader for reStructuredText files
By default the output HTML is written using
docutils.writers.html4css1.Writer and translated using a subclass of
docutils.writers.html4css1.HTMLTranslator. If you want to override it with
your own writer/translator (e.g. a HTML5-based one), pass your classes to
these two attributes. Look in the source code for details.
writer_class Used for writing contents
field_body_translator_class Used for translating metadata such
as article summary
"""
enabled = bool(docutils)
file_extensions = ["rst"]
writer_class = PelicanHTMLWriter
field_body_translator_class = _FieldBodyTranslator
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
lang_code = self.settings.get("DEFAULT_LANG", "en")
if get_docutils_lang(lang_code):
self._language_code = lang_code
else:
logger.warning(
"Docutils has no localization for '%s'. Using 'en' instead.",
lang_code,
)
self._language_code = "en"
def _parse_metadata(self, document, source_path):
"""Return the dict containing document metadata"""
formatted_fields = self.settings["FORMATTED_FIELDS"]
def _parse_metadata(self, content):
"""Return the dict containing metadatas"""
output = {}
for m in re.compile(':([a-z]+): (.*)\s', re.M).finditer(content):
name, value = m.group(1).lower(), m.group(2)
if name in _METADATAS_FIELDS:
output[name] = _METADATAS_FIELDS[name](value)
if document.first_child_matching_class(docutils.nodes.title) is None:
logger.warning(
"Document title missing in file %s: "
"Ensure exactly one top level section",
source_path,
)
try:
# docutils 0.18.1+
nodes = document.findall(docutils.nodes.docinfo)
except AttributeError:
# docutils 0.18.0 or before
nodes = document.traverse(docutils.nodes.docinfo)
for docinfo in nodes:
for element in docinfo.children:
if element.tagname == "field": # custom fields (e.g. summary)
name_elem, body_elem = element.children
name = name_elem.astext()
if name.lower() in formatted_fields:
value = render_node_to_html(
document, body_elem, self.field_body_translator_class
)
else:
value = body_elem.astext()
elif element.tagname == "authors": # author list
name = element.tagname
value = [element.astext() for element in element.children]
else: # standard fields (e.g. address)
name = element.tagname
value = element.astext()
name = name.lower()
output[name] = self.process_metadata(name, value)
return output
def read(self, filename):
"""Parse restructured text"""
text = open(filename)
metadatas = self._parse_metadata(text)
extra_params = {'input_encoding': 'unicode',
'initial_header_level': '2'}
rendered_content = core.publish_parts(text, writer_name='html',
settings_overrides=extra_params)
title = rendered_content.get('title')
content = rendered_content.get('body')
if not metadatas.has_key('title'):
metadatas['title'] = title
return content, metadatas
def _get_publisher(self, source_path):
extra_params = {
"initial_header_level": "2",
"syntax_highlight": "short",
"input_encoding": "utf-8",
"language_code": self._language_code,
"halt_level": 2,
"traceback": True,
"warning_stream": StringIO(),
"embed_stylesheet": False,
}
user_params = self.settings.get("DOCUTILS_SETTINGS")
if user_params:
extra_params.update(user_params)
class MarkdownReader(object):
pub = docutils.core.Publisher(
writer=self.writer_class(), destination_class=docutils.io.StringOutput
)
pub.set_components("standalone", "restructuredtext", "html")
pub.process_programmatic_settings(None, extra_params, None)
pub.set_source(source_path=source_path)
pub.publish()
return pub
def read(self, filename):
"""Parse content and metadata of markdown files"""
text = open(filename)
md = Markdown(extensions = ['meta', 'codehilite'])
content = md.convert(text)
metadatas = {}
for name, value in md.Meta.items():
if name in _METADATAS_FIELDS:
meta = _METADATAS_FIELDS[name](value[0])
def read(self, source_path):
"""Parses restructured text"""
pub = self._get_publisher(source_path)
parts = pub.writer.parts
content = parts.get("body")
metadata = self._parse_metadata(pub.document, source_path)
metadata.setdefault("title", parts.get("title"))
return content, metadata
class MarkdownReader(BaseReader):
"""Reader for Markdown files"""
enabled = bool(Markdown)
file_extensions = ["md", "markdown", "mkd", "mdown"]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
settings = self.settings["MARKDOWN"]
settings.setdefault("extension_configs", {})
settings.setdefault("extensions", [])
for extension in settings["extension_configs"].keys():
if extension not in settings["extensions"]:
settings["extensions"].append(extension)
if "markdown.extensions.meta" not in settings["extensions"]:
settings["extensions"].append("markdown.extensions.meta")
self._source_path = None
def _parse_metadata(self, meta):
"""Return the dict containing document metadata"""
formatted_fields = self.settings["FORMATTED_FIELDS"]
# prevent metadata extraction in fields
self._md.preprocessors.deregister("meta")
output = {}
for name, value in meta.items():
name = name.lower()
if name in formatted_fields:
# formatted metadata is special case and join all list values
formatted_values = "\n".join(value)
# reset the markdown instance to clear any state
self._md.reset()
formatted = self._md.convert(formatted_values)
output[name] = self.process_metadata(name, formatted)
elif not DUPLICATES_DEFINITIONS_ALLOWED.get(name, True):
if len(value) > 1:
logger.warning(
"Duplicate definition of `%s` for %s. Using first one.",
name,
self._source_path,
)
output[name] = self.process_metadata(name, value[0])
elif len(value) > 1:
# handle list metadata as list of string
output[name] = self.process_metadata(name, value)
else:
meta = value[0]
metadatas[name.lower()] = meta
return content, metadatas
# otherwise, handle metadata as single string
output[name] = self.process_metadata(name, value[0])
return output
_EXTENSIONS = {'rst': RstReader, 'md': MarkdownReader} # supported formats
def read(self, source_path):
"""Parse content and metadata of markdown files"""
self._source_path = source_path
self._md = Markdown(**self.settings["MARKDOWN"])
with pelican_open(source_path) as text:
content = self._md.convert(text)
if hasattr(self._md, "Meta"):
metadata = self._parse_metadata(self._md.Meta)
else:
metadata = {}
return content, metadata
def disabled_message(self) -> str:
return (
"Could not import 'markdown.Markdown'. "
"Have you installed the 'markdown' package?"
)
def read_file(filename, fmt=None):
"""Return a reader object using the given format."""
if not fmt:
fmt = filename.split('.')[-1]
if fmt not in _EXTENSIONS.keys():
raise TypeError('Pelican does not know how to parse %s' % filename)
reader = _EXTENSIONS[fmt]()
return reader.read(filename)
class HTMLReader(BaseReader):
"""Parses HTML files as input, looking for meta, title, and body tags"""
file_extensions = ["htm", "html"]
enabled = True
class _HTMLParser(HTMLParser):
def __init__(self, settings, filename):
super().__init__(convert_charrefs=False)
self.body = ""
self.metadata = {}
self.settings = settings
self._data_buffer = ""
self._filename = filename
self._in_top_level = True
self._in_head = False
self._in_title = False
self._in_body = False
self._in_tags = False
def handle_starttag(self, tag, attrs):
if tag == "head" and self._in_top_level:
self._in_top_level = False
self._in_head = True
elif tag == "title" and self._in_head:
self._in_title = True
self._data_buffer = ""
elif tag == "body" and self._in_top_level:
self._in_top_level = False
self._in_body = True
self._data_buffer = ""
elif tag == "meta" and self._in_head:
self._handle_meta_tag(attrs)
elif self._in_body:
self._data_buffer += self.build_tag(tag, attrs, False)
def handle_endtag(self, tag):
if tag == "head":
if self._in_head:
self._in_head = False
self._in_top_level = True
elif self._in_head and tag == "title":
self._in_title = False
self.metadata["title"] = self._data_buffer
elif tag == "body":
self.body = self._data_buffer
self._in_body = False
self._in_top_level = True
elif self._in_body:
self._data_buffer += f"</{escape(tag)}>"
def handle_startendtag(self, tag, attrs):
if tag == "meta" and self._in_head:
self._handle_meta_tag(attrs)
if self._in_body:
self._data_buffer += self.build_tag(tag, attrs, True)
def handle_comment(self, data):
self._data_buffer += f"<!--{data}-->"
def handle_data(self, data):
self._data_buffer += data
def handle_entityref(self, data):
self._data_buffer += f"&{data};"
def handle_charref(self, data):
self._data_buffer += f"&#{data};"
def build_tag(self, tag, attrs, close_tag):
result = f"<{escape(tag)}"
for k, v in attrs:
result += " " + escape(k)
if v is not None:
# If the attribute value contains a double quote, surround
# with single quotes, otherwise use double quotes.
if '"' in v:
result += f"='{escape(v, quote=False)}'"
else:
result += f'="{escape(v, quote=False)}"'
if close_tag:
return result + " />"
return result + ">"
def _handle_meta_tag(self, attrs):
name = self._attr_value(attrs, "name")
if name is None:
attr_list = [f'{k}="{v}"' for k, v in attrs]
attr_serialized = ", ".join(attr_list)
logger.warning(
"Meta tag in file %s does not have a 'name' "
"attribute, skipping. Attributes: %s",
self._filename,
attr_serialized,
)
return
name = name.lower()
contents = self._attr_value(attrs, "content", "")
if not contents:
contents = self._attr_value(attrs, "contents", "")
if contents:
logger.warning(
"Meta tag attribute 'contents' used in file %s, should"
" be changed to 'content'",
self._filename,
extra={
"limit_msg": "Other files have meta tag "
"attribute 'contents' that should "
"be changed to 'content'"
},
)
if name == "keywords":
name = "tags"
if name in self.metadata:
# if this metadata already exists (i.e. a previous tag with the
# same name has already been specified then either convert to
# list or append to list
if isinstance(self.metadata[name], list):
self.metadata[name].append(contents)
else:
self.metadata[name] = [self.metadata[name], contents]
else:
self.metadata[name] = contents
@classmethod
def _attr_value(cls, attrs, name, default=None):
return next((x[1] for x in attrs if x[0] == name), default)
def read(self, filename):
"""Parse content and metadata of HTML files"""
with pelican_open(filename) as content:
parser = self._HTMLParser(self.settings, filename)
parser.feed(content)
parser.close()
metadata = {}
for k in parser.metadata:
metadata[k] = self.process_metadata(k, parser.metadata[k])
return parser.body, metadata
class Readers(FileStampDataCacher):
"""Interface for all readers.
This class contains a mapping of file extensions / Reader classes, to know
which Reader class must be used to read a file (based on its extension).
This is customizable both with the 'READERS' setting, and with the
'readers_init' signall for plugins.
"""
def __init__(self, settings=None, cache_name=""):
self.settings = settings or {}
self.readers = {}
self.disabled_readers = {}
# extension => reader for readers that are enabled
self.reader_classes = {}
# extension => reader for readers that are not enabled
disabled_reader_classes = {}
for cls in [BaseReader] + BaseReader.__subclasses__():
if not cls.enabled:
logger.debug(
"Missing dependencies for %s", ", ".join(cls.file_extensions)
)
for ext in cls.file_extensions:
if cls.enabled:
self.reader_classes[ext] = cls
else:
disabled_reader_classes[ext] = cls
if self.settings["READERS"]:
self.reader_classes.update(self.settings["READERS"])
signals.readers_init.send(self)
for fmt, reader_class in self.reader_classes.items():
if not reader_class:
continue
self.readers[fmt] = reader_class(self.settings)
for fmt, reader_class in disabled_reader_classes.items():
self.disabled_readers[fmt] = reader_class(self.settings)
# set up caching
cache_this_level = (
cache_name != "" and self.settings["CONTENT_CACHING_LAYER"] == "reader"
)
caching_policy = cache_this_level and self.settings["CACHE_CONTENT"]
load_policy = cache_this_level and self.settings["LOAD_CONTENT_CACHE"]
super().__init__(settings, cache_name, caching_policy, load_policy)
@property
def extensions(self):
"""File extensions that will be processed by a reader."""
return self.readers.keys()
@property
def disabled_extensions(self):
return self.disabled_readers.keys()
def read_file(
self,
base_path,
path,
content_class=Page,
fmt=None,
context=None,
preread_signal=None,
preread_sender=None,
context_signal=None,
context_sender=None,
):
"""Return a content object parsed with the given format."""
path = os.path.abspath(os.path.join(base_path, path))
source_path = posixize_path(os.path.relpath(path, base_path))
logger.debug("Read file %s -> %s", source_path, content_class.__name__)
if not fmt:
fmt = file_suffix(path)
if fmt not in self.readers:
raise TypeError("Pelican does not know how to parse %s", path)
if preread_signal:
logger.debug("Signal %s.send(%s)", preread_signal.name, preread_sender)
preread_signal.send(preread_sender)
reader = self.readers[fmt]
metadata = _filter_discardable_metadata(
default_metadata(settings=self.settings, process=reader.process_metadata)
)
metadata.update(
path_metadata(
full_path=path, source_path=source_path, settings=self.settings
)
)
metadata.update(
_filter_discardable_metadata(
parse_path_metadata(
source_path=source_path,
settings=self.settings,
process=reader.process_metadata,
)
)
)
reader_name = reader.__class__.__name__
metadata["reader"] = reader_name.replace("Reader", "").lower()
content, reader_metadata = self.get_cached_data(path, (None, None))
if content is None:
content, reader_metadata = reader.read(path)
reader_metadata = _filter_discardable_metadata(reader_metadata)
self.cache_data(path, (content, reader_metadata))
metadata.update(reader_metadata)
if content:
# find images with empty alt
find_empty_alt(content, path)
# eventually filter the content with typogrify if asked so
if self.settings["TYPOGRIFY"]:
# typogrify is an optional feature, user may not have it installed
import smartypants # noqa: PLC0415
from typogrify.filters import typogrify # noqa: PLC0415
typogrify_dashes = self.settings["TYPOGRIFY_DASHES"]
if typogrify_dashes == "oldschool":
smartypants.Attr.default = smartypants.Attr.set2
elif typogrify_dashes == "oldschool_inverted":
smartypants.Attr.default = smartypants.Attr.set3
else:
smartypants.Attr.default = smartypants.Attr.set1
# Tell `smartypants` to also replace &quot; HTML entities with
# smart quotes. This is necessary because Docutils has already
# replaced double quotes with said entities by the time we run
# this filter.
smartypants.Attr.default |= smartypants.Attr.w
def typogrify_wrapper(text):
"""Ensure compatibility with older versions of Typogrify.
The 'TYPOGRIFY_IGNORE_TAGS' and/or 'TYPOGRIFY_OMIT_FILTERS'
settings will be ignored if the installed version of Typogrify
doesn't have the corresponding features."""
try:
return typogrify(
text,
self.settings["TYPOGRIFY_IGNORE_TAGS"],
**dict.fromkeys(self.settings["TYPOGRIFY_OMIT_FILTERS"], False),
)
except TypeError:
try:
typogrify(text, self.settings["TYPOGRIFY_IGNORE_TAGS"])
except TypeError:
return typogrify(text)
if content:
content = typogrify_wrapper(content)
if "title" in metadata:
metadata["title"] = typogrify_wrapper(metadata["title"])
if "summary" in metadata:
metadata["summary"] = typogrify_wrapper(metadata["summary"])
if context_signal:
logger.debug(
"Signal %s.send(%s, <metadata>)", context_signal.name, context_sender
)
context_signal.send(context_sender, metadata=metadata)
if metadata.get("status") == "skip":
content_class = SkipStub
return content_class(
content=content,
metadata=metadata,
settings=self.settings,
source_path=path,
context=context,
)
def check_file(self, source_path: str) -> None:
"""Log a warning if a file is processed by a disabled reader."""
reader = self.disabled_readers.get(file_suffix(source_path), None)
if reader:
logger.warning(f"{source_path}: {reader.disabled_message()}")
def find_empty_alt(content, path):
"""Find images with empty alt
Create warnings for all images with empty alt (up to a certain number),
as they are really likely to be accessibility flaws.
"""
imgs = re.compile(
r"""
(?:
# src before alt
<img
[^\>]*
src=(['"])(.*?)\1
[^\>]*
alt=(['"])\3
)|(?:
# alt before src
<img
[^\>]*
alt=(['"])\4
[^\>]*
src=(['"])(.*?)\5
)
""",
re.X,
)
for match in re.findall(imgs, content):
logger.warning(
"Empty alt attribute for image %s in %s",
os.path.basename(match[1] + match[5]),
path,
extra={"limit_msg": "Other images have empty alt attributes"},
)
def default_metadata(settings=None, process=None):
metadata = {}
if settings:
for name, value in dict(settings.get("DEFAULT_METADATA", {})).items():
if process:
value = process(name, value)
metadata[name] = value
if "DEFAULT_CATEGORY" in settings:
value = settings["DEFAULT_CATEGORY"]
if process:
value = process("category", value)
metadata["category"] = value
if settings.get("DEFAULT_DATE", None) and settings["DEFAULT_DATE"] != "fs":
if isinstance(settings["DEFAULT_DATE"], str):
metadata["date"] = get_date(settings["DEFAULT_DATE"])
else:
metadata["date"] = datetime.datetime(*settings["DEFAULT_DATE"])
return metadata
def path_metadata(full_path, source_path, settings=None):
metadata = {}
if settings:
if settings.get("DEFAULT_DATE", None) == "fs":
metadata["date"] = datetime.datetime.fromtimestamp(
os.stat(full_path).st_mtime
)
metadata["modified"] = metadata["date"]
# Apply EXTRA_PATH_METADATA for the source path and the paths of any
# parent directories. Sorting EPM first ensures that the most specific
# path wins conflicts.
epm = settings.get("EXTRA_PATH_METADATA", {})
for path, meta in sorted(epm.items()):
# Enforce a trailing slash when checking for parent directories.
# This prevents false positives when one file or directory's name
# is a prefix of another's.
dirpath = posixize_path(os.path.join(path, ""))
if source_path == path or source_path.startswith(dirpath):
metadata.update(meta)
return metadata
def parse_path_metadata(source_path, settings=None, process=None):
r"""Extract a metadata dictionary from a file's path
>>> import pprint
>>> settings = {
... 'FILENAME_METADATA': r'(?P<slug>[^.]*).*',
... 'PATH_METADATA':
... r'(?P<category>[^/]*)/(?P<date>\d{4}-\d{2}-\d{2})/.*',
... }
>>> reader = BaseReader(settings=settings)
>>> metadata = parse_path_metadata(
... source_path='my-cat/2013-01-01/my-slug.html',
... settings=settings,
... process=reader.process_metadata)
>>> pprint.pprint(metadata) # doctest: +ELLIPSIS
{'category': <pelican.urlwrappers.Category object at ...>,
'date': datetime.datetime(2013, 1, 1, 0, 0),
'slug': 'my-slug'}
"""
metadata = {}
dirname, basename = os.path.split(source_path)
base, ext = os.path.splitext(basename)
subdir = os.path.basename(dirname)
if settings:
checks = []
for key, data in [("FILENAME_METADATA", base), ("PATH_METADATA", source_path)]:
checks.append((settings.get(key, None), data))
if settings.get("USE_FOLDER_AS_CATEGORY", None):
checks.append(("(?P<category>.*)", subdir))
for regexp, data in checks:
if regexp and data:
match = re.match(regexp, data)
if match:
# .items() for py3k compat.
for k, v in match.groupdict().items():
k = k.lower() # metadata must be lowercase
if v is not None and k not in metadata:
if process:
v = process(k, v)
metadata[k] = v
return metadata

View file

@ -1,24 +1,36 @@
# -*- coding: utf-8 -*-
from docutils import nodes
from docutils.parsers.rst import directives, Directive
from pygments.formatters import HtmlFormatter
from pygments import highlight
from pygments.lexers import get_lexer_by_name, TextLexer
import re
INLINESTYLES = False
DEFAULT = HtmlFormatter(noclasses=INLINESTYLES)
VARIANTS = {
'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True),
}
from docutils import nodes, utils
from docutils.parsers.rst import Directive, directives, roles
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import TextLexer, get_lexer_by_name
import pelican.settings as pys
class Pygments(Directive):
""" Source code syntax hightlighting.
"""
"""Source code syntax highlighting."""
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = True
option_spec = dict([(key, directives.flag) for key in VARIANTS])
option_spec = {
"anchorlinenos": directives.flag,
"classprefix": directives.unchanged,
"hl_lines": directives.unchanged,
"lineanchors": directives.unchanged,
"linenos": directives.unchanged,
"linenospecial": directives.nonnegative_int,
"linenostart": directives.nonnegative_int,
"linenostep": directives.nonnegative_int,
"lineseparator": directives.unchanged,
"linespans": directives.unchanged,
"nobackground": directives.flag,
"nowrap": directives.flag,
"tagsfile": directives.unchanged,
"tagurlformat": directives.unchanged,
}
has_content = True
def run(self):
@ -28,10 +40,53 @@ class Pygments(Directive):
except ValueError:
# no lexer found - use the text one instead of an exception
lexer = TextLexer()
# take an arbitrary option if more than one is given
formatter = self.options and VARIANTS[self.options.keys()[0]] \
or DEFAULT
parsed = highlight(u'\n'.join(self.content), lexer, formatter)
return [nodes.raw('', parsed, format='html')]
directives.register_directive('code-block', Pygments)
# Fetch the defaults
if pys.PYGMENTS_RST_OPTIONS is not None:
for k, v in pys.PYGMENTS_RST_OPTIONS.items():
# Locally set options overrides the defaults
if k not in self.options:
self.options[k] = v
if "linenos" in self.options and self.options["linenos"] not in (
"table",
"inline",
):
if self.options["linenos"] == "none":
self.options.pop("linenos")
else:
self.options["linenos"] = "table"
for flag in ("nowrap", "nobackground", "anchorlinenos"):
if flag in self.options:
self.options[flag] = True
# noclasses should already default to False, but just in case...
formatter = HtmlFormatter(noclasses=False, **self.options)
parsed = highlight("\n".join(self.content), lexer, formatter)
return [nodes.raw("", parsed, format="html")]
directives.register_directive("code-block", Pygments)
directives.register_directive("sourcecode", Pygments)
_abbr_re = re.compile(r"\((.*)\)$", re.DOTALL)
class abbreviation(nodes.Inline, nodes.TextElement):
pass
def abbr_role(typ, rawtext, text, lineno, inliner, options=None, content=None):
del typ, rawtext, lineno, inliner, options, content # Unused arguments
text = utils.unescape(text)
m = _abbr_re.search(text)
if m is None:
return [abbreviation(text, text)], []
abbr = text[: m.start()].strip()
expl = m.group(1)
return [abbreviation(abbr, abbr, explanation=expl)], []
roles.register_local_role("abbr", abbr_role)

166
pelican/server.py Normal file
View file

@ -0,0 +1,166 @@
import argparse
import logging
import os
import posixpath
import ssl
import sys
import urllib
from http import server
try:
from magic import from_file as magic_from_file
except ImportError:
magic_from_file = None
from pelican.log import console # noqa: F401
from pelican.log import init as init_logging
logger = logging.getLogger(__name__)
def parse_arguments():
parser = argparse.ArgumentParser(
description="Pelican Development Server",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"port", default=8000, type=int, nargs="?", help="Port to Listen On"
)
parser.add_argument("server", default="", nargs="?", help="Interface to Listen On")
parser.add_argument("--ssl", action="store_true", help="Activate SSL listener")
parser.add_argument(
"--cert",
default="./cert.pem",
nargs="?",
help="Path to certificate file. Relative to current directory",
)
parser.add_argument(
"--key",
default="./key.pem",
nargs="?",
help="Path to certificate key file. Relative to current directory",
)
parser.add_argument(
"--path",
default=".",
help="Path to pelican source directory to serve. Relative to current directory",
)
return parser.parse_args()
class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler):
SUFFIXES = [".html", "/index.html", "/", ""]
extensions_map = {
**server.SimpleHTTPRequestHandler.extensions_map,
# web fonts
".oft": "font/oft",
".sfnt": "font/sfnt",
".ttf": "font/ttf",
".woff": "font/woff",
".woff2": "font/woff2",
}
def translate_path(self, path):
# abandon query parameters
path = path.split("?", 1)[0]
path = path.split("#", 1)[0]
# Don't forget explicit trailing slash when normalizing. Issue17324
trailing_slash = path.rstrip().endswith("/")
path = urllib.parse.unquote(path)
path = posixpath.normpath(path)
words = path.split("/")
words = filter(None, words)
path = self.base_path
for word in words:
if os.path.dirname(word) or word in (os.curdir, os.pardir):
# Ignore components that are not a simple file/directory name
continue
path = os.path.join(path, word)
if trailing_slash:
path += "/"
return path
def do_GET(self):
# cut off a query string
original_path = self.path.split("?", 1)[0]
# try to find file
self.path = self.get_path_that_exists(original_path)
if not self.path:
return
server.SimpleHTTPRequestHandler.do_GET(self)
def get_path_that_exists(self, original_path):
# Try to strip trailing slash
trailing_slash = original_path.endswith("/")
original_path = original_path.rstrip("/")
# Try to detect file by applying various suffixes
tries = []
for suffix in self.SUFFIXES:
if not trailing_slash and suffix == "/":
# if original request does not have trailing slash, skip the '/' suffix
# so that base class can redirect if needed
continue
path = original_path + suffix
if os.path.exists(self.translate_path(path)):
return path
tries.append(path)
logger.warning(
"Unable to find `%s` or variations:\n%s", original_path, "\n".join(tries)
)
return None
def guess_type(self, path):
"""Guess at the mime type for the specified file."""
mimetype = server.SimpleHTTPRequestHandler.guess_type(self, path)
# If the default guess is too generic, try the python-magic library
if mimetype == "application/octet-stream" and magic_from_file:
mimetype = magic_from_file(path, mime=True)
return mimetype
def log_message(self, msg_format, *args):
logger.info(msg_format, *args)
class RootedHTTPServer(server.HTTPServer):
def __init__(self, base_path, *args, **kwargs):
server.HTTPServer.__init__(self, *args, **kwargs)
self.RequestHandlerClass.base_path = base_path
if __name__ == "__main__":
init_logging(level=logging.INFO)
logger.warning(
"'python -m pelican.server' is deprecated.\nThe "
"Pelican development server should be run via "
"'pelican --listen' or 'pelican -l'.\nThis can be combined "
"with regeneration as 'pelican -lr'.\nRerun 'pelican-"
"quickstart' to get new Makefile and tasks.py files."
)
args = parse_arguments()
RootedHTTPServer.allow_reuse_address = True
try:
httpd = RootedHTTPServer(
args.path, (args.server, args.port), ComplexHTTPRequestHandler
)
if args.ssl:
httpd.socket = ssl.wrap_socket(
httpd.socket, keyfile=args.key, certfile=args.cert, server_side=True
)
except ssl.SSLError as e:
logger.error(
"Couldn't open certificate file %s or key file %s", args.cert, args.key
)
logger.error("Could not listen on port %s, server %s.", args.port, args.server)
sys.exit(getattr(e, "exitcode", 1))
logger.info("Serving at port %s, server %s.", args.port, args.server)
try:
httpd.serve_forever()
except KeyboardInterrupt:
logger.info("Shutting down server.")
httpd.socket.close()

View file

@ -1,33 +1,739 @@
import copy
import importlib.util
import inspect
import locale
import logging
import os
import re
import sys
from os.path import isabs
from pathlib import Path
from types import ModuleType
from typing import Any, Optional
_DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),
"themes/notmyidea"])
_DEFAULT_CONFIG = {'PATH': None,
'THEME': _DEFAULT_THEME,
'OUTPUT_PATH': 'output/',
'MARKUP': ('rst', 'md'),
'STATIC_PATHS': ['images',],
'THEME_STATIC_PATHS': ['static',],
'FEED': 'feeds/all.atom.xml',
'CATEGORY_FEED': 'feeds/%s.atom.xml',
'SITENAME': 'A Pelican Blog',
'DISPLAY_PAGES_ON_MENU': True,
'PDF_GENERATOR': False,
'DEFAULT_CATEGORY': 'misc',
'FALLBACK_ON_FS_DATE': True,
'CSS_FILE': 'main.css',
'REVERSE_ARCHIVE_ORDER': False,
'KEEP_OUTPUT_DIRECTORY': False,
}
from pelican.log import LimitFilter
from pelican.paginator import PaginationRule
def read_settings(filename):
"""Load a Python file into a dictionary.
"""
context = _DEFAULT_CONFIG.copy()
if filename:
tempdict = {}
execfile(filename, tempdict)
for key in tempdict:
if key.isupper():
context[key] = tempdict[key]
def load_source(name: str, path: str) -> ModuleType:
spec = importlib.util.spec_from_file_location(name, path)
mod = importlib.util.module_from_spec(spec)
sys.modules[name] = mod
spec.loader.exec_module(mod)
return mod
logger = logging.getLogger(__name__)
Settings = dict[str, Any]
DEFAULT_THEME = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "themes", "notmyidea"
)
DEFAULT_CONFIG = {
"PATH": os.curdir,
"ARTICLE_PATHS": [""],
"ARTICLE_EXCLUDES": [],
"PAGE_PATHS": ["pages"],
"PAGE_EXCLUDES": [],
"THEME": DEFAULT_THEME,
"OUTPUT_PATH": "output",
"READERS": {},
"STATIC_PATHS": ["images"],
"STATIC_EXCLUDES": [],
"STATIC_EXCLUDE_SOURCES": True,
"THEME_STATIC_DIR": "theme",
"THEME_STATIC_PATHS": [
"static",
],
"FEED_ALL_ATOM": "feeds/all.atom.xml",
"CATEGORY_FEED_ATOM": "feeds/{slug}.atom.xml",
"AUTHOR_FEED_ATOM": "feeds/{slug}.atom.xml",
"AUTHOR_FEED_RSS": "feeds/{slug}.rss.xml",
"TRANSLATION_FEED_ATOM": "feeds/all-{lang}.atom.xml",
"FEED_MAX_ITEMS": 100,
"RSS_FEED_SUMMARY_ONLY": True,
"FEED_APPEND_REF": False,
"SITEURL": "",
"SITENAME": "A Pelican Blog",
"DISPLAY_PAGES_ON_MENU": True,
"DISPLAY_CATEGORIES_ON_MENU": True,
"DOCUTILS_SETTINGS": {},
"OUTPUT_SOURCES": False,
"OUTPUT_SOURCES_EXTENSION": ".text",
"USE_FOLDER_AS_CATEGORY": True,
"DEFAULT_CATEGORY": "misc",
"WITH_FUTURE_DATES": True,
"CSS_FILE": "main.css",
"NEWEST_FIRST_ARCHIVES": True,
"REVERSE_CATEGORY_ORDER": False,
"DELETE_OUTPUT_DIRECTORY": False,
"OUTPUT_RETENTION": [],
"INDEX_SAVE_AS": "index.html",
"ARTICLE_URL": "{slug}.html",
"ARTICLE_SAVE_AS": "{slug}.html",
"ARTICLE_ORDER_BY": "reversed-date",
"ARTICLE_LANG_URL": "{slug}-{lang}.html",
"ARTICLE_LANG_SAVE_AS": "{slug}-{lang}.html",
"DRAFT_URL": "drafts/{slug}.html",
"DRAFT_SAVE_AS": "drafts/{slug}.html",
"DRAFT_LANG_URL": "drafts/{slug}-{lang}.html",
"DRAFT_LANG_SAVE_AS": "drafts/{slug}-{lang}.html",
"PAGE_URL": "pages/{slug}.html",
"PAGE_SAVE_AS": "pages/{slug}.html",
"PAGE_ORDER_BY": "basename",
"PAGE_LANG_URL": "pages/{slug}-{lang}.html",
"PAGE_LANG_SAVE_AS": "pages/{slug}-{lang}.html",
"DRAFT_PAGE_URL": "drafts/pages/{slug}.html",
"DRAFT_PAGE_SAVE_AS": "drafts/pages/{slug}.html",
"DRAFT_PAGE_LANG_URL": "drafts/pages/{slug}-{lang}.html",
"DRAFT_PAGE_LANG_SAVE_AS": "drafts/pages/{slug}-{lang}.html",
"STATIC_URL": "{path}",
"STATIC_SAVE_AS": "{path}",
"STATIC_CREATE_LINKS": False,
"STATIC_CHECK_IF_MODIFIED": False,
"CATEGORY_URL": "category/{slug}.html",
"CATEGORY_SAVE_AS": "category/{slug}.html",
"TAG_URL": "tag/{slug}.html",
"TAG_SAVE_AS": "tag/{slug}.html",
"AUTHOR_URL": "author/{slug}.html",
"AUTHOR_SAVE_AS": "author/{slug}.html",
"PAGINATION_PATTERNS": [
(1, "{name}{extension}", "{name}{extension}"),
(2, "{name}{number}{extension}", "{name}{number}{extension}"),
],
"YEAR_ARCHIVE_URL": "",
"YEAR_ARCHIVE_SAVE_AS": "",
"MONTH_ARCHIVE_URL": "",
"MONTH_ARCHIVE_SAVE_AS": "",
"DAY_ARCHIVE_URL": "",
"DAY_ARCHIVE_SAVE_AS": "",
"RELATIVE_URLS": False,
"DEFAULT_LANG": "en",
"ARTICLE_TRANSLATION_ID": "slug",
"PAGE_TRANSLATION_ID": "slug",
"DIRECT_TEMPLATES": ["index", "tags", "categories", "authors", "archives"],
"THEME_TEMPLATES_OVERRIDES": [],
"PAGINATED_TEMPLATES": {
"index": None,
"tag": None,
"category": None,
"author": None,
},
"PELICAN_CLASS": "pelican.Pelican",
"DEFAULT_DATE_FORMAT": "%a %d %B %Y",
"DATE_FORMATS": {},
"MARKDOWN": {
"extension_configs": {
"markdown.extensions.codehilite": {"css_class": "highlight"},
"markdown.extensions.extra": {},
"markdown.extensions.meta": {},
},
"output_format": "html5",
},
"JINJA_FILTERS": {},
"JINJA_GLOBALS": {},
"JINJA_TESTS": {},
"JINJA_ENVIRONMENT": {
"trim_blocks": True,
"lstrip_blocks": True,
"extensions": [],
},
"LOG_FILTER": [],
"LOCALE": [""], # defaults to user locale
"DEFAULT_PAGINATION": False,
"DEFAULT_ORPHANS": 0,
"DEFAULT_METADATA": {},
"FILENAME_METADATA": r"(?P<date>\d{4}-\d{2}-\d{2}).*",
"PATH_METADATA": r"",
"EXTRA_PATH_METADATA": {},
"ARTICLE_PERMALINK_STRUCTURE": "",
"TYPOGRIFY": False,
"TYPOGRIFY_IGNORE_TAGS": [],
"TYPOGRIFY_OMIT_FILTERS": [],
"TYPOGRIFY_DASHES": "default",
"SUMMARY_END_SUFFIX": "",
"SUMMARY_MAX_LENGTH": 50,
"PLUGIN_PATHS": [],
"PLUGINS": None,
"PYGMENTS_RST_OPTIONS": {},
"TEMPLATE_PAGES": {},
"TEMPLATE_EXTENSIONS": [".html"],
"IGNORE_FILES": ["**/.*"],
"SLUG_REGEX_SUBSTITUTIONS": [
(r"[^\w\s-]", ""), # remove non-alphabetical/whitespace/'-' chars
(r"(?u)\A\s*", ""), # strip leading whitespace
(r"(?u)\s*\Z", ""), # strip trailing whitespace
(r"[-\s]+", "-"), # reduce multiple whitespace or '-' to single '-'
],
"INTRASITE_LINK_REGEX": "[{|](?P<what>.*?)[|}]",
"SLUGIFY_SOURCE": "title",
"SLUGIFY_USE_UNICODE": False,
"SLUGIFY_PRESERVE_CASE": False,
"CACHE_CONTENT": False,
"CONTENT_CACHING_LAYER": "reader",
"CACHE_PATH": "cache",
"GZIP_CACHE": True,
"CHECK_MODIFIED_METHOD": "mtime",
"LOAD_CONTENT_CACHE": False,
"FORMATTED_FIELDS": ["summary"],
"PORT": 8000,
"BIND": "127.0.0.1",
}
PYGMENTS_RST_OPTIONS = None
def read_settings(
path: Optional[str] = None, override: Optional[Settings] = None
) -> Settings:
settings = override or {}
if path:
settings = dict(get_settings_from_file(path), **settings)
if settings:
settings = handle_deprecated_settings(settings)
if path:
# Make relative paths absolute
def getabs(maybe_relative, base_path=path):
if isabs(maybe_relative):
return maybe_relative
return os.path.abspath(
os.path.normpath(
os.path.join(os.path.dirname(base_path), maybe_relative)
)
)
for p in ["PATH", "OUTPUT_PATH", "THEME", "CACHE_PATH"]:
if settings.get(p) is not None:
absp = getabs(settings[p])
# THEME may be a name rather than a path
if p != "THEME" or os.path.exists(absp):
settings[p] = absp
if settings.get("PLUGIN_PATHS") is not None:
settings["PLUGIN_PATHS"] = [
getabs(pluginpath) for pluginpath in settings["PLUGIN_PATHS"]
]
settings = dict(copy.deepcopy(DEFAULT_CONFIG), **settings)
settings = configure_settings(settings)
# This is because there doesn't seem to be a way to pass extra
# parameters to docutils directive handlers, so we have to have a
# variable here that we'll import from within Pygments.run (see
# rstdirectives.py) to see what the user defaults were.
global PYGMENTS_RST_OPTIONS # noqa: PLW0603
PYGMENTS_RST_OPTIONS = settings.get("PYGMENTS_RST_OPTIONS", None)
return settings
def get_settings_from_module(module: Optional[ModuleType] = None) -> Settings:
"""Loads settings from a module, returns a dictionary."""
context = {}
if module is not None:
context.update((k, v) for k, v in inspect.getmembers(module) if k.isupper())
return context
def get_settings_from_file(path: str) -> Settings:
"""Loads settings from a file path, returning a dict."""
name, ext = os.path.splitext(os.path.basename(path))
module = load_source(name, path)
return get_settings_from_module(module)
def get_jinja_environment(settings: Settings) -> Settings:
"""Sets the environment for Jinja"""
jinja_env = settings.setdefault(
"JINJA_ENVIRONMENT", DEFAULT_CONFIG["JINJA_ENVIRONMENT"]
)
# Make sure we include the defaults if the user has set env variables
for key, value in DEFAULT_CONFIG["JINJA_ENVIRONMENT"].items():
if key not in jinja_env:
jinja_env[key] = value
return settings
def _printf_s_to_format_field(printf_string: str, format_field: str) -> str:
"""Tries to replace %s with {format_field} in the provided printf_string.
Raises ValueError in case of failure.
"""
TEST_STRING = "PELICAN_PRINTF_S_DEPRECATION"
expected = printf_string % TEST_STRING
result = printf_string.replace("{", "{{").replace("}", "}}") % f"{{{format_field}}}"
if result.format(**{format_field: TEST_STRING}) != expected:
raise ValueError(f"Failed to safely replace %s with {{{format_field}}}")
return result
def handle_deprecated_settings(settings: Settings) -> Settings:
"""Converts deprecated settings and issues warnings. Issues an exception
if both old and new setting is specified.
"""
# PLUGIN_PATH -> PLUGIN_PATHS
if "PLUGIN_PATH" in settings:
logger.warning(
"PLUGIN_PATH setting has been replaced by "
"PLUGIN_PATHS, moving it to the new setting name."
)
settings["PLUGIN_PATHS"] = settings["PLUGIN_PATH"]
del settings["PLUGIN_PATH"]
# PLUGIN_PATHS: str -> [str]
if isinstance(settings.get("PLUGIN_PATHS"), str):
logger.warning(
"Defining PLUGIN_PATHS setting as string "
"has been deprecated (should be a list)"
)
settings["PLUGIN_PATHS"] = [settings["PLUGIN_PATHS"]]
# JINJA_EXTENSIONS -> JINJA_ENVIRONMENT > extensions
if "JINJA_EXTENSIONS" in settings:
logger.warning(
"JINJA_EXTENSIONS setting has been deprecated, "
"moving it to JINJA_ENVIRONMENT setting."
)
settings["JINJA_ENVIRONMENT"]["extensions"] = settings["JINJA_EXTENSIONS"]
del settings["JINJA_EXTENSIONS"]
# {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS
for key in ["ARTICLE", "PAGE"]:
old_key = key + "_DIR"
new_key = key + "_PATHS"
if old_key in settings:
logger.warning(
"Deprecated setting %s, moving it to %s list", old_key, new_key
)
settings[new_key] = [settings[old_key]] # also make a list
del settings[old_key]
# EXTRA_TEMPLATES_PATHS -> THEME_TEMPLATES_OVERRIDES
if "EXTRA_TEMPLATES_PATHS" in settings:
logger.warning(
"EXTRA_TEMPLATES_PATHS is deprecated use THEME_TEMPLATES_OVERRIDES instead."
)
if settings.get("THEME_TEMPLATES_OVERRIDES"):
raise Exception(
"Setting both EXTRA_TEMPLATES_PATHS and "
"THEME_TEMPLATES_OVERRIDES is not permitted. Please move to "
"only setting THEME_TEMPLATES_OVERRIDES."
)
settings["THEME_TEMPLATES_OVERRIDES"] = settings["EXTRA_TEMPLATES_PATHS"]
del settings["EXTRA_TEMPLATES_PATHS"]
# MD_EXTENSIONS -> MARKDOWN
if "MD_EXTENSIONS" in settings:
logger.warning(
"MD_EXTENSIONS is deprecated use MARKDOWN "
"instead. Falling back to the default."
)
settings["MARKDOWN"] = DEFAULT_CONFIG["MARKDOWN"]
# LESS_GENERATOR -> Webassets plugin
# FILES_TO_COPY -> STATIC_PATHS, EXTRA_PATH_METADATA
for old, new, doc in [
("LESS_GENERATOR", "the Webassets plugin", None),
(
"FILES_TO_COPY",
"STATIC_PATHS and EXTRA_PATH_METADATA",
"https://github.com/getpelican/pelican/"
"blob/main/docs/settings.rst#path-metadata",
),
]:
if old in settings:
message = f"The {old} setting has been removed in favor of {new}"
if doc:
message += f", see {doc} for details"
logger.warning(message)
# PAGINATED_DIRECT_TEMPLATES -> PAGINATED_TEMPLATES
if "PAGINATED_DIRECT_TEMPLATES" in settings:
message = "The {} setting has been removed in favor of {}".format(
"PAGINATED_DIRECT_TEMPLATES", "PAGINATED_TEMPLATES"
)
logger.warning(message)
# set PAGINATED_TEMPLATES
if "PAGINATED_TEMPLATES" not in settings:
settings["PAGINATED_TEMPLATES"] = {
"tag": None,
"category": None,
"author": None,
}
for t in settings["PAGINATED_DIRECT_TEMPLATES"]:
if t not in settings["PAGINATED_TEMPLATES"]:
settings["PAGINATED_TEMPLATES"][t] = None
del settings["PAGINATED_DIRECT_TEMPLATES"]
# {SLUG,CATEGORY,TAG,AUTHOR}_SUBSTITUTIONS ->
# {SLUG,CATEGORY,TAG,AUTHOR}_REGEX_SUBSTITUTIONS
url_settings_url = "http://docs.getpelican.com/en/latest/settings.html#url-settings"
flavours = {"SLUG", "CATEGORY", "TAG", "AUTHOR"}
old_values = {
f: settings[f + "_SUBSTITUTIONS"]
for f in flavours
if f + "_SUBSTITUTIONS" in settings
}
new_values = {
f: settings[f + "_REGEX_SUBSTITUTIONS"]
for f in flavours
if f + "_REGEX_SUBSTITUTIONS" in settings
}
if old_values and new_values:
raise Exception(
"Setting both {new_key} and {old_key} (or variants thereof) is "
"not permitted. Please move to only setting {new_key}.".format(
old_key="SLUG_SUBSTITUTIONS", new_key="SLUG_REGEX_SUBSTITUTIONS"
)
)
if old_values:
message = (
"{} and variants thereof are deprecated and will be "
"removed in the future. Please use {} and variants thereof "
"instead. Check {}.".format(
"SLUG_SUBSTITUTIONS", "SLUG_REGEX_SUBSTITUTIONS", url_settings_url
)
)
logger.warning(message)
if old_values.get("SLUG"):
for f in ("CATEGORY", "TAG"):
if old_values.get(f):
old_values[f] = old_values["SLUG"] + old_values[f]
old_values["AUTHOR"] = old_values.get("AUTHOR", [])
for f in flavours:
if old_values.get(f) is not None:
regex_subs = []
# by default will replace non-alphanum characters
replace = True
for tpl in old_values[f]:
try:
src, dst, skip = tpl
if skip:
replace = False
except ValueError:
src, dst = tpl
regex_subs.append((re.escape(src), dst.replace("\\", r"\\")))
if replace:
regex_subs += [
(r"[^\w\s-]", ""),
(r"(?u)\A\s*", ""),
(r"(?u)\s*\Z", ""),
(r"[-\s]+", "-"),
]
else:
regex_subs += [
(r"(?u)\A\s*", ""),
(r"(?u)\s*\Z", ""),
]
settings[f + "_REGEX_SUBSTITUTIONS"] = regex_subs
settings.pop(f + "_SUBSTITUTIONS", None)
# `%s` -> '{slug}` or `{lang}` in FEED settings
for key in ["TRANSLATION_FEED_ATOM", "TRANSLATION_FEED_RSS"]:
if (
settings.get(key)
and not isinstance(settings[key], Path)
and "%s" in settings[key]
):
logger.warning("%%s usage in %s is deprecated, use {lang} instead.", key)
try:
settings[key] = _printf_s_to_format_field(settings[key], "lang")
except ValueError:
logger.warning(
"Failed to convert %%s to {lang} for %s. Falling back to default.",
key,
)
settings[key] = DEFAULT_CONFIG[key]
for key in [
"AUTHOR_FEED_ATOM",
"AUTHOR_FEED_RSS",
"CATEGORY_FEED_ATOM",
"CATEGORY_FEED_RSS",
"TAG_FEED_ATOM",
"TAG_FEED_RSS",
]:
if (
settings.get(key)
and not isinstance(settings[key], Path)
and "%s" in settings[key]
):
logger.warning("%%s usage in %s is deprecated, use {slug} instead.", key)
try:
settings[key] = _printf_s_to_format_field(settings[key], "slug")
except ValueError:
logger.warning(
"Failed to convert %%s to {slug} for %s. Falling back to default.",
key,
)
settings[key] = DEFAULT_CONFIG[key]
# CLEAN_URLS
if settings.get("CLEAN_URLS", False):
logger.warning(
"Found deprecated `CLEAN_URLS` in settings."
" Modifying the following settings for the"
" same behaviour."
)
settings["ARTICLE_URL"] = "{slug}/"
settings["ARTICLE_LANG_URL"] = "{slug}-{lang}/"
settings["PAGE_URL"] = "pages/{slug}/"
settings["PAGE_LANG_URL"] = "pages/{slug}-{lang}/"
for setting in ("ARTICLE_URL", "ARTICLE_LANG_URL", "PAGE_URL", "PAGE_LANG_URL"):
logger.warning("%s = '%s'", setting, settings[setting])
# AUTORELOAD_IGNORE_CACHE -> --ignore-cache
if settings.get("AUTORELOAD_IGNORE_CACHE"):
logger.warning(
"Found deprecated `AUTORELOAD_IGNORE_CACHE` in "
"settings. Use --ignore-cache instead."
)
settings.pop("AUTORELOAD_IGNORE_CACHE")
# ARTICLE_PERMALINK_STRUCTURE
if settings.get("ARTICLE_PERMALINK_STRUCTURE", False):
logger.warning(
"Found deprecated `ARTICLE_PERMALINK_STRUCTURE` in"
" settings. Modifying the following settings for"
" the same behaviour."
)
structure = settings["ARTICLE_PERMALINK_STRUCTURE"]
# Convert %(variable) into {variable}.
structure = re.sub(r"%\((\w+)\)s", r"{\g<1>}", structure)
# Convert %x into {date:%x} for strftime
structure = re.sub(r"(%[A-z])", r"{date:\g<1>}", structure)
# Strip a / prefix
structure = re.sub("^/", "", structure)
for setting in (
"ARTICLE_URL",
"ARTICLE_LANG_URL",
"PAGE_URL",
"PAGE_LANG_URL",
"DRAFT_URL",
"DRAFT_LANG_URL",
"ARTICLE_SAVE_AS",
"ARTICLE_LANG_SAVE_AS",
"DRAFT_SAVE_AS",
"DRAFT_LANG_SAVE_AS",
"PAGE_SAVE_AS",
"PAGE_LANG_SAVE_AS",
):
settings[setting] = os.path.join(structure, settings[setting])
logger.warning("%s = '%s'", setting, settings[setting])
# {,TAG,CATEGORY,TRANSLATION}_FEED -> {,TAG,CATEGORY,TRANSLATION}_FEED_ATOM
for new, old in [
("FEED", "FEED_ATOM"),
("TAG_FEED", "TAG_FEED_ATOM"),
("CATEGORY_FEED", "CATEGORY_FEED_ATOM"),
("TRANSLATION_FEED", "TRANSLATION_FEED_ATOM"),
]:
if settings.get(new, False):
logger.warning(
"Found deprecated `%(new)s` in settings. Modify %(new)s "
"to %(old)s in your settings and theme for the same "
"behavior. Temporarily setting %(old)s for backwards "
"compatibility.",
{"new": new, "old": old},
)
settings[old] = settings[new]
# Warn if removed WRITE_SELECTED is present
if "WRITE_SELECTED" in settings:
logger.warning(
"WRITE_SELECTED is present in settings but this functionality was removed. "
"It will have no effect."
)
return settings
def configure_settings(settings: Settings) -> Settings:
"""Provide optimizations, error checking, and warnings for the given
settings.
Also, specify the log messages to be ignored.
"""
if "PATH" not in settings or not os.path.isdir(settings["PATH"]):
raise Exception(
"You need to specify a path containing the content"
" (see pelican --help for more information)"
)
# specify the log messages to be ignored
log_filter = settings.get("LOG_FILTER", DEFAULT_CONFIG["LOG_FILTER"])
LimitFilter._ignore.update(set(log_filter))
# lookup the theme in "pelican/themes" if the given one doesn't exist
if not os.path.isdir(settings["THEME"]):
theme_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "themes", settings["THEME"]
)
if os.path.exists(theme_path):
settings["THEME"] = theme_path
else:
raise Exception("Could not find the theme {}".format(settings["THEME"]))
# standardize strings to lowercase strings
for key in ["DEFAULT_LANG"]:
if key in settings:
settings[key] = settings[key].lower()
# set defaults for Jinja environment
settings = get_jinja_environment(settings)
# standardize strings to lists
for key in ["LOCALE"]:
if key in settings and isinstance(settings[key], str):
settings[key] = [settings[key]]
# check settings that must be a particular type
for key, types in [
("OUTPUT_SOURCES_EXTENSION", str),
("FILENAME_METADATA", str),
]:
if key in settings and not isinstance(settings[key], types):
value = settings.pop(key)
logger.warning(
"Detected misconfigured %s (%s), falling back to the default (%s)",
key,
value,
DEFAULT_CONFIG[key],
)
# try to set the different locales, fallback on the default.
locales = settings.get("LOCALE", DEFAULT_CONFIG["LOCALE"])
for locale_ in locales:
try:
locale.setlocale(locale.LC_ALL, str(locale_))
break # break if it is successful
except locale.Error:
pass
else:
logger.warning(
"Locale could not be set. Check the LOCALE setting, ensuring it "
"is valid and available on your system."
)
if "SITEURL" in settings:
# If SITEURL has a trailing slash, remove it and provide a warning
siteurl = settings["SITEURL"]
if siteurl.endswith("/"):
settings["SITEURL"] = siteurl[:-1]
logger.warning("Removed extraneous trailing slash from SITEURL.")
# If SITEURL is defined but FEED_DOMAIN isn't,
# set FEED_DOMAIN to SITEURL
if "FEED_DOMAIN" not in settings:
settings["FEED_DOMAIN"] = settings["SITEURL"]
# check content caching layer and warn of incompatibilities
if (
settings.get("CACHE_CONTENT", False)
and settings.get("CONTENT_CACHING_LAYER", "") == "generator"
and not settings.get("WITH_FUTURE_DATES", True)
):
logger.warning(
"WITH_FUTURE_DATES conflicts with CONTENT_CACHING_LAYER "
"set to 'generator', use 'reader' layer instead"
)
# Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined
feed_keys = [
"FEED_ATOM",
"FEED_RSS",
"FEED_ALL_ATOM",
"FEED_ALL_RSS",
"CATEGORY_FEED_ATOM",
"CATEGORY_FEED_RSS",
"AUTHOR_FEED_ATOM",
"AUTHOR_FEED_RSS",
"TAG_FEED_ATOM",
"TAG_FEED_RSS",
"TRANSLATION_FEED_ATOM",
"TRANSLATION_FEED_RSS",
]
if any(settings.get(k) for k in feed_keys):
if not settings.get("SITEURL"):
logger.warning(
"Feeds generated without SITEURL set properly may not be valid"
)
if "TIMEZONE" not in settings:
logger.warning(
"No timezone information specified in the settings. Assuming"
" your timezone is UTC for feed generation. Check "
"https://docs.getpelican.com/en/latest/settings.html#TIMEZONE "
"for more information"
)
# fix up pagination rules
pagination_rules = [
PaginationRule(*r)
for r in settings.get(
"PAGINATION_PATTERNS",
DEFAULT_CONFIG["PAGINATION_PATTERNS"],
)
]
settings["PAGINATION_PATTERNS"] = sorted(
pagination_rules,
key=lambda r: r[0],
)
# Save people from accidentally setting a string rather than a list
path_keys = (
"ARTICLE_EXCLUDES",
"DEFAULT_METADATA",
"DIRECT_TEMPLATES",
"THEME_TEMPLATES_OVERRIDES",
"FILES_TO_COPY",
"IGNORE_FILES",
"PAGINATED_DIRECT_TEMPLATES",
"PLUGINS",
"STATIC_EXCLUDES",
"STATIC_PATHS",
"THEME_STATIC_PATHS",
"ARTICLE_PATHS",
"PAGE_PATHS",
)
for PATH_KEY in filter(lambda k: k in settings, path_keys):
if isinstance(settings[PATH_KEY], str):
logger.warning(
"Detected misconfiguration with %s setting "
"(must be a list), falling back to the default",
PATH_KEY,
)
settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY]
# Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES
mutually_exclusive = ("ARTICLE", "PAGE")
for type_1, type_2 in [mutually_exclusive, mutually_exclusive[::-1]]:
try:
includes = settings[type_1 + "_PATHS"]
excludes = settings[type_2 + "_EXCLUDES"]
for path in includes:
if path not in excludes:
excludes.append(path)
except KeyError:
continue # setting not specified, nothing to do
return settings

4
pelican/signals.py Normal file
View file

@ -0,0 +1,4 @@
raise ImportError(
"Importing from `pelican.signals` is deprecated. "
"Use `from pelican import signals` or `import pelican.plugins.signals` instead."
)

View file

@ -0,0 +1,8 @@
This is a test bad page
#######################
:status: invalid
The quick brown fox jumped over the lazy dog's back.
The status here is invalid, the page should not render.

Some files were not shown because too many files have changed in this diff Show more