在设计和实施网站时,有哪些最佳实践和惯例?

时间:2023-01-19 20:07:07

I'll soon be working on a personal website that will include static and dynamic content (starting with static content, with dynamic content added over time using both custom-written components as well as open-source solutions), however I'm fairly new to web design and development, so any advice on things such as directory structure, file names, document structure...anything. Thanks.

我很快就会在一个包含静态和动态内容的个人网站上工作(从静态内容开始,随着时间的推移使用自定义编写的组件以及开源解决方案添加动态内容),但我还是比较新的网页设计和开发,所以任何关于目录结构,文件名,文档结构......等任何事情的建议。谢谢。

5 个解决方案

#1


Make sure that you're diligent about separating the scripts (javascript) and styling (css) from content.

确保您努力将脚本(javascript)和样式(css)与内容分离。

It's very easy to get carried away and leave styling embedded through your content pages, be they simple static or dynamically generated pages. And it is much harder to go back and clean up later.

通过内容页面嵌入样式非常容易,无论是简单的静态页面还是动态生成的页面。后来回去清理起来要困难得多。

Also, try to stay away from the table-based layout as much as possible right from the start. Use divs instead. They can be tricky to get working if you're not familiar with web design but divs are much more flexible in the log run.

此外,尽量从一开始就尽量远离基于表格的布局。请改用div。如果你不熟悉网页设计,那么它们可能很难搞定,但div在日志运行中要灵活得多。

Consider using a javascript framework: either Prototype.js or jQuery will do just fine and they will save a lot of time dealing with browser inconsistencies.

考虑使用一个javascript框架:无论是Prototype.js还是jQuery都会做得很好,它们将节省大量时间来处理浏览器的不一致性。

And the list goes on and on.. These were just a few things a thought of off the top of my head right now.

这个列表一直在继续......这些只是我脑海里想到的一些事情。

P.S. Use source control. Just as with any other software project, a versioning system will help tremendously if you ever want to roll back or simply decide to experiment with a new feature in a branch..

附:使用源代码管理。与任何其他软件项目一样,如果您想要回滚或只是决定在分支中试验新功能,版本控制系统将会有很大帮助。

#2


Don't reinvent the wheel.

不要重新发明*。

Why not use a content management system such as Drupal or Wordpress which can be customised and extended through the use of modules.

为什么不使用Drupal或Wordpress等内容管理系统,可以通过使用模块进行定制和扩展。

Both of these solutions are based on LAMP (Linux, Apache, MySQL and PHP).

这两种解决方案都基于LAMP(Linux,Apache,MySQL和PHP)。

#3


Not sure if this is something you would consider a best practice or convention but I would start with a map of your web site. What kinds of pages are you going to put up there, how will you organize them and how will you construct the navigation.

不确定这是否是您认为最佳做法或惯例的内容,但我会从您的网站地图开始。你打算在那里放什么样的页面,你将如何组织它们以及如何构建导航。

I always start with questions like "What do I want this web site to do?" and "Who is going to be looking at this site?" and go from there.

我总是从诸如“我希望这个网站做什么?”之类的问题开始。和“谁将会看到这个网站?”从那里开始

Also consider how important this site is. Do you plan to focus on it until completion or is it something you are doing just for fun or when time allows? If the latter consider starting small. All to often I see people start personal web sites and never complete it (including me). The worse is when I see people put up a page or two and then have 10 pages of "coming soon".

还要考虑这个网站的重要性。你是否打算专注于它直到完成,或者你只是为了好玩或时间允许而做的事情?如果后者考虑从小开始。我经常看到人们开始个人网站,从来没有完成它(包括我)。更糟糕的是,当我看到人们张贴一两页然后有10页“即将推出”时。

#4


Usability is your friend. Steve Krug's Don't Make Me Think! is pretty good, giving examples of conventions to follow etc.

可用性是你的朋友。 Steve Krug不要让我思考!非常好,提供了遵循的惯例等。

#5


Develop/Design it in Firefox*, test it afterward in IE. You'll drive yourself nuts if you try it the other way around.

在Firefox *中开发/设计它,然后在IE中测试它。如果你以相反的方式尝试,你会让自己疯狂。

*(substitute any non-IE browser as desired)

*(根据需要替换任何非IE浏览器)

#1


Make sure that you're diligent about separating the scripts (javascript) and styling (css) from content.

确保您努力将脚本(javascript)和样式(css)与内容分离。

It's very easy to get carried away and leave styling embedded through your content pages, be they simple static or dynamically generated pages. And it is much harder to go back and clean up later.

通过内容页面嵌入样式非常容易,无论是简单的静态页面还是动态生成的页面。后来回去清理起来要困难得多。

Also, try to stay away from the table-based layout as much as possible right from the start. Use divs instead. They can be tricky to get working if you're not familiar with web design but divs are much more flexible in the log run.

此外,尽量从一开始就尽量远离基于表格的布局。请改用div。如果你不熟悉网页设计,那么它们可能很难搞定,但div在日志运行中要灵活得多。

Consider using a javascript framework: either Prototype.js or jQuery will do just fine and they will save a lot of time dealing with browser inconsistencies.

考虑使用一个javascript框架:无论是Prototype.js还是jQuery都会做得很好,它们将节省大量时间来处理浏览器的不一致性。

And the list goes on and on.. These were just a few things a thought of off the top of my head right now.

这个列表一直在继续......这些只是我脑海里想到的一些事情。

P.S. Use source control. Just as with any other software project, a versioning system will help tremendously if you ever want to roll back or simply decide to experiment with a new feature in a branch..

附:使用源代码管理。与任何其他软件项目一样,如果您想要回滚或只是决定在分支中试验新功能,版本控制系统将会有很大帮助。

#2


Don't reinvent the wheel.

不要重新发明*。

Why not use a content management system such as Drupal or Wordpress which can be customised and extended through the use of modules.

为什么不使用Drupal或Wordpress等内容管理系统,可以通过使用模块进行定制和扩展。

Both of these solutions are based on LAMP (Linux, Apache, MySQL and PHP).

这两种解决方案都基于LAMP(Linux,Apache,MySQL和PHP)。

#3


Not sure if this is something you would consider a best practice or convention but I would start with a map of your web site. What kinds of pages are you going to put up there, how will you organize them and how will you construct the navigation.

不确定这是否是您认为最佳做法或惯例的内容,但我会从您的网站地图开始。你打算在那里放什么样的页面,你将如何组织它们以及如何构建导航。

I always start with questions like "What do I want this web site to do?" and "Who is going to be looking at this site?" and go from there.

我总是从诸如“我希望这个网站做什么?”之类的问题开始。和“谁将会看到这个网站?”从那里开始

Also consider how important this site is. Do you plan to focus on it until completion or is it something you are doing just for fun or when time allows? If the latter consider starting small. All to often I see people start personal web sites and never complete it (including me). The worse is when I see people put up a page or two and then have 10 pages of "coming soon".

还要考虑这个网站的重要性。你是否打算专注于它直到完成,或者你只是为了好玩或时间允许而做的事情?如果后者考虑从小开始。我经常看到人们开始个人网站,从来没有完成它(包括我)。更糟糕的是,当我看到人们张贴一两页然后有10页“即将推出”时。

#4


Usability is your friend. Steve Krug's Don't Make Me Think! is pretty good, giving examples of conventions to follow etc.

可用性是你的朋友。 Steve Krug不要让我思考!非常好,提供了遵循的惯例等。

#5


Develop/Design it in Firefox*, test it afterward in IE. You'll drive yourself nuts if you try it the other way around.

在Firefox *中开发/设计它,然后在IE中测试它。如果你以相反的方式尝试,你会让自己疯狂。

*(substitute any non-IE browser as desired)

*(根据需要替换任何非IE浏览器)