Navbar path resolution

12 views
Skip to first unread message

Don Oxley

unread,
Jan 21, 2021, 5:24:48 AMJan 21
to nikola-discuss
I have a working website on localhost that I'm trying to run on PythonAnywhere (PA).  Everything seems to work fine, except that the (Bootstrap4) navbar is missing a trailing '/' on links below the top level.  I submitted a query to the PA forum:  forum entry
that has an example with screen shots.

My conf.py navigation links are of the form:  ("/pages/activities-index/index.html", "Activities"), though I have also tried without the 'index.html'.   I presume I'm missing a setting somewhere, but I'm not sure where. 

Can you point me to where in the code the links are constructed.

Any guidance appreciated.  

Thanks,
   --Don

Chris Warrick

unread,
Jan 21, 2021, 3:12:48 PMJan 21
to Nikola—Discuss
On Thu, 21 Jan 2021 at 11:24, Don Oxley <dono...@gmail.com> wrote:
>
> I have a working website on localhost that I'm trying to run on PythonAnywhere (PA). Everything seems to work fine, except that the (Bootstrap4) navbar is missing a trailing '/' on links below the top level. I submitted a query to the PA forum: forum entry
> that has an example with screen shots.

The screenshots don't seem to work.

> My conf.py navigation links are of the form: ("/pages/activities-index/index.html", "Activities"), though I have also tried without the 'index.html'. I presume I'm missing a setting somewhere, but I'm not sure where.
>
> Can you point me to where in the code the links are constructed

You should specify "/pages/activities-index/" in conf.py. Also, if
your hosting provider doesn’t work with "/pages/activities-index",
find a better one. (PythonAnywhere might not be the best choice/might
be overkill for hosting a static site.)

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

Don Oxley

unread,
Jan 22, 2021, 5:18:00 AMJan 22
to nikola-discuss
Thx for the reply.  Sorry about the images - I checked with a second browser and apparently PA is requiring you to be logged in to see the images! :-(  I can reproduce them here if that becomes useful.

I am certainly not committed to PA though I would like to be able to run Nikola itself on the server for the convenience of the maintenance team.  Longer term, I have in mind additional capabilities in a subdomain that would not necessarily be static.  I do have the site working as a purely static site on Ionos (1&1) which is a fallback.  It bothers me, however, that I'm not understanding what's really going on such that the same static site is behaving differently in different servers running Apache (and I would hope the Nikola dev server would be consistent).  Can you point me to the code within Nikola that is building the paths.  I've looked at the def path code in Nikola.py but it's a bit hard to follow without a bit more context - if that is even the correct place to look.  

Will update conf.py.  I've tried to make sense of the STRIP_INDEXES warning (tried both ways) and PRETTY_URLS (True) and don't think either is relevant to my problem - right?

Thx,
    --Don

Chris Warrick

unread,
Feb 2, 2021, 5:40:38 PMFeb 2
to Nikola—Discuss
On Fri, 22 Jan 2021 at 11:18, Don Oxley <dono...@gmail.com> wrote:
>
> Thx for the reply. Sorry about the images - I checked with a second browser and apparently PA is requiring you to be logged in to see the images! :-( I can reproduce them here if that becomes useful.
>
> I am certainly not committed to PA though I would like to be able to run Nikola itself on the server for the convenience of the maintenance team. Longer term, I have in mind additional capabilities in a subdomain that would not necessarily be static. I do have the site working as a purely static site on Ionos (1&1) which is a fallback. It bothers me, however, that I'm not understanding what's really going on such that the same static site is behaving differently in different servers running Apache (and I would hope the Nikola dev server would be consistent). Can you point me to the code within Nikola that is building the paths. I've looked at the def path code in Nikola.py but it's a bit hard to follow without a bit more context - if that is even the correct place to look.
>
> Will update conf.py. I've tried to make sense of the STRIP_INDEXES warning (tried both ways) and PRETTY_URLS (True) and don't think either is relevant to my problem - right?

What warning?
Reply all
Reply to author
Forward
0 new messages