GitHub pages how to build a personal site how to add navigation

Source: Internet
Author: User

Those of you who have worked on GitHub pages are aware of the use of Jekyll to build a directory structure for your personal site, while navigating the final code is in the Default.html file in the theme directory you are using.

My structure is as follows:

. ├──404. Html├──about.html├──archive.html├──assets│└──themes├──atom.xml├──categories.html├──changelog.md├──_config . Yml├──_drafts│└──jekyll-introduction-draft.md├──history.markdown├──_includes│├──jb│└── Themes├──index.md├──_layouts│├──default.html │├──page.html│└──post.html├──pages.html├──_plugins│└──debug.rb├──_posts│├── -- on- in-hello-world.md│├── -- Geneva- on-mysql-xx. md│└── -- Geneva- on-to-myself.md├──rakefile├──readme.md├──rss.xml├──screenshot.png├──_site│├──404. Html│├──about.html│├──archive.html│├──assets│├──atom.xml│├──categories.html│├──history.markdo Wn│├──index.html│├──mysql│├──pages.html│├──rss.xml│├──screenshot.png│├──sitemap.txt│├──tags.ht Ml│└──untitled├──sitemap.txt├──tags.html└──_theme_packages└──hooligan

That is, in the picture of the red line in the directory, which is used in the theme directory

There are four files in the theme used: Default.html, page.html, post.html, setting.yml, and navigation-related code in default.html

<class= "nav">    {% assign pages_list = site.pages%}    {% Assign group = ' navigation '%}    {% include jb/pages_list%}    {% assign pages_list = site.pages%}    {% assign Gro up = ' aboutme '%}    {% include jb/pages_list%}</ul>

The first three lines in the UL tag are the default, and the next three lines are the one I added to add a page of my own description.

The Self-Introduction page header is like this:

---layout:pagetitle:About meheader:about megroup:aboutme---{% include jb/setup%}<h1< /c3>></H1>

Note that the group is a place where the value is a separate aboutme, which is why I added three rows to the Default.html page because the default three rows only import the group-navigation page.

Similarly, if all the pages are navigation, then we cannot control their order. In other words, aboutme may be at the top of the line.

GitHub pages how to build a personal site how to add navigation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.