1
0
Fork 0
forked from github/pelican
Commit graph

2,004 commits

Author SHA1 Message Date
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
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
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
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
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
FriedrichFroebel
7adcfc7938 Allow resetting memoized cache. Fixes #3110. 2023-04-24 18:44:50 +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
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
385d5bf75e Update functional test output 2023-03-27 10:02:07 +02:00
Deniz Turgut
3937028c00
update unit test to avoid using deprecated locale.getdefaultlocale() 2022-10-26 23:52:38 +03:00
Justin Mayer
a51d75c8ed
Merge pull request #3043 from copperchin/use-tmp-in-testutils 2022-10-25 14:11:33 -10:00
renyuneyun (Rui Zhao)
cbddac44e4 Use (?P=) to replace \2 for intrasite link 2022-10-24 18:05:40 -07: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
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
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
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
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
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
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
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
Ikko Ashimine
f3613af155
Fix typo in cache.py (#2978)
sublcass -> subclass
2022-02-09 06:15:59 -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
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
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
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
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
9bd54b7b60 All roads lead to Rome 2021-10-08 14:52:55 +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