Auto generate pages links to navigation bar on Octopress - octopress

I created many pages under tutorial folder.
those pages are
tutorial/ruby
tutorial/python
tutorial/c
However, I can only see posts in my Octopress blog,
but pages can not be seem. only posts can be seem.
If I want to access those pages under tutorial,
I should type the link manually.
Is there anyway to generate the pages I create and auto create link to menu or navigation bar?
Thanks for your help

You have to generate the pages using the rake generate
Now add them to the navigation of your site.
Here are the docs on how to do it:
http://octopress.org/docs/theme/template/
Changing the Navigation
To change or add links to the main navigation, edit /source/_includes/custom/navigation.html which looks like this:
Navigation (source/_includes/custom/navigation.html)
<ul class="main-navigation">
<li>Blog</li>
<li>Archives</li>
</ul>
The href for each link begins with {{ root_url }} (this helps Octopress write urls differently if a site is deployed to a subdirectory).
If you're deploying your site to a subdirectory like yoursite.com/octopress you'll want to add this to any links you add.

Related

Use multiple themes on one website jeykll

I have recently found out about jekyll, and want to make a project landing page with it. I would like to have a home page using one theme (e.g. ubuild) and have another page for the docs (accessed via a navigation bar at the top) that uses a different theme (e.g. just-the-docs). How can I go about doing this?
EDIT: I want to use Github Pages for this.
Since you plan to use one of the themes on just a single page, I think the best solution would be to use two base layouts instead of two themes.
It will take some minor work initially, but will greatly ease future maintenance.
First set up the site to render just-the-docs theme for all pages including the landing page. Then modify _layouts/home.html to be a parent layout (like the default layout)
to render the markup from the ubuild.. theme.
I solved this with help from #JoostS's answer but with a few modifications:
Make an organization on GitHub pages with a repo called <org-name>.github.io. This repo should contain the theme for the home page (ubuild in my case) and all the content for it.
Make another repo with a jeykll site, called docs. This site should have the theme you want for the other page (just-the-docs in my case) and all the content along with it.
In the docs repo, add baseurl: "/docs" to your _config.yml
The <org-name>.github.io repo, should now be hosted at <org-name>.github.io/:
The docs repo should now be hosted at the <org-name>.github.io/docs url:
To link to the docs page, you should just be able to use /docs now.
The solution is to create two separate websites. The first site contains just the homepage and should be deployed to the root of your web folder. The second site contains all docs and should be deployed to a subdirectory, like '/docs/'. You might want to use baseurl for this: https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/
I do not think you can use this solution on Github pages. You can TRY to add the same CNAME to both repositories, as I am not 100% sure. Any other static hosting environment should work.
You can link from the docs to the homepage by linking to '/'. You can link from the homepage to the docs by linking to '/docs/pagename/' (assuming you use permalink: pretty).
The simplest way to maintain two layouts on the same site using Jekyll with GitHub Pages is for you to create a new repository for the new layout, so the main site is in a GitHub organization and the pages that need to use a different layout must be in your repositories.
However, if you are not using GitHub, just jekyll, just configure each folder as a new Jekyll project, and direct them to write to the respective subfolders in the _site folder. For everything to work out you need to start Jekyll Server from the main folder, and then build each subfolder separately, so it will update without removing the main one

create a page for each category automatically in Jekyll

How can I create a page for each category automatically in Jekyll ?
example:
the url of the post : https://UsrNm.github.io/Category1/Category2/2018/02/16/Post1.html
I want when I go to link like: https://UsrNm.github.io/Category1/Category2/
Get All posts in category Category1 and Category2
or when I go to link like: https://UsrNm.github.io/Category2/
Get All posts in category Category2 only
You can't do this automatically.
Well, you have 2 options:
The Jekyll way and the hackish way.
In pure Jekyll way you will need to create pages manually for each category, even if you have posts with multiple categories. Note that Jekyll doesn't have dynamic routing for this.
In hackish way you could use Javascript to read the parameters in url and show/hide needed content. Idea is to render all of the posts(hidden by default) and create identifiers on them, proper way to do this would be adding html attribute data-category=cat1 and say that you have url like this
/category?categories=cat1,cat2. You could then get categories from url and add logic in javascript to show just the ones that are actually in that categories.
Hope that helps
You can use the gem jekyll-archives to do this kind of work, which is a plugin of jekyll.
Or if you want to do this manually, you can read this guide
You can see the example of my site
Tips: Github Pages do not support this. Thus, if you want to deploy this on Github pages, you can convert site to static files and push only _site dir to the repo, which has been mentioned at here :)

jekyll bootstrap page not showing in navigation

I'm trying to add a page to my Jekyll Bootstrap blog and it's not showing up in the navbar. I thought that if you included the correct YAML front matter, the pages would automatically generate in the nav. I've created the page manually with a .html file extension, created the page using the command
rake page name="about.md"
... and neither one seems to work. I've restarted my server, I'm using
jekyll serve --force_polling
and I can't seem to get the page to show in my navigation ... please advise.
LINKS:
My github codebase: https://github.com/twotimes22/twotimes22.github.io
Documentation: http://jekyllbootstrap.com/usage/jekyll-quick-start.html
Thanks in advance.
Your need to put your page in the navigation group by adding group: navigation in the front matter.
See the page_list inclusion and the Jekyll bootstrapp documentation.
Edit: After watching at your repository I found a strange bug.
You have a trailing space in the front matter that the page away fronm the jekyll page listing ??
This is your front matter :
---[space]
layout: page
title: "Toto"
group: navigation
---[space]
Removing the [space] makes the page appear in the pages list. Strange !

Moving Related Blog Posts on magento product page using fishpig

I'm trying to move the "Related Blog Posts" on the product page from the bottom of the page into a different section of the page (tabs).
The theme I'm using allows me to add a tab which pulls a static block to create a custom tab. I'd like to use this as a place to store the "Related Blog Posts". The custom tab has an identifier of "block_product_tab1"
I tried moving the "related Blog Post" by replacing "product.info.additional" in wordpress.xml with other "block_product_tab1" but that didn't work.
I'm not sure how to continue.
If in your custom tab extension you can set a static block for a tab, you can add the following code to your static block, which will generate the related posts block:
{{block type="wordpress/post_associated" name="wp.post.related" template="wordpress/post/associated.phtml" title="Related Blog Posts" entity="product" count="5"}}

Joomla: homepage url

Joomla requires that home page was linked with some component.
So, if i link menu item of homepage to some article, i get a url like:
"index.php?option=com_content&view=article&id=68&Itemid=464" on frontend.
How to link homepage to "/" ?
UPD:
Joomla verion 1.7
Maybe, i not accurately explained.
I link home menu item with some article.
When i go to www.mysite.com - all fine, choosen article is shown on homepage.
But then the home menu item on frontend became "index.php?option=com_content&view=article&id=68&Itemid=464", not just '/'
You must use the default Joomla format for setting something as the "home" page. in 2.5 (since you failed to tell us which version you're running) you do this by using 'featured articles'. By default, any featured article is displayed on the homepage.
In older versions (1.5) you must mark it to display on the 'front page'
In doing that when you go to http://www.yoursite.com/ - you will see the articles listed as 'featured' or 'front page' articles. You can adjust how they display by using the front page or featured article manager.
I apologize if I've misunderstood your question - but hope this helps. It also looks like you don't have SEF URL's turned on - you may want to look into that. Regardless your front page will display without any additional URL stuff if you use the methods outlined above.
In your menu manager (backend), create a new entry for 1 article and select it in the list. After that, just define this new menu entry as default (or homepage).
This article will be the default homepage of your website and will be accessible via www.yoursite.com/

Resources