Code Monkey home page Code Monkey logo

series's People

Contributors

botpub avatar doobeh avatar giovanh avatar justinmayer avatar kernc avatar lgiordani avatar mr-ubik avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

series's Issues

TypeError: can't compare offset-naive and offset-aware datetimes

Started using series plugin.

I encounter this error. My skills in python are not sufficient to understand the cause

/Users/peter/.local/lib/python3.9/site-packages/pelican/plugins/series/series.py:42 in           │
│ aggregate_series                                                                                 │
│                                                                                                  │
│   39 │   │   forced_order_articles.sort(key=itemgetter("index"))                                 │
│   40 │   │                                                                                       │
│   41 │   │   date_order_articles = [i for i in series_articles if i["index"] == 0]               │
│ ❱ 42 │   │   date_order_articles.sort(key=itemgetter("date"))                                    │
│   43 │   │                                                                                       │
│   44 │   │   all_articles = forced_order_articles + date_order_articles                          │
│   45 │   │   ordered_articles = [i["content"] for i in all_articles]                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: can't compare offset-naive and offset-aware datetimes

Custom Series Indexing?

Is there a way to manually index the articles in a series using metadata fields in the markdown?

I've been trying to figure out a way to do custom ordering so I can have a next and previous button on the article page and have been struggling with default Pelican. I found this plugin and it is perfect for next and previous buttons, but it seems like it also will only order based on date.

An example case I am thinking of could go like this:
I am making a tutorial series or something of the sort. The work I'm doing is such that I'm making the tutorials a bit out of order. Or maybe I want to go back and add a tutorial in the middle at a later date. So, what I want to do is be able to put an attribute in the meta-data like "series_part" where I can explicitly list part 1, 2, 3, and so on, independent of date posted.

Is this something that is possible and/or would this be something that would be reasonable to add?

Draft articles break pelican if the series is referenced in the article theme

If you have an article that has both a Series tag as well as the Status: draft set, and the article.html makes use of e.g. article.series.all, pelican will throw an error:

UndefinedError: 'str object' has no attribute 'all'

That happens even though I used the {% if article.series %} that is used in the README.
That is mostly a documentation problem in my opinion, as you could just change the template to {% if article.series and article.series.all %} or any variation of that.

series breaks on draft articles

This is similar to #18, although the specifics I'm seeing are slightly different than what was described there.

I've got a draft article with my first series in it.. and just added series support to my theme. My pelicanconf.py defines DEFAULT_METADATA of "status": "published" for development purposes, and publishconf.py sets that default to draft. This is the setup I use so that the devserver will show me draft articles as they will appear once published. My uses of pelican-series worked fine in this setup until I tried to do a producton publish of a new article, while the unfinished series article is still in drafts.

When Pelican's make publish target hits that draft article, it fails. The first encountered error is a reference to article.series.previous.url:

UndefinedError: 'str object' has no attribute 'previous'

The error comes from this bit of template in my article.html:

{% if article.series.previous is not none %}
    <a class="series-footer text-muted"
       href="{{ SITEURL }}/{{ article.series.previous.url }}">
        <i class="fa fa-angles-left"></i>
        Previous Article
    </a>
{% else %}
    <i class="fa fa-angles-left"></i>
    Previous Article
{% endif %}

That block is itself wrapped in an if to check whether the article is part of a series:

{% if SHOW_SERIES and article.series is defined %}

The draft in question is the first and only article in the series, so article.series.next and article.series.previous should both be None. I've done some strategic commenting-out of bits of the template and inserting values as comments to determine that article.series.previous actually references article.series.name in a draft, rather than article.series.all_previous[-1], as it does when the article is published.

Oddly, article.series.index and article.series.name both seem to be empty string when the document is a draft, but work as expected when the document is published.

Relevant software version info from my virtualenv:

% python --version
Python 3.10.9

% pip freeze
blinker==1.5
commonmark==0.9.1
docutils==0.19
feedgenerator==2.0.0
Jinja2==3.1.2
MarkupSafe==2.1.1
pelican==4.8.0
pelican-i18n-subsites==0.9.0
pelican-series==2.1.0
pelican-youtube==0.2.1
Pygments==2.13.0
python-dateutil==2.8.2
pytz==2022.7
rich==13.0.0
six==1.16.0
smartypants==2.0.1
typogrify==2.0.7
Unidecode==1.3.6

Generate paginated post index per-series

Basically what it says; it'd be neat to be able to have a paginated (if using such) index of all articles in each series as an option, especially ordered by series index value. Right now, pagination of articles in an index is dictated only by the sort order across the whole site, so if you want articles listing normally in reverse chronological order, you can't then have a chronological listing only for specific categories or series.

I'd like a feature to generate an index listing per-series, likely by default at /series/{{ series.name }}.html and organized in series order.

`series` variable is not present in the global context

When trying to reference series in a template page in TEMPLATE_PAGES, I get the jinja error
UndefinedError: 'series' is undefined
I don't see a test for this either.

This probably needs to go under all_generators_finalized, since article_generator_finalized only processes article generators, not page generators.

Main build fails

Unfortunately the merge of PR #35 fails and I have no clue how to fix it as there is a lot of automation going on. Can you please help? The build works locally, I'm actually using it for my blog.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.