alexandrevicenzi / Flex

The minimalist Pelican theme.
https://flex.alxd.me
MIT License
608 stars 331 forks source link

HOME button dose not work #87

Closed XiaofeiQian closed 7 years ago

XiaofeiQian commented 7 years ago

The HOME button on the top MENUITEMS not work and HTML element shows:

<a href="">    Home
</a>

If i add a MENUITEM use link "/", and the element shows:

<a href="/">    Home
</a>

and it works just like a real HOME button. how can i fix the defult HOME button? Thanks.

XiaofeiQian commented 7 years ago

sorry, i find my SITEURL is "", um, fix it by change SITEURL to my gitpage

fengdasuk19 commented 7 years ago

@alexandrevicenzi I like this theme, including its color(I LOVE orange SO MUCH!), its code highlight style and the fonts:D But I'm afraid I encounter this problem too, and clicking the sitelogo leads to the same one, while everyting seems well when using the default theme 'notmyidea'. To just assign value for SITEURL will not solve this problem radically. In fact, if I don't push my content to the remote server, setting such value will lead some pages to request resources from remote directly so that I can see nothing but some blank templates like one of the default themes called simple.

I think it maybe a problem concerning templates. After comparing Flex/templates/base.html on line 135(HOME button problem) and line 79(sitelogo problem), with notmyidea-cms/templates/base.html on line 28(normal link), I think we can solve this problem by using {{ SITEURL }}/ to replace those string which starts with {{ SITEURL }} followed by a character other than /, at least those content that will apparantly influence such jumps between pages.

I use the command line below in bash and find these strings:

$ grep -n '{{ SITEURL }}[^/]' -r Flex/templates/* 
Flex/templates/base.html:79:      <a href="{{ SITEURL }}">
Flex/templates/base.html:86:      <h1><a href="{{ SITEURL }}">{{ SITETITLE }}</a></h1>
Flex/templates/base.html:135:      <a href="{{ SITEURL }}">{{ _('Home') }}</a>
Flex/templates/partial/og.html:11:<meta property="og:url" content="{{ SITEURL }}"/>
Flex/templates/partial/jsonld.html:6:  "url" : "{{ SITEURL }}",

It seems that the code related to this problem not so much. May I fix these places and pull a request?

fengdasuk19 commented 7 years ago

And my trials on the localhost and the remote server seem to be effective both.

alexandrevicenzi commented 7 years ago

@fengdasuk19 You say a lot of things but I can't understand what is the problem.

Where do you want HOME to go? HOME link references to SITEURL settings, if you set it properly it should work.

fengdasuk19 commented 7 years ago

@alexandrevicenzi I want HOME to go to my home page. The problem is: when I click the HOME button in the MENUITEMS on the top of the page, it doesn't turn to any other page, only to stay in place. I set SITEURL as the value of my GitHub user page, and such setting will work only when I upload my whole site to the remote server, which I cannot debug on localhost.

alexandrevicenzi commented 7 years ago

@fengdasuk19 What's your site? I would like to see the code and the hosted site if possible.

fengdasuk19 commented 7 years ago

@alexandrevicenzi Well, now I find that if I want to debug my code on localhost, I just need to set the value of SITEURL as http://localhost:8000 on which my localhost runs.

As for the problem code: I just used the very clean Pelican from pip, then installed Flex based on official instructions. Then I changed something in pelicanconf.py: firstly I set the THEME as Flex, then I set the SITEURL

The point is: I do NOT want to publish my code to the web first then debug it online, althought which seems to work. So I thought that since I want to debug on localhost, meaning I want to request resource from local server, then why not set SITEURL as the URL of local server, which 'equals' the actual URL of my site in WWW. And such trial works.

Thanks for your help and your patience!

alexandrevicenzi commented 7 years ago

For future discussion, I would recommend people to take a look at my personal blog code here.

I can easily run my blog locally to debug some stuff and publish it to GitHub pages or anywhere I want.

pogoetic commented 5 years ago

I'm having an issue with the home button as well but it seems different than the other folks issue. My issue is that even when SITEURL is set correctly, the HOME link at the top will change its path to whatever page you happen to be on. The blog is located here: https://pogoetic.github.io/

I have tried a number of things but cannot seem to figure out the issue. Please help.