Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

html - Nav bar not showing up on permalink Jekyll site

I've been toying around with a GH Pages Jekyll site. I took an HTML static site and changed the location for the stylesheet and the text/CSS.

Everything works correctly on my index.html page. However, on the other pages, the mobile/half-sized desktop navbar doesn't appear. The difference being I used a permalink to get navigate to those other pages (/categories/ instead of /categories.html).

I played around with the config file tried changing the

permalink: /:categories/:title/

to

permalink: /:categories/:title.html

Which gives the right filename, but it didn't address the navbar.

The only way I could fix the landing pages for the categories would be to change the links in the default.html. In this example the second item on the list works and the other doesn't.

<nav id="nav">
    <a href="/TITLENAME/">Doesn't work</a>
    <a href="/test.html">Does work</a>
</nav>

My goal is to have permalinks. So I can seamlessly navigate from the landing page to the categories and the blog posts.

This is my GitHub repository: https://github.com/Thor-DraperJr/Thor-DraperJr.github.io

Thanks for the advice!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It turns out that the css only was written to apply to www.baseurl.com/page

I changed the permalink in the _config.yml

permalink: /:title

This meant that each page and post would only show up one level past the root url.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...