1
0
Fork 0
forked from github/pelican

Compare commits

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

1,577 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
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
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
Julien Pivotto
c92e00f17b Add a new signal: page_writer_finalized 2014-09-19 10:12:42 +02:00
Artemy Tregubenko
304b16a9be Fixes #1405: No error message for invalid syntax in period_archives.html 2014-08-31 09:55:45 +02:00
Quentin Pradet
6ac06b28b1 Unify bottom margins of lists and paragraphs 2014-08-20 17:07:01 +02: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
451 changed files with 5136 additions and 31609 deletions

View file

@ -1,3 +0,0 @@
[report]
omit = pelican/tests/*

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"
- "3.4"
before_install:
- sudo apt-get update -qq
- sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8
install:
- pip install .
- pip install -r dev_requirements.txt
- pip install nose-cov
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,144 +0,0 @@
Filing issues
-------------
* Before you file an issue, try `asking for help`_ first.
* If determined to file an issue, first check for `existing issues`_, including
closed issues.
.. _`asking for help`: `How to get help`_
.. _`existing issues`: https://github.com/getpelican/pelican/issues
How to get help
---------------
Before you ask for help, please make sure you do the following:
1. Read the documentation_ thoroughly. If in a hurry, at least use the search
field that is provided at top-right on the documentation_ pages. Make sure
you read the docs for the Pelican version you are using.
2. Use a search engine (e.g., DuckDuckGo, Google) to search for a solution to
your problem. Someone may have already found a solution, perhaps in the
form of a plugin_ or a specific combination of settings.
3. Try reproducing the issue in a clean environment, ensuring you are using:
* latest Pelican release (or an up-to-date git clone of Pelican master)
* latest releases of libraries used by Pelican
* no plugins or only those related to the issue
**NOTE:** The most common sources of problems are anomalies in (1) themes,
(2) settings files, and (3) ``make``/``fab`` automation wrappers. If you can't
reproduce your problem when using the following steps to generate your site,
then the problem is almost certainly with your chosen theme and/or settings
file (and not Pelican itself)::
cd ~/projects/your-site
git clone https://github.com/getpelican/pelican ~/projects/pelican
pelican content -s ~/projects/pelican/samples/pelican.conf.py -t ~/projects/pelican/pelican/themes/notmyidea
If despite the above efforts you still cannot resolve your problem, be sure to
include in your inquiry the following information, preferably in the form of
links to content uploaded to a `paste service`_, GitHub repository, or other
publicly-accessible location:
* Describe what version of Pelican you are running (output of ``pelican --version``
or the HEAD commit hash if you cloned the repo) and how exactly you installed
it (the full command you used, e.g. ``pip install pelican``).
* If you are looking for a way to get some end result, prepare a detailed
description of what the end result should look like (preferably in the form of
an image or a mock-up page) and explain in detail what you have done so far to
achieve it.
* If you are trying to solve some issue, prepare a detailed description of how
to reproduce the problem. If the issue cannot be easily reproduced, it cannot
be debugged by developers or volunteers. Describe only the **minimum steps**
necessary to reproduce it (no extra plugins, etc.).
* Upload your settings file or any other custom code that would enable people to
reproduce the problem or to see what you have already tried to achieve the
desired end result.
* Upload detailed and **complete** output logs and backtraces (remember to add
the ``--debug`` flag: ``pelican --debug content [...]``)
.. _documentation: http://docs.getpelican.com/
.. _`paste service`: https://dpaste.de/
Once the above preparation is ready, you can contact people willing to help via
(preferably) the ``#pelican`` IRC channel or send a message to ``authors at getpelican dot com``.
Remember to include all the information you prepared.
The #pelican IRC channel
........................
* 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 don't have an IRC client handy, use the webchat_ for quick feedback.
* You can direct your IRC client to the channel using this `IRC link`_ or you
can manually join the ``#pelican`` IRC channel on the `freenode IRC network`_.
.. _webchat: https://kiwiirc.com/client/irc.freenode.net/?#pelican
.. _`IRC link`: irc://irc.freenode.org/pelican
.. _`freenode IRC network`: http://www.freenode.org/
Contributing code
-----------------
Before you submit a contribution, please ask whether it is desired so that you
don't spend a lot of time working on something that would be rejected for a
known reason. Consider also whether your new feature might be better suited as
a plugin_ — you can `ask for help`_ to make that determination.
Using Git and GitHub
....................
* `Create a new git branch`_ specific to your change (as opposed to making
your commits in the master branch).
* **Don't put multiple unrelated 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.
* Check for unnecessary whitespace via ``git diff --check`` before committing.
* First line of your commit message should start with present-tense verb, be 50
characters or less, and include the relevant issue number(s) if applicable.
*Example:* ``Ensure proper PLUGIN_PATH behavior. Refs #428.`` If the commit
*completely fixes* an existing bug report, please use ``Fixes #585`` or ``Fix
#585`` syntax (so the relevant issue is automatically closed upon PR merge).
* After the first line of the commit message, add a blank line and then a more
detailed explanation (when relevant).
* `Squash your commits`_ to eliminate merge commits and ensure a clean and
readable commit history.
* 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/github/hub/#installation>`_ and then run
`hub pull-request <https://github.com/github/hub/#git-pull-request>`_ to
turn your GitHub issue into a pull request containing your code.
Contribution quality standards
..............................
* Adhere to `PEP8 coding standards`_ whenever possible. 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.
* Make sure your code is compatible with Python 2.7, 3.3, and 3.4 — see our
`compatibility cheatsheet`_ for more details.
* Add docs and tests for your changes. Undocumented and untested features will
not be accepted.
* `Run all the tests`_ **on all versions of Python supported by Pelican** to
ensure nothing was accidentally broken.
Check out our `Git Tips`_ page or `ask for help`_ if you
need assistance or have any questions about these guidelines.
.. _`plugin`: 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
.. _`Squash your commits`: https://github.com/getpelican/pelican/wiki/Git-Tips#squashing-commits
.. _`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
.. _`PEP8 coding standards`: http://www.python.org/dev/peps/pep-0008/
.. _`ask for help`: `How to get help`_
.. _`compatibility cheatsheet`: http://docs.getpelican.com/en/latest/contribute.html#python-3-development-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,64 +0,0 @@
Pelican |build-status| |coverage-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)
* Fast rebuild times thanks to content caching and selective output writing.
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`_.
How to get help, contribute, or provide feedback
------------------------------------------------
See our `contribution submission and feedback guidelines <CONTRIBUTING.rst>`_.
.. 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/
.. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html
.. |build-status| image:: https://travis-ci.org/getpelican/pelican.svg?branch=master
:target: https://travis-ci.org/getpelican/pelican
:alt: Travis CI: continuous integration status
.. |coverage-status| image:: https://img.shields.io/coveralls/getpelican/pelican.svg
:target: https://coveralls.io/r/getpelican/pelican
:alt: Coveralls: code coverage status

158
THANKS
View file

@ -1,158 +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 contribute, 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
Kevin Deldycke
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 bdist_wheel 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,15 +0,0 @@
# Tests
mock
# Optional Packages
Markdown
BeautifulSoup4
lxml
typogrify
# To perform release
bumpr==0.2.0
wheel
# For docs theme
sphinx_rtd_theme

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.

View file

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

BIN
docs/_static/uml.jpg vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

View file

@ -1,231 +0,0 @@
Release history
###############
3.4.0 (2014-07-01)
==================
* Speed up content generation via new caching mechanism
* Add selective post generation (instead of always building entire site)
* Many documentation improvements, including switching to prettier RtD theme
* Add support for multiple content and plugin paths
* Add ``:modified:`` metadata field to complement ``:date:``.
Used to specify the last date and time an article was updated independently
from the date and time it was published.
* Add support for multiple authors via new ``:authors:`` metadata field
* Watch for changes in static directories when in auto-regeneration mode
* Add filters to limit log output when desired
* Add language support to drafts
* Add ``SLUGIFY_SOURCE`` setting to control how post slugs are generated
* Fix many issues relating to locale and encoding
* Apply Typogrify filter to post summary
* Preserve file metadata (e.g. time stamps) when copying static files to output
* Move AsciiDoc support from Pelican core into separate plugin
* Produce inline links instead of reference-style links when importing content
* Improve handling of ``IGNORE_FILES`` setting behavior
* Properly escape symbol characters in tag names (e.g., ``C++``)
* Minor tweaks for Python 3.4 compatibility
* Add several new signals
3.3.0 (2013-09-24)
==================
* Drop Python 3.2 support in favor of Python 3.3
* Add ``Fabfile`` so Fabric can be used for workflow automation instead of Make
* ``OUTPUT_RETENTION`` setting can be used to preserve metadata (e.g., VCS
data such as ``.hg`` and ``.git``) from being removed from output directory
* Tumblr import
* Improve logic and consistency when cleaning output folder
* Improve documentation versioning and release automation
* Improve pagination flexibility
* Rename signals for better consistency (some plugins may need to be updated)
* Move metadata extraction from generators to readers; metadata extraction no
longer article-specific
* Deprecate ``FILES_TO_COPY`` in favor of ``STATIC_PATHS`` and
``EXTRA_PATH_METADATA``
* Summaries in Markdown posts no longer include footnotes
* Remove unnecessary whitespace in output via ``lstrip_blocks`` Jinja parameter
* Move PDF generation from core to plugin
* Replace ``MARKUP`` setting with ``READERS``
* Add warning if img tag is missing ``alt`` attribute
* Add support for ``{}`` in relative links syntax, besides ``||``
* Add support for ``{tag}`` and ``{category}`` relative links
* Add a ``content_written`` signal
3.2.1 and 3.2.2
===============
* Facilitate inclusion in FreeBSD Ports Collection
3.2 (2013-04-24)
================
* Support for Python 3!
* Override page save-to location from meta-data (enables using a static page as
the site's home page, for example)
* Time period archives (per-year, per-month, and per-day archives of posts)
* Posterous blog import
* Improve WordPress blog import
* Migrate plugins to separate repository
* Improve HTML parser
* Provide ability to show or hide categories from menu using
``DISPLAY_CATEGORIES_ON_MENU`` option
* Auto-regeneration can be told to ignore files via ``IGNORE_FILES`` setting
* Improve post-generation feedback to user
* For multilingual posts, use meta-data to designate which is the original
and which is the translation
* Add ``.mdown`` to list of supported Markdown file extensions
* Document-relative URL generation (``RELATIVE_URLS``) is now off by default
3.1 (2012-12-04)
================
* Importer now stores slugs within files by default. This can be disabled with
the ``--disable-slugs`` option.
* Improve handling of links to intra-site resources
* Ensure WordPress import adds paragraphs for all types of line endings
in post content
* Decode HTML entities within WordPress post titles on import
* Improve appearance of LinkedIn icon in default theme
* Add GitHub and Google+ social icons support in default theme
* Optimize social icons
* Add ``FEED_ALL_ATOM`` and ``FEED_ALL_RSS`` to generate feeds containing all posts regardless of their language
* Split ``TRANSLATION_FEED`` into ``TRANSLATION_FEED_ATOM`` and ``TRANSLATION_FEED_RSS``
* Different feeds can now be enabled/disabled individually
* Allow for blank author: if ``AUTHOR`` setting is not set, author won't
default to ``${USER}`` anymore, and a post won't contain any author
information if the post author is empty
* Move LESS and Webassets support from Pelican core to plugin
* The ``DEFAULT_DATE`` setting now defaults to ``None``, which means that
articles won't be generated unless date metadata is specified
* Add ``FILENAME_METADATA`` setting to support metadata extraction from filename
* Add ``gzip_cache`` plugin to compress common text files into a ``.gz``
file within the same directory as the original file, preventing the server
(e.g. Nginx) from having to compress files during an HTTP call
* Add support for AsciiDoc-formatted content
* Add ``USE_FOLDER_AS_CATEGORY`` setting so that feature can be toggled on/off
* Support arbitrary Jinja template files
* Restore basic functional tests
* New signals: ``generator_init``, ``get_generators``, and
``article_generate_preread``
3.0 (2012-08-08)
================
* Refactored the way URLs are handled
* Improved the English documentation
* Fixed packaging using ``setuptools`` entrypoints
* Added ``typogrify`` support
* Added a way to disable feed generation
* Added support for ``DIRECT_TEMPLATES``
* Allow multiple extensions for content files
* Added LESS support
* Improved the import script
* Added functional tests
* Rsync support in the generated Makefile
* Improved feed support (easily pluggable with Feedburner for instance)
* Added support for ``abbr`` in reST
* Fixed a bunch of bugs :-)
2.8 (2012-02-28)
==================
* Dotclear importer
* Allow the usage of Markdown extensions
* Themes are now easily extensible
* Don't output pagination information if there is only one page
* Add a page per author, with all their articles
* Improved the test suite
* Made the themes easier to extend
* Removed Skribit support
* Added a ``pelican-quickstart`` script
* Fixed timezone-related issues
* Added some scripts for Windows support
* Date can be specified in seconds
* Never fail when generating posts (skip and continue)
* Allow the use of future dates
* Support having different timezones per language
* Enhanced the documentation
2.7 (2011-06-11)
==================
* Use ``logging`` rather than echoing to stdout
* Support custom Jinja filters
* Compatibility with Python 2.5
* Added a theme manager
* Packaged for Debian
* Added draft support
2.6 (2011-03-08)
==================
* Changes in the output directory structure
* Makes templates easier to work with / create
* Added RSS support (was Atom-only)
* Added tag support for the feeds
* Enhance the documentation
* Added another theme (brownstone)
* Added translations
* Added a way to use cleaner URLs with a rewrite url module (or equivalent)
* Added a tag cloud
* Added an autoreloading feature: the blog is automatically regenerated each time a modification is detected
* Translate the documentation into French
* Import a blog from an RSS feed
* Pagination support
* Added Skribit support
2.5 (2010-11-20)
==================
* Import from Wordpress
* Added some new themes (martyalchin / wide-notmyidea)
* First bug report!
* Linkedin support
* Added a FAQ
* Google Analytics support
* Twitter support
* Use relative URLs, not static ones
2.4 (2010-11-06)
================
* Minor themes changes
* Add Disqus support (so we have comments)
* Another code refactoring
* Added config settings about pages
* Blog entries can also be generated in PDF
2.3 (2010-10-31)
================
* Markdown support
2.2 (2010-10-30)
================
* Prettify output
* Manages static pages as well
2.1 (2010-10-30)
================
* Make notmyidea the default theme
2.0 (2010-10-30)
================
* Refactoring to be more extensible
* Change into the setting variables
1.2 (2010-09-28)
================
* Added a debug option
* Added per-category feeds
* Use filesystem to get dates if no metadata is provided
* Add Pygments support
1.1 (2010-08-19)
================
* First working version

View file

@ -1,80 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys, os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
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 = '2014, Alexis Metaireau and contributors'
exclude_patterns = ['_build']
release = __version__
version = '.'.join(release.split('.')[:1])
last_stable = '3.3.0'
rst_prolog = '''
.. |last_stable| replace:: :pelican-doc:`{0}`
'''.format(last_stable)
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
extlinks = {
'pelican-doc': ('http://docs.getpelican.com/%s/', '')
}
# -- Options for HTML output ---------------------------------------------------
html_theme = 'default'
if not on_rtd:
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
pass
html_static_path = ['_static']
# Output file base name for HTML help builder.
htmlhelp_basename = 'Pelicandoc'
html_use_smartypants = True
# If false, no module index is generated.
html_use_modindex = False
# If false, no index is generated.
html_use_index = False
# If true, links to the reST sources are added to the pages.
html_show_sourcelink = False
def setup(app):
# overrides for wide tables in RTD theme
app.add_stylesheet('theme_overrides.css') # path relative to _static
# -- 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,393 +0,0 @@
Writing content
###############
Articles and pages
==================
Pelican considers "articles" to be chronological content, such as posts on a
blog, and thus associated with a date.
The idea behind "pages" is that they are usually not temporal in nature and are
used for content that does not change very often (e.g., "About" or "Contact"
pages).
.. _internal_metadata:
File metadata
=============
Pelican tries to be smart enough to get the information it needs from the
file system (for instance, about the category of your articles), but some
information you need to provide in the form of metadata inside your files.
If you are writing your content in reStructuredText format, you can provide
this metadata in text files via the following syntax (give your file the
``.rst`` extension)::
My super title
##############
:date: 2010-10-03 10:20
:modified: 2010-10-04 18:40
:tags: thats, awesome
:category: yeah
:slug: my-super-post
:authors: Alexis Metaireau, Conan Doyle
:summary: Short version for index and feeds
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``.
Pelican also supports `Markdown Extensions`_, which might have to be installed
separately if they are not included in the default ``Markdown`` package and can
be configured and loaded via the ``MD_EXTENSIONS`` setting.
Metadata syntax for Markdown posts should follow this pattern::
Title: My super title
Date: 2010-12-03 10:20
Modified: 2010-12-05 19:30
Category: Python
Tags: pelican, publishing
Slug: my-super-post
Authors: Alexis Metaireau, Conan Doyle
Summary: Short version for index and feeds
This is the content of my super blog post.
Readers for additional formats (such as AsciiDoc_) are available via plugins.
Refer to `pelican-plugins`_ repository for those.
Pelican can also process HTML files ending in ``.html`` and ``.htm``. Pelican
interprets the HTML in a very straightforward manner, reading metadata from
``meta`` tags, the title from the ``title`` tag, and the body out from the
``body`` tag::
<html>
<head>
<title>My super title</title>
<meta name="tags" content="thats, awesome" />
<meta name="date" content="2012-07-09 22:28" />
<meta name="modified" content="2012-07-10 20:14" />
<meta name="category" content="yeah" />
<meta name="authors" content="Alexis Métaireau, Conan Doyle" />
<meta name="summary" content="Short version for index and feeds" />
</head>
<body>
This is the content of my super blog post.
</body>
</html>
With HTML, there is one simple exception to the standard metadata: ``tags`` can
be specified either via the ``tags`` metadata, as is standard in Pelican, or
via the ``keywords`` metadata, as is standard in HTML. The two can be used
interchangeably.
Note that, aside from the title, none of this 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`__.
.. note::
When experimenting with different settings (especially the metadata
ones) caching may interfere and the changes may not be visible. In
such cases disable caching with ``LOAD_CONTENT_CACHE = False`` or
use the ``--ignore-cache`` command-line switch.
__ `W3C ISO 8601`_
``modified`` should be last time you updated the article, and defaults to ``date`` if not specified.
Besides you can show ``modified`` in the templates, feed entries in feed readers will be updated automatically
when you set ``modified`` to the current date after you modified your article.
``authors`` is a comma-separated list of article authors. If there's only one author you
can use ``author`` field.
If you do not explicitly specify summary metadata for a given post, the
``SUMMARY_MAX_LENGTH`` setting can be used to specify how many words from the
beginning of an article are used as the summary.
You can also 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 site
==========================
It is possible to import your site from WordPress, Tumblr, Dotclear, 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.
.. note::
This core Pelican functionality does not create sub-sites
(e.g. ``example.com/de``) with translated templates for each
language. For such advanced functionality the `i18n_subsites
plugin`_ can be used.
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.
.. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime
.. _AsciiDoc: http://www.methods.co.nz/asciidoc/
.. _pelican-plugins: http://github.com/getpelican/pelican-plugins
.. _Markdown Extensions: http://pythonhosted.org/Markdown/extensions/
.. _i18n_subsites plugin: http://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites

View file

@ -1,206 +0,0 @@
Contributing and feedback guidelines
####################################
There are many ways to contribute to Pelican. You can improve the
documentation, add missing features, and fix bugs (or just report them). You
can also help out by reviewing and commenting on
`existing issues <https://github.com/getpelican/pelican/issues>`_.
Don't hesitate to fork Pelican and submit an issue or pull request on GitHub.
When doing so, please 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 .
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=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/
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.
Logging tips
============
Try to use logging with appropriate levels.
For logging messages that are not repeated, use the usual Python way::
# at top of file
import logging
logger = logging.getLogger(__name__)
# when needed
logger.warning("A warning with %s formatting", arg_to_be_formatted)
Do not format log messages yourself. Use ``%s`` formatting in messages and pass
arguments to logger. This is important, because Pelican logger will preprocess
some arguments (like Exceptions) for Py2/Py3 compatibility.
Limiting extraneous log messages
--------------------------------
If the log message can occur several times, you may want to limit the log to
prevent flooding. In order to do that, use the ``extra`` keyword argument for
the logging message in the following format::
logger.warning("A warning with %s formatting", arg_to_be_formatted,
extra={'limit_msg': 'A generic message for too many warnings'})
Optionally, you can also set ``'limit_args'`` as a tuple of arguments in
``extra`` dict if your generic message needs formatting.
Limit is set to ``5``, i.e, first four logs with the same ``'limit_msg'`` are
outputted normally but the fifth one will be logged using
``'limit_msg'`` (and ``'limit_args'`` if present). After the fifth,
corresponding log messages will be ignored.
For example, if you want to log missing resources, use the following code::
for resource in resources:
if resource.is_missing:
logger.warning(
'The resource %s is missing', resource.name,
extra={'limit_msg': 'Other resources were missing'})
The log messages will be displayed as follows::
WARNING: The resource prettiest_cat.jpg is missing
WARNING: The resource best_cat_ever.jpg is missing
WARNING: The resource cutest_cat.jpg is missing
WARNING: The resource lolcat.jpg is missing
WARNING: Other resources were missing
Outputting traceback in the logs
--------------------------------
If you're logging inside an ``except`` block, you may want to provide the
traceback information as well. You can do that by setting ``exc_info`` keyword
argument to ``True`` during logging. However, doing so by default can be
undesired because tracebacks are long and can be confusing to regular users.
Try to limit them to ``--debug`` mode like the following::
try:
some_action()
except Exception as e:
logger.error('Exception occurred: %s', e,
exc_info=settings.get('DEBUG', False))

View file

@ -1,243 +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?
======================================================================
Please read our :doc:`feedback guidelines <contribute>`.
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.
Changes to the setting file take no effect
==========================================
When experimenting with different settings (especially the metadata
ones) caching may interfere and the changes may not be visible. In
such cases disable caching with ``LOAD_CONTENT_CACHE = False`` or
use the ``--ignore-cache`` command-line switch.
I'm creating my own theme. How do I use Pygments for syntax highlighting?
=========================================================================
Pygments adds some classes to the generated content. These classes are used by
themes to style code syntax highlighting via CSS. Specifically, you can
customize the appearance of your syntax highlighting via the ``.highlight pre``
class in your theme's CSS file. To see how various styles can be used to render
Django code, for example, use the style selector drop-down at top-right on the
`Pygments project demo site <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.
==========================================================================
If you try to generate Markdown content without first installing the Markdown
library, may see a message that says ``No valid files found in content``.
Markdown is not a hard dependency for Pelican, so if you have content in
Markdown format, you will need to explicitly install the Markdown library.
You can do so by typing the following command, prepending ``sudo`` if
permissions require it::
pip install markdown
Can I use arbitrary metadata in my templates?
==============================================
Yes. For example, to include a modified date in a Markdown post, one could
include the following at the top of the article::
Modified: 2012-08-08
For reStructuredText, this metadata should of course be prefixed with a colon::
:Modified: 2012-08-08
This metadata can then be accessed in templates such as ``article.html`` via::
{% if article.modified %}
Last modified: {{ article.modified }}
{% endif %}
If you want to include metadata in templates outside the article context (e.g.,
``base.html``), the ``if`` statement should instead be::
{% if article and article.modified %}
How do I 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!
If the original blog index is still wanted, it can then be saved in a
different location by setting ``INDEX_SAVE_AS = 'blog_index.html`` for
the ``''index'`` direct template.
What if I want to disable feed generation?
==========================================
To disable feed generation, all feed settings should be set to ``None``.
All but three feed settings already default to ``None``, so if you want to
disable all feed generation, you only need to specify the following settings::
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
The word ``None`` should not be surrounded by quotes. Please note that ``None``
and ``''`` are not the same thing.
I'm getting a warning about feeds generated without SITEURL being set properly
==============================================================================
`RSS and Atom feeds require all URL links to be absolute
<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 = ''
Why does Pelican always write all HTML files even with content caching enabled?
===============================================================================
In order to reliably determine whether the HTML output is different
before writing it, a large part of the generation environment
including the template contexts, imported plugins, etc. would have to
be saved and compared, at least in the form of a hash (which would
require special handling of unhashable types), because of all the
possible combinations of plugins, pagination, etc. which may change in
many different ways. This would require a lot more processing time
and memory and storage space. Simply writing the files each time is a
lot faster and a lot more reliable.
However, this means that the modification time of the files changes
every time, so a ``rsync`` based upload will transfer them even if
their content hasn't changed. A simple solution is to make ``rsync``
use the ``--checksum`` option, which will make it compare the file
checksums in a much faster way than Pelican would.
When only several specific output files are of interest (e.g. when
working on some specific page or the theme templates), the
`WRITE_SELECTED` option may help, see
:ref:`writing_only_selected_content`.
How to process only a subset of all articles?
=============================================
It is often useful to process only e.g. 10 articles for debugging
purposes. This can be achieved by explicitly specifying only the
filenames of those articles in ``ARTICLE_PATHS``. A list of such
filenames could be found using a command similar to ``cd content;
find -name '*.md' | head -n 10``.

View file

@ -1,114 +0,0 @@
.. _import:
Importing an existing site
##########################
Description
===========
``pelican-import`` is a command-line tool for converting articles from other
software to reStructuredText or Markdown. The supported import formats are:
- 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,85 +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_. Highlights include:
* Write your content directly with your editor of choice
in reStructuredText_ or Markdown_ formats
* Includes a simple CLI tool to (re)generate your site
* Easy to interface with distributed version control systems and web hooks
* Completely static output is easy to host anywhere
Ready to get started? Check out the :doc:`Quickstart<quickstart>` guide.
Features
--------
Pelican |version| currently supports:
* Articles (e.g., blog posts) and pages (e.g., "About", "Projects", "Contact")
* Comments, via an external service (Disqus). If you prefer to have more
control over your comment data, self-hosted comments are another option.
Check out the `Pelican Plugins`_ repository for more details.
* 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)
* Fast rebuild times thanks to content caching and selective output writing
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
How to get help, contribute, or provide feedback
------------------------------------------------
See our :doc:`feedback and contribution submission guidelines <contribute>`.
Documentation
-------------
.. toctree::
:maxdepth: 2
quickstart
install
content
publish
settings
themes
plugins
pelican-themes
importer
faq
tips
contribute
internals
report
changelog
.. 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 plugins`: https://github.com/getpelican/pelican-plugins

View file

@ -1,117 +0,0 @@
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
(Keep in mind that operating systems will often require you to prefix the above
command with ``sudo`` in order to install Pelican system-wide.)
While the above is the simplest method, the recommended approach is to create
a virtual environment for Pelican via virtualenv_ before installing Pelican.
Assuming you have virtualenv_ installed, you can then open a new terminal
session and create a new virtual environment for Pelican::
virtualenv ~/virtualenvs/pelican
cd ~/virtualenvs/pelican
source bin/activate
Once the virtual environment has been created and activated, Pelican can be
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"
Once Pelican is installed, you can run ``pelican --help`` to see basic usage
options. For more detail, refer to the :doc:`Publish<publish>` section.
Optional packages
-----------------
If you plan on using `Markdown <http://pypi.python.org/pypi/Markdown>`_ as a
markup format, you'll need to install the Markdown library::
pip install Markdown
Typographical enhancements can be enabled in your settings file, but first the
requisite `Typogrify <http://pypi.python.org/pypi/typogrify>`_ library must be
installed::
pip install typogrify
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
* `python-dateutil <https://pypi.python.org/pypi/python-dateutil>`_, to read
the date metadata
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.
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* — shown in parentheses below — 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.
.. _virtualenv: http://www.virtualenv.org/

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 and Markdown
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 (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,155 +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``

View file

@ -1,224 +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,]
.. note::
When experimenting with different plugins (especially the ones that
deal with metadata and content) caching may interfere and the
changes may not be visible. In such cases disable caching with
``LOAD_CONTENT_CACHE = False`` or use the ``--ignore-cache``
command-line switch.
If your plugins are not in an importable path, you can specify a list of paths
via the ``PLUGIN_PATHS`` setting. As shown in the following example, paths in
the ``PLUGIN_PATHS`` list can be absolute or relative to the settings file::
PLUGIN_PATHS = ["plugins", "/srv/pelican/plugins"]
PLUGINS = ["assets", "liquid_tags", "sitemap"]
Where to find plugins
=====================
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)
.. note::
Signal receivers are weakly-referenced and thus must not be defined within
your ``register`` callable or they will be garbage-collected before the
signal is emitted.
List of signals
===============
Here is the list of currently implemented signals:
================================= ============================ ===========================================================================
Signal Arguments Description
================================= ============================ ===========================================================================
initialized pelican object
finalized pelican object invoked after all the generators are executed and just before pelican exits
useful for custom post processing actions, such as:
- minifying js/css assets.
- notify/ping search engines with an updated sitemap.
generator_init generator invoked in the Generator.__init__
readers_init readers invoked in the Readers.__init__
article_generator_context article_generator, metadata
article_generator_preread article_generator invoked before a article is read in ArticlesGenerator.generate_context;
use if code needs to do something before every article is parsed
article_generator_init article_generator invoked in the ArticlesGenerator.__init__
article_generator_pretaxonomy article_generator invoked before categories and tags lists are created
useful when e.g. modifying the list of articles to be generated
so that removed articles are not leaked in categories or tags
article_generator_finalized article_generator invoked at the end of ArticlesGenerator.generate_context
article_generator_write_article article_generator, content invoked before writing each article, the article is passed as content
article_writer_finalized article_generator, writer invoked after all articles and related pages have been written, but before
the article generator is closed.
get_generators pelican object invoked in Pelican.get_generator_classes,
can return a Generator, or several
generators in a tuple or in a list.
get_writer pelican object invoked in Pelican.get_writer,
can return a custom Writer.
page_generator_context page_generator, metadata
page_generator_preread page_generator invoked before a page is read in PageGenerator.generate_context;
use if code needs to do something before every page is parsed.
page_generator_init page_generator invoked in the PagesGenerator.__init__
page_generator_finalized page_generator invoked at the end of PagesGenerator.generate_context
static_generator_context static_generator, metadata
static_generator_preread static_generator invoked before a static file is read in StaticGenerator.generate_context;
use if code needs to do something before every static file is added to the
staticfiles list.
static_generator_init static_generator invoked in the StaticGenerator.__init__
static_generator_finalized static_generator invoked at the end of StaticGenerator.generate_context
content_object_init content_object invoked at the end of Content.__init__ (see note below)
content_written path, context invoked each time a content file is written.
feed_written path, context, feed invoked each time a feed 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(pelican_object):
# define a new generator here if you need to
return MyGenerator
signals.get_generators.connect(get_generators)

View file

@ -1,174 +0,0 @@
Publish your site
#################
Site generation
===============
Once Pelican is installed and you have some content (e.g., in Markdown or reST
format), you can convert your content into HTML via the ``pelican`` command,
specifying the path to your content and (optionally) the path to your
:doc:`settings<settings>` file::
pelican /path/to/your/content/ [-s path/to/your/settings.py]
The above command will generate your site and save it in the ``output/``
folder, using the default theme to produce a simple site. The default theme
consists of very simple HTML without styling and is provided so folks may use
it as a basis for creating their own themes.
You can also tell Pelican to watch for your modifications, instead of
manually re-running it every time you want to see your changes. To enable this,
run the ``pelican`` command with the ``-r`` or ``--autoreload`` option.
Pelican has other command-line switches available. Have a look at the help to
see all the options you can use::
pelican --help
Viewing the generated files
---------------------------
The files generated by Pelican are static files, so you don't actually need
anything special to view them. You can use your browser to open the generated
HTML files directly::
firefox output/index.html
Because the above method may have trouble locating your CSS and other linked
assets, running 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/
Deployment
==========
After you have generated your site, previewed it in your local development
environment, and are ready to deploy it to production, you might first
re-generate your site with any production-specific settings (e.g., analytics
feeds, etc.) that you may have defined::
pelican content -s publishconf.py
The steps for deploying your site will depend on where it will be hosted.
If you have SSH access to a server running Nginx or Apache, you might use the
``rsync`` tool to transmit your site files::
rsync --avc --delete output/ host.example.com:/var/www/your-site/
There are many other deployment options, some of which can be configured when
first setting up your site via the ``pelican-quickstart`` command. See the
:doc:`Tips<tips>` page for detail on publishing via GitHub Pages.
Automation
==========
While the ``pelican`` command is the canonical way to generate your site,
automation tools can be used to streamline the generation and publication
flow. One of the questions asked during the ``pelican-quickstart`` process
pertains to whether you want to automate site generation and publication.
If you answered "yes" to that question, a ``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.
(The default ``Makefile`` and ``devserver.sh`` scripts use the ``python`` and
``pelican`` executables to complete its tasks. If you want to use different
executables, such as ``python3``, you can set the ``PY`` and ``PELICAN``
environment variables, respectively, to override the default executable names.)
.. _Fabric: http://fabfile.org/

View file

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

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,892 +0,0 @@
Settings
########
Pelican is configurable thanks to a settings file you can pass to
the command line::
pelican content -s path/to/your/pelicanconf.py
(If you used the ``pelican-quickstart`` command, your primary settings file will
be named ``pelicanconf.py`` by default.)
.. note::
When experimenting with different settings (especially the metadata
ones) caching may interfere and the changes may not be visible. In
such cases disable caching with ``LOAD_CONTENT_CACHE = False`` or
use the ``--ignore-cache`` command-line switch.
Settings are configured in the form of a Python module (a file). There is an
`example settings file
<https://github.com/getpelican/pelican/raw/master/samples/pelican.conf.py>`_
available for reference.
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 (followed by default value, if any) 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 locale" 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.
``DOCUTILS_SETTINGS = {}`` Extra configuration settings for the docutils publisher
(applicable only to reStructuredText). See `Docutils
Configuration`_ settings for more details.
``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` and ``SLUGIFY_SOURCE``.
``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. Relative paths
require correct OS-specific directory separators (i.e. / in UNIX and
\\ in Windows) unlike some other Pelican file settings.
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.
``LOG_FILTER = []`` A list of tuples containing the logging level (up to ``warning``)
and the message to be ignored.
For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]``
``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`` Path to content directory to be processed by Pelican. If undefined,
and content path is not specified via an argument to the ``pelican``
command, Pelican will use the current working directory.
``PAGE_PATHS = ['pages']`` A list of directories and files to look at for pages,
relative to ``PATH``.
``PAGE_EXCLUDES = []`` A list of directories to exclude when looking for pages in addition
to ``ARTICLE_PATHS``.
``ARTICLE_PATHS = ['']`` A list of directories and files to look at for articles,
relative to ``PATH``.
``ARTICLE_EXCLUDES = []`` A list of directories to exclude when looking for articles in addition
to ``PAGE_PATHS``.
``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`.
``PLUGIN_PATHS = []`` A list of directories where to look for plugins. 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']`` A list of directories (relative to ``PATH``) in which to look for
static files. Such files will be copied to the output directory
without modification. Articles, pages, and other content source
files will normally be skipped, so it is safe for a directory to
appear both here and in ``PAGE_PATHS`` or ``ARTICLE_PATHS``.
Pelican's default settings include the "images" directory here.
``STATIC_EXCLUDES = []`` A list of directories to exclude when looking for static files.
``STATIC_EXCLUDE_SOURCES = True`` If set to False, content source files will not be skipped when
copying files found in ``STATIC_PATHS``.
``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
<https://pypi.python.org/pypi/typogrify>`_ library,
which can be installed via: ``pip install typogrify``
``TYPOGRIFY_IGNORE_TAGS = []`` A list of tags for Typogrify to ignore. By default
Typogrify will ignore ``pre`` and ``code`` tags. This
requires that Typogrify version 2.0.4 or later is installed
``DIRECT_TEMPLATES =`` ``('index', 'categories', 'authors', '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.
``WITH_FUTURE_DATES = True`` If disabled, content with dates in the future will get a default
status of ``draft``. See :ref:`reading_only_modified_content`
for caveats.
``INTRASITE_LINK_REGEX = '[{|](?P<what>.*?)[|}]'`` Regular expression that is used to parse internal links. Default
syntax when linking 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.
``SLUGIFY_SOURCE = 'title'`` Specifies where you want the slug to be automatically generated
from. Can be set to ``title`` to use the 'Title:' metadata tag or
``basename`` to use the article's file name when creating the slug.
``CACHE_CONTENT = True`` If ``True``, save content in a cache file.
See :ref:`reading_only_modified_content` for details about caching.
``CONTENT_CACHING_LAYER = 'reader'`` If set to ``'reader'``, save only the raw content and metadata
returned by readers. If set to ``'generator'``, save processed
content objects.
``CACHE_PATH = 'cache'`` Directory in which to store cache files.
``GZIP_CACHE = True`` If ``True``, use gzip to (de)compress the cache files.
``CHECK_MODIFIED_METHOD = 'mtime'`` Controls how files are checked for modifications.
``LOAD_CONTENT_CACHE = True`` If ``True``, load unmodified content from cache.
``AUTORELOAD_IGNORE_CACHE = False`` If ``True``, do not load content cache in autoreload mode
when the settings file changes.
``WRITE_SELECTED = []`` If this list is not empty, **only** output files with their paths
in this list are written. Paths should be either absolute or relative
to the current Pelican working directory. For possible use cases see
:ref:`writing_only_selected_content`.
=============================================================================== =====================================================================
.. [#] 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 in the
:doc:`Installation <install>` section, 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 (see
example below). 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`_ for more information.
.. _Python datetime documentation:
http://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior
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'``
* ``PAGE_URL = 'pages/{slug}/'``
* ``PAGE_SAVE_AS = 'pages/{slug}/index.html'``
This would save your articles into something like ``/posts/2011/Aug/07/sample-post/index.html``,
save your pages into ``/pages/about/index.html``, and render them available at
URLs of ``/posts/2011/Aug/07/sample-post/`` and ``/pages/about/``, respectively.
====================================================== ==============================================================
Setting name (followed by default value, if any) 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_ORDER_BY = 'slug'`` The metadata attribute used to sort articles. By default,
the ``articles_page.object_list`` template variable is
ordered by slug. If you modify this, make sure all
articles contain the attribute you specify. You can also
specify a "sorting" function of one argument that is used
to extract a comparison key from each article. For example,
sorting by title without using the built-in functionality
would use the function ``operator.attrgetter('title')``.
``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.
``DRAFT_URL = 'drafts/{slug}.html'`` The URL to refer to an article draft.
``DRAFT_SAVE_AS = 'drafts/{slug}.html'`` The place where we will save an article draft.
``DRAFT_LANG_URL = 'drafts/{slug}-{lang}.html'`` The URL to refer to an article draft which doesn't
use the default language.
``DRAFT_LANG_SAVE_AS = 'drafts/{slug}-{lang}.html'`` The place where we will save an article draft 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_ORDER_BY = 'basename'`` The metadata attribute used to sort pages. By default
the ``PAGES`` template variable is ordered by basename
(i.e., path not included). Note that the option ``'basename'``
is a special option supported in the source code. If
you modify this setting, make sure all pages contain
the attribute you specify. You can also specify a "sorting"
function of one argument that is used to extract a comparison
key from each page. For example, the basename function looks
similar to
``lambda x: os.path.basename(getattr(x, 'source_path', ''))``.
``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.
``AUTHOR_URL = 'author/{slug}.html'`` The URL to use for an author.
``AUTHOR_SAVE_AS = 'author/{slug}.html'`` The location to save an author.
``YEAR_ARCHIVE_SAVE_AS = ''`` The location to save per-year archives of your posts.
``MONTH_ARCHIVE_SAVE_AS = ''`` The location to save per-month archives of your posts.
``DAY_ARCHIVE_SAVE_AS = ''`` 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 ``''`` to prevent the
relevant page from being generated.
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.
``DIRECT_TEMPLATES``, which are ``('index', 'tags', 'categories', 'archives')``
by default, work a bit differently than noted above. Only the ``_SAVE_AS``
settings are available, but it is available for any direct template.
============================================= ======================================================
Setting name (followed by default value) What does it do?
============================================= ======================================================
``ARCHIVES_SAVE_AS = 'archives.html'`` The location to save the article archives page.
``YEAR_ARCHIVE_SAVE_AS = ''`` The location to save per-year archives of your posts.
``MONTH_ARCHIVE_SAVE_AS = ''`` The location to save per-month archives of your posts.
``DAY_ARCHIVE_SAVE_AS = ''`` The location to save per-day archives of your posts.
``AUTHORS_SAVE_AS = 'authors.html'`` The location to save the author list.
``CATEGORIES_SAVE_AS = 'categories.html'`` The location to save the category list.
``TAGS_SAVE_AS = 'tags.html'`` The location to save the tag list.
``INDEX_SAVE_AS = 'index.html'`` The location to save the list of all articles.
============================================= ======================================================
URLs for direct template pages are theme-dependent. Some themes use
corresponding ``*_URL`` setting as string, while others hard-code them:
``'archives.html'``, ``'authors.html'``, ``'categories.html'``, ``'tags.html'``.
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.
In addition to the standard C89 strftime format codes that are listed in
`Python strftime documentation`_, you can use ``-`` character between ``%`` and
the format character to remove any leading zeros. For example, ``%d/%m/%Y`` will
output ``01/01/2014`` whereas ``%-d/%-m/%Y`` will result in ``1/1/2014``.
.. 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.
.. _Python strftime documentation: 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 = [
'static/robots.txt',
]
EXTRA_PATH_METADATA = {
'static/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 (followed by default value, if any) 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-posts 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.
``AUTHOR_FEED_ATOM = 'feeds/%s.atom.xml'`` [2]_ Where to put the author Atom feeds.
``AUTHOR_FEED_RSS = 'feeds/%s.rss.xml'`` [2]_ Where to put the author 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``, i.e. 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 (followed by default value, if any) 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 (followed by 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-1 to tag-N,
where N matches ``TAG_CLOUD_STEPS``), tag-1 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-1 {
font-size: 150%;
}
li.tag-2 {
font-size: 120%;
}
...
Translations
============
Pelican offers a way to translate articles. See the :doc:`Content <content>` section for
more information.
======================================================== =====================================================
Setting name (followed by default value, if any) 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 (followed by 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 (followed by default value, if any) 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 https://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 = "/home/myuser/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`` Set to 'UA-XXXX-YYYY' to activate Google Analytics.
``GOSQUARED_SITENAME`` Set to '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"
Logging
=======
Sometimes, a long list of warnings may appear during site generation. Finding
the **meaningful** error message in the middle of tons of annoying log output
can be quite tricky. In order to filter out redundant log messages, Pelican
comes with the ``LOG_FILTER`` setting.
``LOG_FILTER`` should be a list of tuples ``(level, msg)``, each of them being
composed of the logging level (up to ``warning``) and the message to be ignored.
Simply populate the list with the log messages you want to hide, and they will
be filtered out.
For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]``
.. _reading_only_modified_content:
Reading only modified content
=============================
To speed up the build process, Pelican can optionally read only articles
and pages with modified content.
When Pelican is about to read some content source file:
1. The hash or modification time information for the file from a
previous build are loaded from a cache file if ``LOAD_CONTENT_CACHE``
is ``True``. These files are stored in the ``CACHE_PATH``
directory. If the file has no record in the cache file, it is read
as usual.
2. The file is checked according to ``CHECK_MODIFIED_METHOD``:
- If set to ``'mtime'``, the modification time of the file is
checked.
- If set to a name of a function provided by the ``hashlib``
module, e.g. ``'md5'``, the file hash is checked.
- If set to anything else or the necessary information about the
file cannot be found in the cache file, the content is read as
usual.
3. If the file is considered unchanged, the content data saved in a
previous build corresponding to the file is loaded from the cache,
and the file is not read.
4. If the file is considered changed, the file is read and the new
modification information and the content data are saved to the
cache if ``CACHE_CONTENT`` is ``True``.
If ``CONTENT_CACHING_LAYER`` is set to ``'reader'`` (the default),
the raw content and metadata returned by a reader are cached. If this
setting is instead set to ``'generator'``, the processed content
object is cached. Caching the processed content object may conflict
with plugins (as some reading related signals may be skipped) and the
``WITH_FUTURE_DATES`` functionality (as the ``draft`` status of the
cached content objects would not change automatically over time).
Checking modification times is faster than comparing file hashes,
but it is not as reliable because ``mtime`` information can be lost,
e.g., when copying content source files using the ``cp`` or ``rsync``
commands without the ``mtime`` preservation mode (which for ``rsync``
can be invoked by passing the ``--archive`` flag).
The cache files are Python pickles, so they may not be readable by
different versions of Python as the pickle format often changes. If
such an error is encountered, the cache files have to be rebuilt by
removing them and re-running Pelican, or by using the Pelican
command-line option ``--ignore-cache``. The cache files also have to
be rebuilt when changing the ``GZIP_CACHE`` setting for cache file
reading to work properly.
The ``--ignore-cache`` command-line option is also useful when the
whole cache needs to be regenerated, such as when making modifications
to the settings file that will affect the cached content, or just for
debugging purposes. When Pelican runs in autoreload mode, modification
of the settings file will make it ignore the cache automatically if
``AUTORELOAD_IGNORE_CACHE`` is ``True``.
Note that even when using cached content, all output is always
written, so the modification times of the generated ``*.html`` files
will always change. Therefore, ``rsync``-based uploading may benefit
from the ``--checksum`` option.
.. _writing_only_selected_content:
Writing only selected content
=============================
When only working on a single article or page, or making tweaks to
your theme, it is often desirable to generate and review your work
as quickly as possible. In such cases, generating and writing the
entire site output is often unnecessary. By specifying only the
desired files as output paths in the ``WRITE_SELECTED`` list,
**only** those files will be written. This list can be also specified
on the command line using the ``--write-selected`` option, which
accepts a comma-separated list of output file paths. By default this
list is empty, so all output is written.
Example settings
================
.. literalinclude:: ../samples/pelican.conf.py
:language: python
.. _Jinja custom filters documentation: http://jinja.pocoo.org/docs/api/#custom-filters
.. _Docutils Configuration: http://docutils.sourceforge.net/docs/user/config.html

View file

@ -1,451 +0,0 @@
.. _theming-pelican:
Creating themes
###############
To generate its HTML output, Pelican uses the `Jinja <http://jinja.pocoo.org/>`_
templating engine due to its flexibility and straightforward syntax. If you want
to create your own theme, feel free to take inspiration from the `"simple" theme
<https://github.com/getpelican/pelican/tree/master/pelican/themes/simple/templates>`_.
To generate your site using a theme you have created (or downloaded manually and
then modified), you can specify that theme via the ``-t`` flag::
pelican content -s pelicanconf.py -t /projects/your-site/themes/your-theme
If you'd rather not specify the theme on every invocation, you can define
``THEME`` in your settings to point to the location of your preferred theme.
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 home page,
output_file will be "index.html".
articles The list of articles, ordered descending by date.
All the elements are `Article` objects, so you can
access their attributes (e.g. title, summary, author
etc.). Sometimes this is shadowed (for instance in
the tags page). You will then find info about it
in the `all_articles` variable.
dates The same list of articles, but ordered by date,
ascending.
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 or index of your blog, generated at ``index.html``.
If pagination is active, subsequent pages will reside in ``index{number}.html``.
====================== ===================================================
Variable Description
====================== ===================================================
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
articles_previous_page The previous page of articles (``None`` if page does
not exist)
articles_next_page The next page of articles (``None`` if page does
not exist)
dates_paginator A paginator object for the article list, ordered by
date, ascending.
dates_page The current page of articles, ordered by date,
ascending.
dates_previous_page The previous page of articles, ordered by date,
ascending (``None`` if page does not exist)
dates_next_page The next page of articles, ordered by date,
ascending (``None`` if page does not exist)
page_name 'index' -- useful for pagination links
====================== ===================================================
author.html
-------------
This template will be processed for each of the existing authors, with
output generated according to the ``AUTHOR_SAVE_AS`` setting (`Default:`
``author/{author_name}.html``). If pagination is active, subsequent pages will by
default reside at ``author/{author_name}{number}.html``.
====================== ===================================================
Variable Description
====================== ===================================================
author The name of the author being processed
articles Articles by this author
dates Articles by this author, but ordered by date,
ascending
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
articles_previous_page The previous page of articles (``None`` if page does
not exist)
articles_next_page The next page of articles (``None`` if page does
not exist)
dates_paginator A paginator object for the article list, ordered by
date, ascending.
dates_page The current page of articles, ordered by date,
ascending.
dates_previous_page The previous page of articles, ordered by date,
ascending (``None`` if page does not exist)
dates_next_page The next page of articles, ordered by date,
ascending (``None`` if page does not exist)
page_name AUTHOR_URL where everything after `{slug}` is
removed -- useful for pagination links
====================== ===================================================
category.html
-------------
This template will be processed for each of the existing categories, with
output generated according to the ``CATEGORY_SAVE_AS`` setting (`Default:`
``category/{category_name}.html``). If pagination is active, subsequent pages will by
default reside at ``category/{category_name}{number}.html``.
====================== ===================================================
Variable Description
====================== ===================================================
category The name of the category being processed
articles Articles for this category
dates Articles for this category, but ordered by date,
ascending
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
articles_previous_page The previous page of articles (``None`` if page does
not exist)
articles_next_page The next page of articles (``None`` if page does
not exist)
dates_paginator A paginator object for the list of articles,
ordered by date, ascending
dates_page The current page of articles, ordered by date,
ascending
dates_previous_page The previous page of articles, ordered by date,
ascending (``None`` if page does not exist)
dates_next_page The next page of articles, ordered by date,
ascending (``None`` if page does not exist)
page_name CATEGORY_URL where everything after `{slug}` is
removed -- useful for pagination links
====================== ===================================================
article.html
-------------
This template will be processed for each article, with
output generated according to the ``ARTICLE_SAVE_AS`` setting (`Default:`
``{article_name}.html``). The following variables are available when
rendering.
============= ===================================================
Variable Description
============= ===================================================
article The article object to be displayed
category The name of the category for the current article
============= ===================================================
Any metadata that you put in the header of the article source file
will be available as fields on the ``article`` object. The field name will be
the same as the name of the metadata field, except in all-lowercase characters.
For example, you could add a field called `FacebookImage` to your article
metadata, as shown below:
.. code-block:: markdown
Title: I love Python more than music
Date: 2013-11-06 10:06
Tags: personal, python
Category: Tech
Slug: python-je-l-aime-a-mourir
Author: Francis Cabrel
FacebookImage: http://franciscabrel.com/images/pythonlove.png
This new metadata will be made available as `article.facebookimage` in your
`article.html` template. This would allow you, for example, to specify an
image for the Facebook open graph tags that will change for each article:
.. code-block:: html+jinja
<meta property="og:image" content="{{ article.facebookimage }}"/>
page.html
---------
This template will be processed for each page, with
output generated according to the ``PAGE_SAVE_AS`` setting (`Default:`
``pages/{page_name}.html``). The following variables are available when
rendering.
============= ===================================================
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
output generated according to the ``TAG_SAVE_AS`` setting (`Default:`
``tag/{tag_name}.html``). If pagination is active, subsequent pages will by
default reside at ``tag/{tag_name}{number}.html``.
====================== ===================================================
Variable Description
====================== ===================================================
tag The name of the tag being processed
articles Articles related to this tag
dates Articles related to this tag, but ordered by date,
ascending
articles_paginator A paginator object for the list of articles
articles_page The current page of articles
articles_previous_page The previous page of articles (``None`` if page does
not exist)
articles_next_page The next page of articles (``None`` if page does
not exist)
dates_paginator A paginator object for the list of articles,
ordered by date, ascending
dates_page The current page of articles, ordered by date,
ascending
dates_previous_page The previous page of articles, ordered by date,
ascending (``None`` if page does not exist)
dates_next_page The next page of articles, ordered by date,
ascending (``None`` if page does not exist)
page_name TAG_URL where everything after `{slug}` is removed
-- useful for pagination links
====================== ===================================================
period_archives.html
--------------------
This template will be processed for each year of your posts if a path
for ``YEAR_ARCHIVE_SAVE_AS`` is defined, each month if ``MONTH_ARCHIVE_SAVE_AS``
is defined, and each day if ``DAY_ARCHIVE_SAVE_AS`` is defined.
=================== ===================================================
Variable Description
=================== ===================================================
period A tuple of the form (`year`, `month`, `day`) that
indicates the current time period. `year` and `day`
are numbers while `month` is a string. This tuple
only contains `year` if the time period is a
given year. It contains both `year` and `month`
if the time period is over years and months and
so on.
=================== ===================================================
You can see an example of how to use `period` in the `"simple" theme
<https://github.com/getpelican/pelican/blob/master/pelican/themes/simple/templates/period_archives.html>`_.
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`` theme in your own themes by
using the ``{% extends %}`` directive as in the following example:
.. code-block:: html+jinja
{% extends "!simple/index.html" %} <!-- extends the ``index.html`` template from the ``simple`` theme -->
{% extends "index.html" %} <!-- "regular" extending -->
Example
-------
With this system, it is possible to create a theme with just two files.
base.html
"""""""""
The first file is the ``templates/base.html`` template:
.. code-block:: html+jinja
{% extends "!simple/base.html" %}
{% block head %}
{{ super() }}
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/style.css" />
{% endblock %}
1. On the first line, we extend the ``base.html`` template from the ``simple``
theme, so we don't have to rewrite the entire file.
2. On the third line, we open the ``head`` block which has already been defined
in the ``simple`` theme.
3. On the fourth line, the function ``super()`` keeps the content previously
inserted in the ``head`` block.
4. On the fifth line, we append a stylesheet to the page.
5. On the last line, we close the ``head`` block.
This file will be extended by all the other templates, so the stylesheet will
be linked from all pages.
style.css
"""""""""
The second file is the ``static/css/style.css`` CSS stylesheet:
.. code-block:: css
body {
font-family : monospace ;
font-size : 100% ;
background-color : white ;
color : #111 ;
width : 80% ;
min-width : 400px ;
min-height : 200px ;
padding : 1em ;
margin : 5% 10% ;
border : thin solid gray ;
border-radius : 5px ;
display : block ;
}
a:link { color : blue ; text-decoration : none ; }
a:hover { color : blue ; text-decoration : underline ; }
a:visited { color : blue ; }
h1 a { color : inherit !important }
h2 a { color : inherit !important }
h3 a { color : inherit !important }
h4 a { color : inherit !important }
h5 a { color : inherit !important }
h6 a { color : inherit !important }
pre {
margin : 2em 1em 2em 4em ;
}
#menu li {
display : inline ;
}
#post-list {
margin-bottom : 1em ;
margin-top : 1em ;
}
Download
""""""""
You can download this example theme :download:`here <_static/theme-basic.zip>`.

View file

@ -1,101 +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/extra/`` directory and add a ``CNAME`` file to it.
Then use the ``STATIC_PATHS`` setting to tell Pelican to copy this file to your
output directory. For example::
STATIC_PATHS = ['images', 'extra/CNAME']
EXTRA_PATH_METADATA = {'extra/CNAME': {'path': 'CNAME'},}
How to add YouTube or Vimeo Videos
==================================
The easiest way is to paste the embed code of the video from these sites
directly into your source content.
Alternatively, you can also use Pelican plugins like ``liquid_tags``,
``pelican_youtube``, or ``pelican_vimeo`` to embed videos in your content.
Moreover, markup languages like reST and Markdown have plugins that let you
embed videos in the markup. You can use `reST video directive
<https://gist.github.com/dbrgn/2922648>`_ for reST or `mdx_video plugin
<https://github.com/italomaia/mdx-video>`_ for Markdown.

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,431 +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
# pelican.log has to be the first pelican module to be loaded
# because logging.setLoggerClass has to be called before logging.getLogger
from pelican.log import init
from pelican import signals
from pelican.generators import (ArticlesGenerator, PagesGenerator,
StaticGenerator, SourceFileGenerator,
TemplatePagesGenerator)
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.5.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_PATHS to system path')
_sys_path = sys.path[:]
for pluginpath in self.settings['PLUGIN_PATHS']:
sys.path.insert(0, pluginpath)
for plugin in self.settings['PLUGINS']:
# if it's a string, then import it
if isinstance(plugin, six.string_types):
logger.debug("Loading plugin `%s`", plugin)
try:
plugin = __import__(plugin, globals(), locals(),
str('module'))
except ImportError as e:
logger.error(
"Cannot load plugin `%s`\n%s", plugin, e)
continue
logger.debug("Registering plugin `%s`", 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', 'DRAFT_URL', 'DRAFT_LANG_URL',
'ARTICLE_SAVE_AS', 'ARTICLE_LANG_SAVE_AS',
'DRAFT_SAVE_AS', 'DRAFT_LANG_SAVE_AS',
'PAGE_SAVE_AS', 'PAGE_LANG_SAVE_AS'):
self.settings[setting] = os.path.join(structure,
self.settings[setting])
logger.warning("%s = '%s'", setting, self.settings[setting])
for new, old in [('FEED', 'FEED_ATOM'), ('TAG_FEED', 'TAG_FEED_ATOM'),
('CATEGORY_FEED', 'CATEGORY_FEED_ATOM'),
('TRANSLATION_FEED', 'TRANSLATION_FEED_ATOM')]:
if self.settings.get(new, False):
logger.warning(
'Found deprecated `%(new)s` in settings. Modify %(new)s '
'to %(old)s in your settings and theme for the same '
'behavior. Temporarily setting %(old)s for backwards '
'compatibility.',
{'new': new, 'old': old}
)
self.settings[old] = self.settings[new]
def run(self):
"""Run the generators and return"""
start_time = time.time()
context = self.settings.copy()
# Share these among all the generators and content objects:
context['filenames'] = {} # maps source path to Content object or None
context['localsiteurl'] = self.settings['SITEURL']
generators = [
cls(
context=context,
settings=self.settings,
path=self.path,
theme=self.theme,
output_path=self.output_path,
) for cls in self.get_generator_classes()
]
# erase the directory if it is not the source and if that's
# explicitly 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 {} article(s), {} draft(s) and {} page(s) in ' \
'{:.2f} seconds.'.format(
len(articles_generator.articles) + len(articles_generator.translations),
len(articles_generator.drafts) + \
len(articles_generator.drafts_translations),
len(pages_generator.pages) + len(pages_generator.translations),
time.time() - start_time))
def get_generator_classes(self):
generators = [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: %s', v)
generators.append(v)
# StaticGenerator runs last so it can see which files the others handle
generators.append(StaticGenerator)
return generators
def get_writer(self):
writers = [ w for (_, w) in signals.get_writer.send(self)
if isinstance(w, type) ]
writers_found = len(writers)
if writers_found == 0:
return Writer(self.output_path, settings=self.settings)
else:
writer = writers[0]
if writers_found == 1:
logger.debug('Found writer: %s', writer)
else:
logger.warning(
'%s writers found, using only first one: %s',
writers_found, writer)
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 messages, including debug messages.')
parser.add_argument('--version', action='version', version=__version__,
help='Print the pelican version and exit.')
parser.add_argument('-r', '--autoreload', dest='autoreload',
action='store_true',
help='Relaunch pelican each time a modification occurs'
' on the content files.')
parser.add_argument('--cache-path', dest='cache_path',
help=('Directory in which to store cache files. '
'If not specified, defaults to "cache".'))
parser.add_argument('--ignore-cache', action='store_true',
dest='ignore_cache', help='Ignore content cache '
'from previous runs by not loading cache files.')
parser.add_argument('-w', '--write-selected', type=str,
dest='selected_paths', default=None,
help='Comma separated list of selected paths to write')
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
if args.ignore_cache:
config['LOAD_CONTENT_CACHE'] = False
if args.cache_path:
config['CACHE_PATH'] = args.cache_path
if args.selected_paths:
config['WRITE_SELECTED'] = args.selected_paths.split(',')
config['DEBUG'] = args.verbosity == logging.DEBUG
# 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)}
for static_path in settings.get("STATIC_PATHS", []):
watchers[static_path] = folder_watcher(static_path, [''], pelican.ignore_files)
try:
if args.autoreload:
print(' --- AutoReload Mode: Monitoring `content`, `theme` and'
' `settings` for changes. ---')
def _ignore_cache(pelican_obj):
if pelican_obj.settings['AUTORELOAD_IGNORE_CACHE']:
pelican_obj.settings['LOAD_CONTENT_CACHE'] = False
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()}
original_load_cache = settings['LOAD_CONTENT_CACHE']
if modified['settings']:
pelican, settings = get_instance(args)
original_load_cache = settings['LOAD_CONTENT_CACHE']
_ignore_cache(pelican)
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()
# restore original caching policy
pelican.settings['LOAD_CONTENT_CACHE'] = original_load_cache
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 "%s". Reloading.', 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:
logger.critical('%s', e)
if args.verbosity == logging.DEBUG:
raise
else:
sys.exit(getattr(e, 'exitcode', 1))

View file

@ -1,381 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import six
from six.moves.urllib.parse import (unquote, urlparse, urlunparse)
import copy
import locale
import logging
import functools
import os
import re
import sys
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, set_date_tzinfo, SafeDatetime)
# 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()
# First, read the authors from "authors", if not, fallback to "author"
# and if not use the settings defined one, if any.
if not hasattr(self, 'author'):
if hasattr(self, 'authors'):
self.author = self.authors[0]
elif 'AUTHOR' in settings:
self.author = Author(settings['AUTHOR'], settings)
if not hasattr(self, 'authors') and hasattr(self, 'author'):
self.authors = [self.author]
# XXX Split all the following code into pieces, there is too much here.
# manage languages
self.in_default_lang = True
if 'DEFAULT_LANG' in settings:
default_lang = settings['DEFAULT_LANG'].lower()
if not hasattr(self, 'lang'):
self.lang = default_lang
self.in_default_lang = (self.lang == default_lang)
# create the slug if not existing, generate slug according to
# setting of SLUG_ATTRIBUTE
if not hasattr(self, 'slug'):
if settings['SLUGIFY_SOURCE'] == 'title' and hasattr(self, 'title'):
self.slug = slugify(self.title,
settings.get('SLUG_SUBSTITUTIONS', ()))
elif settings['SLUGIFY_SOURCE'] == 'basename' and source_path != None:
basename = os.path.basename(os.path.splitext(source_path)[0])
self.slug = slugify(basename,
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]
# manage timezone
default_timezone = settings.get('TIMEZONE', 'UTC')
timezone = getattr(self, 'timezone', default_timezone)
if hasattr(self, 'date'):
self.date = set_date_tzinfo(self.date, timezone)
self.locale_date = strftime(self.date, self.date_format)
if hasattr(self, 'modified'):
self.modified = set_date_tzinfo(self.modified, timezone)
self.locale_modified = strftime(self.modified, 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 > SafeDatetime.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', SafeDatetime.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 output content.
:param content: content resource that will be passed to the templates.
:param siteurl: siteurl which is locally generated by the writer in
case of RELATIVE_URLS.
"""
if not content:
return content
instrasite_link_regex = self.settings['INTRASITE_LINK_REGEX']
regex = r"""
(?P<markup><\s*[^\>]* # match tag with all url-value attributes
(?:href|src|poster|data|cite|formaction|action)\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 not in self._context['filenames']:
unquoted_path = path.replace('%20', ' ')
if unquoted_path in self._context['filenames']:
path = unquoted_path
if self._context['filenames'].get(path):
origin = '/'.join((siteurl,
self._context['filenames'][path].url))
origin = origin.replace('\\', '/') # for Windows paths.
else:
logger.warning(
"Unable to find `%s`, skipping url replacement.",
value.geturl(), extra = {
'limit_msg': ("Other resources were not found "
"and their urls not replaced")})
elif what == 'category':
origin = 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)
def get_siteurl(self):
return self._context.get('localsiteurl', '')
@property
def content(self):
return self.get_content(self.get_siteurl())
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._update_content(self._summary,
self.get_siteurl())
if self.settings['SUMMARY_MAX_LENGTH'] is None:
return self.content
return truncate_html_words(self.content,
self.settings['SUMMARY_MAX_LENGTH'])
@memoized
def get_summary(self, siteurl):
"""uses siteurl to be memoizable"""
return self._get_summary()
@property
def summary(self):
return self.get_summary(self.get_siteurl())
@summary.setter
def summary(self, value):
"""Dummy function"""
pass
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 Draft(Page):
mandatory_properties = ('title', '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,745 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import os
import six
import math
import random
import logging
import shutil
import fnmatch
import calendar
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, Draft, Page, Static, is_valid_content
from pelican.readers import Readers
from pelican.utils import (copy, process_translations, mkdir_p, DateFormatter,
FileStampDataCacher, python_2_unicode_compatible)
from pelican import signals
logger = logging.getLogger(__name__)
@python_2_unicode_compatible
class Generator(object):
"""Baseclass generator"""
def __init__(self, context, settings, path, theme, output_path,
readers_cache_name='', **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, readers_cache_name)
# 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: %s', 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)
#check IGNORE_FILES
ignores = self.settings['IGNORE_FILES']
if any(fnmatch.fnmatch(basename, ignore) for ignore in ignores):
return False
if extensions is False or basename.endswith(extensions):
return True
return False
def get_files(self, paths, exclude=[], extensions=None):
"""Return a list of files to use, based on rules
:param paths: the list pf paths 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)
"""
if isinstance(paths, six.string_types):
paths = [paths] # backward compatibility for older generators
# group the exclude dir names by parent path, for use with os.walk()
exclusions_by_dirpath = {}
for e in exclude:
parent_path, subdir = os.path.split(os.path.join(self.path, e))
exclusions_by_dirpath.setdefault(parent_path, set()).add(subdir)
files = []
for path in paths:
# careful: os.path.join() will add a slash when path == ''.
root = os.path.join(self.path, path) if path else self.path
if os.path.isdir(root):
for dirpath, dirs, temp_files in os.walk(root, followlinks=True):
for e in exclusions_by_dirpath.get(dirpath, ()):
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):
"""Record a source file path that a Generator found and processed.
Store a reference to its Content object, for url lookups later.
"""
location = content.get_relative_source_path()
self.context['filenames'][location] = content
def _add_failed_source_path(self, path):
"""Record a source file path that a Generator failed to process.
(For example, one that was missing mandatory metadata.)
The path argument is expected to be relative to self.path.
"""
self.context['filenames'][os.path.normpath(path)] = None
def _is_potential_source_path(self, path):
"""Return True if path was supposed to be used as a source file.
(This includes all source files that have been found by generators
before this method is called, even if they failed to process.)
The path argument is expected to be relative to self.path.
"""
return os.path.normpath(path) in self.context['filenames']
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
def __str__(self):
# return the name of the class for logging purposes
return self.__class__.__name__
class CachingGenerator(Generator, FileStampDataCacher):
'''Subclass of Generator and FileStampDataCacher classes
enables content caching, either at the generator or reader level
'''
def __init__(self, *args, **kwargs):
'''Initialize the generator, then set up caching
note the multiple inheritance structure
'''
cls_name = self.__class__.__name__
Generator.__init__(self, *args,
readers_cache_name=(cls_name + '-Readers'),
**kwargs)
cache_this_level = self.settings['CONTENT_CACHING_LAYER'] == 'generator'
caching_policy = cache_this_level and self.settings['CACHE_CONTENT']
load_policy = cache_this_level and self.settings['LOAD_CONTENT_CACHE']
FileStampDataCacher.__init__(self, self.settings, cls_name,
caching_policy, load_policy
)
def _get_file_stamp(self, filename):
'''Get filestamp for path relative to generator.path'''
filename = os.path.join(self.path, filename)
return super(CachingGenerator, self)._get_file_stamp(filename)
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(CachingGenerator):
"""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 = [] # only drafts in default language
self.drafts_translations = []
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')
for auth, arts in self.authors:
arts.sort(key=attrgetter('date'), reverse=True)
if self.settings.get('AUTHOR_FEED_ATOM'):
writer.write_feed(arts, self.context,
self.settings['AUTHOR_FEED_ATOM']
% auth.slug)
if self.settings.get('AUTHOR_FEED_RSS'):
writer.write_feed(arts, self.context,
self.settings['AUTHOR_FEED_RSS']
% auth.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):
signals.article_generator_write_article.send(self, content=article)
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')
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')
}
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)
context = self.context.copy()
if key == period_date_key['year']:
context["period"] = (_period,)
else:
month_name = calendar.month_name[_period[1]]
if not six.PY3:
month_name = month_name.decode('utf-8')
if key == period_date_key['month']:
context["period"] = (_period[0],
month_name)
else:
context["period"] = (_period[0],
month_name,
_period[2])
write(save_as, template, context,
dates=archive, blog=True)
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 draft in chain(self.drafts_translations, self.drafts):
write(draft.save_as, self.get_template(draft.template),
self.context, article=draft, category=draft.category,
override_output=hasattr(draft, 'override_save_as'),
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 = []
all_drafts = []
for f in self.get_files(
self.settings['ARTICLE_PATHS'],
exclude=self.settings['ARTICLE_EXCLUDES']):
article = self.get_cached_data(f, None)
if article is None:
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.error('Could not process %s\n%s', f, e,
exc_info=self.settings.get('DEBUG', False))
self._add_failed_source_path(f)
continue
if not is_valid_content(article, f):
self._add_failed_source_path(f)
continue
self.cache_data(f, article)
self.add_source_path(article)
if article.status.lower() == "published":
all_articles.append(article)
elif article.status.lower() == "draft":
draft = self.readers.read_file(
base_path=self.path, path=f, content_class=Draft,
context=self.context,
preread_signal=signals.article_generator_preread,
preread_sender=self,
context_signal=signals.article_generator_context,
context_sender=self)
all_drafts.append(draft)
else:
logger.error("Unknown status '%s' for file %s, skipping it.",
article.status, f)
self.articles, self.translations = process_translations(all_articles,
order_by=self.settings['ARTICLE_ORDER_BY'])
self.drafts, self.drafts_translations = \
process_translations(all_drafts)
signals.article_generator_pretaxonomy.send(self)
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
for author in getattr(article, 'authors', []):
if author.name != '':
self.authors[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'))
self.save_cache()
self.readers.save_cache()
signals.article_generator_finalized.send(self)
def generate_output(self, writer):
self.generate_feeds(writer)
self.generate_pages(writer)
signals.article_writer_finalized.send(self, writer=writer)
class PagesGenerator(CachingGenerator):
"""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_PATHS'],
exclude=self.settings['PAGE_EXCLUDES']):
page = self.get_cached_data(f, None)
if page is None:
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.error('Could not process %s\n%s', f, e,
exc_info=self.settings.get('DEBUG', False))
self._add_failed_source_path(f)
continue
if not is_valid_content(page, f):
self._add_failed_source_path(f)
continue
self.cache_data(f, page)
self.add_source_path(page)
if page.status == "published":
all_pages.append(page)
elif page.status == "hidden":
hidden_pages.append(page)
else:
logger.error("Unknown status '%s' for file %s, skipping it.",
page.status, f)
self.pages, self.translations = process_translations(all_pages,
order_by=self.settings['PAGE_ORDER_BY'])
self.hidden_pages, self.hidden_translations = (
process_translations(hidden_pages))
self._update_context(('pages', ))
self.context['PAGES'] = self.pages
self.save_cache()
self.readers.save_cache()
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 __init__(self, *args, **kwargs):
super(StaticGenerator, self).__init__(*args, **kwargs)
signals.static_generator_init.send(self)
def _copy_paths(self, paths, source, destination, output_path,
final_path=None):
"""Copy all the paths from source to destination"""
for path in paths:
if final_path:
copy(os.path.join(source, path),
os.path.join(output_path, destination, final_path))
else:
copy(os.path.join(source, path),
os.path.join(output_path, destination, path))
def generate_context(self):
self.staticfiles = []
for f in self.get_files(self.settings['STATIC_PATHS'],
exclude=self.settings['STATIC_EXCLUDES'],
extensions=False):
# skip content source files unless the user explicitly wants them
if self.settings['STATIC_EXCLUDE_SOURCES']:
if self._is_potential_source_path(f):
continue
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',))
signals.static_generator_finalized.send(self)
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.copy2(source_path, save_as)
logger.info('Copying %s to %s', 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,198 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
__all__ = [
'init'
]
import os
import sys
import logging
import locale
from collections import defaultdict, Mapping
import six
class BaseFormatter(logging.Formatter):
def __init__(self, fmt=None, datefmt=None):
FORMAT = '%(customlevelname)s %(message)s'
super(BaseFormatter, self).__init__(fmt=FORMAT, datefmt=datefmt)
def format(self, record):
record.__dict__['customlevelname'] = self._get_levelname(record.levelname)
# format multiline messages 'nicely' to make it clear they are together
record.msg = record.msg.replace('\n', '\n | ')
return super(BaseFormatter, self).format(record)
def formatException(self, ei):
''' prefix traceback info for better representation '''
# .formatException returns a bytestring in py2 and unicode in py3
# since .format will handle unicode conversion,
# str() calls are used to normalize formatting string
s = super(BaseFormatter, self).formatException(ei)
# fancy format traceback
s = str('\n').join(str(' | ') + line for line in s.splitlines())
# separate the traceback from the preceding lines
s = str(' |___\n{}').format(s)
return s
def _get_levelname(self, name):
''' NOOP: overridden by subclasses '''
return name
class ANSIFormatter(BaseFormatter):
ANSI_CODES = {
'red': '\033[1;31m',
'yellow': '\033[1;33m',
'cyan': '\033[1;36m',
'white': '\033[1;37m',
'bgred': '\033[1;41m',
'bggrey': '\033[1;100m',
'reset': '\033[0;m'}
LEVEL_COLORS = {
'INFO': 'cyan',
'WARNING': 'yellow',
'ERROR': 'red',
'CRITICAL': 'bgred',
'DEBUG': 'bggrey'}
def _get_levelname(self, name):
color = self.ANSI_CODES[self.LEVEL_COLORS.get(name, 'white')]
if name == 'INFO':
fmt = '{0}->{2}'
else:
fmt = '{0}{1}{2}:'
return fmt.format(color, name, self.ANSI_CODES['reset'])
class TextFormatter(BaseFormatter):
"""
Convert a `logging.LogRecord' object into text.
"""
def _get_levelname(self, name):
if name == 'INFO':
return '->'
else:
return name + ':'
class LimitFilter(logging.Filter):
"""
Remove duplicates records, and limit the number of records in the same
group.
Groups are specified by the message to use when the number of records in
the same group hit the limit.
E.g.: log.warning(('43 is not the answer', 'More erroneous answers'))
"""
_ignore = set()
_threshold = 5
_group_count = defaultdict(int)
def filter(self, record):
# don't limit log messages for anything above "warning"
if record.levelno > logging.WARN:
return True
# extract group
group = record.__dict__.get('limit_msg', None)
group_args = record.__dict__.get('limit_args', ())
# ignore record if it was already raised
# use .getMessage() and not .msg for string formatting
ignore_key = (record.levelno, record.getMessage())
if ignore_key in self._ignore:
return False
else:
self._ignore.add(ignore_key)
# check if we went over threshold
if group:
key = (record.levelno, group)
self._group_count[key] += 1
if self._group_count[key] == self._threshold:
record.msg = group
record.args = group_args
elif self._group_count[key] > self._threshold:
return False
return True
class SafeLogger(logging.Logger):
"""
Base Logger which properly encodes Exceptions in Py2
"""
_exc_encoding = locale.getpreferredencoding()
def _log(self, level, msg, args, exc_info=None, extra=None):
# if the only argument is a Mapping, Logger uses that for formatting
# format values for that case
if args and len(args)==1 and isinstance(args[0], Mapping):
args = ({k: self._decode_arg(v) for k, v in args[0].items()},)
# otherwise, format each arg
else:
args = tuple(self._decode_arg(arg) for arg in args)
super(SafeLogger, self)._log(level, msg, args,
exc_info=exc_info, extra=extra)
def _decode_arg(self, arg):
'''
properly decode an arg for Py2 if it's Exception
localized systems have errors in native language if locale is set
so convert the message to unicode with the correct encoding
'''
if isinstance(arg, Exception):
text = str(arg)
if six.PY2:
text = text.decode(self._exc_encoding)
return text
else:
return arg
class LimitLogger(SafeLogger):
"""
A logger which adds LimitFilter automatically
"""
limit_filter = LimitFilter()
def __init__(self, *args, **kwargs):
super(LimitLogger, self).__init__(*args, **kwargs)
self.addFilter(LimitLogger.limit_filter)
logging.setLoggerClass(LimitLogger)
def init(level=None, handler=logging.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=logging.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,160 +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, self.extension = os.path.splitext(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': '/',
'extension': self.extension,
}
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,591 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import logging
import os
import re
import docutils
import docutils.core
import docutils.io
from docutils.writers.html4css1 import HTMLTranslator
import six
# import the directives to have pygments support
from pelican import rstdirectives # NOQA
try:
from markdown import Markdown
except ImportError:
Markdown = False # NOQA
try:
from html import escape
except ImportError:
from cgi import escape
from six.moves.html_parser import HTMLParser
from pelican import signals
from pelican.contents import Page, Category, Tag, Author
from pelican.utils import get_date, pelican_open, FileStampDataCacher, SafeDatetime
METADATA_PROCESSORS = {
'tags': lambda x, y: [Tag(tag, y) for tag in x.split(',')],
'date': lambda x, y: get_date(x),
'modified': lambda x, y: get_date(x),
'status': lambda x, y: x.strip(),
'category': Category,
'author': Author,
'authors': lambda x, y: [Author(author.strip(), y) for author in x.split(',')],
}
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']
class FileInput(docutils.io.FileInput):
"""Patch docutils.io.FileInput to remove "U" mode in py3.
Universal newlines is enabled by default and "U" mode is deprecated
in py3.
"""
def __init__(self, *args, **kwargs):
if six.PY3:
kwargs['mode'] = kwargs.get('mode', 'r').replace('U', '')
docutils.io.FileInput.__init__(self, *args, **kwargs)
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()
elif element.tagname == 'authors': # author list
name = element.tagname
value = [element.astext() for element in element.children]
value = ','.join(value) # METADATA_PROCESSORS expects a string
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',
'exit_status_level': 2,
'embed_stylesheet': False}
user_params = self.settings.get('DOCUTILS_SETTINGS')
if user_params:
extra_params.update(user_params)
pub = docutils.core.Publisher(
source_class=self.FileInput,
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(enable_exit_status=True)
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')
self._source_path = None
def _parse_metadata(self, meta):
"""Return the dict containing document metadata"""
output = {}
for name, value in meta.items():
name = name.lower()
if name == "summary":
# handle summary metadata as markdown
# summary metadata is special case and join all list values
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)
elif name in METADATA_PROCESSORS:
if len(value) > 1:
logger.warning('Duplicate definition of `%s` '
'for %s. Using first one.', name, self._source_path)
output[name] = self.process_metadata(name, value[0])
elif len(value) > 1:
# handle list metadata as list of string
output[name] = self.process_metadata(name, value)
else:
# otherwise, handle metadata as single string
output[name] = self.process_metadata(name, value[0])
return output
def read(self, source_path):
"""Parse content and metadata of markdown files"""
self._source_path = source_path
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):
try:
# Python 3.4+
HTMLParser.__init__(self, convert_charrefs=False)
except TypeError:
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')
if name is None:
attr_serialized = ', '.join(['{}="{}"'.format(k, v) for k, v in attrs])
logger.warning("Meta tag in file %s does not have a 'name' "
"attribute, skipping. Attributes: %s",
self._filename, attr_serialized)
return
name = name.lower()
contents = self._attr_value(attrs, 'content', '')
if not contents:
contents = self._attr_value(attrs, 'contents', '')
if contents:
logger.warning(
"Meta tag attribute 'contents' used in file %s, should"
" be changed to 'content'",
self._filename,
extra={'limit_msg': ("Other files have meta tag "
"attribute 'contents' that should "
"be changed to 'content'")})
if name == 'keywords':
name = 'tags'
self.metadata[name] = contents
@classmethod
def _attr_value(cls, attrs, name, default=None):
return next((x[1] for x in attrs if x[0] == name), default)
def read(self, filename):
"""Parse content and metadata of HTML files"""
with pelican_open(filename) as content:
parser = self._HTMLParser(self.settings, filename)
parser.feed(content)
parser.close()
metadata = {}
for k in parser.metadata:
metadata[k] = self.process_metadata(k, parser.metadata[k])
return parser.body, metadata
class Readers(FileStampDataCacher):
"""Interface for all readers.
This class contains a mapping of file extensions / Reader classes, to know
which Reader class must be used to read a file (based on its extension).
This is customizable both with the 'READERS' setting, and with the
'readers_init' signall for plugins.
"""
def __init__(self, settings=None, cache_name=''):
self.settings = settings or {}
self.readers = {}
self.reader_classes = {}
for cls in [BaseReader] + BaseReader.__subclasses__():
if not cls.enabled:
logger.debug('Missing dependencies for %s',
', '.join(cls.file_extensions))
continue
for ext in cls.file_extensions:
self.reader_classes[ext] = cls
if self.settings['READERS']:
self.reader_classes.update(self.settings['READERS'])
signals.readers_init.send(self)
for fmt, reader_class in self.reader_classes.items():
if not reader_class:
continue
self.readers[fmt] = reader_class(self.settings)
# set up caching
cache_this_level = (cache_name != '' and
self.settings['CONTENT_CACHING_LAYER'] == 'reader')
caching_policy = cache_this_level and self.settings['CACHE_CONTENT']
load_policy = cache_this_level and self.settings['LOAD_CONTENT_CACHE']
super(Readers, self).__init__(settings, cache_name,
caching_policy, load_policy,
)
@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 %s -> %s',
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 %s', path)
if preread_signal:
logger.debug('Signal %s.send(%s)',
preread_signal.name, preread_sender)
preread_signal.send(preread_sender)
reader = self.readers[fmt]
metadata = 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))
reader_name = reader.__class__.__name__
metadata['reader'] = reader_name.replace('Reader', '').lower()
content, reader_metadata = self.get_cached_data(path, (None, None))
if content is None:
content, reader_metadata = reader.read(path)
self.cache_data(path, (content, reader_metadata))
metadata.update(reader_metadata)
if content:
# find images with empty alt
find_empty_alt(content, path)
# eventually filter the content with typogrify if asked so
if self.settings['TYPOGRIFY']:
from typogrify.filters import typogrify
def typogrify_wrapper(text):
"""Ensures ignore_tags feature is backward compatible"""
try:
return typogrify(text, self.settings['TYPOGRIFY_IGNORE_TAGS'])
except TypeError:
return typogrify(text)
if content:
content = typogrify_wrapper(content)
metadata['title'] = typogrify_wrapper(metadata['title'])
if 'summary' in metadata:
metadata['summary'] = typogrify_wrapper(metadata['summary'])
if context_signal:
logger.debug('Signal %s.send(%s, <metadata>)',
context_signal.name, context_sender)
context_signal.send(context_sender, metadata=metadata)
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)
for match in re.findall(imgs, content):
logger.warning(
'Empty alt attribute for image %s in %s',
os.path.basename(match[1] + match[5]), path,
extra={'limit_msg': 'Other images have empty alt attributes'})
def default_metadata(settings=None, process=None):
metadata = {}
if settings:
if 'DEFAULT_CATEGORY' in settings:
value = settings['DEFAULT_CATEGORY']
if process:
value = process('category', value)
metadata['category'] = value
if settings.get('DEFAULT_DATE', None) and settings['DEFAULT_DATE'] != 'fs':
metadata['date'] = SafeDatetime(*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'] = SafeDatetime.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': SafeDatetime(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,52 +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
found = False
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):
srvmod.SimpleHTTPRequestHandler.do_GET(self)
logging.info("Found: %s" % self.path)
found = True
break
logging.info("Tried to find file %s, but it doesn't exist. ", self.path)
if not found:
logging.warning("Unable to find file %s or variations.", self.path)
Handler = ComplexHTTPRequestHandler
socketserver.TCPServer.allow_reuse_address = True
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,381 +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
from pelican.log import LimitFilter
logger = logging.getLogger(__name__)
DEFAULT_THEME = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'themes', 'notmyidea')
DEFAULT_CONFIG = {
'PATH': os.curdir,
'ARTICLE_PATHS': [''],
'ARTICLE_EXCLUDES': [],
'PAGE_PATHS': ['pages'],
'PAGE_EXCLUDES': [],
'THEME': DEFAULT_THEME,
'OUTPUT_PATH': 'output',
'READERS': {},
'STATIC_PATHS': ['images'],
'STATIC_EXCLUDES': [],
'STATIC_EXCLUDE_SOURCES': True,
'THEME_STATIC_DIR': 'theme',
'THEME_STATIC_PATHS': ['static', ],
'FEED_ALL_ATOM': os.path.join('feeds', 'all.atom.xml'),
'CATEGORY_FEED_ATOM': os.path.join('feeds', '%s.atom.xml'),
'AUTHOR_FEED_ATOM': os.path.join('feeds', '%s.atom.xml'),
'AUTHOR_FEED_RSS': os.path.join('feeds', '%s.rss.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,
'DOCUTILS_SETTINGS': {},
'OUTPUT_SOURCES': False,
'OUTPUT_SOURCES_EXTENSION': '.text',
'USE_FOLDER_AS_CATEGORY': True,
'DEFAULT_CATEGORY': 'misc',
'WITH_FUTURE_DATES': True,
'CSS_FILE': 'main.css',
'NEWEST_FIRST_ARCHIVES': True,
'REVERSE_CATEGORY_ORDER': False,
'DELETE_OUTPUT_DIRECTORY': False,
'OUTPUT_RETENTION': (),
'ARTICLE_URL': '{slug}.html',
'ARTICLE_SAVE_AS': '{slug}.html',
'ARTICLE_ORDER_BY': 'slug',
'ARTICLE_LANG_URL': '{slug}-{lang}.html',
'ARTICLE_LANG_SAVE_AS': '{slug}-{lang}.html',
'DRAFT_URL': 'drafts/{slug}.html',
'DRAFT_SAVE_AS': os.path.join('drafts', '{slug}.html'),
'DRAFT_LANG_URL': 'drafts/{slug}-{lang}.html',
'DRAFT_LANG_SAVE_AS': os.path.join('drafts', '{slug}-{lang}.html'),
'PAGE_URL': 'pages/{slug}.html',
'PAGE_SAVE_AS': os.path.join('pages', '{slug}.html'),
'PAGE_ORDER_BY': 'basename',
'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}{extension}', '{name}{number}{extension}'),
],
'YEAR_ARCHIVE_SAVE_AS': '',
'MONTH_ARCHIVE_SAVE_AS': '',
'DAY_ARCHIVE_SAVE_AS': '',
'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': {},
'MD_EXTENSIONS': ['codehilite(css_class=highlight)', 'extra'],
'JINJA_EXTENSIONS': [],
'JINJA_FILTERS': {},
'LOG_FILTER': [],
'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,
'TYPOGRIFY_IGNORE_TAGS': [],
'SUMMARY_MAX_LENGTH': 50,
'PLUGIN_PATHS': [],
'PLUGINS': [],
'PYGMENTS_RST_OPTIONS': {},
'TEMPLATE_PAGES': {},
'IGNORE_FILES': ['.#*'],
'SLUG_SUBSTITUTIONS': (),
'INTRASITE_LINK_REGEX': '[{|](?P<what>.*?)[|}]',
'SLUGIFY_SOURCE': 'title',
'CACHE_CONTENT': True,
'CONTENT_CACHING_LAYER': 'reader',
'CACHE_PATH': 'cache',
'GZIP_CACHE': True,
'CHECK_MODIFIED_METHOD': 'mtime',
'LOAD_CONTENT_CACHE': True,
'AUTORELOAD_IGNORE_CACHE': False,
'WRITE_SELECTED': [],
}
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', 'CACHE_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') or os.path.exists(absp):
local_settings[p] = absp
if 'PLUGIN_PATH' in local_settings:
logger.warning('PLUGIN_PATH setting has been replaced by '
'PLUGIN_PATHS, moving it to the new setting name.')
local_settings['PLUGIN_PATHS'] = local_settings['PLUGIN_PATH']
del local_settings['PLUGIN_PATH']
if isinstance(local_settings['PLUGIN_PATHS'], six.string_types):
logger.warning("Defining PLUGIN_PATHS setting as string "
"has been deprecated (should be a list)")
local_settings['PLUGIN_PATHS'] = [local_settings['PLUGIN_PATHS']]
elif local_settings['PLUGIN_PATHS'] is not None:
local_settings['PLUGIN_PATHS'] = [os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(path), pluginpath)))
if not isabs(pluginpath) else pluginpath for pluginpath in local_settings['PLUGIN_PATHS']]
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.
Also, specify the log messages to be ignored.
"""
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)')
# specify the log messages to be ignored
LimitFilter._ignore.update(set(settings.get('LOG_FILTER',
DEFAULT_CONFIG['LOG_FILTER'])))
# lookup the theme in "pelican/themes" if the given one doesn't exist
if not os.path.isdir(settings['THEME']):
theme_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'themes',
settings['THEME'])
if os.path.exists(theme_path):
settings['THEME'] = theme_path
else:
raise Exception("Could not find the theme %s"
% settings['THEME'])
# make paths selected for writing absolute if necessary
settings['WRITE_SELECTED'] = [
os.path.abspath(path) for path in
settings.get('WRITE_SELECTED', DEFAULT_CONFIG['WRITE_SELECTED'])
]
# 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 %s (%s), '
'falling back to the default (%s)',
key, value, DEFAULT_CONFIG[key])
# try to set the different locales, fallback on the default.
locales = settings.get('LOCALE', DEFAULT_CONFIG['LOCALE'])
for locale_ in locales:
try:
locale.setlocale(locale.LC_ALL, str(locale_))
break # break if it is successful
except locale.Error:
pass
else:
logger.warning("LOCALE 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']
# check content caching layer and warn of incompatibilities
if (settings.get('CACHE_CONTENT', False) and
settings.get('CONTENT_CACHING_LAYER', '') == 'generator' and
settings.get('WITH_FUTURE_DATES', DEFAULT_CONFIG['WITH_FUTURE_DATES'])):
logger.warning('WITH_FUTURE_DATES conflicts with '
"CONTENT_CACHING_LAYER set to 'generator', "
"use 'reader' layer instead")
# Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined
feed_keys = [
'FEED_ATOM', 'FEED_RSS',
'FEED_ALL_ATOM', 'FEED_ALL_RSS',
'CATEGORY_FEED_ATOM', 'CATEGORY_FEED_RSS',
'AUTHOR_FEED_ATOM', 'AUTHOR_FEED_RSS',
'TAG_FEED_ATOM', 'TAG_FEED_RSS',
'TRANSLATION_FEED_ATOM', 'TRANSLATION_FEED_RSS',
]
if any(settings.get(k) for k in feed_keys):
if not settings.get('SITEURL'):
logger.warning('Feeds generated without SITEURL set properly may'
' not be valid')
if 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],
)
# move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS
for key in ['ARTICLE', 'PAGE']:
old_key = key + '_DIR'
new_key = key + '_PATHS'
if old_key in settings:
logger.warning('Deprecated setting %s, moving it to %s list',
old_key, new_key)
settings[new_key] = [settings[old_key]] # also make a list
del settings[old_key]
# 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_EXCLUDES',
'STATIC_PATHS',
'THEME_STATIC_PATHS',
'ARTICLE_PATHS',
'PAGE_PATHS',
)
for PATH_KEY in filter(lambda k: k in settings, path_keys):
if isinstance(settings[PATH_KEY], 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]
# Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES
mutually_exclusive = ('ARTICLE', 'PAGE')
for type_1, type_2 in [mutually_exclusive, mutually_exclusive[::-1]]:
try:
includes = settings[type_1 + '_PATHS']
excludes = settings[type_2 + '_EXCLUDES']
for path in includes:
if path not in excludes:
excludes.append(path)
except KeyError:
continue # setting not specified, nothing to do
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,47 +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')
get_writer = signal('get_writer')
finalized = signal('pelican_finalized')
# Reader-level signals
readers_init = signal('readers_init')
# Generator-level signals
generator_init = signal('generator_init')
article_generator_init = signal('article_generator_init')
article_generator_pretaxonomy = signal('article_generator_pretaxonomy')
article_generator_finalized = signal('article_generator_finalized')
article_generator_write_article = signal('article_generator_write_article')
article_writer_finalized = signal('article_writer_finalized')
page_generator_init = signal('page_generator_init')
page_generator_finalized = signal('page_generator_finalized')
static_generator_init = signal('static_generator_init')
static_generator_finalized = signal('static_generator_finalized')
# Page-level signals
article_generator_preread = signal('article_generator_preread')
article_generator_context = signal('article_generator_context')
page_generator_preread = signal('page_generator_preread')
page_generator_context = signal('page_generator_context')
static_generator_preread = signal('static_generator_preread')
static_generator_context = signal('static_generator_context')
content_object_init = signal('content_object_init')
# Writers signals
content_written = signal('content_written')
feed_written = signal('feed_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,6 +0,0 @@
A Page (Test) for sorting
#########################
:slug: zzzz
When using title, should be first. When using slug, should be last.

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,15 +0,0 @@
An Article With Code Block To Test Typogrify Ignore
###################################################
An article with some code
.. code-block:: python
x & y
A block quote:
x & y
Normal:
x & y

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,15 +0,0 @@
Title: Article with markdown containing footnotes
Date: 2012-10-31
Modified: 2012-11-01
Summary: Summary with **inline** markup *should* be supported.
Multiline: Line Metadata should be handle properly.
See syntax of Meta-Data extension of Python Markdown package:
If a line is indented by 4 or more spaces,
that line is assumed to be an additional line of the value
for the previous keyword.
A keyword may have as many lines as desired.
This is some content[^1] with some footnotes[^footnote]
[^1]: Numbered footnote
[^footnote]: Named footnote

View file

@ -1,19 +0,0 @@
Title: マックOS X 10.8でパイソンとVirtualenvをインストールと設定
Slug: python-virtualenv-on-mac-osx-mountain-lion-10.8
Date: 2012-12-20
Modified: 2012-12-22
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,14 +0,0 @@
Title: Test md File
Category: test
Tags: foo, bar, foobar
Date: 2010-12-02 10:14
Modified: 2010-12-02 10:20
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,13 +0,0 @@
This is a super article !
#########################
:tags: foo, bar, foobar
:date: 2010-12-02 10:14
:modified: 2010-12-02 10:20
:category: yeah
:author: Alexis Métaireau
:summary:
Multi-line metadata should be supported
as well as **inline markup** and stuff to "typogrify"...
: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,6 +0,0 @@
<html>
<head>
<title>This is an article with multiple authors!</title>
<meta name="authors" content="First Author, Second Author" />
</head>
</html>

View file

@ -1,6 +0,0 @@
This is an article with multiple authors!
#########################################
:date: 2014-02-09 02:20
:modified: 2014-02-09 02:20
:authors: First Author, Second Author

View file

@ -1,12 +0,0 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Article with Nonconformant HTML meta tags</title>
<meta name="summary" content="Summary and stuff" />
</head>
<body>
Multi-line metadata should be supported
as well as <strong>inline markup</strong>.
</body>
</html>

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,953 +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>
<item>
<title>A custom post in category 4</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>custpost1cat4</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>custom1</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-4"><![CDATA[Category 4]]></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 custom post in category 5</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.
<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>176</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>custpost1cat5</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>custom1</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-5"><![CDATA[Category 5]]></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 2nd custom post type also in category 5</title>
<link>http://thisisa.test/?p=177</link>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisisa.test/?p=177</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>177</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>custpost2cat5</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>custom2</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="category-5"><![CDATA[Category 5]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[3]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Attachment with a parent</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">http://thisurlisinvalid.notarealdomain/not_an_image.jpg</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>25</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>attachment-with-a-parent</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>8</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>http://thisurlisinvalid.notarealdomain/not_an_image.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>2nd Attachment to same parent</title>
<link>http://thisisa.test/?attachment_id=25</link>
<pubDate>Sat, 04 Feb 2012 03:17:33 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://en.wikipedia.org/wiki/File:Pelikan_Walvis_Bay.jpg</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>25</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>2nd[attachment-to-same-parent</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>8</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>http://en.wikipedia.org/wiki/File:Pelikan_Walvis_Bay.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>Attachment with a different parent</title>
<link>http://thisisa.test/?attachment_id=26</link>
<pubDate>Sat, 04 Feb 2012 03:17:33 +0000</pubDate>
<dc:creator>bob</dc:creator>
<guid isPermaLink="false">http://thisurlisinvalid.notarealdomain</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>25</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>attachment-with-a-different-parent</wp:post_name>
<wp:status>inherit</wp:status>
<wp:post_parent>25</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>http://thisurlisinvalid.notarealdomain</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>
</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,3 +0,0 @@
Title: Short Page
This is a page with little text.

View file

@ -1,3 +0,0 @@
Title: Main Dir Page
This page lives in maindir.

View file

@ -1,3 +0,0 @@
Title: Subdir Page
This page lives in maindir/subdir.

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+00:00">
Published: 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>

View file

@ -1,68 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Article 1</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="/article-1.html" rel="bookmark"
title="Permalink to Article 1">Article 1</a></h1>
</header>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2011-02-17T00:00:00+00:00">
Published: Thu 17 February 2011
</abbr>
<p>In <a href="/category/cat1.html">cat1</a>. </p>
</footer><!-- /.post-info --> <p>Article 1</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,68 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Article 2</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="/article-2.html" rel="bookmark"
title="Permalink to Article 2">Article 2</a></h1>
</header>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2011-02-17T00:00:00+00:00">
Published: Thu 17 February 2011
</abbr>
<p>In <a href="/category/cat1.html">cat1</a>. </p>
</footer><!-- /.post-info --> <p>Article 2</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,68 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Article 3</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="/article-3.html" rel="bookmark"
title="Permalink to Article 3">Article 3</a></h1>
</header>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2011-02-17T00:00:00+00:00">
Published: Thu 17 February 2011
</abbr>
<p>In <a href="/category/cat1.html">cat1</a>. </p>
</footer><!-- /.post-info --> <p>Article 3</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>

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