Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL 的结构 #12

Closed
happypeter opened this issue Nov 20, 2012 · 23 comments
Closed

URL 的结构 #12

happypeter opened this issue Nov 20, 2012 · 23 comments

Comments

@happypeter
Copy link
Owner

github : github.com/username/projectname
lynda.com: lynda.com/category/classname
udemy: udemy.com/classname

Which is the best for us?

@happypeter
Copy link
Owner Author

For now I will stay as RESTful default, which is

onestep.com/members/1
onestep.com/courses/1

@luckyyang
Copy link
Collaborator

I think lynda's better, have a category

@happypeter
Copy link
Owner Author

Would love things like

hpcasts.com/courses/html-basics/video1
hpcasts.com/categories/web
hpcasts.com/members/happypeter

The rules:

  • I want neither url/user_name nor url/course_name, cause they are not beautiful or flesible enough.
    For twitter and github, url/user_name is perfect, cause they are about the people there. For hpcasts, it's more about the courses, for sure. But I think hpcasts.com/courses/html are a much sweeter url than hpcasts/html is. Cause the latter may cause a lot of confusion to people.
  • At the end, I don't want restful defaults, like url/courses/1, while instead I want url/courses/course_name and url/members/member_name, url/categories/cat_name.

For a course, you can give it a long detailed Chinese name, like "Html 超越经典“,but this will be a title field in database. The name field will be what is shown in the url, which will be the same as the directory name of all videos of this very course. No space in the name, use - for multi-world names, not Camal case, we don't need same couses here, so we don't allow the couses have same dir names.

@luckyyang
Copy link
Collaborator

use - for multi-world names, or _ ? which better?

@happypeter
Copy link
Owner Author

@luckyyang if you are writing C code, and want to name a variable, _ is preferred, it's from GNU coding style.

but to use as part of URL, I think - is more common.

@luckyyang
Copy link
Collaborator

fine with -

@happypeter
Copy link
Owner Author

对于课程的链接格式做些改变

现在我更倾向于用,hpcasts.com/0032-javascript-training

  1. 去掉原有的 courses, 因为 hpcasts.com 的基本元素就是 course, 就像twitter 的基本元素是人,所以他们不用 twitter.com/member/happypeter
  2. 0032 是课程编号,随机选取,没有意义,作用
    1. 用户可以敲 hpcasts.com/0032 就可以打开这门课了,很方便,当然出于 SEO 等的考虑,最官方的链接是 0032-course-name
    2. hpcasts.com 上的课程是不能重名的,相同的课没必要(不允许)录两套。但是默认一门课,一年会有一个改进版出来,改进版可以用 0079-same-course-name/0079-better-course-name,然后到 0032 的页面上注明一下 课程新版: 0079

其他的东西不变

hpcasts.com/member/happypeter
hpcasts.com/blog/0035-site-news
hpcasts.com/category/git

@happypeter
Copy link
Owner Author

#37 (comment)

@luckyyang
Copy link
Collaborator

hpcasts.com/0032-javascript-training
如果直接这么写就可以打开课程,我觉得也没什么不妥,对于用户来说更方便。但是我们总该需要个分类,这个如何实现呢?

@luckyyang
Copy link
Collaborator

lynda竟然有字幕,做的真细

@happypeter
Copy link
Owner Author

CC is great to have if you have international audience. However our courses will be done in Chinese, and our audience will be mostly native-Chinese speaker. So it's OK for us to go without CC, IMO.

@happypeter
Copy link
Owner Author

每个课程都会有分类标签,未来可以在 hpcasts.com/category/git 看到类似 http://happycasts.net/episodes?tag_id=2 的页面,所以分类效果就达到了。

我觉得 lynda.com 上把分类写在链接里没有太多必要。

http://www.lynda.com/Ruby-on-Rails-3-tutorials/essential-training/55960-2.htm

这个太啰嗦了。

@luckyyang
Copy link
Collaborator

恩,分类还是要的。lynda的确实有点罗嗦。

@happypeter
Copy link
Owner Author

@luckyyang 不仅要分类,还要分初级中级高级。

@happypeter
Copy link
Owner Author

@happypeter
Copy link
Owner Author

http://onestep.local/assets/applicaston.js

Couldn't find Course with id=assets

Need to fix

可见,把课程名放在顶级还是会有一些意想不到的不方便。

@happypeter
Copy link
Owner Author

http://warpspire.com/posts/url-design/
刚读了这篇文章,很受启发。

还是要把 course_name 放在 top section of the URL, 这样我们可以有

url.com/course_name/subscribers
url.com/course_name/edit
url.com/course_name/exercises/part_1
url.com/course_name/issues/12#issuecomment-13219679

等等一切 github 在 user_name 之后做的所有事情。

刚也想了一下要不要像 github 一样把 user_name 放在 top section. 这样我们就要:

url.com/happypeter/0001-html-basics/edit
url.com/courses/all

感觉比现在的差远了:

url.com/0001-html-basics/edit
url.com/all

@happypeter
Copy link
Owner Author

html5 onPushState 一定要学一下。

@happypeter
Copy link
Owner Author

@daqing believe hpcasts.com/course/0132-course-name is prettier

我非常想要的是 hpcasts.com/5 能带我到 id 为 5 的那门课。 这要比 hpcasts.com/course/5 方便太多了。

将来我可以在 route.rb 中判断顶级 path 只有是数字的才定向到 course#show, 这样干扰的问题就解决了。

@asmcos
Copy link
Contributor

asmcos commented Feb 18, 2013

hpcasts.com/course/5

我倾向的课程地址

@happypeter
Copy link
Owner Author

@asmcos
hpcasts.com/course/5 是 SEO 很不友好的。

可以先看看这篇文章。
#12 (comment)

@asmcos
Copy link
Contributor

asmcos commented Feb 18, 2013

hpcasts.com/course/course_name 更合适? 我担心课程名字含有中文名(或者空格,《,等)会让我们有麻烦。

@happypeter
Copy link
Owner Author

Screen shot 2013-02-18 at 6 05 28 PM

提交课程是必填的一项就是“课程英文名”,这个会最终出现在 URL 之中,英文名中的空格会一律被改为 -.
“课程标题” 这项中英文均可,是比较长的真正的课程名。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants