Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-post toy abstract interpreter blog post #125

Merged
merged 7 commits into from
Jul 24, 2024

Conversation

tekknolagi
Copy link
Contributor

No description provided.

@tekknolagi
Copy link
Contributor Author

TODO... figure out how to set canonical URL...

@mattip
Copy link
Member

mattip commented Jul 24, 2024

I see in the preview metadata, nikola is rendering <link rel="canonical" href="https://www.pypy.org/blog/">, you would like it to point to https://bernsteinbear.com/blog/toy-abstract-interpretation ? I think that metadata value is created by our theme

<link rel="canonical" href="{{ abs_link(permalink) }}">

I am not sure how to adjust that per-post, maybe that line should move from the base_helper.tmpl to the per-post template post.tmpl around here,

and use a jinja-2 selector

{% if post.meta('canonical') %}
...
{% else %}
...
{% endif %}

Feel like giving it a try? You can build the docs locally with make (if on macos, you will need gmake from homebrew) and python<3.12. Then you should be able to inspect the generated posts for the correct links, I would expect the default to continue working.

@tekknolagi
Copy link
Contributor Author

tekknolagi commented Jul 24, 2024

Happy to make that change but was trying to avoid dropping canonical URLs from all your other pages

I'll go with that for now and if there's a way to add them back later, great

Thank you!

@mattip
Copy link
Member

mattip commented Jul 24, 2024

Maybe I wasn't clear. Each post page currently has a rel='canonical' link element with the text <link rel="canonical" href="https://www.pypy.org/blog/">. I think it would be desirable to allow canonical: xxx in the post's metadata. If that metadata is not specified, the else clause should create the pages exactly as it does today. If it is specified, the link in the xxx should replace the href target.

@tekknolagi
Copy link
Contributor Author

Oh no that was clear! I just worry that by moving it to the post template, the other types of pages (indices, etc) lose the canonical URL.

@mattip
Copy link
Member

mattip commented Jul 24, 2024

Ahh, good point. Maybe there is a better way?

@tekknolagi
Copy link
Contributor Author

@cfbolz decided to investigate

@cfbolz
Copy link
Member

cfbolz commented Jul 24, 2024

I think it would be desirable to allow canonical: xxx in the post's metadata.
agreed, unfortunately what you suggested doesn't work :-(

@cfbolz
Copy link
Member

cfbolz commented Jul 24, 2024

I'm looking into it.

@tekknolagi
Copy link
Contributor Author

oh nice, good stuff

@cfbolz cfbolz marked this pull request as ready for review July 24, 2024 14:49
@tekknolagi
Copy link
Contributor Author

Looked at my post and others and they look good (canonical URL is correct). Awesome

@cfbolz cfbolz merged commit d184064 into pypy:main Jul 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants