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

Problems with duplicate or out of date content with aurora serve #12

Open
richard5mith opened this issue Dec 13, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@richard5mith
Copy link

Bug

When running aurora serve, it's not always generating the site from scratch each time.

I've encountered the following issues:

  • My homepage not showing the latest content, even if the individual post page does
  • My homepage showing the same single post (I only have one post right now) twice, like an old version and new version of it.
  • The tags page showing the same post twice.
  • If you rename a post file to change the date, not then seeing that new date on my homepage post list.

If I exit out of the serve and run it again, it all gets fixed. So the render process is working correctly, but somewhere along the line it's remembering stuff from it's previous run.

Also note in my partial post I have to do content or post.content to make it work everywhere. There's inconsistency on how that gets filled in, because on the post page it makes the content available as content, but everything else is in the post dictionary apart from content. But when you loop through site.posts it becomes post.content. It would be good if post pages also put it into post.content so you could more easily share templates.

Minimal Reproducible Example

My templates/index.html is:

<section class="h-feed">
    {% for post in site.posts %}
        {% include '_layouts/_partial_post.html' %}
    {% endfor %}
</section>

My layouts/post.html is:

---
layout: default
---
{% include '_layouts/_partial_post.html' %}

And the layouts/_partial_post.html is:

<p class="post-date">posted <a href="{{ post.url }}"><time datetime="{{ post.date | date_to_xml_string }}">{{ post.date | long_date }}</time></a></p>
<h1>{{ post.title }}</h1>

<section class="content">
    {{ content or post.content }}
</section>

{% if post.tags %}
<p>
    {% for tag in post.tags %}
        <a href="/tag/{{ tag.lower() }}" class="p-tag">{{ tag }}</a>
    {% endfor %}
</p>
{% endif %}

Additional

No response

@richard5mith richard5mith added the bug Something isn't working label Dec 13, 2024
@richard5mith
Copy link
Author

Further investigation has got me to the point where I can edit a post, hit refresh on the homepage and I see it as the duplicate. But then if I edit it again, nothing appears. But the post page itself works.

But I also notice that post.content on the homepage isn't properly formatted - it's just the raw markdown. But content on the post page has been run through the markdown parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant