3

I really have taken a liking to Stackoverflow's permalinks. The way I understand them to work is as follows:

https://stackoverflow.com/questions/uniqueid/post-title-for-seo

The following gets the job done too https://stackoverflow.com/questions/15721310:

https://stackoverflow.com/questions/uniqueid

Interestingly, if you put anything after uniqueid you will get to the question

https://stackoverflow.com/questions/100001/hello-world
https://stackoverflow.com/questions/100001/hello-cruel-world
https://stackoverflow.com/questions/100001/hello-strange-world

All of the above work, this allows you to change the question's title without losing all your permalinks.

I'm using jekyll and I plan to launch on github with github-pages (which doesn't allow .htaccess). If it can be done with jekyll without github-pages (which I'm sure is much easier) then I'd be willing to deploy it to a hosted VPS. I'm open to any solution!

I would also like questions to be a specific variable in the post like post.category or post.template such as blog or portfolio.

Community
  • 1
  • 1
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424
  • If you're willing to have an .htaccess file, you can just do this using a rewrite rule http://httpd.apache.org/docs/current/mod/mod_rewrite.html (no need for an expensive VPS by the way, Jekyll will give you a lightweight static site you could still host for free, e.g. a nearlyfreespeech.net, etc – cboettig Apr 01 '13 at 22:44
  • Um, I know it's commonly stated that Github doesn't support .htaccess, but perhaps that applies only to creating secure pages, etc with .htaccess. It seems to be obeying my mod-rewrite rules for links (e.g. 404 page, removing the htmls, etc) here: http://cboettig.github.com/index – cboettig Apr 04 '13 at 15:25
  • @cboettig Thanks, I gota try this out! – ThomasReggi Apr 04 '13 at 19:02
  • Ah, clarification on the github side, my rules just happen to match the default rules. https://help.github.com/articles/custom-404-pages. still, should be able to use an .htaccess solution on other servers – cboettig Apr 04 '13 at 23:22
  • @cboettig Can you provide an answer including the `.htaccess` configuration for what I want? I would be glad to accept the answer. – ThomasReggi May 11 '13 at 19:15
  • Linked to http://stackoverflow.com/questions/6468566/configuring-per-directory-permalink-settings-in-jekyll , http://stackoverflow.com/questions/5286964/jekyll-permalinks – Paul Verest Sep 17 '13 at 10:23

1 Answers1

2

The only close this I found in Jekill Docs is to define permalink in every post:

---
layout: share
title: CoffeeScript Spaces and Tabs
date: 2013-09-17
categories: [coffee, eclipse, nodeclipse, enide, studio, monster]
permalink: /share/coffeescript-spaces-and-tabs
---

I see no trace of post ID concept in Jekyll. I hope someone can suggest how to do that with variables or some other way.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332