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

How to correct the links in my built html pages? #245

Open
CalMacCQ opened this issue Aug 16, 2023 · 7 comments
Open

How to correct the links in my built html pages? #245

CalMacCQ opened this issue Aug 16, 2023 · 7 comments

Comments

@CalMacCQ
Copy link

CalMacCQ commented Aug 16, 2023

Hi,

This is more of a question rather than a bug report. If preferred I can ask elsewhere instead of raising an issue here.

I'm trying to build and deploy a simple blog using ablog with the pydata sphinx theme. Everything is going well except the links in the built html are broken and I can't seem to fix them.

I have a main blog folder with my conf.py and an index.rst file. I have some blog source files in markdown format (I'm using the myst parser).

The built html looks like this

Screenshot 2023-08-16 at 16 48 27

If I click on the links to the different posts I see this page

Screenshot 2023-08-16 at 16 56 49

It seems each post has its own directory and contains a single index.html file which I did not expect. Clicking on the index.html link does take me to the expected post.

I suspect something has gone with the file structure of my project. I don't think there should be a new directory for every single blog post with a single index.html file in each directory.

Any idea what I've done wrong? I'm sure I'm just missing something.

Any help would be appreciated. Thanks in advance.

@CalMacCQ CalMacCQ changed the title How to build the html with the correct links How to correct the links in my built html pages Aug 16, 2023
@CalMacCQ CalMacCQ changed the title How to correct the links in my built html pages How to correct the links in my built html pages? Aug 16, 2023
@nabobalis
Copy link
Contributor

Do you have a link to your project?

@CalMacCQ
Copy link
Author

CalMacCQ commented Aug 16, 2023

I've quickly put what I've done so far in a public repo.

https://github.com/CalMacCQ/test-blog

I haven't written any content or deployed anything yet. Just started experimenting with ablog today.

Appreciate you taking a look :)

@nabobalis
Copy link
Contributor

So I can replicate this locally, but I can't figure out why it only affects that project at least locally for me.

I have opened a PR that forces to add the index.html to the blog post url. I am unsure if this will break more items but locally, your project builds with the correct url now.

@CalMacCQ
Copy link
Author

CalMacCQ commented Aug 17, 2023

Ah, I see.

For this repository I started following the quick start here -> https://ablog.readthedocs.io/en/stable/manual/ablog-quick-start.html. I then modified the file structure.

I seem to be able to replicate this issue with linking to the html pages by creating a fresh project as with ablog start.

I get the same issue as above when I click on first post

Screenshot 2023-08-17 at 14 49 17

I also seem to be getting a lot of warnings when I build the template project.

Screenshot 2023-08-17 at 14 48 45

Screenshot 2023-08-17 at 14 48 34

Is this expected? Are there any issues with the ablog template not working with the newer sphinx versions? (I'm using Version: 7.2.0 but this is just a guess).

Thanks again for looking into this.

@nabobalis
Copy link
Contributor

It should not error like that.

My limited testing seems to have the same problem no matter if I go back to sphinx 4.
Still trying to work out what changed that could have caused this.

Sorry for the delay

@CalMacCQ
Copy link
Author

CalMacCQ commented Aug 17, 2023

Just to clarify my previous comment...

The html pages still build sucessfully. Its just that there's a lot of warnings generated and the linking issue is still there with a fresh quick start project.

@CalMacCQ
Copy link
Author

CalMacCQ commented Aug 17, 2023

Aha! I was using ablog build to build my html pages.

If I use ablog serve and then check the links locally then they all work fine.

Can you tell I'm not a web developer? 😆

I think I'm unblocked from working on my blog now, hopefully the links should work okay when I deploy the blog. Thanks for taking the time to look into this.

If I have further issues I'll let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants