1
0
Fork 0
forked from github/pelican

Compare commits

...
Sign in to create a new pull request.

1,897 commits

Author SHA1 Message Date
f5840e7f2d fix: update Forgejo link 2026-01-20 15:24:58 +01:00
da015db848 feat: add AbuseIPDB verification snippet 2026-01-20 14:38:56 +01:00
25aec6d05d fix: properly add SVG title inside path 2025-09-09 16:17:43 +02:00
c0618e0a9c feat: add blog post word count 2025-07-08 10:51:34 +02:00
df34aec7f2 feat: better navigation 2025-05-22 12:14:30 +02:00
755cabe0bb feat: remove link underline on hover on title 2025-05-22 12:14:15 +02:00
17234d7520 feat: add Hacker News share link 2025-05-21 09:10:10 +02:00
cc07b2dbb0 fix: remove main prism.css to avoid visual glitch 2025-05-21 09:09:58 +02:00
101f856a82 fix: properly close link/meta tags 2025-02-28 09:12:40 +01:00
e663b95c9e feat: fancy subtitle, more whitespace between footer elements 2025-02-24 14:03:11 +01:00
f8ca328568 feat: image floats, wcag, remove target blank links 2025-02-17 11:08:37 +01:00
279c589a84 feat: change subheading font to C64 2025-01-22 15:32:36 +01:00
9818b62a2f fix: shrink readability score text length 2025-01-16 15:52:05 +01:00
37f4802e27 fix: reduce h4 heading size 2025-01-16 15:51:39 +01:00
9f84d3e911 feat: bold buymeacoffee link 2025-01-13 15:40:47 +01:00
2ed8e41f1d feat: use social share plugin, comma-separate tags 2025-01-13 15:40:24 +01:00
914dc73320 feat: bigger font size on mobile 2025-01-13 15:39:43 +01:00
310fab5496 feat: yearly archives, restructure headings 2025-01-08 11:45:09 +01:00
bfed925127 refactor: remove obsolete period archives template 2025-01-08 11:42:54 +01:00
6716c43b32 fix: table heading colors 2025-01-08 11:41:25 +01:00
c188ce1152 feat: add skip links and note/warn blocks 2025-01-07 17:27:27 +01:00
89ea49d06f fix(article): remove orphaned closing a href element 2025-01-07 17:26:20 +01:00
e35ca0fd21 fix: add license name 2024-12-30 12:40:24 +01:00
3d9fff7ce6 feat: add LICENSE 2024-12-30 12:36:06 +01:00
49ea09bbbe fix: headings hierarchy, font sizes, optimize sizes for breakpoints 2024-12-19 23:22:34 +01:00
6c0f3cbd58 feat: update Tailwind to 3.4.17 2024-12-19 10:03:49 +01:00
06cac4589c feat: this is going live now 2024-12-19 09:56:25 +01:00
eeaffe79e1 chore: remove obsolete code from repo 2024-12-13 15:09:18 +01:00
0d6bec6451 docs: update development parts of README 2024-12-13 14:59:35 +01:00
08e2883d56 feat: use Tailwind typography and implement rose pine, WIP 2024-10-26 00:28:57 +02:00
de5b3aec04 feat: add work in progress state 2024-10-21 07:53:36 +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
M. Utku Altinkaya
a987b65bd2 Watch static folders in Autoreload mode 2013-09-25 04:43:06 +03:00
367 changed files with 5136 additions and 24015 deletions

15
.editorconfig Normal file
View file

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

2
.gitattributes vendored
View file

@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

16
.gitignore vendored
View file

@ -1,15 +1 @@
*.egg-info
.*.swp
.*.swo
*.pyc
.DS_Store
docs/_build
docs/fr/_build
build
dist
tags
.tox
.coverage
htmlcov
six-*.egg/
*.orig
node_modules/

View file

@ -1,24 +0,0 @@
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>

View file

@ -1,22 +0,0 @@
language: python
python:
- "2.7"
- "3.3"
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq --no-install-recommends asciidoc
- sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi
- pip install mock nose nose-cov Markdown
- pip install .
script: nosetests -sv --with-coverage --cover-package=pelican pelican
after_success:
# Report coverage results to coveralls.io
- pip install coveralls
- coveralls
notifications:
irc:
channels:
- "irc.freenode.org#pelican"
on_success: change

View file

@ -1,40 +0,0 @@
Contribution submission guidelines
==================================
* Consider whether your new feature might be better suited as a plugin_. Folks
are usually available in the `#pelican IRC channel`_ if help is needed to
make that determination.
* `Create a new git branch`_ specific to your change (as opposed to making
your commits in the master branch).
* **Don't put multiple fixes/features in the same branch / pull request.**
For example, if you're hacking 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.
* Adhere to PEP8 coding standards whenever possible.
* Check for unnecessary whitespace via ``git diff --check`` before committing.
* **Add docs and tests for your changes**.
* `Run all the tests`_ **on both Python 2.7 and 3.3** to ensure nothing was
accidentally broken.
* 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).
* If you have previously filed a GitHub issue and want to contribute code that
addresses that issue, **please use** ``hub pull-request`` instead of using
GitHub's web UI to submit the pull request. This isn't an absolute
requirement, but makes the maintainers' lives much easier! Specifically:
`install hub <https://github.com/defunkt/hub/#installation>`_ and then run
`hub pull-request <https://github.com/defunkt/hub/#git-pull-request>`_ to
turn your GitHub issue into a pull request containing your code.
Check out our `Git Tips`_ page or ask on the `#pelican IRC channel`_ if you
need assistance or have any questions about these guidelines.
.. _`plugin`: http://docs.getpelican.com/en/latest/plugins.html
.. _`#pelican IRC channel`: http://webchat.freenode.net/?channels=pelican&uio=d4
.. _`Create a new git branch`: https://github.com/getpelican/pelican/wiki/Git-Tips#making-your-changes
.. _`Run all the tests`: http://docs.getpelican.com/en/latest/contribute.html#running-the-test-suite
.. _`Git Tips`: https://github.com/getpelican/pelican/wiki/Git-Tips

681
LICENSE
View file

@ -1,661 +1,20 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
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 <http://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
<http://www.gnu.org/licenses/>.
MIT License
Copyright (c) 2024 Oliver Ladner
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,3 +0,0 @@
include *.rst
recursive-include pelican *.html *.css *png *.in *.rst *.md *.mkd *.xml *.py
include LICENSE THANKS docs/changelog.rst

43
README.md Normal file
View file

@ -0,0 +1,43 @@
# lugh Pelican theme
This theme is based on the [simple theme](https://github.com/getpelican/pelican/tree/main/pelican/themes/simple/templates).
It's heavily customized to what I need here, so no efforts have been made to
keep it useful for others. Amongst other things, I:
- removed translations
- changed the structure (HTML `<footer>` etc.)
## Docs
- [Pelican: how to create your own theme](https://docs.getpelican.com/en/stable/themes.html)
- [Tailwind CSS quick start](https://tailwindcss.com/docs/installation)
## Doing
### Prepare Pelican development server config
Adapt Pelican's `publishconf.py` for local development.
E.g. `RELATIVE_URLS = False`
### Install Tailwind CSS Typography plugin
Typography enables sane defaults for longer texts. In this case, we use it for
the body content only, which is always Markdown. Typography is a bit of a beast
to configure/align to standard Tailwind.
```shell
npm install -D @tailwindcss/typography
```
### Run the Tailwind build process
```shell
npx tailwindcss -i static/css/in.css -o static/css/out.css --watch
```
### Run Pelican dev server
```shell
conda activate pelican
./devserver.sh
```

View file

@ -1,68 +0,0 @@
Pelican
=======
.. image:: https://secure.travis-ci.org/getpelican/pelican.png?branch=master
:target: http://travis-ci.org/getpelican/pelican
:alt: Travis-ci: continuous integration status.
Pelican is a static site generator, written in Python_.
* Write your weblog entries directly with your editor of choice (vim!)
in reStructuredText_ or Markdown_
* Includes a simple CLI tool to (re)generate the weblog
* Easy to interface with DVCSes and web hooks
* Completely static output is easy to host anywhere
Features
--------
Pelican currently supports:
* Blog articles and pages
* Comments, via an external service (Disqus). (Please note that while
useful, Disqus is an external service, and thus the comment data will be
somewhat outside of your control and potentially subject to data loss.)
* Theming support (themes are created using Jinja2_ templates)
* PDF generation of the articles/pages (optional)
* Publication of articles in multiple languages
* Atom/RSS feeds
* Code syntax highlighting
* Import from WordPress, Dotclear, or RSS feeds
* Integration with external tools: Twitter, Google Analytics, etc. (optional)
Have a look at the `Pelican documentation`_ for more information.
Why the name "Pelican"?
-----------------------
"Pelican" is an anagram for *calepin*, which means "notebook" in French. ;)
Source code
-----------
You can access the source code at: https://github.com/getpelican/pelican
If you feel hackish, have a look at the explanation of `Pelican's internals`_.
Feedback / Contact us
---------------------
If you want to see new features in Pelican, don't hesitate to offer
suggestions, clone the repository, etc. There are many ways to contribute_.
That's open source, dude!
Send a message to "authors at getpelican dot com" with any requests/feedback! You
can also join the team at `#pelican on Freenode`_ (or if you don't have an IRC
client handy, use the webchat_ for quick feedback.
.. Links
.. _Python: http://www.python.org/
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
.. _Markdown: http://daringfireball.net/projects/markdown/
.. _Jinja2: http://jinja.pocoo.org/
.. _`Pelican documentation`: http://docs.getpelican.com/latest/
.. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html
.. _`#pelican on Freenode`: irc://irc.freenode.net/pelican
.. _webchat: http://webchat.freenode.net/?channels=pelican&uio=d4
.. _contribute: http://docs.getpelican.com/en/latest/contribute.html

157
THANKS
View file

@ -1,157 +0,0 @@
Pelican is a project originally created by Alexis Métaireau
<http://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
If you want to contibute, check the documentation section about how to do so:
<http://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
Benoît HERVIER
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
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
jawher
Jered Boxman
Jerome
Jiachen Yang
Jochen Breuer
joe di castro
John Kristensen
John Mastro
Jökull Sólberg Auðunsson
Jomel Imperio
Joseph Reagle
Joshua Adelman
Julian Berman
Justin Mayer
Kyle Fuller
Laureline Guerin
Leonard Huang
Leroy Jiang
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
m-r-r
mviera
Nico Di Rocco
Nicolas Duhamel
Nicolas Perriault
Nicolas Steinmetz
Paul Asselin
Pavel Puchkin
Perry Roper
Peter Desmet
Philippe Pepiot
Rachid Belaid
Randall Degges
Ranjhith Kalisamy
Remi Rampin
Rémy HUBSCHER
renhbo
Richard Duivenvoorde
Rogdham
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
Tomi Pieviläinen
Trae Blain
Tshepang Lekhonkhobe
Valentin-Costel Hăloiu
Vlad Niculae
William Light
Wladislaw Merezhko
W. Trevor King
Zoresvit

View file

@ -1,30 +0,0 @@
[bumpr]
file = pelican/__init__.py
vcs = git
clean =
python setup.py clean
rm -rf *egg-info build dist
tests = python -m unittest discover
publish = python setup.py sdist register upload
files = README.rst
[bump]
unsuffix = true
message = Bump version {version}
[prepare]
part = patch
suffix = dev
message = Prepare version {version} for next development cycle
[changelog]
file = docs/changelog.rst
separator = =
bump = {version} ({date:%Y-%m-%d})
prepare = Next release
[readthedoc]
url = http://docs.getpelican.com/{tag}
[commands]
bump = sed -i "" "s/last_stable\s*=.*/last_stable = '{version}'/" docs/conf.py

View file

@ -1,11 +0,0 @@
# Tests
mock
# Optional Packages
Markdown
BeautifulSoup4
lxml
typogrify
# To perform release
bumpr==0.2.0

View file

@ -1,130 +0,0 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Raclette.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Raclette.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Raclette"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Raclette"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

BIN
docs/_static/uml.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

View file

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

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,254 +0,0 @@
/*
* pelican.css_t
* ~~~~~~~~~~~~
*
* Sphinx stylesheet -- pelican theme, based on the nature theme
*
* :copyright: Copyright 2011 by Alexis Metaireau.
*/
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: Arial, sans-serif;
font-size: 100%;
background-color: white;
color: #555;
margin: 0;
padding: 0;
}
div.documentwrapper {
width: 70%;
margin: auto;
}
div.bodywrapper {
margin: 0 0 0 230px;
}
hr {
border: 1px solid #B1B4B6;
}
div.document {
}
div.body {
background-color: #ffffff;
color: #3E4349;
padding: 0 30px 30px 30px;
font-size: 0.9em;
}
div.footer {
color: #555;
width: 100%;
padding: 13px 0;
text-align: center;
font-size: 75%;
}
div.footer a {
color: #444;
text-decoration: underline;
}
div.related {
background-color: #6BA81E;
line-height: 32px;
color: #fff;
text-shadow: 0px 1px 0 #444;
font-size: 0.9em;
}
div.related a {
color: #E2F3CC;
}
div.sphinxsidebar {
font-size: 0.75em;
line-height: 1.5em;
}
div.sphinxsidebarwrapper{
padding: 20px 0;
}
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
font-family: Arial, sans-serif;
color: #222;
font-size: 1.2em;
font-weight: normal;
margin: 0;
padding: 5px 10px;
background-color: #ddd;
text-shadow: 1px 1px 0 white
}
div.sphinxsidebar h4{
font-size: 1.1em;
}
div.sphinxsidebar h3 a {
color: #444;
}
div.sphinxsidebar p {
color: #888;
padding: 5px 20px;
}
div.sphinxsidebar p.topless {
}
div.sphinxsidebar ul {
margin: 10px 20px;
padding: 0;
color: #000;
}
div.sphinxsidebar a {
color: #444;
}
div.sphinxsidebar input {
border: 1px solid #ccc;
font-family: sans-serif;
font-size: 1em;
}
div.sphinxsidebar input[type=text]{
margin-left: 20px;
}
/* -- body styles ----------------------------------------------------------- */
a {
color: #005B81;
text-decoration: none;
}
a:hover {
color: #E32E00;
text-decoration: underline;
}
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: Arial, sans-serif;
font-weight: normal;
color: #212224;
margin: 30px 0px 10px 0px;
padding: 5px 0 5px 10px;
text-shadow: 0px 1px 0 white
}
{% 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 h1 {
border-top: 20px solid white;
margin-top: 0;
font-size: 250%;
text-align: center;
}
div.body h2 { font-size: 150%; background-color: #C8D5E3; }
div.body h3 { font-size: 120%; background-color: #D8DEE3; }
div.body h4 { font-size: 110%; background-color: #D8DEE3; }
div.body h5 { font-size: 100%; background-color: #D8DEE3; }
div.body h6 { font-size: 100%; background-color: #D8DEE3; }
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
div.body p, div.body dd, div.body li {
line-height: 1.5em;
}
div.admonition p.admonition-title + p {
display: inline;
}
div.highlight{
background-color: #111;
}
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 {
padding: 10px;
background-color: #111;
color: #fff;
line-height: 1.2em;
border: 1px solid #C6C9CB;
font-size: 1.1em;
margin: 1.5em 0 1.5em 0;
-webkit-box-shadow: 1px 1px 1px #d8d8d8;
-moz-box-shadow: 1px 1px 1px #d8d8d8;
}
tt {
background-color: #ecf0f3;
color: #222;
/* padding: 1px 2px; */
font-size: 1.1em;
font-family: monospace;
}
.viewcode-back {
font-family: Arial, sans-serif;
}
div.viewcode-block:target {
background-color: #f4debf;
border-top: 1px solid #ac9;
border-bottom: 1px solid #ac9;
}

View file

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

View file

@ -1,211 +0,0 @@
Release history
###############
Next release
============
- Nothing yet
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,58 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys, os
sys.path.append(os.path.abspath(os.pardir))
from pelican import __version__
# -- General configuration -----------------------------------------------------
templates_path = ['_templates']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.ifconfig', 'sphinx.ext.extlinks']
source_suffix = '.rst'
master_doc = 'index'
project = 'Pelican'
copyright = '2010, Alexis Metaireau and contributors'
exclude_patterns = ['_build']
release = __version__
version = '.'.join(release.split('.')[:1])
last_stable = '3.2.2'
rst_prolog = '''
.. |last_stable| replace:: :pelican-doc:`{0}`
'''.format(last_stable)
extlinks = {
'pelican-doc': ('http://docs.getpelican.com/%s/', '')
}
# -- Options for HTML output ---------------------------------------------------
html_theme_path = ['_themes']
html_theme = 'pelican'
html_theme_options = {
'nosidebar': True,
'index_logo': 'pelican.png',
'github_fork': 'getpelican/pelican',
}
html_static_path = ['_static']
# Output file base name for HTML help builder.
htmlhelp_basename = 'Pelicandoc'
# -- Options for LaTeX output --------------------------------------------------
latex_documents = [
('index', 'Pelican.tex', 'Pelican Documentation',
'Alexis Métaireau', 'manual'),
]
# -- Options for manual page output --------------------------------------------
man_pages = [
('index', 'pelican', 'pelican documentation',
['Alexis Métaireau'], 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)
]

View file

@ -1,145 +0,0 @@
How to contribute
#################
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 a pull request on GitHub. When doing
so, please adhere to the following guidelines.
.. include:: ../CONTRIBUTING.rst
Setting up the development environment
======================================
While there are many ways to set up one's development environment, following
is a method that uses `virtualenv <http://www.virtualenv.org/>`_. If you don't
have ``virtualenv`` installed, you can install it via::
$ pip install virtualenv
Virtual environments allow you to work on Python projects which are isolated
from one another so you can use different packages (and package versions) with
different projects.
To create and activate a virtual environment, use the following syntax::
$ virtualenv ~/virtualenvs/pelican
$ cd ~/virtualenvs/pelican
$ . bin/activate
To clone the Pelican source::
$ git clone https://github.com/getpelican/pelican.git src/pelican
To install the development dependencies::
$ cd src/pelican
$ pip install -r dev_requirements.txt
To install Pelican and its dependencies::
$ python setup.py develop
Or using ``pip``::
$ pip install -e .
Coding standards
================
Try to respect what is described in the `PEP8 specification
<http://www.python.org/dev/peps/pep-0008/>`_ when making contributions. This
can be eased via the `pep8 <http://pypi.python.org/pypi/pep8>`_ or `flake8
<http://pypi.python.org/pypi/flake8/>`_ tools, the latter of which in
particular will give you some useful hints about ways in which the
code/formatting can be improved.
Building the docs
=================
If you make changes to the documentation, you should preview your changes
before committing them::
$ pip install sphinx
$ cd src/pelican/docs
$ make html
Open ``_build/html/index.html`` in your browser to preview the documentation.
Running the test suite
======================
Each time you add a feature, there are two things to do regarding tests:
check that the existing tests pass, and add tests for the new feature
or bugfix.
The tests live in ``pelican/tests`` and you can run them using the
"discover" feature of ``unittest``::
$ python -m unittest discover
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, you can use the following two commands::
$ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \
-s samples/pelican.conf.py samples/content/
$ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \
samples/content/
Testing on Python 2 and 3
-------------------------
Testing on Python 3 currently requires some extra steps: installing
Python 3-compatible versions of dependent packages and plugins.
Tox_ is a useful tool to run tests on both versions. It will install the
Python 3-compatible version of dependent packages.
.. _Tox: http://testrun.org/tox/latest/
Python 3 development tips
=========================
Here are some tips that may be useful when doing some code for both Python 2.7
and Python 3 at the same time:
- Assume every string and literal is unicode (import unicode_literals):
- Do not use prefix ``u'``.
- Do not encode/decode strings in the middle of sth. Follow the code to the
source (or target) of a string and encode/decode at the first/last possible
point.
- In other words, write your functions to expect and to return unicode.
- Encode/decode strings if e.g. the source is a Python function that is known
to handle this badly, e.g. strftime() in Python 2.
- Use new syntax: print function, "except ... *as* e" (not comma) etc.
- Refactor method calls like ``dict.iteritems()``, ``xrange()`` etc. in a way
that runs without code change in both Python versions.
- Do not use magic method ``__unicode()__`` in new classes. Use only ``__str()__``
and decorate the class with ``@python_2_unicode_compatible``.
- Do not start int literals with a zero. This is a syntax error in Py3k.
- Unfortunately I did not find an octal notation that is valid in both
Pythons. Use decimal instead.
- use six, e.g.:
- ``isinstance(.., basestring) -> isinstance(.., six.string_types)``
- ``isinstance(.., unicode) -> isinstance(.., six.text_type)``
- ``setlocale()`` in Python 2 bails when we give the locale name as unicode,
and since we are using ``from __future__ import unicode_literals``, we do
that everywhere! As a workaround, I enclosed the localename with ``str()``;
in Python 2 this casts the name to a byte string, in Python 3 this should do
nothing, because the locale name already had been unicode.
- Kept range() almost everywhere as-is (2to3 suggests list(range())), just
changed it where I felt necessary.
- Changed xrange() back to range(), so it is valid in both Python versions.

View file

@ -1,206 +0,0 @@
Frequently Asked Questions (FAQ)
################################
Here are some frequently asked questions about Pelican.
What's the best way to communicate a problem, question, or suggestion?
======================================================================
If you have a problem, question, or suggestion, please start by striking up a
conversation on `#pelican on Freenode <irc://irc.freenode.net/pelican>`_.
Those who don't have an IRC client handy can jump in immediately via
`IRC webchat <http://webchat.freenode.net/?channels=pelican&uio=d4>`_. Because
of differing time zones, you may not get an immediate response to your
question, but please be patient and stay logged into IRC — someone will almost
always respond if you wait long enough (it may take a few hours).
If you're unable to resolve your issue or if you have a feature request, please
refer to the `issue tracker <https://github.com/getpelican/pelican/issues>`_.
How can I help?
================
There are several ways to help out. First, you can report any Pelican
suggestions or problems you might have via IRC or the `issue tracker
<https://github.com/getpelican/pelican/issues>`_. If submitting an issue
report, please first check the existing issue list (both open and closed) in
order to avoid submitting a duplicate issue.
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 it mandatory to have a configuration file?
=============================================
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.
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 <http://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`.
I want to use Markdown, but I got an error.
===========================================
Markdown is not a hard dependency for Pelican, so you will need to explicitly
install it. You can do so by typing the following command, prepending ``sudo``
if permissions require it::
pip install markdown
If you don't have ``pip`` installed, consider installing it via::
easy_install pip
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 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``).
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 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!
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
Please note that ``None`` and ``''`` are not the same thing. The word ``None``
should not be surrounded by quotes.
I'm getting a warning about feeds generated without SITEURL being set properly
==============================================================================
`RSS and Atom feeds require all URL links to be absolute
<http://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.
My feeds are broken since I upgraded to Pelican 3.x
===================================================
Starting in 3.0, some of the FEED setting names were changed to more explicitly
refer to the Atom feeds they inherently represent (much like the FEED_RSS
setting names). Here is an exact list of the renamed settings::
FEED -> FEED_ATOM
TAG_FEED -> TAG_FEED_ATOM
CATEGORY_FEED -> CATEGORY_FEED_ATOM
Starting in 3.1, the new feed ``FEED_ALL_ATOM`` has been introduced: this
feed will aggregate all posts regardless of their language. This setting
generates ``'feeds/all.atom.xml'`` by default and ``FEED_ATOM`` now defaults to
``None``. The following feed setting has also been renamed::
TRANSLATION_FEED -> TRANSLATION_FEED_ATOM
Older themes that referenced the old setting names may not link properly.
In order to rectify this, please update your theme for compatibility by changing
the relevant values in your template files. For an example of complete feed
headers and usage please check out the ``simple`` theme.
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 = ''

View file

@ -1,20 +0,0 @@
Trucs et astuces pour Pelican
#############################
Personnaliser l'url d'un article pour Pelican
=============================================
Par défaut, quand vous créez un article ayant pour titre *Mon article pour Pelican*,
l'url par défaut devient *mon-article-pour-pelican.html*. Cependant, il est possible
de modifier cela en utilisant la technique utilisée pour les traductions d'article,
c'est à dire le paramètre *:slug:* ::
Mon article pour Pelican
########################
:date: 2011-01-31 11:05
:slug: super-article-pour-pelican
bla, bla, bla …
En prenant cet exemple ci dessus, votre url deviendra *super-article-pour-pelican.html*

View file

@ -1,58 +0,0 @@
Les bases de Pelican
####################
Créer son premier article
=========================
Pour créer notre premier article, nous allons éditer un fichier, par exemple premier_article.rst ::
Premier article pour Pelican
############################
:author: Guillaume
:date: 2011-01-08 10:20
:category: GNU-Linux
:tags: tutoriel, git
Ceci est un tutoriel pour configurer git.
Bla, bla, bla ....
Maintenant que ce fichier est créé, on va lancer la création du blog ::
pelican .
Vous aller obtenir une sortie comme celle ci — $PATH représente le dossier où vous
avez créé votre article ::
[ok] writing $PATH/output/feeds/all.atom.xml
[ok] writing $PATH/output/feeds/GNU/Linux.atom.xml
[ok] writing $PATH/output/feeds/all-en.atom.xml
[ok] writing $PATH/output/premier-article-pour-pelican.html
[ok] writing $PATH/output/index.html
[ok] writing $PATH/output/tags.html
[ok] writing $PATH/output/categories.html
[ok] writing $PATH/output/archives.html
[ok] writing $PATH/output/tag/tutoriel.html
[ok] writing $PATH/output/tag/git.html
[ok] writing $PATH/output/category/GNU-Linux.html
Première analyse
================
Nous allons décortiquer un peu tout ça ensemble.
* Un dossier output/ a été créé pour y mettre le fichiers xml et html du blog.
* Dans le dossier feeds/, nous retrouvons les différents flux de syndication.
* Le fichier de larticle et la page principale du blog a été généré.
* Le répertoire tag/ propose une page par tag.
* La page correspondant à la catégorie est générée dans le répertoire category/
Si vous ouvrez le fichier index.html — ou un autre — avec votre navigateur, vous
remarquerez que :
* Le thème utilisé par défaut est notmyidea
* Le nom du blog est A Pelican Blog.
Bien évidemment, il y a des paramètres de base que lon peut modifier pour mettre
un peu tout ça à sa sauce. Cest ce que nous allons voir au travers du fichier de configuration.

View file

@ -1,165 +0,0 @@
Fichier de configuration
************************
On va créer un fichier de configuration que lon va appeler **settings.py**. On peut
utiliser Pelican sans faire ce fichier, mais il faudrait à chaque fois passer les paramètres
en ligne de commande. Et comme il va nous servir à faire dautres choses bien utile,
autant lappréhender de suite. Cependant, nous nallons voir que la base pour linstant.
Paramètres de base
==================
AUTHOR :
Désigne lauteur par défaut ;
DEFAULT_CATEGORY :
La catégorie par défaut des articles. Si ce paramètre nest
pas documenté, il prendra la valeur misc — pour miscellaneous (divers en français) ;
SITENAME :
Le nom de votre site ;
OUTPUT_PATH :
Le répertoire de sortie du blog.
Quand je dis quon va faire simple, on fait simple !
Passons donc à ce quoi doit ressembler le fichier de configuration ::
# -*- coding: utf-8 -*-
AUTHOR = "Guillaume"
DEFAULT_CATEGORY = "GNU-Linux"
SITENAME = "Free Culture"
Si vous avez un serveur comme Apache de configuré pour votre machine, vous
pouvez paramétrer le répertoire de sortie vers **/var/www/blog** par exemple ::
OUTPUT_PATH = "/var/www/blog"
Une remarque importante. Si vous avez besoin de passer un caractère accentué, il
faut le préciser que la chaine est en unicode en faisant par exemple
*AUTHOR = u"Guillaume LAMÉ"*
Pour bien vérifier que les paramètres sont bien pris en compte, nous allons enlever les lignes *:author: Guillaume* et *:category: GNU-Linux* de notre fichier
**premier_article.rst** et regénérer le blog.
Rafraichissez votre page, ce devrait être bon.
Nous allons maintenant passer en revue les différents paramètres de Pelican. Je les
ai regroupé par thème. Cependant, cest surtout un listing avant de rentrer dans les
détails au prochain chapitre.
Flux de syndication
===================
CATEGORY_FEED_ATOM :
Chemin décriture des flux Atom liés aux catégories ;
CATEGORY_FEED_RSS :
Idem pour les flux rss (Optionnel);
FEED_ATOM :
Chemin du flux Atom global;
FEED_RSS :
Chemin du flux Rss global (Optionnel);
FEED_ALL_ATOM :
Chemin du flux Atom global qui inclut la totalité des posts, indépendamment de la langue;
FEED_ALL_RSS :
Chemin du flux Rss global qui inclut la totalité des posts, indépendamment de la langue (Optionnel);
TAG_FEED_ATOM :
Chemin des flux Atom pour les tags (Optionnel);
TAG_FEED_RSS :
Chemin des flux Rss pour les tags (Optionnel).
Traductions
===========
DEFAULT_LANG :
Le langage par défaut à utiliser. «*en*» par défaut ;
TRANSLATION_FEED_ATOM :
Chemin du flux Atom pour les traductions.
TRANSLATION_FEED_RSS :
Chemin du flux RSS pour les traductions.
Thèmes
======
CSS_FILE :
Fichier css à utiliser si celui-ci est différent du fichier par défaut (*main.css*) ;
DISPLAY_PAGES_ON_MENU :
Affiche ou non les pages statiques sur le menu du thème ;
DISQUS_SITENAME :
Indiquer le nom du site spécifié sur Disqus ;
GITHUB_URL :
Indiquez votre url Github ;
GOOGLE_ANALYTICS :
'UA-XXXX-YYYY' pour activer Google analytics ;
GOSQUARED_SITENAME :
'XXX-YYYYYY-X' pour activer GoSquared ;
JINJA_EXTENSIONS :
Liste d'extension Jinja2 que vous souhaitez utiliser ;
LINKS :
Une liste de tuples (Titre, url) pour afficher la liste de lien ;
PDF_PROCESSOR :
Génère ou non les articles et pages au format pdf ;
NEWEST_FIRST_ARCHIVES :
Met les articles plus récent en tête de l'archive ;
SOCIAL :
Une liste de tuples (Titre, url) pour afficher la liste de lien dans la section "Social" ;
STATIC_THEME_PATHS :
Répertoire du thème que vous souhaitez importer dans l'arborescence finale ;
THEME :
Thème à utiliser:
TWITTER_USERNAME :
Permet d'afficher un bouton permettant le tweet des articles.
Pelican est fournit avec :doc:`pelican-themes`, un script permettant de gérer les thèmes
Paramètres divers
=================
DEFAULT_DATE:
Date par défaut à utiliser si l'information de date n'est pas spécifiée
dans les metadonnées de l'article.
Si 'fs', Pelican se basera sur le *mtime* du fichier.
Si c'est un tuple, il sera passé au constructeur datetime.datetime pour
générer l'objet datetime utilisé par défaut.
KEEP_OUTPUT DIRECTORY :
Ne génère que les fichiers modifiés et n'efface pas le repertoire de sortie ;
MARKUP :
Langage de balisage à utiliser ;
PATH :
Répertoire à suivre pour les fichiers inclus ;
SITEURL :
URL de base de votre site ;
STATIC_PATHS :
Les chemins statiques que vous voulez avoir accès sur le chemin de sortie "statique" ;

View file

@ -1,18 +0,0 @@
Conventions
###########
Environnement de test
=====================
Les exemples sont basées sur une distribution Debian. Pour les autres distributions,
il y aura des ajustements à faire, notamment pour linstallation de Pelican. Les
noms des paquets peuvent changer.
Conventions typographiques
==========================
Un petit rappel concernant les codes sources.
* $ correspond à une ligne à exécuter en tant quutilisateur courant du systême ;
* # correspond à une ligne à exécuter en tant que root ;
* **settings.py** : Les noms des répertoires et fichiers sont en gras.

View file

@ -1,40 +0,0 @@
Foire aux questions (FAQ)
#########################
Voici un résumé des questions fréquemment posées pour pelican.
Est-il obligatoire d'avoir un fichier de configuration ?
========================================================
Non. Les fichiers de configuration sont juste un moyen facile de configurer
pelican. Pour les opérations de base, il est possible de spécifier des
options
en invoquant pelican avec la ligne de commande (voir pelican --help pour
plus
d'informations à ce sujet)
Je crée mon propre thème, comment utiliser pygments?
====================================================
Pygment ajoute quelques classes au contenu généré, de sorte qua colorisation
de votre thème se fait grâce à un fichier css. Vous pouvez jeter un oeil à
celui proposé par`sur le site du projet <http://pygments.org/demo/15101/>`_
Comment puis-je créer mon propre thèm
=====================================
Vueillez vous référer à :ref:`theming-pelican-fr`.
Comment puis-je aider?
======================
Vous avez plusieurs options pour aider. Tout d'abord, vous pouvez utiliser
le
pélican, et signaler toute idée ou problème que vous avez sur le bugtracker
.
Si vous voulez contribuer, jeter un oeil au dépôt git , ajoutez vos
modifications et faites une demande, je les regarderai dès que possible
Vous pouvez aussi contribuer en créant des thèmes, et/ou compléter la
documentation.

View file

@ -1,57 +0,0 @@
Pelican
#######
Pelican est un generateur de blog simple codé en python
* Écrivez vos articles directement dans votre éditeur favori (vim !) et
directement en syntaxe reStructuredText ou Markdown ;
* Un outil simple en ligne de conmmande pour (re)générer le blog ;
* Sortie complètement statique, facile pour l'héberger n'importe où ;
Fonctionnalités
===============
Pelican supporte actuellement :
* des articles de blog ;
* des pages statiques ;
* les commentaires via un service externe (`disqus <http://disqus.com>`_)
Notez qu'étant bien un service externe assez pratique, vous ne gérez pas
vous même les commentaires. Ce qui pourrait occasionner une perte de vos données;
* support de template (les templates sont crées avec `jinja2 <http://jinjna.pocoo.org>`_) ;
* génération optionnelle de vos pages et articles en pdf.
Pourquoi le nom "Pelican" ?
============================
Vous n'avez pas remarqué ? "Pelican" est un anagramme pour "Calepin" ;)
Code source
===========
Vous pouvez accéder au code source via git à l'adresse
http://github.com/getpelican/pelican/
Feedback !
==========
Si vous voulez de nouvelles fonctionnalitées pour Pelican, n'hésitez pas à nous le dire,
à cloner le dépôt, etc … C'est open source !!!
Contactez Alexis à "alexis at notmyidea dot org" pour quelques requêtes ou retour d'expérience que ce soi !
Documentation
=============
.. toctree::
:maxdepth: 2
conventions
installation
bases
configuration
themes
parametres_article
astuces
faq
pelican-themes

View file

@ -1,67 +0,0 @@
Installation et mise à jour de Pelican
######################################
Installation
============
Il y a deux façons dinstaller Pelican sur son système. La première est via lutilitaire
pip, lautre façon est de télécharger Pelican via Github. Ici nous allons voir les deux
façons de procéder.
Via pip
-------
Pour installer Pelican via pip, vous aurez besoin du paquet python-pip. puis installez Pelican ::
# apt-get install python-pip
# pip install pelican
Via Github
----------
Pour installer Pelican en reprenant le code via Github, nous aurons besoin du paquet
git-core pour récupérez les sources de Pelican. Puis nous procédons à linstallation ::
# apt-get install git-core
$ git clone https://github.com/getpelican/pelican.git
$ cd pelican
# python setup.py install
Mises à jour
============
Via pip
-------
Rien de bien compliqué pour mettre à jour via pip ::
$ cd votreRepertoireSource
$ pip install --upgrade pelican
Via Github
----------
C'est un peu plus long avec Github par contre ::
$ cd votreRepertoireSource
$ git pull origin master
$ cd pelican
# python setup.py install
Vous aurez un message derreur si le module setuptools de python nest pas installé.
La manipulation est la suivante ::
# apt-get install python-setuptools
Alors, quelle méthode choisir ?
===============================
Vous avez le choix entre deux méthodes, mais aussi entre deux concepts. La méthode
de Github est la version de développement, où les modifications arrivent assez
fréquemment sans être testées à fond. La version de pip est une version arrêtée avec un
numéro de version dans laquelle vous aurez moins de bug. Noubliez cependant pas
que le projet est très jeune et manque donc de maturité. Si vous aimez avoir les toutes
dernières versions utilisez Github, sinon penchez vous sur pip.

View file

@ -1,106 +0,0 @@
Les paramètres des articles dans Pelican
########################################
Les catégories
==============
Nous avons vu que pour affecter un article à une catégorie, nous avions le paramètre *:category:*.
Il y a cependant plus simple, affecter un répertoire à une catégorie.
Dans le répertoire ou vous avez vos articles, créez le repertoire **GNU-Linux** et déplacez y le fichier
**premier_article.rst**. Bien évidemment nous ne verront pas la différence, car jusqu'ici *GNU-Linux*
est notre catégorie par défaut.
Nous allons faire un autre exemple d'article avec la catégorie Pelican. Créez le répertoire **Pelican**
et collez cette exemple d'article ::
Préparation de la documentation
###############################
:date: 2011-01-27 15:28
:tags: documentation
Il y a quand même pas mal de boulot pour faire une documentation !
Et lancez la compilation du blog. Vous voyez que la catégorie est affectée automatiquement.
Les tags
========
Pour les tags, il n'y a rien de compliqué. il suffit de mettre le(s) tags séparés si besoin d'une virgule. ::
Préparation de la documentation
###############################
:date: 2011-01-27 15:28
:tags: documentation, pelican
Par contre, par soucis de clarté au niveau des url je vous conseille de mettre les expression de plusieurs
mots séparées par des tirets ::
:tags: mise-a-jour
et non ::
:tags: mise a jour
Les auteurs
===========
Par défaut, vous pouvez indiqué votre nom en tant qu'auteur dans le fichier de configuration.
S'il y a plusieurs auteurs pour le site, vous pouvez le définir manuellement dans
l'article avec la méta-donnée ::
:author: Guillaume
La date
=======
La date se met au format anglophone : **YYYY-MM-DD hh:mm** ::
:date: 2011-01-31 14:12
Les traductions
===============
Pelican permet de générer un blog multilingue assez facilement. Pour cela nous devons :
* Définir la langue de base du blog ;
* Donner une référence à l'article initial ;
* Définir la langue du fichier traduit et y reporter la référence.
Pour définir la langue de base nous allons modifier le fichier **settings.py** et y rajouter la ligne suivante ::
DEFAULT_LANG = "fr"
Puis ajouter la référence dans notre article d'origine qui deviendra ::
Préparation de la documentation
###############################
:date: 2011-01-27 15:28
:tags: documentation
:slug: preparation-de-la-documentation
Il y a quand même pas mal de boulot pour faire une documentation !
Nous n'avons plus qu'à créer l'article en anglais ::
Start of documentation
######################
:slug: preparation-de-la-documention
:lang: en
There are still a lot of work to documentation !
**Il est important de comprendre que la valeur de :slug: deviendra votre url. Ne mettez donc pas un diminutif pour
identifier l'article**
Rien de plus à savoir pour traduire efficacement des articles.
Maintenant que vous avez toutes les clés en main pour créer un article, nous allons passer à la personnalisation
du fichier de configuration.

View file

@ -1,172 +0,0 @@
pelican-themes
##############
Description
===========
``pelican-themes`` est un outil en lignes de commandes pour gérer les thèmes de Pelican.
Utilisation:
""""""""""""
| pelican-themes [-h] [-l] [-i *chemin d'un thème* [*chemin d'un thème* ...]]
| [-r *nom d'un thème* [*nom d'un thème* ...]]
| [-s *chemin d'un thème* [*chemin d'un thème* ...]] [-v] [--version]
Arguments:
""""""""""
-h, --help Afficher l'aide et quitter
-l, --list Montrer les thèmes installés
-i chemin, --install chemin Chemin(s) d'accès d'un ou plusieurs thème à installer
-r nom, --remove nom Noms d'un ou plusieurs thèmes à installer
-s chemin, --symlink chemin Fonctionne de la même façon que l'option ``--install``, mais crée un lien symbolique au lieu d'effectuer une copie du thème vers le répertoire des thèmes.
Utile pour le développement de thèmes.
-v, --verbose Sortie détaillée
--version Affiche la version du script et quitte
Exemples
========
Lister les thèmes installés
"""""""""""""""""""""""""""
``pelican-themes`` peut afficher les thèmes disponibles.
Pour cela, vous pouvez utiliser l'option ``-l`` ou ``--list``, comme ceci:
.. code-block:: console
$ pelican-themes -l
notmyidea
two-column@
simple
$ pelican-themes --list
notmyidea
two-column@
simple
Dans cet exemple, nous voyons qu'il y a trois thèmes d'installés: ``notmyidea``, ``simple`` and ``two-column``.
``two-column`` est suivi d'un ``@`` par ce que c'est un lien symbolique (voir `Créer des liens symboliques`_).
Notez que vous pouvez combiner l'option ``--list`` avec l'option ``--verbose``, pour afficher plus de détails:
.. 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
Installer des thèmes
""""""""""""""""""""
Vous pouvez installer un ou plusieurs thèmes en utilisant l'option ``-i`` ou ``--install``.
Cette option prends en argument le(s) chemin(s) d'accès du ou des thème(s) que vous voulez installer, et peut se combiner avec l'option ``--verbose``:
.. 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
Supprimer des thèmes
""""""""""""""""""""
``pelican-themes`` peut aussi supprimer des thèmes précédemment installés grâce à l'option ``-r`` ou ``--remove``.
Cette option prends en argument le ou les nom(s) des thèmes que vous voulez installer, et peux se combiner avec l'option ``--verbose``:
.. code-block:: console
# pelican-themes --remove two-column
.. code-block:: console
# pelican-themes -r martyachin notmyidea-cmd -v
Créer des liens symboliques
"""""""""""""""""""""""""""
L'option ``-s`` ou ``--symlink`` de ``pelican-themes`` permet de lier symboliquement un thème.
Cette option s'utilise exactement comme l'option ``--install``:
.. code-block:: console
# pelican-themes --symlink ~/Dev/Python/pelican-themes/two-column
Dans l'exemple ci dessus, un lien symbolique pointant vers le thème ``two-column`` a été installé dans le répertoire des thèmes de Pelican, toute modification sur le thème ``two-column`` prendra donc effet immédiatement.
Cela peut être pratique pour le développement de thèmes
.. 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-coumn/static/css/main.css
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ cp /tmp/bg.png ~/Dev/Pelican/pelican-themes/two-coumn/static/img/bg.png
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ vim ~/Dev/Pelican/pelican-themes/two-coumn/templates/index.html
$ pelican ~/Blog/content -o /tmp/out -t two-column
Notez que cette fonctionnalité nécessite d'avoir un système d'exploitation et un système de fichiers supportant les liens symboliques, elle n'est donc pas disponible sous Micro$oft®©™ Fenêtre®©™.
Faire plusieurs choses à la fois
""""""""""""""""""""""""""""""""
Les options ``--install``, ``--remove`` et ``--symlink`` peuvent être employées en même temps, ce qui permets de réaliser plusieurs opérations en même temps:
.. 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
Dans cette exemple, le thème ``notmyidea-cms`` sera remplacé par le thème ``notmyidea-cms-fr`` et le thème ``two-column`` sera lié symboliquement...
À voir également
================
- http://docs.notmyidea.org/alexis/pelican/
- ``/usr/share/doc/pelican/`` si vous avez installé Pelican par le `dépôt APT <http://skami18.github.com/pelican-packages/>`_

View file

@ -1,171 +0,0 @@
.. _theming-pelican:
Cette page est une traduction de la documentation originale, en anglais et
disponible `ici <../themes.html>`_.
Comment créer des thèmes pour Pelican
#####################################
Pelican utlise le très bon moteur de template `jinja2 <http://jinja.pocoo.org>`_
pour produire de l'HTML. La syntaxe de jinja2 est vraiment très simple. Si vous
voulez créer votre propre thème, soyez libre de prendre inspiration sur le theme
"simple" qui est disponible `ici
<https://github.com/getpelican/pelican/tree/master/pelican/themes/simple/templates>`_
Structure
=========
Pour réaliser votre propre thème vous devez respecter la structure suivante ::
├── static
│   ├── css
│   └── images
└── templates
├── archives.html // pour afficher les archives
├── article.html // généré pour chaque article
├── categories.html // doit lister toutes les catégories
├── category.html // généré pour chaque catégorie
├── index.html // la page d'index, affiche tous les articles
├── page.html // généré pour chaque page
├── tag.html // généré pour chaque tag
└── tags.html // doit lister tous les tags. Peut être un nuage de tag.
* `static` contient tout le contenu statique. Il sera copié dans le dossier
`theme/static`. J'ai mis un dossier css et un image, mais ce sont juste des
exemples. Mettez ce dont vous avez besoin ici.
* `templates` contient tous les templates qui vont être utiliser pour générer les
pages. J'ai juste mis les templates obligatoires ici, vous pouvez définir les
vôtres si cela vous aide à vous organiser pendant que vous réaliser le thème.
Vous pouvez par exemple utiliser les directives {% include %} et {% extends %}
de jinja2.
Templates et variables
======================
Cela utilise une syntaxe simple, que vous pouvez insérer dans vos pages HTML.
Ce document décrit les templates qui doivent exister dans un thème, et quelles
variables seront passées à chaque template, au moment de le générer.
Tous les templates recevront les variables définies dans votre fichier de
configuration, si elles sont en capitales. Vous pouvez y accéder directement.
Variables communes
------------------
Toutes ces variables seront passées à chaque template.
============= ===================================================
Variable Description
============= ===================================================
articles C'est la liste des articles, ordonnée décroissante
par date. Tous les éléments de la liste sont des
objets `Article`, vous pouvez donc accéder à leurs
propriétés (exemple : title, summary, author, etc).
dates La même liste d'articles, ordonnée croissante par
date.
tags Un dictionnaire contenant tous les tags (clés), et
la liste des articles correspondants à chacun
d'entre eux (valeur).
categories Un dictionnaire contenant toutes les catégories
(clés), et la liste des articles correspondants à
chacune d'entre elles (valeur).
pages La liste des pages.
============= ===================================================
index.html
----------
La page d'accueil de votre blog, sera générée dans output/index.html.
Si la pagination est activée, les pages suivantes seront à l'adresse
output/index`n`.html.
=================== ===================================================
Variable Description
=================== ===================================================
articles_paginator Un objet paginator de la liste d'articles.
articles_page La page actuelle d'articles.
dates_paginator Un objet paginator de la liste d'articles, ordonné
par date croissante.
dates_pages La page actuelle d'articles, ordonnée par date
croissante.
page_name 'index'.
=================== ===================================================
category.html
-------------
Ce template sera généré pour chaque catégorie existante, et se retrouvera
finalement à output/category/`nom de la catégorie`.html.
Si la pagination est activée, les pages suivantes seront disponibles à
l'adresse output/category/`nom de la catégorie``n`.html.
=================== ===================================================
Variable Description
=================== ===================================================
category La catégorie qui est en train d'être générée.
articles Les articles dans cette catégorie.
dates Les articles dans cette catégorie, ordonnés par
date croissante.
articles_paginator Un objet paginator de la liste d'articles.
articles_page La page actuelle d'articles.
dates_paginator Un objet paginator de la liste d'articles, ordonné
par date croissante.
dates_pages La page actuelle d'articles, ordonnée par date
croissante.
page_name 'category/`nom de la catégorie`'.
=================== ===================================================
article.html
-------------
Ce template sera généré pour chaque article. Les fichiers .html seront
disponibles à output/`nom de l'article`.html.
============= ===================================================
Variable Description
============= ===================================================
article L'objet article à afficher.
category Le nom de la catégorie de l'article actuel.
============= ===================================================
page.html
---------
Pour chaque page ce template sera généré à l'adresse
output/`nom de la page`.html
============= ===================================================
Variable Description
============= ===================================================
page L'objet page à afficher. Vous pouvez accéder à son
titre (title), slug, et son contenu (content).
============= ===================================================
tag.html
--------
Ce template sera généré pour chaque tag. Cela créera des fichiers .html à
l'adresse output/tag/`nom du tag`.html.
Si la pagination est activée, les pages suivantes seront disponibles à
l'adresse output/tag/`nom du tag``n`.html
=================== ===================================================
Variable Description
=================== ===================================================
tag Nom du tag à afficher.
articles Une liste des articles contenant ce tag.
dates Une liste des articles contenant ce tag, ordonnée
par date croissante.
articles_paginator Un objet paginator de la liste d'articles.
articles_page La page actuelle d'articles.
dates_paginator Un objet paginator de la liste d'articles, ordonné
par date croissante.
dates_pages La page actuelle d'articles, ordonnée par date
croissante.
page_name 'tag/`nom du tag`'.
=================== ===================================================

View file

@ -1,636 +0,0 @@
Getting started
###############
Installing Pelican
==================
Pelican currently runs best on Python 2.7.x; earlier versions of Python are
not supported. There is provisional support for Python 3.3, although there may
be rough edges, particularly with regards to optional 3rd-party components.
You can install Pelican via several different methods. The simplest is via
`pip <http://www.pip-installer.org/>`_::
$ pip install pelican
If you don't have ``pip`` installed, an alternative method is
``easy_install``::
$ easy_install pelican
(Keep in mind that operating systems will often require you to prefix the above
commands 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
$ . bin/activate
Once the virtual environment has been created and activated, Pelican can be
be installed via ``pip install pelican`` as noted above. Alternatively, if
you have the project source, you can install Pelican using the distutils
method::
$ cd path-to-Pelican-source
$ python setup.py 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::
$ pip install -e git+https://github.com/getpelican/pelican.git#egg=pelican
If you plan on using Markdown as a markup format, you'll need to install the
Markdown library as well::
$ pip install Markdown
If you want to use AsciiDoc_ you need to install it from `source
<http://www.methods.co.nz/asciidoc/INSTALL.html>`_ or use your operating
system's package manager.
Basic usage
-----------
Once Pelican is installed, you can use it to convert your Markdown or reST
content into HTML via the ``pelican`` command, specifying the path to your
content and (optionally) the path to your 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.
Pelican has other command-line switches available. Have a look at the help to
see all the options you can use::
$ pelican --help
Continue reading below for more detail, and check out the Pelican wiki's
`Tutorials <https://github.com/getpelican/pelican/wiki/Tutorials>`_ page for
links to community-published tutorials.
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 a simple web server using Python will often provide a more
reliable previewing experience::
cd output && python -m SimpleHTTPServer
Once the ``SimpleHTTPServer`` has been started, you can preview your site at
http://localhost:8000/
Upgrading
---------
If you installed a stable Pelican release via ``pip`` or ``easy_install`` and
wish to upgrade to the latest stable release, you can do so by adding
``--upgrade`` to the relevant command. For pip, that would be::
$ 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.
Dependencies
------------
When Pelican is installed, the following dependent Python packages should be
automatically installed without any action on your part:
* `feedgenerator <http://pypi.python.org/pypi/feedgenerator>`_, to generate the
Atom feeds
* `jinja2 <http://pypi.python.org/pypi/Jinja2>`_, for templating support
* `pygments <http://pypi.python.org/pypi/Pygments>`_, for syntax highlighting
* `docutils <http://pypi.python.org/pypi/docutils>`_, for supporting
reStructuredText as an input format
* `pytz <http://pypi.python.org/pypi/pytz>`_, for timezone definitions
* `blinker <http://pypi.python.org/pypi/blinker>`_, an object-to-object and
broadcast signaling system
* `unidecode <http://pypi.python.org/pypi/Unidecode>`_, for ASCII
transliterations of Unicode text
* `six <http://pypi.python.org/pypi/six>`_, for Python 2 and 3 compatibility
utilities
* `MarkupSafe <http://pypi.python.org/pypi/MarkupSafe>`_, for a markup safe
string implementation
If you want the following optional packages, you will need to install them
manually via ``pip``:
* `markdown <http://pypi.python.org/pypi/Markdown>`_, for supporting Markdown as
an input format
* `typogrify <http://pypi.python.org/pypi/typogrify>`_, for typographical
enhancements
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
Once you finish answering all the questions, your project will consist of the
following hierarchy (except for "pages", which you can optionally add yourself
if you plan to create non-chronological content)::
yourproject/
├── content
│   └── (pages)
├── output
├── develop_server.sh
├── fabfile.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. (See the **Writing content using Pelican** section below
for more information about how to format your content.)
Once you have written some content to generate, you can use the ``pelican``
command to generate your site, which will be placed in the output folder.
Automation tools
================
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
described above pertains to whether you want to automate site generation and
publication. If you answered "yes" to that question, a ``fabfile.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 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.
Fabric
------
The advantage of Fabric_ 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 Fabric, prefixing with
``sudo`` if your environment requires it::
$ pip install Fabric
Take a moment to open the ``fabfile.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::
$ fab 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::
$ fab regenerate
To serve the generated site so it can be previewed in your browser at
http://localhost:8000/::
$ fab serve
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::
$ fab publish
These are just a few of the commands available by default, so feel free to
explore ``fabfile.py`` and see what other commands are available. More
importantly, don't hesitate to customize ``fabfile.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, run::
$ make html
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. Once you are done testing your
changes, you should stop the development server via::
$ ./develop_server.sh stop
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.
Writing content using Pelican
=============================
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).
.. _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
:tags: thats, awesome
:category: yeah
:slug: my-super-post
:author: Alexis Metaireau
:summary: Short version for index and feeds
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 ``Markdown`` package, which can be done via ``pip
install Markdown``. Metadata syntax for Markdown posts should follow this
pattern::
Title: My super title
Date: 2010-12-03 10:20
Category: Python
Tags: pelican, publishing
Slug: my-super-post
Author: Alexis Metaireau
Summary: Short version for index and feeds
This is the content of my super blog post.
Conventions for AsciiDoc_ posts, which should have an ``.asc`` extension, can
be found on the AsciiDoc_ site.
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="category" content="yeah" />
<meta name="author" content="Alexis Métaireau" />
<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 article 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`__.
__ `W3C ISO 8601`_
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 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.
.. _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 posts
and images that may be sitting alongside the current post (instead of having
to determine where those resources will be placed after site generation).
To link to internal content (files in the ``content`` directory), use the
following syntax: ``{filename}path/to/file``::
website/
├── content
│   ├── article1.rst
│   ├── cat/
│   │   └── article2.md
│ └── pages
│      └── about.md
└── pelican.conf.py
In this example, ``article1.rst`` could look like::
The first article
#################
:date: 2012-12-01 10:02
See below intra-site link examples in reStructuredText format.
`a link relative to content root <{filename}/cat/article2.rst>`_
`a link relative to current file <{filename}cat/article2.rst>`_
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 content root]({filename}/article1.md)
[a link relative to current file]({filename}../article1.md)
Embedding non-article or non-page content is slightly different in that the
directories need to be specified in ``pelicanconf.py`` file. The ``images``
directory is configured for this by default but others will need to be added
manually::
content
├── images
│   └── han.jpg
└── misc
   └── image-test.md
And ``image-test.md`` would include::
![Alt Text]({filename}/images/han.jpg)
Any content can be linked in this way. What happens is that the ``images``
directory gets copied to ``output/`` during site generation because Pelican
includes ``images`` in the ``STATIC_PATHS`` setting's list by default. If
you want to have another directory, say ``pdfs``, copied from your content to
your output during site generation, you would need to add the following to
your settings file::
STATIC_PATHS = ['images', 'pdfs']
After the above line has been added, subsequent site generation should copy the
``content/pdfs/`` directory to ``output/pdfs/``.
You can also link to categories or tags, using the ``{tag}tagname`` and
``{category}foobar`` syntax.
For backward compatibility, Pelican also supports bars (``||``) in addition to
curly braces (``{}``). 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.
Importing an existing blog
--------------------------
It is possible to import your blog from Dotclear, WordPress, and RSS feeds 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.
Pelican uses the article's URL "slug" to determine if two or more articles are
translations of one another. 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 is able to provide colorized syntax highlighting for your code blocks.
To do so, you have to use the following conventions inside your content files.
For reStructuredText, use the code-block directive::
.. code-block:: identifier
<indented code block goes here>
For Markdown, include the language identifier just above the code block,
indenting both the identifier and code::
A block of text.
:::identifier
<code goes here>
The specified identifier (e.g. ``python``, ``ruby``) should be one that
appears on the `list of available lexers <http://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.
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 <http://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 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.
.. _virtualenv: http://www.virtualenv.org/
.. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime
.. _Fabric: http://fabfile.org/
.. _AsciiDoc: http://www.methods.co.nz/asciidoc/

View file

@ -1,116 +0,0 @@
.. _import:
=================================
Import from other blog software
=================================
Description
===========
``pelican-import`` is a command-line tool for converting articles from other
software to reStructuredText or Markdown. The supported import formats are:
- WordPress XML export
- Dotclear export
- Posterous API
- Tumblr API
- 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).
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: http://johnmacfarlane.net/pandoc/
.. _Pandoc site: http://johnmacfarlane.net/pandoc/installing.html
Usage
=====
::
pelican-import [-h] [--wpfile] [--dotclear] [--posterous] [--tumblr] [--feed] [-o OUTPUT]
[-m MARKUP] [--dir-cat] [--dir-page] [--strip-raw] [--disable-slugs]
[-e EMAIL] [-p PASSWORD] [-b BLOGNAME]
input|api_token|api_key
Positional arguments
--------------------
input The input file to read
api_token [Posterous only] api_token can be obtained from http://posterous.com/api/
api_key [Tumblr only] api_key can be obtained from http://www.tumblr.com/oauth/apps
Optional arguments
------------------
-h, --help Show this help message and exit
--wpfile WordPress XML export (default: False)
--dotclear Dotclear export (default: False)
--posterous Posterous API (default: False)
--tumblr Tumblr API (default: False)
--feed Feed to parse (default: False)
-o OUTPUT, --output OUTPUT
Output path (default: output)
-m MARKUP, --markup MARKUP
Output markup format (supports rst & markdown)
(default: rst)
--dir-cat Put files in directories with categories name
(default: False)
--dir-page Put files recognised as pages in "pages/" sub-
directory (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 (wordpress import
only) (default: False)
--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)
-e EMAIL, --email=EMAIL
Email used to authenticate Posterous API
-p PASSWORD, --password=PASSWORD
Password used to authenticate Posterous API
-b BLOGNAME, --blogname=BLOGNAME
Blog name used in Tumblr API
Examples
========
For WordPress::
$ pelican-import --wpfile -o ~/output ~/posts.xml
For Dotclear::
$ pelican-import --dotclear -o ~/output ~/backup.txt
for Posterous::
$ pelican-import --posterous -o ~/output --email=<email_address> --password=<password> <api_token>
For Tumblr::
$ pelican-import --tumblr -o ~/output --blogname=<blogname> <api_token>
Tests
=====
To test the module, one can use sample files:
- for WordPress: http://wpcandy.com/made/the-sample-post-collection
- for Dotclear: http://themes.dotaddict.org/files/public/downloads/lorem-backup.txt

View file

@ -1,93 +0,0 @@
Pelican |release|
=================
.. ifconfig:: release.endswith('.dev')
.. warning::
This documentation is for the version of Pelican currently under development.
Were you looking for version |last_stable| documentation?
Pelican is a static site generator, written in Python_.
* Write your content directly with your editor of choice (vim!)
in reStructuredText_, Markdown_, or AsciiDoc_ 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
Features
--------
Pelican |version| currently supports:
* Articles (e.g., blog posts) and pages (e.g., "About", "Projects", "Contact")
* Comments, via an external service (Disqus). (Please note that while
useful, Disqus is an external service, and thus the comment data will be
somewhat outside of your control and potentially subject to data loss.)
* Theming support (themes are created using Jinja2_ templates)
* Publication of articles in multiple languages
* Atom/RSS feeds
* Code syntax highlighting
* Import from WordPress, Dotclear, or RSS feeds
* Integration with external tools: Twitter, Google Analytics, etc. (optional)
Why the name "Pelican"?
-----------------------
"Pelican" is an anagram for *calepin*, which means "notebook" in French. ;)
Source code
-----------
You can access the source code at: https://github.com/getpelican/pelican
Feedback / Contact us
---------------------
If you want to see new features in Pelican, don't hesitate to offer suggestions,
clone the repository, etc. There are many ways to :doc:`contribute<contribute>`.
That's open source, dude!
Send a message to "authors at getpelican dot com" with any requests/feedback.
For a more immediate response, you can also join the team via IRC at
`#pelican on Freenode`_ — if you don't have an IRC client handy, use the
webchat_ for quick feedback. If you ask a question via IRC and don't get an
immediate response, don't leave the channel! It may take a few hours because
of time zone differences, but f you are patient and remain in the channel,
someone will almost always respond to your inquiry.
Documentation
-------------
A French version of the documentation is available at :doc:`fr/index`.
.. toctree::
:maxdepth: 2
getting_started
settings
themes
plugins
internals
pelican-themes
importer
faq
tips
contribute
report
changelog
.. Links
.. _Python: http://www.python.org/
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
.. _Markdown: http://daringfireball.net/projects/markdown/
.. _AsciiDoc: http://www.methods.co.nz/asciidoc/index.html
.. _Jinja2: http://jinja.pocoo.org/
.. _`Pelican documentation`: http://docs.getpelican.com/latest/
.. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html
.. _`#pelican on Freenode`: irc://irc.freenode.net/pelican
.. _webchat: http://webchat.freenode.net/?channels=pelican&uio=d4

View file

@ -1,90 +0,0 @@
Pelican internals
#################
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 take a list of files and process them into some sort of
output. Usually, the input files are reStructuredText, Markdown and AsciiDoc
files, and the output is a blog, but both input and output can be anything you
want.
The logic is separated into different classes and concepts:
* **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 (AsciiDoc, 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``. 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 your own theme. The
syntax is `Jinja2 <http://jinja.pocoo.org/>`_ and is very easy to learn, so
don't hesitate to jump in and build your own theme.
How to implement a new reader?
==============================
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 at the Markdown reader::
class MarkdownReader(BaseReader):
enabled = bool(Markdown)
def read(self, source_path):
"""Parse content and metadata of markdown files"""
text = pelican_open(source_path)
md = Markdown(extensions = ['meta', 'codehilite'])
content = md.convert(text)
metadata = {}
for name, value in md.Meta.items():
name = name.lower()
meta = self.process_metadata(name, value[0])
metadata[name] = meta
return content, metadata
Simple, isn't it?
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.
How to implement a new generator?
=================================
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
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. :) 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.

View file

@ -1,164 +0,0 @@
pelican-themes
##############
Description
===========
``pelican-themes`` is a command line tool for managing themes for Pelican.
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 an 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 prefixed with 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-coumn/static/css/main.css
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ cp /tmp/bg.png ~/Dev/Pelican/pelican-themes/two-coumn/static/img/bg.png
$ pelican ~/Blog/content -o /tmp/out -t two-column
$ vim ~/Dev/Pelican/pelican-themes/two-coumn/templates/index.html
$ pelican ~/Blog/content -o /tmp/out -t two-column
Doing several things at once
""""""""""""""""""""""""""""
The ``--install``, ``--remove`` and ``--symlink`` option 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``
See also
========
- http://docs.notmyidea.org/alexis/pelican/
- ``/usr/share/doc/pelican/`` if you have installed Pelican using the `APT repository <http://skami18.github.com/pelican-packages/>`_

View file

@ -1,193 +0,0 @@
.. _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
==================
To load plugins, you have to specify them in your settings file. There are two
ways to do so. The first method is to specify strings with the path to the
callables::
PLUGINS = ['package.myplugin',]
Alternatively, another method is to import them and add them to the list::
from package import myplugin
PLUGINS = [myplugin,]
If your plugins are not in an importable path, you can specify a ``PLUGIN_PATH``
in the settings. ``PLUGIN_PATH`` can be an absolute path or a path relative to
the settings file::
PLUGIN_PATH = "plugins"
PLUGINS = ["list", "of", "plugins"]
Where to find plugins
=====================
We maintain a separate repository of plugins for people to share and use.
Please visit the `pelican-plugins`_ repository for a list of available plugins.
.. _pelican-plugins: 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 signals are defined 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::
from pelican import signals
def test(sender):
print "%s initialized !!" % sender
def register():
signals.initialized.connect(test)
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
usefull 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__
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_finalized article_generator invoked at the end of ArticlesGenerator.generate_context
get_generators generators invoked in Pelican.get_generator_classes,
can return a Generator, or several
generator in a tuple or in a list.
page_generate_context page_generator, metadata
page_generator_init page_generator invoked in the PagesGenerator.__init__
page_generator_finalized page_generator invoked at the end of PagesGenerator.generate_context
content_object_init content_object invoked at the end of Content.__init__ (see note below)
content_written path, context invoked each time a content file is written.
============================= ============================ ===========================================================================
The list is currently small, so don't hesitate to add signals and make a pull
request if you need them!
.. note::
The signal ``content_object_init`` can send a different type of object as
the argument. If you want to register only one type of object then you will
need to specify the sender when you are connecting to the signal.
::
from pelican import signals
from pelican import contents
def test(sender, instance):
print "%s : %s content initialized !!" % (sender, instance)
def register():
signals.content_object_init.connect(test, sender=contents.Article)
.. 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(generators):
# define a new generator here if you need to
return generators
signals.get_generators.connect(get_generators)

View file

@ -1,121 +0,0 @@
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.

View file

@ -1,682 +0,0 @@
Settings
########
Pelican is configurable thanks to a configuration file you can pass to
the command line::
$ pelican -s path/to/your/settingsfile.py path
Settings are configured in the form of a Python module (a file). You can see an
example by looking at `/samples/pelican.conf.py
<https://github.com/getpelican/pelican/raw/master/samples/pelican.conf.py>`_
All the setting identifiers must be set in all-caps, otherwise they will not be
processed. Setting values that are numbers (5, 20, etc.), booleans (True,
False, None, etc.), dictionaries, or tuples should *not* be enclosed in
quotation marks. All other values (i.e., strings) *must* be enclosed in
quotation marks.
Unless otherwise specified, settings that refer to paths can be either absolute
or relative to the configuration file.
The settings you define in the configuration file will be passed to the
templates, which allows you to use your settings to add site-wide content.
Here is a list of settings for Pelican:
Basic settings
==============
===================================================================== =====================================================================
Setting name (default value) What does it do?
===================================================================== =====================================================================
`AUTHOR` Default author (put your name)
`DATE_FORMATS` (``{}``) If you manage multiple languages, you can set the date formatting
here. See the "Date format and locales" section below for details.
`USE_FOLDER_AS_CATEGORY` (``True``) When you don't specify a category in your post metadata, set this
setting to ``True``, and organize your articles in subfolders, the
subfolder will become the category of your post. If set to ``False``,
``DEFAULT_CATEGORY`` will be used as a fallback.
`DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on.
`DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use.
`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the
template. Templates may or may not honor this
setting.
`DISPLAY_CATEGORIES_ON_MENU` (``True``) Whether to display categories on the menu of the
template. Templates may or not honor this
setting.
`DEFAULT_DATE` (``None``) The default date you want to use.
If ``fs``, Pelican will use the file system
timestamp information (mtime) if it can't get
date information from the metadata.
If set to a tuple object, the default datetime object will instead
be generated by passing the tuple to the
``datetime.datetime`` constructor.
`DEFAULT_METADATA` (``()``) The default metadata you want to use for all articles
and pages.
`FILENAME_METADATA` (``'(?P<date>\d{4}-\d{2}-\d{2}).*'``) The regexp that will be used to extract any metadata
from the filename. All named groups that are matched
will be set in the metadata object.
The default value 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>.*)'``.
See :ref:`path_metadata`.
`PATH_METADATA` (``''``) Like ``FILENAME_METADATA``, but parsed from a page's
full path relative to the content source directory.
See :ref:`path_metadata`.
`EXTRA_PATH_METADATA` (``{}``) Extra metadata dictionaries keyed by relative path.
See :ref:`path_metadata`.
`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory, and **all** of its contents, before
generating new files. This can be useful in preventing older,
unnecessary files from persisting in your output. However, **this is
a destructive setting and should be handled with extreme care.**
`OUTPUT_RETENTION` (``()``) A tuple of filenames that should be retained and not deleted from the
output directory. One use case would be the preservation of version
control data. For example: ``(".hg", ".git", ".bzr")``
`JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use.
`JINJA_FILTERS` (``{}``) A list of custom Jinja2 filters you want to use.
The dictionary should map the filtername to the filter function.
For example: ``{'urlencode': urlencode_filter}``
See `Jinja custom filters documentation`_.
`LOCALE` (''[#]_) Change the locale. A list of locales can be provided
here or a single string representing one locale.
When providing a list, all the locales will be tried
until one works.
`READERS` (``{}``) A dictionary of file extensions / Reader classes for Pelican to
process or ignore. For example, to avoid processing .html files,
set: ``READERS = {'html': None}``. To add a custom reader for the
`foo` extension, set: ``READERS = {'foo': FooReader}``
`IGNORE_FILES` (``['.#*']``) A list of file globbing patterns to match against the
source files to be ignored by the processor. For example,
the default ``['.#*']`` will ignore emacs lock files.
`MD_EXTENSIONS` (``['codehilite(css_class=highlight)','extra']``) A list of the extensions that the Markdown processor
will use. Refer to the Python Markdown documentation's
`Extensions section <http://pythonhosted.org/Markdown/extensions/>`_
for a complete list of supported extensions. (Note that
defining this in your settings file will override and
replace the default values. If your goal is to *add*
to the default values for this setting, you'll need to
include them explicitly and enumerate the full list of
desired Markdown extensions.)
`OUTPUT_PATH` (``'output/'``) Where to output the generated files.
`PATH` (``None``) Path to content directory to be processed by Pelican.
`PAGE_DIR` (``'pages'``) Directory to look at for pages, relative to `PATH`.
`PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages.
`ARTICLE_DIR` (``''``) Directory to look at for articles, relative to `PATH`.
`ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles.
`OUTPUT_SOURCES` (``False``) Set to True if you want to copy the articles and pages in their
original format (e.g. Markdown or reStructuredText) to the
specified ``OUTPUT_PATH``.
`OUTPUT_SOURCES_EXTENSION` (``.text``) Controls the extension that will be used by the SourcesGenerator.
Defaults to ``.text``. If not a valid string the default value
will be used.
`RELATIVE_URLS` (``False``) Defines whether Pelican should use document-relative URLs or
not. Only set this to ``True`` when developing/testing and only
if you fully understand the effect it can have on links/feeds.
`PLUGINS` (``[]``) The list of plugins to load. See :ref:`plugins`.
`SITENAME` (``'A Pelican Blog'``) Your site name
`SITEURL` Base URL of your website. Not defined by default,
so it is best to specify your SITEURL; if you do not, feeds
will not be generated with properly-formed URLs. You should
include ``http://`` and your domain, with no trailing
slash at the end. Example: ``SITEURL = 'http://mydomain.com'``
`TEMPLATE_PAGES` (``None``) A mapping containing template pages that will be rendered with
the blog entries. See :ref:`template_pages`.
`STATIC_PATHS` (``['images']``) The static paths you want to have accessible
on the output path "static". By default,
Pelican will copy the "images" folder to the
output folder.
`TIMEZONE` The timezone used in the date information, to
generate Atom and RSS feeds. See the *Timezone*
section below for more info.
`TYPOGRIFY` (``False``) If set to True, several typographical improvements will be
incorporated into the generated HTML via the `Typogrify
<http://static.mintchaos.com/projects/typogrify/>`_
library, which can be installed via: ``pip install typogrify``
`DIRECT_TEMPLATES` (``('index', 'tags', 'categories', 'archives')``) List of templates that are used directly to render
content. Typically direct templates are used to generate
index pages for collections of content (e.g., tags and
category index pages). If the tag and category collections
are not needed, set ``DIRECT_TEMPLATES = ('index', 'archives')``
`PAGINATED_DIRECT_TEMPLATES` (``('index',)``) Provides the direct templates that should be paginated.
`SUMMARY_MAX_LENGTH` (``50``) When creating a short summary of an article, this will
be the default length (measured in words) of the text created.
This only applies if your content does not otherwise
specify a summary. Setting to ``None`` will cause the summary
to be a copy of the original content.
`EXTRA_TEMPLATES_PATHS` (``[]``) A list of paths you want Jinja2 to search for templates.
Can be used to separate templates from the theme.
Example: projects, resume, profile ...
These templates need to use ``DIRECT_TEMPLATES`` setting.
`ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to AsciiDoc. See the `manpage
<http://www.methods.co.nz/asciidoc/manpage.html>`_
`WITH_FUTURE_DATES` (``True``) If disabled, content with dates in the future will get a
default status of ``draft``.
`INTRASITE_LINK_REGEX` (``'[{|](?P<what>.*?)[|}]'``) Regular expression that is used to parse internal links.
Default syntax of links to internal files, tags, etc., is
to enclose the identifier, say ``filename``, in ``{}`` or ``||``.
Identifier between ``{`` and ``}`` goes into the ``what`` capturing group.
For details see :ref:`ref-linking-to-internal-content`.
`PYGMENTS_RST_OPTIONS` (``[]``) A list of default Pygments settings for your reStructuredText
code blocks. See :ref:`internal_pygments_options` for a list of
supported options.
===================================================================== =====================================================================
.. [#] Default is the system locale.
URL settings
------------
The first thing to understand is that there are currently two supported methods
for URL formation: *relative* and *absolute*. Relative URLs are useful
when testing locally, and absolute URLs are reliable and most useful when
publishing. One method of supporting both is to have one Pelican configuration
file for local development and another for publishing. To see an example of this
type of setup, use the ``pelican-quickstart`` script as described at the top of
the :doc:`Getting Started <getting_started>` page, which will produce two separate
configuration files for local development and publishing, respectively.
You can customize the URLs and locations where files will be saved. The
``*_URL`` and ``*_SAVE_AS`` variables use Python's format strings. These
variables allow you to place your articles in a location such as
``{slug}/index.html`` and link to them as ``{slug}`` for clean URLs. These
settings give you the flexibility to place your articles and pages anywhere you
want.
.. note::
If you specify a ``datetime`` directive, it will be substituted using the
input files' date metadata attribute. If the date is not specified for a
particular file, Pelican will rely on the file's ``mtime`` timestamp.
Check the Python datetime documentation at http://bit.ly/cNcJUC for more
information.
Also, you can use other file metadata attributes as well:
* slug
* date
* lang
* author
* category
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 would save your articles in something like ``/posts/2011/Aug/07/sample-post/index.html``,
and the URL to this would be ``/posts/2011/Aug/07/sample-post/``.
Pelican can optionally create per-year, per-month, and per-day archives of your
posts. These secondary archives are disabled by default but are automatically
enabled if you supply format strings for their respective ``_SAVE_AS`` settings.
Period archives fit intuitively with the hierarchical model of web URLs and can
make it easier for readers to navigate through the posts you've written over time.
Example usage:
* YEAR_ARCHIVE_SAVE_AS = ``'posts/{date:%Y}/index.html'``
* MONTH_ARCHIVE_SAVE_AS = ``'posts/{date:%Y}/{date:%b}/index.html'``
With these settings, Pelican will create an archive of all your posts for the
year at (for instance) ``posts/2011/index.html`` and an archive of all your
posts for the month at ``posts/2011/Aug/index.html``.
.. note::
Period archives work best when the final path segment is ``index.html``.
This way a reader can remove a portion of your URL and automatically
arrive at an appropriate archive of posts, without having to specify
a page name.
==================================================== =====================================================
Setting name (default value) What does it do?
==================================================== =====================================================
`ARTICLE_URL` (``'{slug}.html'``) The URL to refer to an ARTICLE.
`ARTICLE_SAVE_AS` (``'{slug}.html'``) The place where we will save an article.
`ARTICLE_LANG_URL` (``'{slug}-{lang}.html'``) The URL to refer to an ARTICLE which doesn't use the
default language.
`ARTICLE_LANG_SAVE_AS` (``'{slug}-{lang}.html'``) The place where we will save an article which
doesn't use the default language.
`PAGE_URL` (``'pages/{slug}.html'``) The URL we will use to link to a page.
`PAGE_SAVE_AS` (``'pages/{slug}.html'``) The location we will save the page. This value has to be
the same as PAGE_URL or you need to use a rewrite in
your server config.
`PAGE_LANG_URL` (``'pages/{slug}-{lang}.html'``) The URL we will use to link to a page which doesn't
use the default language.
`PAGE_LANG_SAVE_AS` (``'pages/{slug}-{lang}.html'``) The location we will save the page which doesn't
use the default language.
`CATEGORY_URL` (``'category/{slug}.html'``) The URL to use for a category.
`CATEGORY_SAVE_AS` (``'category/{slug}.html'``) The location to save a category.
`TAG_URL` (``'tag/{slug}.html'``) The URL to use for a tag.
`TAG_SAVE_AS` (``'tag/{slug}.html'``) The location to save the tag page.
`TAGS_URL` (``'tags.html'``) The URL to use for the tag list.
`TAGS_SAVE_AS` (``'tags.html'``) The location to save the tag list.
`AUTHOR_URL` (``'author/{slug}.html'``) The URL to use for an author.
`AUTHOR_SAVE_AS` (``'author/{slug}.html'``) The location to save an author.
`AUTHORS_URL` (``'authors.html'``) The URL to use for the author list.
`AUTHORS_SAVE_AS` (``'authors.html'``) The location to save the author list.
`<DIRECT_TEMPLATE_NAME>_SAVE_AS` The location to save content generated from direct
templates. Where <DIRECT_TEMPLATE_NAME> is the
upper case template name.
`ARCHIVES_SAVE_AS` (``'archives.html'``) The location to save the article archives page.
`YEAR_ARCHIVE_SAVE_AS` (False) The location to save per-year archives of your
posts.
`MONTH_ARCHIVE_SAVE_AS` (False) The location to save per-month archives of your
posts.
`DAY_ARCHIVE_SAVE_AS` (False) The location to save per-day archives of your
posts.
`SLUG_SUBSTITUTIONS` (``()``) Substitutions to make prior to stripping out
non-alphanumerics when generating slugs. Specified
as a list of 2-tuples of ``(from, to)`` which are
applied in order.
==================================================== =====================================================
.. note::
If you do not want one or more of the default pages to be created (e.g.,
you are the only author on your site and thus do not need an Authors page),
set the corresponding ``*_SAVE_AS`` setting to ``False`` to prevent the
relevant page from being generated.
Timezone
--------
If no timezone is defined, UTC is assumed. This means that the generated Atom
and RSS feeds will contain incorrect date information if your locale is not UTC.
Pelican issues a warning in case this setting is not defined, as it was not
mandatory in previous versions.
Have a look at `the wikipedia page`_ to get a list of valid timezone values.
.. _the wikipedia page: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Date format and locale
----------------------
If no ``DATE_FORMATS`` are set, Pelican will fall back to
``DEFAULT_DATE_FORMAT``. If you need to maintain multiple languages with
different date formats, you can set the ``DATE_FORMATS`` dictionary using the
language name (``lang`` metadata in your post content) as the key. Regarding
available format codes, see `strftime document of python`_ :
.. parsed-literal::
DATE_FORMATS = {
'en': '%a, %d %b %Y',
'jp': '%Y-%m-%d(%a)',
}
You can set locale to further control date format:
.. parsed-literal::
LOCALE = ('usa', 'jpn', # On Windows
'en_US', 'ja_JP' # On Unix/Linux
)
Also, it is possible to set different locale settings for each language. If you
put (locale, format) tuples in the dict, this will override the ``LOCALE``
setting above:
.. parsed-literal::
# On Unix/Linux
DATE_FORMATS = {
'en': ('en_US','%a, %d %b %Y'),
'jp': ('ja_JP','%Y-%m-%d(%a)'),
}
# On Windows
DATE_FORMATS = {
'en': ('usa','%a, %d %b %Y'),
'jp': ('jpn','%Y-%m-%d(%a)'),
}
This is a list of available `locales on Windows`_ . On Unix/Linux, usually you
can get a list of available locales via the ``locale -a`` command; see manpage
`locale(1)`_ for more information.
.. _strftime document of python: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
.. _locales on Windows: http://msdn.microsoft.com/en-us/library/cdax410z%28VS.71%29.aspx
.. _locale(1): http://linux.die.net/man/1/locale
.. _template_pages:
Template pages
==============
If you want to generate custom pages besides your blog entries, you can point
any Jinja2 template file with a path pointing to the file and the destination
path for the generated file.
For instance, if you have a blog with three static pages — a list of books,
your resume, and a contact page — you could have::
TEMPLATE_PAGES = {'src/books.html': 'dest/books.html',
'src/resume.html': 'dest/resume.html',
'src/contact.html': 'dest/contact.html'}
.. _path_metadata:
Path metadata
=============
Not all metadata needs to be `embedded in source file itself`__. For
example, blog posts are often named following a ``YYYY-MM-DD-SLUG.rst``
pattern, or nested into ``YYYY/MM/DD-SLUG`` directories. To extract
metadata from the filename or path, set ``FILENAME_METADATA`` or
``PATH_METADATA`` to regular expressions that use Python's `group name
notation`_ ``(?P<name>…)``. If you want to attach additional metadata
but don't want to encode it in the path, you can set
``EXTRA_PATH_METADATA``:
.. parsed-literal::
EXTRA_PATH_METADATA = {
'relative/path/to/file-1': {
'key-1a': 'value-1a',
'key-1b': 'value-1b',
},
'relative/path/to/file-2': {
'key-2': 'value-2',
},
}
This can be a convenient way to shift the installed location of a
particular file:
.. parsed-literal::
# Take advantage of the following defaults
# STATIC_SAVE_AS = '{path}'
# STATIC_URL = '{path}'
STATIC_PATHS = [
'extra/robots.txt',
]
EXTRA_PATH_METADATA = {
'extra/robots.txt': {'path': 'robots.txt'},
}
__ internal_metadata__
.. _group name notation:
http://docs.python.org/3/library/re.html#regular-expression-syntax
Feed settings
=============
By default, Pelican uses Atom feeds. However, it is also possible to use RSS
feeds if you prefer.
Pelican generates category feeds as well as feeds for all your articles. It does
not generate feeds for tags by default, but it is possible to do so using
the ``TAG_FEED_ATOM`` and ``TAG_FEED_RSS`` settings:
================================================ =====================================================
Setting name (default value) What does it do?
================================================ =====================================================
`FEED_DOMAIN` (``None``, i.e. base URL is "/") The domain prepended to feed URLs. Since feed URLs
should always be absolute, it is highly recommended
to define this (e.g., "http://feeds.example.com"). If
you have already explicitly defined SITEURL (see
above) and want to use the same domain for your
feeds, you can just set: ``FEED_DOMAIN = SITEURL``.
`FEED_ATOM` (``None``, i.e. no Atom feed) Relative URL to output the Atom feed.
`FEED_RSS` (``None``, i.e. no RSS) Relative URL to output the RSS feed.
`FEED_ALL_ATOM` (``'feeds/all.atom.xml'``) Relative URL to output the all posts Atom feed:
this feed will contain all posts regardless of their
language.
`FEED_ALL_RSS` (``None``, i.e. no all RSS) Relative URL to output the all posts RSS feed:
this feed will contain all posts regardless of their
language.
`CATEGORY_FEED_ATOM` ('feeds/%s.atom.xml'[2]_) Where to put the category Atom feeds.
`CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the category RSS feeds.
`TAG_FEED_ATOM` (``None``, i.e. no tag feed) Relative URL to output the tag Atom feed. It should
be defined using a "%s" match in the tag name.
`TAG_FEED_RSS` (``None``, ie no RSS tag feed) Relative URL to output the tag RSS feed
`FEED_MAX_ITEMS` Maximum number of items allowed in a feed. Feed item
quantity is unrestricted by default.
================================================ =====================================================
If you don't want to generate some or any of these feeds, set the above variables to ``None``.
.. [2] %s is the name of the category.
FeedBurner
----------
If you want to use FeedBurner for your feed, you will likely need to decide
upon a unique identifier. For example, if your site were called "Thyme" and
hosted on the www.example.com domain, you might use "thymefeeds" as your
unique identifier, which we'll use throughout this section for illustrative
purposes. In your Pelican settings, set the `FEED_ATOM` attribute to
"thymefeeds/main.xml" to create an Atom feed with an original address of
`http://www.example.com/thymefeeds/main.xml`. Set the `FEED_DOMAIN` attribute
to `http://feeds.feedburner.com`, or `http://feeds.example.com` if you are
using a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature).
There are two fields to configure in the `FeedBurner
<http://feedburner.google.com>`_ interface: "Original Feed" and "Feed
Address". In this example, the "Original Feed" would be
`http://www.example.com/thymefeeds/main.xml` and the "Feed Address" suffix
would be `thymefeeds/main.xml`.
Pagination
==========
The default behaviour of Pelican is to list all the article titles along
with a short description on the index page. While this works well for
small-to-medium sites, sites with a large quantity of articles will probably
benefit from paginating this list.
You can use the following settings to configure the pagination.
================================================ =====================================================
Setting name (default value) What does it do?
================================================ =====================================================
`DEFAULT_ORPHANS` (``0``) The minimum number of articles allowed on the
last page. Use this when you don't want the last page
to only contain a handful of articles.
`DEFAULT_PAGINATION` (``False``) The maximum number of articles to include on a
page, not including orphans. False to disable
pagination.
`PAGINATION_PATTERNS` A set of patterns that are used to determine advanced
pagination output.
================================================ =====================================================
Using Pagination Patterns
-------------------------
The ``PAGINATION_PATTERNS`` setting can be used to configure where
subsequent pages are created. The setting is a sequence of three
element tuples, where each tuple consists of::
(minimum page, URL setting, SAVE_AS setting,)
For example, if you wanted the first page to just be ``/``, and the
second (and subsequent) pages to be ``/page/2/``, you would set
``PAGINATION_PATTERNS`` as follows::
PAGINATION_PATTERNS = (
(1, '{base_name}/', '{base_name}/index.html'),
(2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'),
)
This would cause the first page to be written to
``{base_name}/index.html``, and subsequent ones would be written into
``page/{number}`` directories.
Tag cloud
=========
If you want to generate a tag cloud with all your tags, you can do so using the
following settings.
================================================ =====================================================
Setting name (default value) What does it do?
================================================ =====================================================
`TAG_CLOUD_STEPS` (``4``) Count of different font sizes in the tag
cloud.
`TAG_CLOUD_MAX_ITEMS` (``100``) Maximum number of tags in the cloud.
================================================ =====================================================
The default theme does not include a tag cloud, but it is pretty easy to add one::
<ul class="tagcloud">
{% for tag in tag_cloud %}
<li class="tag-{{ tag.1 }}"><a href="{{ SITEURL }}/{{ tag.0.url }}">{{ tag.0 }}</a></li>
{% endfor %}
</ul>
You should then also define CSS styles with appropriate classes (tag-0 to tag-N,
where N matches ``TAG_CLOUD_STEPS`` -1), tag-0 being the most frequent, and
define a ``ul.tagcloud`` class with appropriate list-style to create the cloud.
For example::
ul.tagcloud {
list-style: none;
padding: 0;
}
ul.tagcloud li {
display: inline-block;
}
li.tag-0 {
font-size: 150%;
}
li.tag-1 {
font-size: 120%;
}
...
Translations
============
Pelican offers a way to translate articles. See the :doc:`Getting Started <getting_started>` section for
more information.
===================================================== =====================================================
Setting name (default value) What does it do?
===================================================== =====================================================
`DEFAULT_LANG` (``'en'``) The default language to use.
`TRANSLATION_FEED_ATOM` ('feeds/all-%s.atom.xml'[3]_) Where to put the Atom feed for translations.
`TRANSLATION_FEED_RSS` (``None``, i.e. no RSS) Where to put the RSS feed for translations.
===================================================== =====================================================
.. [3] %s is the language
Ordering content
=================
================================================ =====================================================
Setting name (default value) What does it do?
================================================ =====================================================
`NEWEST_FIRST_ARCHIVES` (``True``) Order archives by newest first by date. (False:
orders by date with older articles first.)
`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True: lists by reverse
alphabetical order; default lists alphabetically.)
================================================ =====================================================
Themes
======
Creating Pelican themes is addressed in a dedicated section (see :ref:`theming-pelican`).
However, here are the settings that are related to themes.
================================================ =====================================================
Setting name (default value) What does it do?
================================================ =====================================================
`THEME` Theme to use to produce the output. Can be a relative
or absolute path to a theme folder, or the name of a
default theme or a theme installed via
``pelican-themes`` (see below).
`THEME_STATIC_DIR` (``'theme'``) Destination directory in the output path where
Pelican will place the files collected from
`THEME_STATIC_PATHS`. Default is `theme`.
`THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default
value is `static`, but if your theme has
other static paths, you can put them here. If files
or directories with the same names are included in
the paths defined in this settings, they will be
progressively overwritten.
`CSS_FILE` (``'main.css'``) Specify the CSS file you want to load.
================================================ =====================================================
By default, two themes are available. You can specify them using the `THEME` setting or by passing the
``-t`` option to the ``pelican`` command:
* notmyidea
* simple (a synonym for "plain text" :)
There are a number of other themes available at http://github.com/getpelican/pelican-themes.
Pelican comes with :doc:`pelican-themes`, a small script for managing themes.
You can define your own theme, either by starting from scratch or by duplicating
and modifying a pre-existing theme. Here is :doc:`a guide on how to create your theme <themes>`.
Following are example ways to specify your preferred theme::
# Specify name of a built-in theme
THEME = "notmyidea"
# Specify name of a theme installed via the pelican-themes tool
THEME = "chunk"
# Specify a customized theme, via path relative to the settings file
THEME = "themes/mycustomtheme"
# Specify a customized theme, via absolute path
THEME = "~/projects/mysite/themes/mycustomtheme"
The built-in ``notmyidea`` theme can make good use of the following settings. Feel
free to use them in your themes as well.
======================= =======================================================
Setting name What does it do ?
======================= =======================================================
`SITESUBTITLE` A subtitle to appear in the header.
`DISQUS_SITENAME` Pelican can handle Disqus comments. Specify the
Disqus sitename identifier here.
`GITHUB_URL` Your GitHub URL (if you have one). It will then
use this information to create a GitHub ribbon.
`GOOGLE_ANALYTICS` 'UA-XXXX-YYYY' to activate Google Analytics.
`GOSQUARED_SITENAME` 'XXX-YYYYYY-X' to activate GoSquared.
`MENUITEMS` A list of tuples (Title, URL) for additional menu
items to appear at the beginning of the main menu.
`PIWIK_URL` URL to your Piwik server - without 'http://' at the
beginning.
`PIWIK_SSL_URL` If the SSL-URL differs from the normal Piwik-URL
you have to include this setting too. (optional)
`PIWIK_SITE_ID` ID for the monitored website. You can find the ID
in the Piwik admin interface > settings > websites.
`LINKS` A list of tuples (Title, URL) for links to appear on
the header.
`SOCIAL` A list of tuples (Title, URL) to appear in the
"social" section.
`TWITTER_USERNAME` Allows for adding a button to articles to encourage
others to tweet about them. Add your Twitter username
if you want this button to appear.
======================= =======================================================
In addition, you can use the "wide" version of the ``notmyidea`` theme by
adding the following to your configuration::
CSS_FILE = "wide.css"
Example settings
================
.. literalinclude:: ../samples/pelican.conf.py
:language: python
.. _Jinja custom filters documentation: http://jinja.pocoo.org/docs/api/#custom-filters

View file

@ -1,346 +0,0 @@
.. _theming-pelican:
How to create themes for Pelican
################################
Pelican uses the great `Jinja2 <http://jinja.pocoo.org/>`_ templating engine to
generate its HTML output. Jinja2 syntax is really simple. If you want to
create your own theme, feel free to take inspiration from the `"simple" theme
<https://github.com/getpelican/pelican/tree/master/pelican/themes/simple/templates>`_.
Structure
=========
To make your own theme, you must follow the following structure::
├── static
│   ├── css
│   └── images
└── templates
├── archives.html // to display archives
├── period_archives.html // to display time-period 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
├── tag.html // processed for each tag
└── tags.html // must list all the tags. Can be a tag cloud.
* `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.
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 and variables
=======================
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, as long
as they are in all-caps. You can access them directly.
Common variables
----------------
All of these settings will be available to all templates.
============= ===================================================
Variable Description
============= ===================================================
output_file The name of the file currently being generated. For
instance, when Pelican is rendering the homepage,
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.
tags A list of (tag, articles) tuples, containing all
the tags.
categories A list of (category, articles) tuples, containing
all the categories and corresponding articles (values)
pages The list of 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.
__ http://jinja.pocoo.org/docs/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: http://docs.python.org/2/library/datetime.html#datetime-objects
.. _strftime: http://docs.python.org/2/library/datetime.html#strftime-strptime-behavior
index.html
----------
This is the home page of your blog, generated at output/index.html.
If pagination is active, subsequent pages will reside in output/index`n`.html.
=================== ===================================================
Variable Description
=================== ===================================================
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
dates_paginator A paginator object for the article list, ordered by
date, ascending.
dates_page The current page of articles, ordered by date,
ascending.
page_name 'index' -- useful for pagination links
=================== ===================================================
author.html
-------------
This template will be processed for each of the existing authors, with
output generated at output/author/`author_name`.html.
If pagination is active, subsequent pages will reside as defined by setting
AUTHOR_SAVE_AS (`Default:` output/author/`author_name'n'`.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
dates_paginator A paginator object for the article list, ordered by
date, ascending.
dates_page The current page of articles, ordered by date,
ascending.
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, with
output generated at output/category/`category_name`.html.
If pagination is active, subsequent pages will reside as defined by setting
CATEGORY_SAVE_AS (`Default:` output/category/`category_name'n'`.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
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
page_name CATEGORY_URL where everything after `{slug}` is
removed -- useful for pagination links
=================== ===================================================
article.html
-------------
This template will be processed for each article, with .html files saved
as output/`article_name`.html. Here are the specific variables it gets.
============= ===================================================
Variable Description
============= ===================================================
article The article object to be displayed
category The name of the category for the current article
============= ===================================================
page.html
---------
This template will be processed for each page, with corresponding .html files
saved as output/`page_name`.html.
============= ===================================================
Variable Description
============= ===================================================
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 corresponding .html files
saved as output/tag/`tag_name`.html.
If pagination is active, subsequent pages will reside as defined in setting
TAG_SAVE_AS (`Default:` output/tag/`tag_name'n'`.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
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
page_name TAG_URL where everything after `{slug}` is removed
-- useful for pagination links
=================== ===================================================
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::
FEED_ATOM
FEED_RSS
FEED_ALL_ATOM
FEED_ALL_RSS
CATEGORY_FEED_ATOM
CATEGORY_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`` themes 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>`.

View file

@ -1,96 +0,0 @@
Tips
####
Here are some tips about Pelican that you might find useful.
Publishing to GitHub
====================
`GitHub Pages <https://help.github.com/categories/20/articles>`_ offer an easy
and convenient way to publish Pelican sites. There are `two types of GitHub
Pages <https://help.github.com/articles/user-organization-and-project-pages>`_:
*Project Pages* and *User Pages*. Pelican sites can be published as both
Project Pages and User Pages.
Project Pages
-------------
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 ``easy_install`` or ``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
$ 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 created by the ``pelican-quickstart``
command publishes the Pelican site as Project Pages, as described above.
User Pages
----------
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.
Again, you can take advantage of ``ghp-import``::
$ pelican content -o output -s pelicanconf.py
$ ghp-import output
$ git push git@github.com:elemoine/elemoine.github.io.git gh-pages:master
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.
.. note::
To publish your Pelican site as User Pages, feel free to adjust the
``github`` target of the Makefile.
Extra Tips
----------
Tip #1:
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
Tip #2:
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/extras/`` 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'},}
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.

1556
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

6
package.json Normal file
View file

@ -0,0 +1,6 @@
{
"devDependencies": {
"@tailwindcss/typography": "^0.5.15",
"tailwindcss": "^3.4.17"
}
}

View file

@ -1,387 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
import os
import re
import sys
import time
import logging
import argparse
import locale
import collections
from pelican import signals
from pelican.generators import (ArticlesGenerator, PagesGenerator,
StaticGenerator, SourceFileGenerator,
TemplatePagesGenerator)
from pelican.log import init
from pelican.readers import Readers
from pelican.settings import read_settings
from pelican.utils import clean_output_dir, folder_watcher, file_watcher
from pelican.writers import Writer
__version__ = "3.3.1.dev"
DEFAULT_CONFIG_NAME = 'pelicanconf.py'
logger = logging.getLogger(__name__)
class Pelican(object):
def __init__(self, settings):
"""
Pelican initialisation, performs some checks on the environment before
doing anything else.
"""
# define the default settings
self.settings = settings
self._handle_deprecation()
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 = []
logger.debug('Temporarily adding PLUGIN_PATH to system path')
_sys_path = sys.path[:]
sys.path.insert(0, self.settings['PLUGIN_PATH'])
for plugin in self.settings['PLUGINS']:
# if it's a string, then import it
if isinstance(plugin, six.string_types):
logger.debug("Loading plugin `{0}`".format(plugin))
try:
plugin = __import__(plugin, globals(), locals(), str('module'))
except ImportError as e:
logger.error("Can't find plugin `{0}`: {1}".format(plugin, e))
continue
logger.debug("Registering plugin `{0}`".format(plugin.__name__))
plugin.register()
self.plugins.append(plugin)
logger.debug('Restoring system path')
sys.path = _sys_path
def _handle_deprecation(self):
if self.settings.get('CLEAN_URLS', False):
logger.warning('Found deprecated `CLEAN_URLS` in settings.'
' Modifying the following settings for the'
' same behaviour.')
self.settings['ARTICLE_URL'] = '{slug}/'
self.settings['ARTICLE_LANG_URL'] = '{slug}-{lang}/'
self.settings['PAGE_URL'] = 'pages/{slug}/'
self.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, self.settings[setting]))
if self.settings.get('ARTICLE_PERMALINK_STRUCTURE', False):
logger.warning('Found deprecated `ARTICLE_PERMALINK_STRUCTURE` in'
' settings. Modifying the following settings for'
' the same behaviour.')
structure = self.settings['ARTICLE_PERMALINK_STRUCTURE']
# Convert %(variable) into {variable}.
structure = re.sub('%\((\w+)\)s', '{\g<1>}', structure)
# Convert %x into {date:%x} for strftime
structure = re.sub('(%[A-z])', '{date:\g<1>}', structure)
# Strip a / prefix
structure = re.sub('^/', '', structure)
for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL',
'PAGE_LANG_URL', 'ARTICLE_SAVE_AS',
'ARTICLE_LANG_SAVE_AS', 'PAGE_SAVE_AS',
'PAGE_LANG_SAVE_AS'):
self.settings[setting] = os.path.join(structure,
self.settings[setting])
logger.warning("%s = '%s'" % (setting, self.settings[setting]))
if self.settings.get('FEED', False):
logger.warning('Found deprecated `FEED` in settings. Modify FEED'
' to FEED_ATOM in your settings and theme for the same behavior.'
' Temporarily setting FEED_ATOM for backwards compatibility.')
self.settings['FEED_ATOM'] = self.settings['FEED']
if self.settings.get('TAG_FEED', False):
logger.warning('Found deprecated `TAG_FEED` in settings. Modify '
' TAG_FEED to TAG_FEED_ATOM in your settings and theme for the '
'same behavior. Temporarily setting TAG_FEED_ATOM for backwards '
'compatibility.')
self.settings['TAG_FEED_ATOM'] = self.settings['TAG_FEED']
if self.settings.get('CATEGORY_FEED', False):
logger.warning('Found deprecated `CATEGORY_FEED` in settings. '
'Modify CATEGORY_FEED to CATEGORY_FEED_ATOM in your settings and '
'theme for the same behavior. Temporarily setting '
'CATEGORY_FEED_ATOM for backwards compatibility.')
self.settings['CATEGORY_FEED_ATOM'] =\
self.settings['CATEGORY_FEED']
if self.settings.get('TRANSLATION_FEED', False):
logger.warning('Found deprecated `TRANSLATION_FEED` in settings. '
'Modify TRANSLATION_FEED to TRANSLATION_FEED_ATOM in your '
'settings and theme for the same behavior. Temporarily setting '
'TRANSLATION_FEED_ATOM for backwards compatibility.')
self.settings['TRANSLATION_FEED_ATOM'] =\
self.settings['TRANSLATION_FEED']
def run(self):
"""Run the generators and return"""
start_time = time.time()
context = self.settings.copy()
context['filenames'] = {} # share the dict between all the generators
context['localsiteurl'] = self.settings['SITEURL'] # share
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()
]
# erase the directory if it is not the source and if that's
# explicitely asked
if (self.delete_outputdir and not
os.path.realpath(self.path).startswith(self.output_path)):
clean_output_dir(self.output_path, self.output_retention)
for p in generators:
if hasattr(p, 'generate_context'):
p.generate_context()
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))
print('Done: Processed {} articles and {} pages in {:.2f} seconds.'.format(
len(articles_generator.articles) + len(articles_generator.translations),
len(pages_generator.pages) + len(pages_generator.translations),
time.time() - start_time))
def get_generator_classes(self):
generators = [StaticGenerator, ArticlesGenerator, PagesGenerator]
if self.settings['TEMPLATE_PAGES']:
generators.append(TemplatePagesGenerator)
if self.settings['OUTPUT_SOURCES']:
generators.append(SourceFileGenerator)
for pair in signals.get_generators.send(self):
(funct, value) = pair
if not isinstance(value, collections.Iterable):
value = (value, )
for v in value:
if isinstance(v, type):
logger.debug('Found generator: {0}'.format(v))
generators.append(v)
return generators
def get_writer(self):
return Writer(self.output_path, settings=self.settings)
def parse_arguments():
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', nargs='?',
help='Path where to find the content files.',
default=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.')
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 automatically set to '
'{0} if a file exists with this name.'.format(DEFAULT_CONFIG_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 message, 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.")
return parser.parse_args()
def get_config(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
# argparse returns bytes in Py2. There is no definite answer as to which
# encoding argparse (or sys.argv) uses.
# "Best" option seems to be locale.getpreferredencoding()
# ref: http://mail.python.org/pipermail/python-list/2006-October/405766.html
if not six.PY3:
enc = locale.getpreferredencoding()
for key in config:
if key in ('PATH', 'OUTPUT_PATH', 'THEME'):
config[key] = config[key].decode(enc)
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
settings = read_settings(config_file, override=get_config(args))
cls = settings['PELICAN_CLASS']
if isinstance(cls, six.string_types):
module, cls_name = cls.rsplit('.', 1)
module = __import__(module)
cls = getattr(module, cls_name)
return cls(settings), settings
def main():
args = parse_arguments()
init(args.verbosity)
pelican, settings = get_instance(args)
readers = Readers(settings)
watchers = {'content': folder_watcher(pelican.path,
readers.extensions,
pelican.ignore_files),
'theme': folder_watcher(pelican.theme,
[''],
pelican.ignore_files),
'settings': file_watcher(args.settings)}
try:
if args.autoreload:
print(' --- AutoReload Mode: Monitoring `content`, `theme` and'
' `settings` for changes. ---')
while True:
try:
# Check source dir for changed files ending with the given
# extension in the settings. In the theme dir is no such
# restriction; all files are recursively checked if they
# have changed, no matter what extension the filenames
# have.
modified = {k: next(v) for k, v in watchers.items()}
if modified['settings']:
pelican, settings = get_instance(args)
if any(modified.values()):
print('\n-> Modified: {}. re-generating...'.format(
', '.join(k for k, v in modified.items() if v)))
if modified['content'] is None:
logger.warning('No valid files found in content.')
if modified['theme'] is None:
logger.warning('Empty theme folder. Using `basic` theme.')
pelican.run()
except KeyboardInterrupt:
logger.warning("Keyboard interrupt, quitting.")
break
except Exception as e:
if (args.verbosity == logging.DEBUG):
logger.critical(e.args)
raise
logger.warning(
'Caught exception "{0}". Reloading.'.format(e))
finally:
time.sleep(.5) # sleep to avoid cpu load
else:
if next(watchers['content']) is None:
logger.warning('No valid files found in content.')
if next(watchers['theme']) is None:
logger.warning('Empty theme folder. Using `basic` theme.')
pelican.run()
except Exception as e:
# localized systems have errors in native language if locale is set
# so convert the message to unicode with the correct encoding
msg = str(e)
if not six.PY3:
msg = msg.decode(locale.getpreferredencoding())
logger.critical(msg)
if (args.verbosity == logging.DEBUG):
raise
else:
sys.exit(getattr(e, 'exitcode', 1))

View file

@ -1,342 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
import copy
import locale
import logging
import functools
import os
import re
import sys
try:
from urlparse import urlparse, urlunparse
except ImportError:
from urllib.parse import urlparse, urlunparse
from datetime import datetime
from pelican import signals
from pelican.settings import DEFAULT_CONFIG
from pelican.utils import (slugify, truncate_html_words, memoized, strftime,
python_2_unicode_compatible, deprecated_attribute,
path_to_url)
# Import these so that they're avalaible when you import from pelican.contents.
from pelican.urlwrappers import (URLWrapper, Author, Category, Tag) # NOQA
logger = logging.getLogger(__name__)
class Content(object):
"""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.
"""
@deprecated_attribute(old='filename', new='source_path', since=(3, 2, 0))
def filename():
return None
def __init__(self, content, metadata=None, settings=None,
source_path=None, context=None):
if metadata is None:
metadata = {}
if settings is None:
settings = copy.deepcopy(DEFAULT_CONFIG)
self.settings = settings
self._content = content
if context is None:
context = {}
self._context = context
self.translations = []
local_metadata = dict(settings['DEFAULT_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()
# default author to the one in settings if not defined
if not hasattr(self, 'author'):
if 'AUTHOR' in settings:
self.author = Author(settings['AUTHOR'], settings)
# 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, from the title
if not hasattr(self, 'slug') and hasattr(self, 'title'):
self.slug = slugify(self.title,
settings.get('SLUG_SUBSTITUTIONS', ()))
self.source_path = 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]
if sys.version_info < (3, ) and isinstance(locale_string,
six.text_type):
locale_string = locale_string.encode('ascii')
locale.setlocale(locale.LC_ALL, locale_string)
self.date_format = self.date_format[1]
if hasattr(self, 'date'):
self.locale_date = strftime(self.date, self.date_format)
# manage status
if not hasattr(self, 'status'):
self.status = settings['DEFAULT_STATUS']
if not settings['WITH_FUTURE_DATES']:
if hasattr(self, 'date') and self.date > datetime.now():
self.status = 'draft'
# 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):
if self.source_path is None:
return repr(self)
elif six.PY3:
return self.source_path or repr(self)
else:
return str(self.source_path.encode('utf-8', 'replace'))
def check_properties(self):
"""Test mandatory properties are set."""
for prop in self.mandatory_properties:
if not hasattr(self, prop):
raise NameError(prop)
@property
def url_format(self):
"""Returns the URL, formatted with the proper values"""
metadata = copy.copy(self.metadata)
path = self.metadata.get('path', self.get_relative_source_path())
default_category = self.settings['DEFAULT_CATEGORY']
slug_substitutions = self.settings.get('SLUG_SUBSTITUTIONS', ())
metadata.update({
'path': path_to_url(path),
'slug': getattr(self, 'slug', ''),
'lang': getattr(self, 'lang', 'en'),
'date': getattr(self, 'date', datetime.now()),
'author': slugify(
getattr(self, 'author', ''),
slug_substitutions
),
'category': slugify(
getattr(self, 'category', default_category),
slug_substitutions
)
})
return metadata
def _expand_settings(self, key):
fq_key = ('%s_%s' % (self.__class__.__name__, key)).upper()
return self.settings[fq_key].format(**self.url_format)
def get_url_setting(self, key):
if hasattr(self, 'override_' + key):
return getattr(self, 'override_' + key)
key = key if self.in_default_lang else 'lang_%s' % key
return self._expand_settings(key)
def _update_content(self, content, siteurl):
"""Update the content attribute.
Change all the relative paths of the content to relative paths
suitable for the ouput 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
instrasite_link_regex = self.settings['INTRASITE_LINK_REGEX']
regex = r"""
(?P<markup><\s*[^\>]* # match tag with src and href attr
(?:href|src)\s*=)
(?P<quote>["\']) # require value to be quoted
(?P<path>{0}(?P<value>.*?)) # the url value
\2""".format(instrasite_link_regex)
hrefs = re.compile(regex, re.X)
def replacer(m):
what = m.group('what')
value = urlparse(m.group('value'))
path = value.path
origin = m.group('path')
# XXX Put this in a different location.
if what == 'filename':
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)
)
if path in self._context['filenames']:
origin = '/'.join((siteurl,
self._context['filenames'][path].url))
origin = origin.replace('\\', '/') # for Windows paths.
else:
logger.warning("Unable to find {fn}, skipping url"
" replacement".format(fn=path))
elif what == 'category':
origin = Category(path, self.settings).url
elif what == 'tag':
origin = Tag(path, self.settings).url
# 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')))
return hrefs.sub(replacer, content)
@memoized
def get_content(self, siteurl):
if hasattr(self, '_get_content'):
content = self._get_content()
else:
content = self._content
return self._update_content(content, siteurl)
@property
def content(self):
return self.get_content(self._context.get('localsiteurl', ''))
def _get_summary(self):
"""Returns the summary of an article.
This is based on the summary metadata if set, otherwise truncate the
content.
"""
if hasattr(self, '_summary'):
return self._summary
if self.settings['SUMMARY_MAX_LENGTH'] is None:
return self.content
return truncate_html_words(self.content,
self.settings['SUMMARY_MAX_LENGTH'])
def _set_summary(self, summary):
"""Dummy function"""
pass
summary = property(_get_summary, _set_summary, "Summary of the article."
"Based on the content. Can't be set")
url = property(functools.partial(get_url_setting, key='url'))
save_as = property(functools.partial(get_url_setting, key='save_as'))
def _get_template(self):
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=None):
"""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 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):
return os.path.dirname(os.path.relpath(
os.path.abspath(self.source_path),
os.path.abspath(self.settings['PATH']))
)
class Page(Content):
mandatory_properties = ('title',)
default_template = 'page'
class Article(Page):
mandatory_properties = ('title', 'date', 'category')
default_template = 'article'
class Quote(Page):
base_properties = ('author', 'date')
@python_2_unicode_compatible
class Static(Page):
@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
def is_valid_content(content, f):
try:
content.check_properties()
return True
except NameError as e:
logger.error("Skipping %s: could not find information about "
"'%s'" % (f, e))
return False

View file

@ -1,595 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import os
import math
import random
import logging
import shutil
from codecs import open
from collections import defaultdict
from functools import partial
from itertools import chain, groupby
from operator import attrgetter, itemgetter
from jinja2 import (Environment, FileSystemLoader, PrefixLoader, ChoiceLoader,
BaseLoader, TemplateNotFound)
from pelican.contents import Article, Page, Static, is_valid_content
from pelican.readers import Readers
from pelican.utils import copy, process_translations, mkdir_p, DateFormatter
from pelican import signals
logger = logging.getLogger(__name__)
class Generator(object):
"""Baseclass generator"""
def __init__(self, context, settings, path, theme, output_path, **kwargs):
self.context = context
self.settings = settings
self.path = path
self.theme = theme
self.output_path = output_path
for arg, value in kwargs.items():
setattr(self, arg, value)
self.readers = Readers(self.settings)
# templates cache
self._templates = {}
self._templates_path = []
self._templates_path.append(os.path.expanduser(
os.path.join(self.theme, 'templates')))
self._templates_path += self.settings['EXTRA_TEMPLATES_PATHS']
theme_path = os.path.dirname(os.path.abspath(__file__))
simple_loader = FileSystemLoader(os.path.join(theme_path,
"themes", "simple", "templates"))
self.env = Environment(
trim_blocks=True,
lstrip_blocks=True,
loader=ChoiceLoader([
FileSystemLoader(self._templates_path),
simple_loader, # implicit inheritance
PrefixLoader({'!simple': simple_loader}) # explicit one
]),
extensions=self.settings['JINJA_EXTENSIONS'],
)
logger.debug('template list: {0}'.format(self.env.list_templates()))
# provide utils.strftime as a jinja filter
self.env.filters.update({'strftime': DateFormatter()})
# get custom Jinja filters from user settings
custom_filters = self.settings['JINJA_FILTERS']
self.env.filters.update(custom_filters)
signals.generator_init.send(self)
def get_template(self, name):
"""Return the template by name.
Use self.theme to get the templates to use, and return a list of
templates ready to use with Jinja2.
"""
if name not in self._templates:
try:
self._templates[name] = self.env.get_template(name + '.html')
except TemplateNotFound:
raise Exception('[templates] unable to load %s.html from %s'
% (name, self._templates_path))
return self._templates[name]
def _include_path(self, path, extensions=None):
"""Inclusion logic for .get_files(), returns True/False
:param path: the path which might be including
:param extensions: the list of allowed extensions (if False, all
extensions are allowed)
"""
if extensions is None:
extensions = tuple(self.readers.extensions)
basename = os.path.basename(path)
if extensions is False or basename.endswith(extensions):
return True
return False
def get_files(self, path, exclude=[], extensions=None):
"""Return a list of files to use, based on rules
:param path: the path to search (relative to self.path)
:param exclude: the list of path to exclude
:param extensions: the list of allowed extensions (if False, all
extensions are allowed)
"""
files = []
root = os.path.join(self.path, path)
if os.path.isdir(root):
for dirpath, dirs, temp_files in os.walk(root, followlinks=True):
for e in exclude:
if e in dirs:
dirs.remove(e)
reldir = os.path.relpath(dirpath, self.path)
for f in temp_files:
fp = os.path.join(reldir, f)
if self._include_path(fp, extensions):
files.append(fp)
elif os.path.exists(root) and self._include_path(path, extensions):
files.append(path) # can't walk non-directories
return files
def add_source_path(self, content):
location = content.get_relative_source_path()
self.context['filenames'][location] = content
def _update_context(self, items):
"""Update the context with the given items from the currrent
processor.
"""
for item in items:
value = getattr(self, item)
if hasattr(value, 'items'):
value = list(value.items()) # py3k safeguard for iterators
self.context[item] = value
class _FileLoader(BaseLoader):
def __init__(self, path, basedir):
self.path = path
self.fullpath = os.path.join(basedir, path)
def get_source(self, environment, template):
if template != self.path or not os.path.exists(self.fullpath):
raise TemplateNotFound(template)
mtime = os.path.getmtime(self.fullpath)
with open(self.fullpath, 'r', encoding='utf-8') as f:
source = f.read()
return (source, self.fullpath,
lambda: mtime == os.path.getmtime(self.fullpath))
class TemplatePagesGenerator(Generator):
def generate_output(self, writer):
for source, dest in self.settings['TEMPLATE_PAGES'].items():
self.env.loader.loaders.insert(0, _FileLoader(source, self.path))
try:
template = self.env.get_template(source)
rurls = self.settings['RELATIVE_URLS']
writer.write_file(dest, template, self.context, rurls,
override_output=True)
finally:
del self.env.loader.loaders[0]
class ArticlesGenerator(Generator):
"""Generate blog articles"""
def __init__(self, *args, **kwargs):
"""initialize properties"""
self.articles = [] # only articles in default language
self.translations = []
self.dates = {}
self.tags = defaultdict(list)
self.categories = defaultdict(list)
self.related_posts = []
self.authors = defaultdict(list)
self.drafts = []
super(ArticlesGenerator, self).__init__(*args, **kwargs)
signals.article_generator_init.send(self)
def generate_feeds(self, writer):
"""Generate the feeds from the current context, and output files."""
if self.settings.get('FEED_ATOM'):
writer.write_feed(self.articles, self.context,
self.settings['FEED_ATOM'])
if self.settings.get('FEED_RSS'):
writer.write_feed(self.articles, self.context,
self.settings['FEED_RSS'], feed_type='rss')
if (self.settings.get('FEED_ALL_ATOM')
or self.settings.get('FEED_ALL_RSS')):
all_articles = list(self.articles)
for article in self.articles:
all_articles.extend(article.translations)
all_articles.sort(key=attrgetter('date'), reverse=True)
if self.settings.get('FEED_ALL_ATOM'):
writer.write_feed(all_articles, self.context,
self.settings['FEED_ALL_ATOM'])
if self.settings.get('FEED_ALL_RSS'):
writer.write_feed(all_articles, self.context,
self.settings['FEED_ALL_RSS'],
feed_type='rss')
for cat, arts in self.categories:
arts.sort(key=attrgetter('date'), reverse=True)
if self.settings.get('CATEGORY_FEED_ATOM'):
writer.write_feed(arts, self.context,
self.settings['CATEGORY_FEED_ATOM']
% cat.slug)
if self.settings.get('CATEGORY_FEED_RSS'):
writer.write_feed(arts, self.context,
self.settings['CATEGORY_FEED_RSS']
% cat.slug, feed_type='rss')
if (self.settings.get('TAG_FEED_ATOM')
or self.settings.get('TAG_FEED_RSS')):
for tag, arts in self.tags.items():
arts.sort(key=attrgetter('date'), reverse=True)
if self.settings.get('TAG_FEED_ATOM'):
writer.write_feed(arts, self.context,
self.settings['TAG_FEED_ATOM']
% tag.slug)
if self.settings.get('TAG_FEED_RSS'):
writer.write_feed(arts, self.context,
self.settings['TAG_FEED_RSS'] % tag.slug,
feed_type='rss')
if (self.settings.get('TRANSLATION_FEED_ATOM')
or self.settings.get('TRANSLATION_FEED_RSS')):
translations_feeds = defaultdict(list)
for article in chain(self.articles, self.translations):
translations_feeds[article.lang].append(article)
for lang, items in translations_feeds.items():
items.sort(key=attrgetter('date'), reverse=True)
if self.settings.get('TRANSLATION_FEED_ATOM'):
writer.write_feed(items, self.context,
self.settings['TRANSLATION_FEED_ATOM'] % lang)
if self.settings.get('TRANSLATION_FEED_RSS'):
writer.write_feed(items, self.context,
self.settings['TRANSLATION_FEED_RSS'] % lang,
feed_type='rss')
def generate_articles(self, write):
"""Generate the articles."""
for article in chain(self.translations, self.articles):
write(article.save_as, self.get_template(article.template),
self.context, article=article, category=article.category,
override_output=hasattr(article, 'override_save_as'))
def generate_period_archives(self, write):
"""Generate per-year, per-month, and per-day archives."""
try:
template = self.get_template('period_archives')
except Exception:
template = self.get_template('archives')
def _generate_period_archives(dates, key, save_as_fmt):
"""Generate period archives from `dates`, grouped by
`key` and written to `save_as`.
"""
# `dates` is already sorted by date
for _period, group in groupby(dates, key=key):
archive = list(group)
# arbitrarily grab the first date so that the usual
# format string syntax can be used for specifying the
# period archive dates
date = archive[0].date
save_as = save_as_fmt.format(date=date)
write(save_as, template, self.context,
dates=archive, blog=True)
period_save_as = {
'year' : self.settings['YEAR_ARCHIVE_SAVE_AS'],
'month': self.settings['MONTH_ARCHIVE_SAVE_AS'],
'day' : self.settings['DAY_ARCHIVE_SAVE_AS'],
}
period_date_key = {
'year' : attrgetter('date.year'),
'month': attrgetter('date.year', 'date.month'),
'day' : attrgetter('date.year', 'date.month', 'date.day')
}
for period in 'year', 'month', 'day':
save_as = period_save_as[period]
if save_as:
key = period_date_key[period]
_generate_period_archives(self.dates, key, save_as)
def generate_direct_templates(self, write):
"""Generate direct templates pages"""
PAGINATED_TEMPLATES = self.settings['PAGINATED_DIRECT_TEMPLATES']
for template in self.settings['DIRECT_TEMPLATES']:
paginated = {}
if template in PAGINATED_TEMPLATES:
paginated = {'articles': self.articles, 'dates': self.dates}
save_as = self.settings.get("%s_SAVE_AS" % template.upper(),
'%s.html' % template)
if not save_as:
continue
write(save_as, self.get_template(template),
self.context, blog=True, paginated=paginated,
page_name=os.path.splitext(save_as)[0])
def generate_tags(self, write):
"""Generate Tags pages."""
tag_template = self.get_template('tag')
for tag, articles in self.tags.items():
articles.sort(key=attrgetter('date'), reverse=True)
dates = [article for article in self.dates if article in articles]
write(tag.save_as, tag_template, self.context, tag=tag,
articles=articles, dates=dates,
paginated={'articles': articles, 'dates': dates},
page_name=tag.page_name, all_articles=self.articles)
def generate_categories(self, write):
"""Generate category pages."""
category_template = self.get_template('category')
for cat, articles in self.categories:
articles.sort(key=attrgetter('date'), reverse=True)
dates = [article for article in self.dates if article in articles]
write(cat.save_as, category_template, self.context,
category=cat, articles=articles, dates=dates,
paginated={'articles': articles, 'dates': dates},
page_name=cat.page_name, all_articles=self.articles)
def generate_authors(self, write):
"""Generate Author pages."""
author_template = self.get_template('author')
for aut, articles in self.authors:
articles.sort(key=attrgetter('date'), reverse=True)
dates = [article for article in self.dates if article in articles]
write(aut.save_as, author_template, self.context,
author=aut, articles=articles, dates=dates,
paginated={'articles': articles, 'dates': dates},
page_name=aut.page_name, all_articles=self.articles)
def generate_drafts(self, write):
"""Generate drafts pages."""
for article in self.drafts:
write(os.path.join('drafts', '%s.html' % article.slug),
self.get_template(article.template), self.context,
article=article, category=article.category,
all_articles=self.articles)
def generate_pages(self, writer):
"""Generate the pages on the disk"""
write = partial(writer.write_file,
relative_urls=self.settings['RELATIVE_URLS'])
# to minimize the number of relative path stuff modification
# in writer, articles pass first
self.generate_articles(write)
self.generate_period_archives(write)
self.generate_direct_templates(write)
# and subfolders after that
self.generate_tags(write)
self.generate_categories(write)
self.generate_authors(write)
self.generate_drafts(write)
def generate_context(self):
"""Add the articles into the shared context"""
all_articles = []
for f in self.get_files(
self.settings['ARTICLE_DIR'],
exclude=self.settings['ARTICLE_EXCLUDES']):
try:
article = self.readers.read_file(
base_path=self.path, path=f, content_class=Article,
context=self.context,
preread_signal=signals.article_generator_preread,
preread_sender=self,
context_signal=signals.article_generator_context,
context_sender=self)
except Exception as e:
logger.warning('Could not process {}\n{}'.format(f, e))
continue
if not is_valid_content(article, f):
continue
self.add_source_path(article)
if article.status == "published":
all_articles.append(article)
elif article.status == "draft":
self.drafts.append(article)
else:
logger.warning("Unknown status %s for file %s, skipping it." %
(repr(article.status),
repr(f)))
self.articles, self.translations = process_translations(all_articles)
for article in self.articles:
# only main articles are listed in categories and tags
# not translations
self.categories[article.category].append(article)
if hasattr(article, 'tags'):
for tag in article.tags:
self.tags[tag].append(article)
# ignore blank authors as well as undefined
if hasattr(article, 'author') and article.author.name != '':
self.authors[article.author].append(article)
# sort the articles by date
self.articles.sort(key=attrgetter('date'), reverse=True)
self.dates = list(self.articles)
self.dates.sort(key=attrgetter('date'),
reverse=self.context['NEWEST_FIRST_ARCHIVES'])
# create tag cloud
tag_cloud = defaultdict(int)
for article in self.articles:
for tag in getattr(article, 'tags', []):
tag_cloud[tag] += 1
tag_cloud = sorted(tag_cloud.items(), key=itemgetter(1), reverse=True)
tag_cloud = tag_cloud[:self.settings.get('TAG_CLOUD_MAX_ITEMS')]
tags = list(map(itemgetter(1), tag_cloud))
if tags:
max_count = max(tags)
steps = self.settings.get('TAG_CLOUD_STEPS')
# calculate word sizes
self.tag_cloud = [
(
tag,
int(math.floor(steps - (steps - 1) * math.log(count)
/ (math.log(max_count)or 1)))
)
for tag, count in tag_cloud
]
# put words in chaos
random.shuffle(self.tag_cloud)
# and generate the output :)
# order the categories per name
self.categories = list(self.categories.items())
self.categories.sort(
reverse=self.settings['REVERSE_CATEGORY_ORDER'])
self.authors = list(self.authors.items())
self.authors.sort()
self._update_context(('articles', 'dates', 'tags', 'categories',
'tag_cloud', 'authors', 'related_posts'))
signals.article_generator_finalized.send(self)
def generate_output(self, writer):
self.generate_feeds(writer)
self.generate_pages(writer)
class PagesGenerator(Generator):
"""Generate pages"""
def __init__(self, *args, **kwargs):
self.pages = []
self.hidden_pages = []
self.hidden_translations = []
super(PagesGenerator, self).__init__(*args, **kwargs)
signals.page_generator_init.send(self)
def generate_context(self):
all_pages = []
hidden_pages = []
for f in self.get_files(
self.settings['PAGE_DIR'],
exclude=self.settings['PAGE_EXCLUDES']):
try:
page = self.readers.read_file(
base_path=self.path, path=f, content_class=Page,
context=self.context,
preread_signal=signals.page_generator_preread,
preread_sender=self,
context_signal=signals.page_generator_context,
context_sender=self)
except Exception as e:
logger.warning('Could not process {}\n{}'.format(f, e))
continue
if not is_valid_content(page, f):
continue
self.add_source_path(page)
if page.status == "published":
all_pages.append(page)
elif page.status == "hidden":
hidden_pages.append(page)
else:
logger.warning("Unknown status %s for file %s, skipping it." %
(repr(page.status),
repr(f)))
self.pages, self.translations = process_translations(all_pages)
self.hidden_pages, self.hidden_translations = (
process_translations(hidden_pages))
self._update_context(('pages', ))
self.context['PAGES'] = self.pages
signals.page_generator_finalized.send(self)
def generate_output(self, writer):
for page in chain(self.translations, self.pages,
self.hidden_translations, self.hidden_pages):
writer.write_file(page.save_as, self.get_template(page.template),
self.context, page=page,
relative_urls=self.settings['RELATIVE_URLS'],
override_output=hasattr(page, 'override_save_as'))
class StaticGenerator(Generator):
"""copy static paths (what you want to copy, like images, medias etc.
to output"""
def _copy_paths(self, paths, source, destination, output_path,
final_path=None):
"""Copy all the paths from source to destination"""
for path in paths:
copy(path, source, os.path.join(output_path, destination),
final_path)
def generate_context(self):
self.staticfiles = []
# walk static paths
for static_path in self.settings['STATIC_PATHS']:
for f in self.get_files(
static_path, extensions=False):
static = self.readers.read_file(
base_path=self.path, path=f, content_class=Static,
fmt='static', context=self.context,
preread_signal=signals.static_generator_preread,
preread_sender=self,
context_signal=signals.static_generator_context,
context_sender=self)
self.staticfiles.append(static)
self.add_source_path(static)
self._update_context(('staticfiles',))
def generate_output(self, writer):
self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme,
self.settings['THEME_STATIC_DIR'], self.output_path,
os.curdir)
# copy all Static files
for sc in self.context['staticfiles']:
source_path = os.path.join(self.path, sc.source_path)
save_as = os.path.join(self.output_path, sc.save_as)
mkdir_p(os.path.dirname(save_as))
shutil.copy(source_path, save_as)
logger.info('copying {} to {}'.format(sc.source_path, sc.save_as))
class SourceFileGenerator(Generator):
def generate_context(self):
self.output_extension = self.settings['OUTPUT_SOURCES_EXTENSION']
def _create_source(self, obj):
output_path, _ = os.path.splitext(obj.save_as)
dest = os.path.join(self.output_path,
output_path + self.output_extension)
copy('', obj.source_path, dest)
def generate_output(self, writer=None):
logger.info(' Generating source files...')
for obj in chain(self.context['articles'], self.context['pages']):
self._create_source(obj)
for obj_trans in obj.translations:
self._create_source(obj_trans)

View file

@ -1,89 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
__all__ = [
'init'
]
import os
import sys
import logging
from logging import Formatter, getLogger, StreamHandler, DEBUG
RESET_TERM = '\033[0;m'
COLOR_CODES = {
'red': 31,
'yellow': 33,
'cyan': 36,
'white': 37,
'bgred': 41,
'bggrey': 100,
}
def ansi(color, text):
"""Wrap text in an ansi escape sequence"""
code = COLOR_CODES[color]
return '\033[1;{0}m{1}{2}'.format(code, text, RESET_TERM)
class ANSIFormatter(Formatter):
"""Convert a `logging.LogRecord' object into colored text, using ANSI
escape sequences.
"""
def format(self, record):
msg = record.getMessage()
if record.levelname == 'INFO':
return ansi('cyan', '-> ') + msg
elif record.levelname == 'WARNING':
return ansi('yellow', record.levelname) + ': ' + msg
elif record.levelname == 'ERROR':
return ansi('red', record.levelname) + ': ' + msg
elif record.levelname == 'CRITICAL':
return ansi('bgred', record.levelname) + ': ' + msg
elif record.levelname == 'DEBUG':
return ansi('bggrey', record.levelname) + ': ' + msg
else:
return ansi('white', record.levelname) + ': ' + msg
class TextFormatter(Formatter):
"""
Convert a `logging.LogRecord' object into text.
"""
def format(self, record):
if not record.levelname or record.levelname == 'INFO':
return record.getMessage()
else:
return record.levelname + ': ' + record.getMessage()
def init(level=None, logger=getLogger(), handler=StreamHandler()):
logger = logging.getLogger()
if (os.isatty(sys.stdout.fileno())
and not sys.platform.startswith('win')):
fmt = ANSIFormatter()
else:
fmt = TextFormatter()
handler.setFormatter(fmt)
logger.addHandler(handler)
if level:
logger.setLevel(level)
if __name__ == '__main__':
init(level=DEBUG)
root_logger = logging.getLogger()
root_logger.debug('debug')
root_logger.info('info')
root_logger.warning('warning')
root_logger.error('error')
root_logger.critical('critical')

View file

@ -1,159 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
# From django.core.paginator
from collections import namedtuple
import functools
import logging
import os
from math import ceil
logger = logging.getLogger(__name__)
PaginationRule = namedtuple(
'PaginationRule',
'min_page URL SAVE_AS',
)
class Paginator(object):
def __init__(self, name, object_list, settings):
self.name = name
self.object_list = object_list
self.settings = settings
if settings.get('DEFAULT_PAGINATION'):
self.per_page = settings.get('DEFAULT_PAGINATION')
self.orphans = settings.get('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.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 = int(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(object):
def __init__(self, name, object_list, number, paginator, settings):
self.name = name
self.object_list = object_list
self.number = number
self.paginator = paginator
self.settings = settings
def __repr__(self):
return '<Page %s of %s>' % (self.number, 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 <= self.number:
rule = p
if not rule:
return ''
prop_value = getattr(rule, key)
if not isinstance(prop_value, six.string_types):
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 = {
'name': self.name,
'object_list': self.object_list,
'number': self.number,
'paginator': self.paginator,
'settings': self.settings,
'base_name': os.path.dirname(self.name),
'number_sep': '/',
}
if self.number == 1:
# no page numbers on the first page
context['number'] = ''
context['number_sep'] = ''
ret = prop_value.format(**context)
if ret[0] == '/':
ret = ret[1:]
return ret
url = property(functools.partial(_from_settings, key='URL'))
save_as = property(functools.partial(_from_settings, key='SAVE_AS'))

View file

@ -1,574 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import datetime
import logging
import os
import re
try:
import docutils
import docutils.core
import docutils.io
from docutils.writers.html4css1 import HTMLTranslator
# import the directives to have pygments support
from pelican import rstdirectives # NOQA
except ImportError:
docutils = False
try:
from markdown import Markdown
except ImportError:
Markdown = False # NOQA
try:
from asciidocapi import AsciiDocAPI
asciidoc = True
except ImportError:
asciidoc = False
try:
from html import escape
except ImportError:
from cgi import escape
try:
from html.parser import HTMLParser
except ImportError:
from HTMLParser import HTMLParser
from pelican import signals
from pelican.contents import Page, Category, Tag, Author
from pelican.utils import get_date, pelican_open
METADATA_PROCESSORS = {
'tags': lambda x, y: [Tag(tag, y) for tag in x.split(',')],
'date': lambda x, y: get_date(x),
'status': lambda x, y: x.strip(),
'category': Category,
'author': Author,
}
logger = logging.getLogger(__name__)
class BaseReader(object):
"""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"
content = None
metadata = {}
return content, metadata
class _FieldBodyTranslator(HTMLTranslator):
def __init__(self, document):
HTMLTranslator.__init__(self, 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):
visitor = _FieldBodyTranslator(document)
node.walkabout(visitor)
return visitor.astext()
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):
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"""
enabled = bool(docutils)
file_extensions = ['rst']
def __init__(self, *args, **kwargs):
super(RstReader, self).__init__(*args, **kwargs)
def _parse_metadata(self, document):
"""Return the dict containing document metadata"""
output = {}
for docinfo in document.traverse(docutils.nodes.docinfo):
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 == 'summary':
value = render_node_to_html(document, body_elem)
else:
value = body_elem.astext()
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 _get_publisher(self, source_path):
extra_params = {'initial_header_level': '2',
'syntax_highlight': 'short',
'input_encoding': 'utf-8'}
user_params = self.settings.get('DOCUTILS_SETTINGS')
if user_params:
extra_params.update(user_params)
pub = docutils.core.Publisher(
destination_class=docutils.io.StringOutput)
pub.set_components('standalone', 'restructuredtext', 'html')
pub.writer.translator_class = PelicanHTMLTranslator
pub.process_programmatic_settings(None, extra_params, None)
pub.set_source(source_path=source_path)
pub.publish()
return pub
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)
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(MarkdownReader, self).__init__(*args, **kwargs)
self.extensions = list(self.settings['MD_EXTENSIONS'])
if 'meta' not in self.extensions:
self.extensions.append('meta')
def _parse_metadata(self, meta):
"""Return the dict containing document metadata"""
output = {}
for name, value in meta.items():
name = name.lower()
if name == "summary":
summary_values = "\n".join(value)
# reset the markdown instance to clear any state
self._md.reset()
summary = self._md.convert(summary_values)
output[name] = self.process_metadata(name, summary)
else:
output[name] = self.process_metadata(name, value[0])
return output
def read(self, source_path):
"""Parse content and metadata of markdown files"""
self._md = Markdown(extensions=self.extensions)
with pelican_open(source_path) as text:
content = self._md.convert(text)
metadata = self._parse_metadata(self._md.Meta)
return content, metadata
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):
HTMLParser.__init__(self)
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 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 += '</{}>'.format(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 += '<!--{}-->'.format(data)
def handle_data(self, data):
self._data_buffer += data
def handle_entityref(self, data):
self._data_buffer += '&{};'.format(data)
def handle_charref(self, data):
self._data_buffer += '&#{};'.format(data)
def build_tag(self, tag, attrs, close_tag):
result = '<{}'.format(escape(tag))
for k, v in attrs:
result += ' ' + escape(k)
if v is not None:
result += '="{}"'.format(escape(v))
if close_tag:
return result + ' />'
return result + '>'
def _handle_meta_tag(self, attrs):
name = self._attr_value(attrs, '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)
if name == 'keywords':
name = 'tags'
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 AsciiDocReader(BaseReader):
"""Reader for AsciiDoc files"""
enabled = bool(asciidoc)
file_extensions = ['asc']
default_options = ["--no-header-footer", "-a newline=\\n"]
def read(self, source_path):
"""Parse content and metadata of asciidoc files"""
from cStringIO import StringIO
with pelican_open(source_path) as source:
text = StringIO(source)
content = StringIO()
ad = AsciiDocAPI()
options = self.settings['ASCIIDOC_OPTIONS']
if isinstance(options, (str, unicode)):
options = [m.strip() for m in options.split(',')]
options = self.default_options + options
for o in options:
ad.options(*o.split())
ad.execute(text, content, backend="html4")
content = content.getvalue()
metadata = {}
for name, value in ad.asciidoc.document.attributes.items():
name = name.lower()
metadata[name] = self.process_metadata(name, value)
if 'doctitle' in metadata:
metadata['title'] = metadata['doctitle']
return content, metadata
class Readers(object):
"""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.
"""
# used to warn about missing dependencies only once, at the first
# instanciation of a Readers object.
warn_missing_deps = True
def __init__(self, settings=None):
self.settings = settings or {}
self.readers = {}
self.reader_classes = {}
for cls in [BaseReader] + BaseReader.__subclasses__():
if not cls.enabled:
if self.__class__.warn_missing_deps:
logger.debug('Missing dependencies for {}'
.format(', '.join(cls.file_extensions)))
continue
for ext in cls.file_extensions:
self.reader_classes[ext] = cls
self.__class__.warn_missing_deps = False
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)
@property
def extensions(self):
return self.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 = os.path.relpath(path, base_path)
logger.debug('read file {} -> {}'.format(
source_path, content_class.__name__))
if not fmt:
_, ext = os.path.splitext(os.path.basename(path))
fmt = ext[1:]
if fmt not in self.readers:
raise TypeError(
'Pelican does not know how to parse {}'.format(path))
if preread_signal:
logger.debug('signal {}.send({})'.format(
preread_signal, preread_sender))
preread_signal.send(preread_sender)
reader = self.readers[fmt]
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(parse_path_metadata(
source_path=source_path, settings=self.settings,
process=reader.process_metadata))
content, reader_metadata = reader.read(path)
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 content and self.settings['TYPOGRIFY']:
from typogrify.filters import typogrify
content = typogrify(content)
metadata['title'] = typogrify(metadata['title'])
if context_signal:
logger.debug('signal {}.send({}, <metadata>)'.format(
context_signal, context_sender))
context_signal.send(context_sender, metadata=metadata)
return content_class(content=content, metadata=metadata,
settings=self.settings, source_path=path,
context=context)
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)
matches = re.findall(imgs, content)
# find a correct threshold
nb_warnings = 10
if len(matches) == nb_warnings + 1:
nb_warnings += 1 # avoid bad looking case
# print one warning per image with empty alt until threshold
for match in matches[:nb_warnings]:
logger.warning('Empty alt attribute for image {} in {}'.format(
os.path.basename(match[1] + match[5]), path))
# print one warning for the other images with empty alt
if len(matches) > nb_warnings:
logger.warning('{} other images with empty alt attributes'
.format(len(matches) - nb_warnings))
def default_metadata(settings=None, process=None):
metadata = {}
if settings:
if 'DEFAULT_CATEGORY' in settings:
value = settings['DEFAULT_CATEGORY']
if process:
value = process('category', value)
metadata['category'] = value
if 'DEFAULT_DATE' in settings and settings['DEFAULT_DATE'] != 'fs':
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_ctime)
metadata.update(settings.get('EXTRA_PATH_METADATA', {}).get(
source_path, {}))
return metadata
def parse_path_metadata(source_path, settings=None, process=None):
"""Extract a metadata dictionary from a file's path
>>> import pprint
>>> settings = {
... 'FILENAME_METADATA': '(?P<slug>[^.]*).*',
... 'PATH_METADATA':
... '(?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.insert(0, ('(?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():
if k not in metadata:
k = k.lower() # metadata must be lowercase
if process:
v = process(k, v)
metadata[k] = v
return metadata

View file

@ -1,89 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from docutils import nodes, utils
from docutils.parsers.rst import directives, roles, Directive
from pygments.formatters import HtmlFormatter
from pygments import highlight
from pygments.lexers import get_lexer_by_name, TextLexer
import re
import six
import pelican.settings as pys
class Pygments(Directive):
""" Source code syntax highlighting.
"""
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = True
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):
self.assert_has_content()
try:
lexer = get_lexer_by_name(self.arguments[0])
except ValueError:
# no lexer found - use the text one instead of an exception
lexer = TextLexer()
# Fetch the defaults
if pys.PYGMENTS_RST_OPTIONS is not None:
for k, v in six.iteritems(pys.PYGMENTS_RST_OPTIONS):
# 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('\((.*)\)$')
class abbreviation(nodes.Inline, nodes.TextElement):
pass
def abbr_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
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)

View file

@ -1,48 +0,0 @@
from __future__ import print_function
import os
import sys
import logging
try:
import SimpleHTTPServer as srvmod
except ImportError:
import http.server as srvmod # NOQA
try:
import SocketServer as socketserver
except ImportError:
import socketserver # NOQA
PORT = len(sys.argv) == 2 and int(sys.argv[1]) or 8000
SUFFIXES = ['','.html','/index.html']
class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler):
def do_GET(self):
# we are trying to detect the file by having a fallback mechanism
r = None
for suffix in SUFFIXES:
if not hasattr(self,'original_path'):
self.original_path = self.path
self.path = self.original_path + suffix
path = self.translate_path(self.path)
if os.path.exists(path):
r = srvmod.SimpleHTTPRequestHandler.do_GET(self)
if r is not None:
break
logging.warning("Unable to find %s file." % self.path)
return r
Handler = ComplexHTTPRequestHandler
try:
httpd = socketserver.TCPServer(("", PORT), Handler)
except OSError as e:
logging.error("Could not listen on port %s" % PORT)
sys.exit(getattr(e, 'exitcode', 1))
logging.info("serving at port %s" % PORT)
try:
httpd.serve_forever()
except KeyboardInterrupt as e:
logging.info("shutting down server")
httpd.socket.close()

View file

@ -1,302 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
import copy
import inspect
import os
import locale
import logging
try:
# SourceFileLoader is the recommended way in 3.3+
from importlib.machinery import SourceFileLoader
load_source = lambda name, path: SourceFileLoader(name, path).load_module()
except ImportError:
# but it does not exist in 3.2-, so fall back to imp
import imp
load_source = imp.load_source
from os.path import isabs
logger = logging.getLogger(__name__)
DEFAULT_THEME = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'themes', 'notmyidea')
DEFAULT_CONFIG = {
'PATH': os.curdir,
'ARTICLE_DIR': '',
'ARTICLE_EXCLUDES': ('pages',),
'PAGE_DIR': 'pages',
'PAGE_EXCLUDES': (),
'THEME': DEFAULT_THEME,
'OUTPUT_PATH': 'output',
'READERS': {},
'STATIC_PATHS': ['images', ],
'THEME_STATIC_DIR': 'theme',
'THEME_STATIC_PATHS': ['static', ],
'FEED_ALL_ATOM': os.path.join('feeds', 'all.atom.xml'),
'CATEGORY_FEED_ATOM': os.path.join('feeds', '%s.atom.xml'),
'TRANSLATION_FEED_ATOM': os.path.join('feeds', 'all-%s.atom.xml'),
'FEED_MAX_ITEMS': '',
'SITEURL': '',
'SITENAME': 'A Pelican Blog',
'DISPLAY_PAGES_ON_MENU': True,
'DISPLAY_CATEGORIES_ON_MENU': True,
'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': (),
'ARTICLE_URL': '{slug}.html',
'ARTICLE_SAVE_AS': '{slug}.html',
'ARTICLE_LANG_URL': '{slug}-{lang}.html',
'ARTICLE_LANG_SAVE_AS': '{slug}-{lang}.html',
'PAGE_URL': 'pages/{slug}.html',
'PAGE_SAVE_AS': os.path.join('pages', '{slug}.html'),
'PAGE_LANG_URL': 'pages/{slug}-{lang}.html',
'PAGE_LANG_SAVE_AS': os.path.join('pages', '{slug}-{lang}.html'),
'STATIC_URL': '{path}',
'STATIC_SAVE_AS': '{path}',
'PDF_GENERATOR': False,
'PDF_STYLE_PATH': '',
'PDF_STYLE': 'twelvepoint',
'CATEGORY_URL': 'category/{slug}.html',
'CATEGORY_SAVE_AS': os.path.join('category', '{slug}.html'),
'TAG_URL': 'tag/{slug}.html',
'TAG_SAVE_AS': os.path.join('tag', '{slug}.html'),
'AUTHOR_URL': 'author/{slug}.html',
'AUTHOR_SAVE_AS': os.path.join('author', '{slug}.html'),
'PAGINATION_PATTERNS': [
(0, '{name}{number}.html', '{name}{number}.html'),
],
'YEAR_ARCHIVE_SAVE_AS': False,
'MONTH_ARCHIVE_SAVE_AS': False,
'DAY_ARCHIVE_SAVE_AS': False,
'RELATIVE_URLS': False,
'DEFAULT_LANG': 'en',
'TAG_CLOUD_STEPS': 4,
'TAG_CLOUD_MAX_ITEMS': 100,
'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'authors', 'archives'),
'EXTRA_TEMPLATES_PATHS': [],
'PAGINATED_DIRECT_TEMPLATES': ('index', ),
'PELICAN_CLASS': 'pelican.Pelican',
'DEFAULT_DATE_FORMAT': '%a %d %B %Y',
'DATE_FORMATS': {},
'ASCIIDOC_OPTIONS': [],
'MD_EXTENSIONS': ['codehilite(css_class=highlight)', 'extra'],
'JINJA_EXTENSIONS': [],
'JINJA_FILTERS': {},
'LOCALE': [''], # defaults to user locale
'DEFAULT_PAGINATION': False,
'DEFAULT_ORPHANS': 0,
'DEFAULT_METADATA': (),
'FILENAME_METADATA': '(?P<date>\d{4}-\d{2}-\d{2}).*',
'PATH_METADATA': '',
'EXTRA_PATH_METADATA': {},
'DEFAULT_STATUS': 'published',
'ARTICLE_PERMALINK_STRUCTURE': '',
'TYPOGRIFY': False,
'SUMMARY_MAX_LENGTH': 50,
'PLUGIN_PATH': '',
'PLUGINS': [],
'PYGMENTS_RST_OPTIONS': {},
'TEMPLATE_PAGES': {},
'IGNORE_FILES': ['.#*'],
'SLUG_SUBSTITUTIONS': (),
'INTRASITE_LINK_REGEX': '[{|](?P<what>.*?)[|}]',
}
PYGMENTS_RST_OPTIONS = None
def read_settings(path=None, override=None):
if path:
local_settings = get_settings_from_file(path)
# Make the paths relative to the settings file
for p in ['PATH', 'OUTPUT_PATH', 'THEME', 'PLUGIN_PATH']:
if p in local_settings and local_settings[p] is not None \
and not isabs(local_settings[p]):
absp = os.path.abspath(os.path.normpath(os.path.join(
os.path.dirname(path), local_settings[p])))
if p not in ('THEME', 'PLUGIN_PATH') or os.path.exists(absp):
local_settings[p] = absp
else:
local_settings = copy.deepcopy(DEFAULT_CONFIG)
if override:
local_settings.update(override)
parsed_settings = configure_settings(local_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
PYGMENTS_RST_OPTIONS = parsed_settings.get('PYGMENTS_RST_OPTIONS', None)
return parsed_settings
def get_settings_from_module(module=None, default_settings=DEFAULT_CONFIG):
"""Loads settings from a module, returns a dictionary."""
context = copy.deepcopy(default_settings)
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, default_settings=DEFAULT_CONFIG):
"""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, default_settings=default_settings)
def configure_settings(settings):
"""Provide optimizations, error checking and warnings for the given
settings.
"""
if not 'PATH' 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)')
# 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 %s"
% settings['THEME'])
# standardize strings to lowercase strings
for key in [
'DEFAULT_LANG',
]:
if key in settings:
settings[key] = settings[key].lower()
# standardize strings to lists
for key in [
'LOCALE',
]:
if key in settings and isinstance(settings[key], six.string_types):
settings[key] = [settings[key]]
# check settings that must be a particular type
for key, types in [
('OUTPUT_SOURCES_EXTENSION', six.string_types),
('FILENAME_METADATA', six.string_types),
]:
if key in settings and not isinstance(settings[key], types):
value = settings.pop(key)
logger.warn(
'Detected misconfigured {} ({}), '
'falling back to the default ({})'.format(
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 option doesn't contain a correct value")
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 not 'FEED_DOMAIN' in settings:
settings['FEED_DOMAIN'] = settings['SITEURL']
# 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',
'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 not 'TIMEZONE' in settings:
logger.warning(
'No timezone information specified in the settings. Assuming'
' your timezone is UTC for feed generation. Check '
'http://docs.getpelican.com/en/latest/settings.html#timezone '
'for more information')
# fix up pagination rules
from pelican.paginator import PaginationRule
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',
'EXTRA_TEMPLATES_PATHS',
'FILES_TO_COPY',
'IGNORE_FILES',
'JINJA_EXTENSIONS',
'PAGINATED_DIRECT_TEMPLATES',
'PLUGINS',
'STATIC_PATHS',
'THEME_STATIC_PATHS',
)
for PATH_KEY in filter(lambda k: k in settings, path_keys):
if isinstance(settings[PATH_KEY], six.string_types):
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]
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/master/docs/settings.rst#path-metadata'),
]:
if old in settings:
message = 'The {} setting has been removed in favor of {}'.format(
old, new)
if doc:
message += ', see {} for details'.format(doc)
logger.warning(message)
return settings

View file

@ -1,42 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from blinker import signal
# Run-level signals:
initialized = signal('pelican_initialized')
get_generators = signal('get_generators')
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_finalized = signal('article_generator_finalized')
page_generator_init = signal('page_generator_init')
page_generator_finalized = signal('page_generator_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')

View file

@ -1,8 +0,0 @@
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.

View file

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

View file

@ -1,12 +0,0 @@
title: This is a markdown test hidden page
status: hidden
Test Markdown File Header
=========================
Used for pelican test
---------------------
The quick brown fox jumped over the lazy dog's back.
This page is hidden

View file

@ -1,11 +0,0 @@
This is a test hidden page with a custom template
#################################################
:status: hidden
:template: custom
The quick brown fox jumped over the lazy dog's back.
This page is hidden
This page has a custom template to be called when rendered

View file

@ -1,4 +0,0 @@
This is a test page
###################
The quick brown fox jumped over the lazy dog's back.

View file

@ -1,9 +0,0 @@
title: This is a markdown test page
Test Markdown File Header
=========================
Used for pelican test
---------------------
The quick brown fox jumped over the lazy dog's back.

View file

@ -1,8 +0,0 @@
This is a test page with a preset template
##########################################
:template: custom
The quick brown fox jumped over the lazy dog's back.
This article has a custom template to be called when rendered

View file

@ -1,2 +0,0 @@
import logging
logging.getLogger().addHandler(logging.NullHandler())

View file

@ -1,6 +0,0 @@
Rst with filename metadata
##########################
:category: yeah
:author: Alexis Métaireau

View file

@ -1,6 +0,0 @@
category: yeah
author: Alexis Métaireau
Markdown with filename metadata
===============================

View file

@ -1,7 +0,0 @@
This is an article with category !
##################################
:category: yeah
:date: 1970-01-01
This article should be in 'yeah' category.

View file

@ -1,4 +0,0 @@
This is an article without category !
#####################################
This article should be in 'TestCategory' category.

View file

@ -1,6 +0,0 @@
Article title
#############
This is some content. With some stuff to "typogrify".
Now with added support for :abbr:`TLA (three letter acronym)`.

View file

@ -1,12 +0,0 @@
Test AsciiDoc File Header
=========================
:Author: Author O. Article
:Email: <author@nowhere.com>
:Date: 2011-09-15 09:05
:Category: Blog
:Tags: Linux, Python, Pelican
Used for pelican test
---------------------
The quick brown fox jumped over the lazy dog's back.

View file

@ -1,9 +0,0 @@
Test AsciiDoc File Header
=========================
Used for pelican test
---------------------
version {revision}
The quick brown fox jumped over the lazy dog's back.

View file

@ -1,8 +0,0 @@
<html>
<head>
</head>
<body>
Body content
<!-- This comment is included (including extra whitespace) -->
</body>
</html>

View file

@ -1,6 +0,0 @@
<html>
<head>
<title>This is a super article !</title>
<meta name="keywords" content="foo, bar, foobar" />
</head>
</html>

View file

@ -1,8 +0,0 @@
Title: Article with markdown containing footnotes
Date: 2012-10-31
Summary: Summary with **inline** markup *should* be supported.
This is some content[^1] with some footnotes[^footnote]
[^1]: Numbered footnote
[^footnote]: Named footnote

View file

@ -1,18 +0,0 @@
Title: マックOS X 10.8でパイソンとVirtualenvをインストールと設定
Slug: python-virtualenv-on-mac-osx-mountain-lion-10.8
Date: 2012-12-20
Tags: パイソン, マック
Category: 指導書
Summary: パイソンとVirtualenvをまっくでインストールする方法について明確に説明します。
Writing unicode is certainly fun.
パイソンとVirtualenvをまっくでインストールする方法について明確に説明します。
And let's mix languages.
первый пост
Now another.
İlk yazı çok özel değil.

View file

@ -1,7 +0,0 @@
Title: Article with markdown and summary metadata multi
Date: 2012-10-31
Summary:
A multi-line summary should be supported
as well as **inline markup**.
This is some content.

View file

@ -1,5 +0,0 @@
Title: Article with markdown and summary metadata single
Date: 2012-10-30
Summary: A single-line summary should be supported as well as **inline markup**.
This is some content.

View file

@ -1,10 +0,0 @@
title: Test markdown File
category: test
Test Markdown File Header
=========================
Used for pelican test
---------------------
This is another markdown test file. Uses the markdown extension.

View file

@ -1,8 +0,0 @@
Title: Test Markdown extensions
[TOC]
## Level1
### Level2

View file

@ -1,13 +0,0 @@
Title: Test md File
Category: test
Tags: foo, bar, foobar
Date: 2010-12-02 10:14
Summary: I have a lot to test
Test Markdown File Header
=========================
Used for pelican test
---------------------
The quick brown fox jumped over the lazy dog's back.

View file

@ -1,10 +0,0 @@
title: Test mdown File
category: test
Test Markdown File Header
=========================
Used for pelican test
---------------------
This is another markdown test file. Uses the mdown extension.

View file

@ -1,15 +0,0 @@
<html>
<head>
<title>This is a super article !</title>
<meta name="tags" content="foo, bar, foobar" />
<meta name="date" content="2010-12-02 10:14" />
<meta name="category" content="yeah" />
<meta name="author" content="Alexis Métaireau" />
<meta name="summary" content="Summary and stuff" />
<meta name="custom_field" content="http://notmyidea.org" />
</head>
<body>
Multi-line metadata should be supported
as well as <strong>inline markup</strong>.
</body>
</html>

View file

@ -1,12 +0,0 @@
This is a super article !
#########################
:tags: foo, bar, foobar
:date: 2010-12-02 10:14
:category: yeah
:author: Alexis Métaireau
:summary:
Multi-line metadata should be supported
as well as **inline markup**.
:custom_field: http://notmyidea.org

View file

@ -1,12 +0,0 @@
This is a super article !
#########################
:tags: foo, bar, foobar
:date: 2010-12-02 10:14
:category: yeah
:author: Alexis Métaireau
:summary:
Multi-line metadata should be supported
as well as **inline markup**.
:custom_field: http://notmyidea.org

View file

@ -1,15 +0,0 @@
<html>
<head>
<title>This is a super article !</title>
<meta name="tags" contents="foo, bar, foobar" />
<meta name="date" contents="2010-12-02 10:14" />
<meta name="category" contents="yeah" />
<meta name="author" contents="Alexis Métaireau" />
<meta name="summary" contents="Summary and stuff" />
<meta name="custom_field" contents="http://notmyidea.org" />
</head>
<body>
Multi-line metadata should be supported
as well as <strong>inline markup</strong>.
</body>
</html>

View file

@ -1,10 +0,0 @@
title: Test mkd File
category: test
Test Markdown File Header
=========================
Used for pelican test
---------------------
This is another markdown test file. Uses the mkd extension.

View file

@ -1,8 +0,0 @@
<html>
<head>
</head>
<body>
Ensure that empty attributes are copied properly.
<input name="test" disabled style="" />
</body>
</html>

View file

@ -1,8 +0,0 @@
Article with template
#####################
:template: custom
This article has a custom template to be called when rendered
This is some content. With some stuff to "typogrify".

View file

@ -1,6 +0,0 @@
<html>
<head>
<title>This is a super article !</title>
<meta name="Category" content="Yeah" />
</head>
</html>

View file

@ -1,6 +0,0 @@
This is a super article !
#########################
:Category: Yeah

View file

@ -1,6 +0,0 @@
This is an article without category !
#####################################
This article should be in the DEFAULT_CATEGORY.

View file

@ -1,48 +0,0 @@
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/XSrW-wAWZe4"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/XSrW-wAWZe4" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p>
<blockquote><p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p></blockquote>
<ul>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
</ul>
<pre>
<code>
a = [1, 2, 3]
b = [4, 5, 6]
for i in zip(a, b):
print i
</code>
</pre>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

View file

@ -1,55 +0,0 @@
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/XSrW-wAWZe4"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/XSrW-wAWZe4" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
<blockquote>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</blockquote>
<ul>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
</ul>
<pre>
<code>
a = [1, 2, 3]
b = [4, 5, 6]
for i in zip(a, b):
print i
</code>
</pre>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

View file

@ -1,686 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
<!-- 4. Activate & Run Importer. -->
<!-- 5. Upload this file using the form provided on that page. -->
<!-- 6. You will first be asked to map the authors in this export file to users -->
<!-- on the site. For each author, you may choose to map to an -->
<!-- existing user on the site or to create a new user. -->
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!-- contained in this file into your site. -->
<!-- generator="WordPress/3.3.1" created="2012-05-13 01:13" -->
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.1/"
>
<channel>
<title>Pelican test channel</title>
<link>http://thisisa.test</link>
<description>Not a real feed, just for test</description>
<pubDate>Sun, 13 May 2012 01:13:52 +0000</pubDate>
<language>en</language>
<wp:wxr_version>1.1</wp:wxr_version>
<wp:base_site_url>http://thisisa.test</wp:base_site_url>
<wp:base_blog_url>http://thisisa.test</wp:base_blog_url>
<wp:author><wp:author_id>2</wp:author_id><wp:author_login>Bob</wp:author_login><wp:author_email>bob@thisisa.test</wp:author_email><wp:author_display_name><![CDATA[Bob]]></wp:author_display_name><wp:author_first_name><![CDATA[Bob]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
<wp:author><wp:author_id>3</wp:author_id><wp:author_login>Jonh</wp:author_login><wp:author_email>jonh@thisisa.test</wp:author_email><wp:author_display_name><![CDATA[Jonh]]></wp:author_display_name><wp:author_first_name><![CDATA[Jonh]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
<wp:category><wp:term_id>7</wp:term_id><wp:category_nicename>categ-1</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Category 1]]></wp:cat_name></wp:category>
<wp:category><wp:term_id>11</wp:term_id><wp:category_nicename>categ-2</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Category 2]]></wp:cat_name></wp:category>
<wp:category><wp:term_id>1</wp:term_id><wp:category_nicename>uncategorized</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name></wp:category>
<wp:category><wp:term_id>15</wp:term_id><wp:category_nicename>categ-3</wp:category_nicename><wp:category_parent></wp:category_parent><wp:cat_name><![CDATA[Category 3]]></wp:cat_name></wp:category>
<wp:tag><wp:term_id>25</wp:term_id><wp:tag_slug>tag-1</wp:tag_slug><wp:tag_name><![CDATA[tag 1]]></wp:tag_name></wp:tag>
<wp:tag><wp:term_id>122</wp:term_id><wp:tag_slug>tag2</wp:tag_slug><wp:tag_name><![CDATA[Tag2]]></wp:tag_name></wp:tag>
<wp:tag><wp:term_id>68</wp:term_id><wp:tag_slug>tag-3</wp:tag_slug><wp:tag_name><![CDATA[Tag 3]]></wp:tag_name></wp:tag>
<generator>http://wordpress.org/?v=3.3.1</generator>
<item>
<title>Empty post</title>
<link>http://thisisa.test/?attachment_id=24</link>
<pubDate>Sat, 04 Feb 2012 03:17:33 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Pelican_lakes_entrance02.jpg/240px-Pelican_lakes_entrance02.jpg</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>24</wp:post_id>
<wp:post_date>2012-02-04 03:17:33</wp:post_date>
<wp:post_date_gmt>2012-02-04 03:17:33</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>empty-post</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>attachment</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:attachment_url>https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Pelican_lakes_entrance02.jpg/240px-Pelican_lakes_entrance02.jpg</wp:attachment_url>
<wp:postmeta>
<wp:meta_key>_wp_attachment_metadata</wp:meta_key>
<wp:meta_value><![CDATA[a:5:{s:5:"width";s:3:"150";s:6:"height";s:3:"186";s:14:"hwstring_small";s:22:"height='96' width='77'";s:4:"file";s:20:"2012/02/pelican.png";s:10:"image_meta";a:10:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_attached_file</wp:meta_key>
<wp:meta_value><![CDATA[2012/02/stuff.png]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_attachment_image_alt</wp:meta_key>
<wp:meta_value><![CDATA[Stuff]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title></title>
<link>http://thisisa.test/?p=168</link>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=168</guid>
<description></description>
<content:encoded><![CDATA[This is a draft with no title]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>168</wp:post_id>
<wp:post_date>2012-02-15 21:23:57</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name></wp:post_name>
<wp:status>draft</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="categ-1"><![CDATA[Category 1]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>A normal post</title>
<link>http://thisisa.test/?p=174</link>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=174</guid>
<description></description>
<content:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<ul>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
</ul>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>174</wp:post_id>
<wp:post_date>2012-02-16 15:52:55</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name></wp:post_name>
<wp:status>draft</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-2"><![CDATA[Category 2]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Complete draft</title>
<link>http://thisisa.test/?p=176</link>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=176</guid>
<description></description>
<content:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>176</wp:post_id>
<wp:post_date>2012-02-17 15:11:55</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name></wp:post_name>
<wp:status>draft</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-3"><![CDATA[Category 3]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Page</title>
<link>http://thisisa.test/contact/</link>
<pubDate>Wed, 11 Apr 2012 11:38:08 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?page_id=334</guid>
<description></description>
<content:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>334</wp:post_id>
<wp:post_date>2012-04-11 06:38:08</wp:post_date>
<wp:post_date_gmt>2012-04-11 11:38:08</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>contact</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>page</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>sharing_disabled</wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_page_template</wp:meta_key>
<wp:meta_value><![CDATA[default]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Empty Page</title>
<link>http://thisisa.test/empty/</link>
<pubDate>Wed, 11 Apr 2012 11:38:08 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?page_id=334</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>334</wp:post_id>
<wp:post_date>2012-04-11 06:38:08</wp:post_date>
<wp:post_date_gmt>2012-04-11 11:38:08</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>empty</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>page</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>sharing_disabled</wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_wp_page_template</wp:meta_key>
<wp:meta_value><![CDATA[default]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Special chars: l&#039;é</title>
<link>http://thisisa.test/?p=471</link>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=471</guid>
<description></description>
<content:encoded><![CDATA[l&#039;é]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>471</wp:post_id>
<wp:post_date>2012-04-29 09:44:27</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name></wp:post_name>
<wp:status>draft</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-1"><![CDATA[Category 1]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>With excerpt</title>
<link>http://thisisa.test/with-excerpt/</link>
<pubDate>Sat, 04 Feb 2012 02:03:06 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=8</guid>
<description></description>
<content:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content:encoded>
<excerpt:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></excerpt:encoded>
<wp:post_id>8</wp:post_id>
<wp:post_date>2012-02-04 02:03:06</wp:post_date>
<wp:post_date_gmt>2012-02-04 02:03:06</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>with-excerpt</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="Category 1"><![CDATA[Category 1]]></category>
<category domain="post_tag" nicename="tag-1"><![CDATA[tag 1]]></category>
<category domain="post_tag" nicename="tag2"><![CDATA[Tag2]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>et_bigpost</wp:meta_key>
<wp:meta_value><![CDATA[0]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_thumbnail_id</wp:meta_key>
<wp:meta_value><![CDATA[32]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>With tags</title>
<link>http://thisisa.test/tags/</link>
<pubDate>Sat, 04 Feb 2012 21:05:25 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=25</guid>
<description></description>
<content:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>25</wp:post_id>
<wp:post_date>2012-02-04 21:05:25</wp:post_date>
<wp:post_date_gmt>2012-02-04 21:05:25</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>with-tags</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-3"><![CDATA[Category 3]]></category>
<category domain="post_tag" nicename="tag-1"><![CDATA[tag 1]]></category>
<category domain="post_tag" nicename="tag-2"><![CDATA[Tag2]]></category>
<category domain="post_tag" nicename="tag-3"><![CDATA[Tag 3]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>et_bigpost</wp:meta_key>
<wp:meta_value><![CDATA[0]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_thumbnail_id</wp:meta_key>
<wp:meta_value><![CDATA[29]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>With comments</title>
<link>http://thisisa.test/with-comments/</link>
<pubDate>Wed, 18 Apr 2012 08:36:26 +0000</pubDate>
<dc:creator>john</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=422</guid>
<description></description>
<content:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>422</wp:post_id>
<wp:post_date>2012-04-18 03:36:26</wp:post_date>
<wp:post_date_gmt>2012-04-18 08:36:26</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>with-comments</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-1"><![CDATA[Category 1]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[2]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_thumbnail_id</wp:meta_key>
<wp:meta_value><![CDATA[423]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>116</wp:comment_id>
<wp:comment_author><![CDATA[User2]]></wp:comment_author>
<wp:comment_author_email>User2@mail.test</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>127.0.0.1</wp:comment_author_IP>
<wp:comment_date>2012-05-06 15:46:06</wp:comment_date>
<wp:comment_date_gmt>2012-05-06 20:46:06</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Comment content.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key>akismet_result</wp:meta_key>
<wp:meta_value><![CDATA[false]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key>akismet_history</wp:meta_key>
<wp:meta_value><![CDATA[a:4:{s:4:"time";s:15:"1336337189.7974";s:7:"message";s:28:"Akismet cleared this comment";s:5:"event";s:9:"check-ham";s:4:"user";s:0:"";}]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key>akismet_as_submitted</wp:meta_key>
<wp:meta_value><![CDATA[a:64:{s:15:"comment_post_ID";s:3:"422";s:14:"comment_author";s:8:"Baronsed";s:20:"comment_author_email";s:15:"User2@mail.test";s:18:"comment_author_url";s:0:"";s:15:"comment_content";s:118:"Dans les listes d'articles où celui-ci apparaît, l'image est trop grande et ralentit le chargement de toute la page.";s:12:"comment_type";s:0:"";s:14:"comment_parent";s:1:"0";s:7:"user_ID";s:1:"0";s:7:"user_ip";s:14:"127.0.0.1";s:10:"user_agent";s:74:"Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0";s:8:"referrer";s:0:"";s:4:"blog";s:19:"http://thisisa.test";s:9:"blog_lang";s:5:"en_US";s:12:"blog_charset";s:5:"UTF-8";s:9:"permalink";s:62:"http://thisisa.test/htop-un-visualiseur-interactif-de-process/";s:9:"user_role";s:0:"";s:21:"akismet_comment_nonce";s:6:"passed";s:11:"POST_author";s:8:"Baronsed";s:10:"POST_email";s:15:"User2@mail.test";s:8:"POST_url";s:0:"";s:12:"POST_comment";s:118:"Dans les listes d'articles où celui-ci apparaît, l'image est trop grande et ralentit le chargement de toute la page.";s:11:"POST_submit";s:14:"Submit Comment";s:20:"POST_comment_post_ID";s:3:"422";s:19:"POST_comment_parent";s:1:"0";s:26:"POST_akismet_comment_nonce";s:10:"96b66769dc";s:15:"SERVER_SOFTWARE";s:12:"nginx/0.8.55";s:11:"REQUEST_URI";s:21:"/wp-comments-post.php";s:4:"TERM";s:5:"xterm";s:17:"PHP_FCGI_CHILDREN";s:1:"4";s:4:"PATH";s:29:"/sbin:/usr/sbin:/bin:/usr/bin";s:1:"_";s:25:"/usr/local/bin/spawn-fcgi";s:3:"PWD";s:1:"/";s:4:"LANG";s:11:"en_US.UTF-8";s:5:"SHLVL";s:1:"2";s:21:"PHP_FCGI_MAX_REQUESTS";s:4:"1000";s:9:"FCGI_ROLE";s:9:"RESPONDER";s:12:"QUERY_STRING";s:0:"";s:14:"REQUEST_METHOD";s:4:"POST";s:12:"CONTENT_TYPE";s:33:"application/x-www-form-urlencoded";s:14:"CONTENT_LENGTH";s:3:"277";s:11:"SCRIPT_NAME";s:21:"/wp-comments-post.php";s:12:"DOCUMENT_URI";s:21:"/wp-comments-post.php";s:13:"DOCUMENT_ROOT";s:14:"/home/blog";s:15:"SERVER_PROTOCOL";s:8:"HTTP/1.1";s:17:"GATEWAY_INTERFACE";s:7:"CGI/1.1";s:11:"REMOTE_ADDR";s:14:"127.0.0.1";s:11:"REMOTE_PORT";s:5:"52826";s:11:"SERVER_ADDR";s:13:"127.0.0.1";s:11:"SERVER_PORT";s:2:"80";s:11:"SERVER_NAME";s:12:"thisisa.test";s:15:"REDIRECT_STATUS";s:3:"200";s:15:"SCRIPT_FILENAME";s:35:"/home/blog/wp-comments-post.php";s:9:"HTTP_HOST";s:12:"thisisa.test";s:15:"HTTP_USER_AGENT";s:74:"Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0";s:11:"HTTP_ACCEPT";s:63:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";s:20:"HTTP_ACCEPT_LANGUAGE";s:35:"fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3";s:20:"HTTP_ACCEPT_ENCODING";s:13:"gzip, deflate";s:8:"HTTP_DNT";s:1:"1";s:15:"HTTP_CONNECTION";s:10:"keep-alive";s:11:"HTTP_COOKIE";s:0:"";s:17:"HTTP_CONTENT_TYPE";s:33:"application/x-www-form-urlencoded";s:19:"HTTP_CONTENT_LENGTH";s:3:"277";s:8:"PHP_SELF";s:21:"/wp-comments-post.php";s:12:"REQUEST_TIME";s:10:"1336337164";}]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>117</wp:comment_id>
<wp:comment_author><![CDATA[Bob]]></wp:comment_author>
<wp:comment_author_email>bob@thisisa.test</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>127.0.0.1</wp:comment_author_IP>
<wp:comment_date>2012-05-06 17:44:06</wp:comment_date>
<wp:comment_date_gmt>2012-05-06 22:44:06</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Comment content.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>116</wp:comment_parent>
<wp:comment_user_id>3</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key>akismet_result</wp:meta_key>
<wp:meta_value><![CDATA[false]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key>akismet_history</wp:meta_key>
<wp:meta_value><![CDATA[a:4:{s:4:"time";s:15:"1336344263.8658";s:7:"message";s:28:"Akismet cleared this comment";s:5:"event";s:9:"check-ham";s:4:"user";s:3:"bob";}]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key>akismet_as_submitted</wp:meta_key>
<wp:meta_value><![CDATA[a:74:{s:15:"comment_post_ID";s:3:"422";s:14:"comment_author";s:3:"bob";s:20:"comment_author_email";s:25:"bob@thisisa.test";s:18:"comment_author_url";s:0:"";s:15:"comment_content";s:26:"Merci de l'avoir signalé.";s:14:"comment_parent";s:3:"116";s:7:"user_ID";s:1:"3";s:7:"user_ip";s:14:"127.0.0.1";s:10:"user_agent";s:139:"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/127.0.0.1 Chrome/127.0.0.1 Safari/535.19";s:8:"referrer";s:29:"http://thisisa.test/wp-admin/";s:4:"blog";s:19:"http://thisisa.test";s:9:"blog_lang";s:5:"en_US";s:12:"blog_charset";s:5:"UTF-8";s:9:"permalink";s:62:"http://thisisa.test/htop-un-visualiseur-interactif-de-process/";s:9:"user_role";s:13:"administrator";s:21:"akismet_comment_nonce";s:6:"passed";s:22:"POST_newcomment_author";s:0:"";s:28:"POST_newcomment_author_email";s:0:"";s:26:"POST_newcomment_author_url";s:0:"";s:12:"POST_user_ID";s:1:"3";s:11:"POST_action";s:15:"replyto-comment";s:15:"POST_comment_ID";s:3:"116";s:20:"POST_comment_post_ID";s:3:"422";s:11:"POST_status";s:0:"";s:13:"POST_position";s:2:"-1";s:13:"POST_checkbox";s:1:"0";s:9:"POST_mode";s:9:"dashboard";s:32:"POST__ajax_nonce-replyto-comment";s:10:"d1ad3bd917";s:32:"POST__wp_unfiltered_html_comment";s:10:"fc11aee860";s:12:"POST_content";s:26:"Merci de l'avoir signalé.";s:7:"POST_id";s:3:"422";s:21:"POST_comments_listing";s:0:"";s:15:"SERVER_SOFTWARE";s:12:"nginx/0.8.55";s:11:"REQUEST_URI";s:24:"/wp-admin/admin-ajax.php";s:4:"TERM";s:5:"xterm";s:17:"PHP_FCGI_CHILDREN";s:1:"4";s:4:"PATH";s:29:"/sbin:/usr/sbin:/bin:/usr/bin";s:1:"_";s:25:"/usr/local/bin/spawn-fcgi";s:3:"PWD";s:1:"/";s:4:"LANG";s:11:"en_US.UTF-8";s:5:"SHLVL";s:1:"2";s:21:"PHP_FCGI_MAX_REQUESTS";s:4:"1000";s:9:"FCGI_ROLE";s:9:"RESPONDER";s:12:"QUERY_STRING";s:0:"";s:14:"REQUEST_METHOD";s:4:"POST";s:12:"CONTENT_TYPE";s:33:"application/x-www-form-urlencoded";s:14:"CONTENT_LENGTH";s:3:"322";s:11:"SCRIPT_NAME";s:24:"/wp-admin/admin-ajax.php";s:12:"DOCUMENT_URI";s:24:"/wp-admin/admin-ajax.php";s:13:"DOCUMENT_ROOT";s:14:"/home/blog";s:15:"SERVER_PROTOCOL";s:8:"HTTP/1.1";s:17:"GATEWAY_INTERFACE";s:7:"CGI/1.1";s:11:"REMOTE_ADDR";s:14:"127.0.0.1";s:11:"REMOTE_PORT";s:5:"10252";s:11:"SERVER_ADDR";s:13:"127.0.0.1";s:11:"SERVER_PORT";s:2:"80";s:11:"SERVER_NAME";s:12:"thisisa.test";s:15:"REDIRECT_STATUS";s:3:"200";s:15:"SCRIPT_FILENAME";s:38:"/home/blog/wp-admin/admin-ajax.php";s:9:"HTTP_HOST";s:12:"thisisa.test";s:15:"HTTP_CONNECTION";s:10:"keep-alive";s:19:"HTTP_CONTENT_LENGTH";s:3:"322";s:11:"HTTP_ORIGIN";s:19:"http://thisisa.test";s:21:"HTTP_X_REQUESTED_WITH";s:14:"XMLHttpRequest";s:15:"HTTP_USER_AGENT";s:139:"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/127.0.0.1 Chrome/127.0.0.1 Safari/535.19";s:17:"HTTP_CONTENT_TYPE";s:33:"application/x-www-form-urlencoded";s:11:"HTTP_ACCEPT";s:3:"*/*";s:12:"HTTP_REFERER";s:29:"http://thisisa.test/wp-admin/";s:20:"HTTP_ACCEPT_ENCODING";s:17:"gzip,deflate,sdch";s:20:"HTTP_ACCEPT_LANGUAGE";s:35:"fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4";s:19:"HTTP_ACCEPT_CHARSET";s:30:"ISO-8859-1,utf-8;q=0.7,*;q=0.3";s:11:"HTTP_COOKIE";s:0:"";s:8:"PHP_SELF";s:24:"/wp-admin/admin-ajax.php";s:12:"REQUEST_TIME";s:10:"1336344246";}]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>156</wp:comment_id>
<wp:comment_author><![CDATA[Ping back comment author]]></wp:comment_author>
<wp:comment_author_email></wp:comment_author_email>
<wp:comment_author_url>http://thisisa.test/to-article-you-ping-back/</wp:comment_author_url>
<wp:comment_author_IP>127.0.0.1</wp:comment_author_IP>
<wp:comment_date>2012-05-09 19:30:19</wp:comment_date>
<wp:comment_date_gmt>2012-05-10 00:30:19</wp:comment_date_gmt>
<wp:comment_content><![CDATA[[...]this is a ping pack [...] ]]></wp:comment_content>
<wp:comment_approved>trash</wp:comment_approved>
<wp:comment_type>pingback</wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key>akismet_history</wp:meta_key>
<wp:meta_value><![CDATA[a:4:{s:4:"time";s:15:"1336610793.7343";s:7:"message";s:39:"bob changed the comment status to trash";s:5:"event";s:12:"status-trash";s:4:"user";s:3:"bob";}]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key>_wp_trash_meta_status</wp:meta_key>
<wp:meta_value><![CDATA[0]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key>_wp_trash_meta_time</wp:meta_key>
<wp:meta_value><![CDATA[1336610793]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>122</wp:comment_id>
<wp:comment_author><![CDATA[bob]]></wp:comment_author>
<wp:comment_author_email>bob@thisisa.test</wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP>127.0.0.1</wp:comment_author_IP>
<wp:comment_date>2012-05-07 14:11:34</wp:comment_date>
<wp:comment_date_gmt>2012-05-07 19:11:34</wp:comment_date_gmt>
<wp:comment_content><![CDATA[Comment content.]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>121</wp:comment_parent>
<wp:comment_user_id>3</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key>akismet_result</wp:meta_key>
<wp:meta_value><![CDATA[false]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key>akismet_history</wp:meta_key>
<wp:meta_value><![CDATA[a:4:{s:4:"time";s:15:"1336417895.1821";s:7:"message";s:28:"Akismet cleared this comment";s:5:"event";s:9:"check-ham";s:4:"user";s:3:"bob";}]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key>akismet_as_submitted</wp:meta_key>
<wp:meta_value><![CDATA[a:65:{s:15:"comment_post_ID";s:3:"422";s:14:"comment_author";s:3:"bob";s:20:"comment_author_email";s:25:"bob@thisisa.test";s:18:"comment_author_url";s:0:"";s:15:"comment_content";s:832:"Comment content";s:12:"comment_type";s:0:"";s:14:"comment_parent";s:3:"121";s:7:"user_ID";s:1:"3";s:7:"user_ip";s:14:"127.0.0.1";s:10:"user_agent";s:139:"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/127.0.0.1 Chrome/127.0.0.1 Safari/535.19";s:8:"referrer";s:62:"http://thisisa.test/htop-un-visualiseur-interactif-de-process/";s:4:"blog";s:19:"http://thisisa.test";s:9:"blog_lang";s:5:"en_US";s:12:"blog_charset";s:5:"UTF-8";s:9:"permalink";s:62:"http://thisisa.test/htop-un-visualiseur-interactif-de-process/";s:9:"user_role";s:13:"administrator";s:21:"akismet_comment_nonce";s:6:"passed";s:12:"POST_comment";s:832:"Comment content.";s:11:"POST_submit";s:14:"Submit Comment";s:20:"POST_comment_post_ID";s:3:"422";s:19:"POST_comment_parent";s:3:"121";s:32:"POST__wp_unfiltered_html_comment";s:10:"9dacc22ee8";s:26:"POST_akismet_comment_nonce";s:10:"b9cbdae553";s:15:"SERVER_SOFTWARE";s:12:"nginx/0.8.55";s:11:"REQUEST_URI";s:21:"/wp-comments-post.php";s:4:"TERM";s:5:"xterm";s:17:"PHP_FCGI_CHILDREN";s:1:"4";s:4:"PATH";s:29:"/sbin:/usr/sbin:/bin:/usr/bin";s:1:"_";s:25:"/usr/local/bin/spawn-fcgi";s:3:"PWD";s:1:"/";s:4:"LANG";s:11:"en_US.UTF-8";s:5:"SHLVL";s:1:"2";s:21:"PHP_FCGI_MAX_REQUESTS";s:4:"1000";s:9:"FCGI_ROLE";s:9:"RESPONDER";s:12:"QUERY_STRING";s:0:"";s:14:"REQUEST_METHOD";s:4:"POST";s:12:"CONTENT_TYPE";s:33:"application/x-www-form-urlencoded";s:14:"CONTENT_LENGTH";s:4:"1143";s:11:"SCRIPT_NAME";s:21:"/wp-comments-post.php";s:12:"DOCUMENT_URI";s:21:"/wp-comments-post.php";s:13:"DOCUMENT_ROOT";s:14:"/home/blog";s:15:"SERVER_PROTOCOL";s:8:"HTTP/1.1";s:17:"GATEWAY_INTERFACE";s:7:"CGI/1.1";s:11:"REMOTE_ADDR";s:14:"127.0.0.1";s:11:"REMOTE_PORT";s:5:"10834";s:11:"SERVER_ADDR";s:13:"127.0.0.1";s:11:"SERVER_PORT";s:2:"80";s:11:"SERVER_NAME";s:12:"thisisa.test";s:15:"REDIRECT_STATUS";s:3:"200";s:15:"SCRIPT_FILENAME";s:35:"/home/blog/wp-comments-post.php";s:9:"HTTP_HOST";s:12:"thisisa.test";s:15:"HTTP_CONNECTION";s:10:"keep-alive";s:19:"HTTP_CONTENT_LENGTH";s:4:"1143";s:18:"HTTP_CACHE_CONTROL";s:9:"john-age=0";s:11:"HTTP_ORIGIN";s:19:"http://thisisa.test";s:15:"HTTP_USER_AGENT";s:139:"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/127.0.0.1 Chrome/127.0.0.1 Safari/535.19";s:17:"HTTP_CONTENT_TYPE";s:33:"application/x-www-form-urlencoded";s:11:"HTTP_ACCEPT";s:63:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";s:12:"HTTP_REFERER";s:62:"http://thisisa.test/htop-un-visualiseur-interactif-de-process/";s:20:"HTTP_ACCEPT_ENCODING";s:17:"gzip,deflate,sdch";s:20:"HTTP_ACCEPT_LANGUAGE";s:35:"fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4";s:19:"HTTP_ACCEPT_CHARSET";s:30:"ISO-8859-1,utf-8;q=0.7,*;q=0.3";s:11:"HTTP_COOKIE";s:0:"";s:8:"PHP_SELF";s:21:"/wp-comments-post.php";s:12:"REQUEST_TIME";s:10:"1336417893";}]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
</item>
<item>
<title>Post with raw data</title>
<link>http://thisisa.test/?p=173</link>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=173</guid>
<description></description>
<content:encoded><![CDATA[<h1>Pelicans are scary</h1>
Pelicans are supposed to eat fish, damn it!
<iframe width="420" height="315" src="http://www.youtube.com/embed/QNNl_uWmQXE" frameborder="0" allowfullscreen></iframe>
Bottom line: don't mess up with birds]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>173</wp:post_id>
<wp:post_date>2012-02-16 15:52:55</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>post-with-raw-data</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-2"><![CDATA[Category 2]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>A normal post with some &lt;html&gt; entities in the title. You can&#039;t miss them.</title>
<link>http://thisisa.test/?p=175</link>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=175</guid>
<description></description>
<content:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<ul>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</li>
</ul>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>175</wp:post_id>
<wp:post_date>2012-02-16 15:52:55</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>html-entity-test</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-2"><![CDATA[Category 2]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Code in List</title>
<link>http://thisisa.test/?p=175</link>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=175</guid>
<description></description>
<content:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<ul>
<li>List Item One!</li>
<li>List Item Two!</li>
<li>This is a code sample
<pre>
<code>
a = [1, 2, 3]
b = [4, 5, 6]
for i in zip(a, b):
print i
</code>
</pre></li>
<li>List Item Four!</li>
</ul>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>175</wp:post_id>
<wp:post_date>2012-02-16 15:52:55</wp:post_date>
<wp:post_date_gmt>0000-00-00 00:00:00</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>code-in-list-test</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-2"><![CDATA[Category 2]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
</channel>
</rss>

View file

@ -1,44 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
AUTHOR = 'Alexis Métaireau'
SITENAME = "Alexis' log"
SITEURL = 'http://blog.notmyidea.org'
TIMEZONE = 'UTC'
GITHUB_URL = 'http://github.com/ametaireau/'
DISQUS_SITENAME = "blog-notmyidea"
PDF_GENERATOR = False
REVERSE_CATEGORY_ORDER = True
DEFAULT_PAGINATION = 2
FEED_RSS = 'feeds/all.rss.xml'
CATEGORY_FEED_RSS = 'feeds/%s.rss.xml'
LINKS = (('Biologeek', 'http://biologeek.org'),
('Filyb', "http://filyb.info/"),
('Libert-fr', "http://www.libert-fr.com"),
('N1k0', "http://prendreuncafe.com/blog/"),
('Tarek Ziadé', "http://ziade.org/blog"),
('Zubin Mithra', "http://zubin71.wordpress.com/"),)
SOCIAL = (('twitter', 'http://twitter.com/ametaireau'),
('lastfm', 'http://lastfm.com/user/akounet'),
('github', 'http://github.com/ametaireau'),)
# global metadata to all the contents
DEFAULT_METADATA = (('yeah', 'it is'),)
# path-specific metadata
EXTRA_PATH_METADATA = {
'extra/robots.txt': {'path': 'robots.txt'},
}
# static paths will be copied without parsing their contents
STATIC_PATHS = [
'pictures',
'extra/robots.txt',
]
# foobar will not be used, because it's not in caps. All configuration keys
# have to be in caps
foobar = "barbaz"

View file

@ -1,69 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>A markdown powered article</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="index" class="home">
<header id="banner" class="body">
<h1><a href="/">A Pelican Blog </a></h1>
<nav><ul>
<li><a href="/tag/oh.html">Oh Oh Oh</a></li>
<li><a href="/override/">Override url/save_as</a></li>
<li><a href="/pages/this-is-a-test-page.html">This is a test page</a></li>
<li><a href="/category/bar.html">bar</a></li>
<li class="active"><a href="/category/cat1.html">cat1</a></li>
<li><a href="/category/misc.html">misc</a></li>
<li><a href="/category/yeah.html">yeah</a></li>
</ul></nav>
</header><!-- /#banner -->
<section id="content" class="body">
<article>
<header>
<h1 class="entry-title">
<a href="/a-markdown-powered-article.html" rel="bookmark"
title="Permalink to A markdown powered article">A markdown powered article</a></h1>
</header>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2011-04-20T00:00:00">
Wed 20 April 2011
</abbr>
<p>In <a href="/category/cat1.html">cat1</a>. </p>
</footer><!-- /.post-info --> <p>You're mutually oblivious.</p>
<p><a href="/unbelievable.html">a root-relative link to unbelievable</a>
<a href="/unbelievable.html">a file-relative link to unbelievable</a></p>
</div><!-- /.entry-content -->
</article>
</section>
<section id="extras" class="body">
<div class="social">
<h2>social</h2>
<ul>
<li><a href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate">atom feed</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
Proudly powered by <a href="http://getpelican.com/">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.
</address><!-- /#about -->
<p>The theme is by <a href="http://coding.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a>, thanks!</p>
</footer><!-- /#contentinfo -->
</body>
</html>

View file

@ -1,72 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>A Pelican Blog</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="index" class="home">
<header id="banner" class="body">
<h1><a href="/">A Pelican Blog </a></h1>
<nav><ul>
<li><a href="/tag/oh.html">Oh Oh Oh</a></li>
<li><a href="/override/">Override url/save_as</a></li>
<li><a href="/pages/this-is-a-test-page.html">This is a test page</a></li>
<li><a href="/category/bar.html">bar</a></li>
<li><a href="/category/cat1.html">cat1</a></li>
<li><a href="/category/misc.html">misc</a></li>
<li><a href="/category/yeah.html">yeah</a></li>
</ul></nav>
</header><!-- /#banner -->
<section id="content" class="body">
<h1>Archives for A Pelican Blog</h1>
<dl>
<dt>Fri 30 November 2012</dt>
<dd><a href="/filename_metadata-example.html">FILENAME_METADATA example</a></dd>
<dt>Wed 29 February 2012</dt>
<dd><a href="/second-article.html">Second article</a></dd>
<dt>Wed 20 April 2011</dt>
<dd><a href="/a-markdown-powered-article.html">A markdown powered article</a></dd>
<dt>Thu 17 February 2011</dt>
<dd><a href="/article-1.html">Article 1</a></dd>
<dt>Thu 17 February 2011</dt>
<dd><a href="/article-2.html">Article 2</a></dd>
<dt>Thu 17 February 2011</dt>
<dd><a href="/article-3.html">Article 3</a></dd>
<dt>Thu 02 December 2010</dt>
<dd><a href="/this-is-a-super-article.html">This is a super article !</a></dd>
<dt>Wed 20 October 2010</dt>
<dd><a href="/oh-yeah.html">Oh yeah !</a></dd>
<dt>Fri 15 October 2010</dt>
<dd><a href="/unbelievable.html">Unbelievable !</a></dd>
<dt>Sun 14 March 2010</dt>
<dd><a href="/tag/baz.html">The baz tag</a></dd>
</dl>
</section>
<section id="extras" class="body">
<div class="social">
<h2>social</h2>
<ul>
<li><a href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate">atom feed</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
Proudly powered by <a href="http://getpelican.com/">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.
</address><!-- /#about -->
<p>The theme is by <a href="http://coding.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a>, thanks!</p>
</footer><!-- /#contentinfo -->
</body>
</html>

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