Overwriting blog/index.html

Open
#293 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
web-dev

Research direction

Start by inspecting how the blog_path setting handles blog/index.md and generates the default blog/index.html; the issue identifies the custom page and the setting but no repository file or test. Done means a custom landing page is preserved when blog_path is blog, or the expected behavior and controlling template are documented.

Written by the indexing model from the issue text.

Description

Bug Help Wanted
Describe the bug

I am happy Ablog user, but recently I'have noticed possible bug. Let me to explain.

Custom landing page

I wish custom blog landing page with "pinned" (topped) posts first, followed by all posts. I created blog/index.md with two postlist directives.

# Tech writer at work blog

<div class="top-posts">
:::{postlist} 5
:category: top
:excerpts:
:format: "{title} on {date} 🏷️ {tags}"
:::
</div>

## Recent Posts

<div class="recent-posts">
:::{postlist}
:excerpts:
:format: "{title} on {date} 🏷️ {tags}"
:::
</div>

So this is our Tech writer at work blog homepage:

CleanShot 2024-10-21 at 12 30 55@2x

Custom landing page is overwritten

All is fine, but recently, I was playing with blog_path. When set to blog (or omitted since blog is its default value), my custom blog/index.html is overwritten with some default landing page with "All Posts" heading.

CleanShot 2024-10-21 at 12 38 58@2x

Is it a bug?

I am not sure that this is expected behavior. If so, is it documented? Where is template which controls this default landing page?

To Reproduce

No response

Screenshots

No response

System Details
dependencies = [
    "ablog==0.11.11",
    "sphinx==8.1.3",
    "myst-parser[linkify]==4.0.0",
    "sphinx-sitemap==2.6.0",
    "sphinx-design==0.6.1",
    "sphinx_reredirects==0.1.5"
]
Installation method

No response

Dominant language
Python
Stars
196
Forks
64
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sunpy/ablog

All issues in sunpy/ablog

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.