• Resolved timjuedemann

    (@timjuedemann)


    When saving a WordPress site for offline use, Simply Static seems to struggle with pagination links. While the directory structure created by Simply Static is correct, it will mess up the pagination links. This usually occurs starting from the second page of a paginated archive, so assuming I am on path/blog/page/2, instead of

    path/blog/page/3
    path/blog/page/4
    etc.

    it will create

    path/blog/page/2/3
    path/blog/page/2/4
    etc.

    Curiously, this only affects the “Save for offline use” option, so it’s only a minor concern. For what it’s worth: I am making modifications to query_var parameters in order to have a common rewrite base for all my blog content, i.e.

    path/blog/slug-of-blog-post
    path/blog/category (category archive)
    path/blog/2023 (date archive)
    etc.

    Best regards and thanks for your work on this great plugin!
    Tim

    • This topic was modified 2 years, 11 months ago by timjuedemann.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter timjuedemann

    (@timjuedemann)

    And while I’m at it – are there any hooks that can be set up to run on export that would set a variable or add a class that’s only included in the static files generated by Simply Static? What I am actually looking for is the ability to run some custom code for static files (i.e. AJAX requests that don’t leverage query_vars since I wouldn’t be able to access them in the static environment).

    Plugin Author patrickposner

    (@patrickposner)

    Hey @timjuedemann,

    thanks for your report!

    Pagination:

    Good catch! I add that to our issue list. I could also replicate it easily, it seems we need to modify our regex pattern for the offline usage slightly to make that work.

    Hook:

    You may want to use the action “ss_after_extract_and_replace_urls_in_html” for that.

    You get the current dom object(the parsed HTML content) and the actual page (the raw HTML) to work with.

    The $dom variable can be used to find, modify and replace attributes for certain HTML tags (like adding a class for example).

    We use SimpleHTMLDOMParser from voku – here are a couple of examples on how to work with it: https://github.com/voku/simple_html_dom/tree/master/example

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Wrong Pagination Links (Offline Use)’ is closed to new replies.