19 November 2009

Building websites - how do you do it?

From reading the title of this post you might assume that I am about to talk about what I do every day and have always done. You are only partly right.

The specific topic I am interested in is the building of completely flat websites. That is to say the type of delivery to a client which is made up of HTML, CSS and JavaScript that will never be integrated into a back-end, never have any other coding wrapped around it but will be kept as a series of flat pages.

This is something I have had to do recently for the first time in some time and the question of how to achieve such a thing in an elegant manner keeping the trials of development to a minimum occupies some of my time now.

What I did in this instance was use server side includes to include all the common components of each page from a central resource - this includes things like global navigation, a footer etc etc. When it came time to send the code to the client, I then ran an ANT script (as supplied by the esteemed Mr Alexander, once more a colleague) to output the flat pages.

This seemed to work well for me. However, I was not happy with the way this worked for the CSS and JavaScript code.

During development, I wanted the CSS and JavaScript code broken down into many files to help me find where code was, organise new code and bug fix. I wanted the convenience of loading Firebug and being able to see exactly where my style declarations came from on any particular node.

For the final delivery, I wanted one CSS file and just a few JavaScript files. But how to make that happen without breaking my ideals during development? Well, I could end up using ANT to piece it all together just like the HTML code. But that felt a bit messy and frankly, hand crafting XML is about the worst thing I can think of doing.

This is where I stop providing solutions and pose a question. How would you have prepared your build? How would you have made sure that during development you could pull in only the bits of JavaScript that should have been on each page and then built the flat files correctly? Its more complex than it at first appears....

64 comments:

Alex said...

If you can serve images from a web server using java environment, there is a solutionm: wro4j (http://code.google.com/p/wro4j/).
You can have as many css & js you want. All you have to do, is to create an xml defining resources to be merged & include a single resource in your html. This way you can benefit from both: easy of development & performance optimization.

Elixon said...

I would use any CMS I like (I like my own CMS of course ;-) and wouldn't worry about anything else during the site development.

Once the site is ready I would mirror it into static pages using wget tool (or similar).

Then I would create a simple script that crawls the static files and optimizes them in a way required.

The optimization is up to you. You can grab the LINK tags referring to multiple CSS files and join referred CSS into one and rewrite the HTML to link joined file, the same javascripts, ...

You can even embed linked CSS/scripts/images into the HTML itself (if you are sure that modern browsers will be used then use the "data" URL scheme to embed images, css, scripts, whatever you need into the URL itself).

Depends on what is your goal and purpose of the pages. Less files (embed into one HTML) or fast pages (join external resources)...

Who knows maybe there are already some tools for this out there.

This seems to be very easy question for me so I am not sure if I really did understand your problem correctly. Did I miss something that makes it more complicated?

Web Development in India said...

We cater to a Global Clientele - both big and small. Our prime focus is on procuring clients’ specifications and deliver stunning tailor-made websites that fuse great designs with smooth functionality. Our aim is to make excel each project with the best design standards.We’ve designed great websites for a rich array of clients and businesses around the world. We ensure you value for money and maximum ROI. Thanks. Web Development in India

Jason Grant said...

There is no easy solution to this as you say, but it's a very important consideration to give.

It would need to be a server side 'build' on the fly which would create one JS file containing all the necessary code for the required functionality to meet Yahoo UI performance guidelines.

Martin Dube said...

Take a look at "MINIFY".
It's a PHP5 app that combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.

http://code.google.com/p/minify/

tenax_technologies said...

Java Platform, Enterprise Edition (Java EE) is the industry-standard platform for building enterprise-class applications coded in the Java programming language. Based on the solid foundation of Java Platform, Standard Edition (Java SE), Java EE adds libraries and system services that support the scalability, accessibility, security, integrity, and other requirements of enterprise-class applications. java software company

lala said...

Thanks for your post and welcome to check: here.

panel çit said...

thanks for sharing

sorna said...

Hi. Greetings. This post is really good and blog is really interesting. It gives good details.
Scrum Process

Anthony said...

Cheap Cigarettes Newport 100s this kind of kind of pattern initially decides, considered the profession recent several rounds reforms " Newport Cigarettes to compete beneficially moderately " The policy inherits, as well as profession stratification plane regarding cigarette on horizontal sincere hope, we have made the following several aspect supposition, hoped that while proposed question, may provide in some kind of way for the key backbone brand next step development the reference: Whether is these brands? With " Whether is these brand "

But is not " Which brand " also has; Comes to indicate that has indicated our basic standpoint - - present's " Double 15 " the future xiny67xt, will be in the lead for a while have been in the lead. At present resides in " Double Newport Regular Cigarettes " Row, row of position before brand will be whether the future 532, 461, whether will these brands smile finally Marlboro Reds?

Very obviously, from the present profession stratification plane's policy guidance judgment, encouraged the moderate beneficial competition was still cultivates 532, 461 essential requirements and the important way, this has decided the future 532, 461 not oriented trainings, but performed superior win and the inferior wash out through the further high level's competition, was in the lead for a while does not represent is in the lead at times. At the same time, recalls a stage the brand development process, always has some to look that resembles the accident but to anticipate in the brand change, has a look at 36 kind of superior smoke the present circumstances, including many once crest of wave very vigor brand at present tough Cheap Newports, " Double 15 " The brand has not lowered one's guard regarding prospect any Newport Cigarettes Website.

arkadaş said...

thank you very nice

rulman said...

had a great share thanks

tahir sumar said...

Free Bollywood hot News, Bollywood Top Hot Actress and Hot Desi Girls Beautiful hot Pictures.
hotentertainnews.blogspot.com

tahir sumar said...

Most Popular and Famous Vehicles, Latest Speed Cars, Sports Cars Info and Pictures.
worldlatestvehicles.blogspot.com

sunny kumar said...

Forex Market is very high for internet Business Users, Latest Forex updates, forex tips, Currency exchange rates, Daily updates news about Forex
LatestFxMarket.Com

bhawan kumar said...

Online Earning opportunities to make money online from home, Internet Online Business want to make money easy now.
www.jobzcorner.com

muhammad ibraheem said...

Investment Plans to make money online, Online Jobs can make money online from home, Just Visit
www.jobzcorner.com

Rakesh Kumar said...

Most popular 2013 Cars and Vehicles, Latest Company Cars Huyndai, Honda, BMW, Nissan, New Aston, Ferrari and Most popular speed and Super Cars
WorldLatestVehicles.Com

sunny kumar said...

Online Earning opportunities to make money online from home, Internet Online Business want to make money easy now.
www.jobzcorner.com

bhawan kumar said...

Online Earning opportunities to make money online from home, Internet Online Business want to make money easy now.
www.jobzcorner.com

Rakesh Kumar said...

Most popular 2013 Cars and Vehicles, Latest Company Cars Huyndai, Honda, BMW, Nissan, New Aston, Ferrari and Most popular speed and Super Cars
WorldLatestVehicles.Com

sunny kumar said...

Online Earning opportunities to make money online from home, Internet Online Business want to make money easy now.
www.jobzcorner.com

zahid ahmed said...

Many of the Online Jobs and Online Earning System in internet online Business, but here is a best and legit online earning systems with life time opportunity.
www.jobzcorner.com

Fahad Naseer said...

Which Car you want..? Here is a best list of Cars and Vehicles, Hot Vehicles, Strange Cars, Super Cars Model, Funny Cars, Car Latest Models, Cars with Girls, Cars like helicopter and Most Speed and Expensive Cars
WorldLatestVehicles.com

sunny kumar said...

World's Most Popular Website where you can get every thing you want, Marketing and Advertising, Social Media Marketing, News updates, Entertainment Updates, Funny pictures, Entertainment Pictures, Hot pictures, Classified Websites, Mp3 Tunes, Online Jobs, Videos, Funny Videos and Much More Fun Mania
HotCurrentAffairs.com

zahid ahmed said...

Many of the Online Jobs and Online Earning System in internet online Business, but here is a best and legit online earning systems with life time opportunity.
www.jobzcorner.com

Uhu work said...

Many peoples want to earn money on internet without any investment but there is many online jobs which have many investments. Now you can earn without any investment with Just clicking and Earn daily upto 10 Dollars.
Join this Best opportunity to make money online without any investment or Charges.
HotProClicks.com

news said...

Internet Online System is very usefull and Billions of Peoples use Internet and Many of the peoples want to make money online from home and make online business for a life time
We have the best Online earning System with Data Entry Jobs, Online Jobs, Network Marketing, SMS Earning, and Much More Online Work From home, Skype : Jobz.Corner
JobzCorner.Com

Özbekistan Vizesi said...

Thank you stuff for share

Muhammad Hassan said...

Do you need any Online Job from home to Make Money online..? Jobz Corner Provides you the Best Online Earning Opportunities to Earn Money Online From home, Data Entry, Copy Pasting, Clicking, Article Sharing, Data Sharing, Facebook Share Like and Many Types of Online Jobs
Join now with Best Online Jobs Provider Company where you can your Future Income
JobzCorner.com

muhammed waqar said...

What is Lol...? Every thing you want in Lol and Troll, Now you Get all in one Network, ThatIsLol.. Lol Pictures, Lol Videos, Lol Peoples, Funny Peoples, Troll Images, troll pictures, funny pictures, Facebook pictures, facebook funny pictures, facebook lol pictures, Funny videos and Much More only Laughing out of Laughing
lolsgag.com

muhammed waqar said...

Get Part time online jobs on Facebook, The best Social Media Website where you can share some fun and earn with us, Share some pictures on Facebook and earn on every pictures you post or share. Unlimited Facebook Wall Sharing and Unlimited Earning.
Earn with Making Facebook Ids, Make Unlimited Facebook Ids and Get 10$ on Every FB Id.
jobzcorner.com

Sagar Khattak said...

Entertainment for Fun... Entertainment Articles, Entertainment News, Entertainment Pictures, Bollywood, Hollywood and Lollywood Pictures and Videos, Entertainment Latest updates, Hot Entertainment News and Pictures Funny Entertainment Pictures, lol Pictures, Funny Pictures and Much More Fun Only on 1 Current Affairs Network
hotcurrentaffairs.com

shafique said...

Internet Users have very big Good News, Now you can earn with Just Share an add or picture on Facebook, Facebook is the Most popular Website in the World and you can make unlimited income with Just Facebook Posting Program.
Genuines Works of Data Entry, Facebook Posting, Copy Pasting, Add Posting, Clicking, Web Surfing, Website Visiting, Article Sharing, Data Sharing, Google Business Plan and Much More Business Plans.
www.jobzcorner.com

hasnain raza said...

Lols Gag is the the Best Lol Network Ever, where you can every thing is lol and Funny, Troll Images, Prank Peoples, Funny Peoples, funny planet, funny facts, funny cartoons, funny movies pics, iphone funny, funny jokes, Prank Images, Fail Pictures, Epic Pictures, Lols and Gags, Lol Pictures, Funny Pictures, Lol is the Laugh out of Laugh where you can Fun Unlimited and Laughing Unlimited.
lolsgag.com

hammad sohail said...

Forex Affaris.. Latest Currency news updates, latest forex trading business updates, trading updates, forex trading latest news, forex brokers directory, forex brokers list, Dollars news affairs, Stock Markets, stock market news, stock market analysis, technology news, international forex markets, international forex business news and all updates about Forex Trading
ForexAffairs.Com

feroz khan said...

Want to Learn Forex Trading and earn with Forex Business...?? The best Forex Trading Learning Website where you can get any thing about Forex, Trading updates, forex trading latest news, forex brokers directory, forex brokers list, Dollars news affairs, Stock Markets, stock market news, stock market analysis, technology news, international forex markets, international forex business news and all updates about Forex Trading
ForexAffairs.Com

feroz khan said...

Latest cars and vehicles, Latest Mazda Models, Racing Cars, International Sport Cars, Concept Cars, PS-Pod, Strange Vehicles, Nissan, Royce Corniche, Ford Concept Cars, Strange Vehicles, Mercedes and More Sport Cars and Vehicles with Pictures and Info
WorldLatestVehicles.com

hammad sohail said...

Super Cars Latest Mazda Models, Racing Cars, International Sport Cars, Concept Cars, PS-Pod, Strange Vehicles, Nissan, Royce Corniche, Ford Concept Cars, Strange Vehicles, Mercedes and More Sport Cars and Vehicles with Pictures and Info
SuperCars.Com

daniyal raza said...

Genuines Works of Data Entry, Copy Pasting, Add Posting, Clicking, Web Surfing, Website Visiting, Article Sharing, Data Sharing, Google Business Plan and Much More Business Plans
www.jobzcorner.com

Sagheer said...

Online Jobs of Data Entry, Copy Pasting, Add Posting, Clicking, Web Surfing, Website Visiting, Article Sharing, Data Sharing, Google Business Plans, Investment Plans, Genuine earnings from home.
www.jobzcorner.com

Syed Kazim Ali said...

The Best Lol n Troll Network with the Name of Lols Gag... Troll Images, Prank Peoples, Funny Peoples, funny planet, funny facts, funny cartoons, funny movies pics, iphone funny, funny jokes, Prank Images, Fail Pictures, Epic Pictures, Lols and Gags, Lol Pictures, Funny Pictures, Lol is the Laugh out of Laugh where you can Fun Unlimited and Laughing Unlimited.
LolsGag.Blogspot.Com

Faheem Zia said...

For All Latest Hot Current Affairs
www.hotcurrentaffairs.com

Ahsan Afsar said...

World Most Popular and Top Amazing Speedy Cars
TopAmazingCars.BlogSpot.Com

Natsu Uaganda said...

Get Hourly profit for 200 hours on every hour without any risk and without any work, best business plans ever
AllTimeProfit.com

Rehan Ahmed said...

Online Jobs, work from home, part time online jobs, just join any where in the world
Fb.com/JobzCornerz
JobzCorner.com

hasnain raza said...

Online Corner is the best Platform to earn money online from internet, Just Join Now and start earnings
OnlineCornerz.com

Rehan Ahmed said...

Online Business as low as $1, Join Now and Get Best Business from Home without any work
AllTimeProfit.com

hasnain raza said...

Get your website on google top 10 Results, Best Search Engine Optimization Company in Pakistan
Contact Now
Skype : Jobz.Corner
www.jobzcorner.com

Rehan Ahmed said...

Funny and Lol Pictures only on this online network in the world, online gags
LolsGag.com

hasnain raza said...

Business at home...??? want to join the best business without any work, just invest and rest
www.earningsclub.com

Syed Kazim Ali said...

Best Business Club of Earnings, Hourly Stable Plans Like 1% Hourly for 120 Hours, Total 120% Profit within 5 Days
EarningsClub.com

hasnain raza said...

Online Jobs, Just Post a Comment on any blog site and earn $0.06 per Link, Just Like this post, Visit and Click on Link Relation
JobzCorner.com

ahmedraza moon said...

Get Facebook Likes on your fb page, likes on your facebook pictures, followers on your facebook id, shares of your facebook posts, every thing is available here, visit for more details
www.jobzcorner.com

adnan khan said...

Find Best online home based jobs, data entry, copy pasting, facebook and clicking jobs
JobzCorner.com

Rehan Ahmed said...

Get Free Online Jobs from home, best ad clicking work, join now
JobzCorner.com/FreeEarning

hasnain raza said...

Play Games and Earn Money online from home, best add clicking website in the world
PaidVerts.com

Syed Kazim Ali said...

Earn Money on without investment, just join free add clicking websites and earn upto $10 per Day, Join Now
jobzcorner.com

ahmedraza moon said...

Earning is only for you, just spend 1 hour daily and earn upto $35 Daily with just clicking job, Join Now
adsclickearning.com

waleedgazdar said...

for best Online Jobs without any rejection, no time limit required, no investment requires, just spend few minutes and earn upto $35 daily
www.adsclickearning.com

ahmedraza moon said...

Instant Payment without any Risk, Just Invest and Rest of your home, Just Invest as low as $5 and Get Instant Profit, Join Fast
HotProfitOnline.com

waleedgazdar said...

Find best business in the world where you can invest only $5 and get profit upto 7% daily for 60 Days, most popular website in ranking, Join now
www.hotprofitonline.com

bilal sabir ali said...

for best Online Jobs without any rejection, no time limit required, no investment requires, just spend few minutes and earn upto $35 daily
www.adsclickearning.com

waleedgazdar said...

Find best business in the world where you can invest only $10 and get 3000% Profit, most popular website in ranking, Join now
www.investorganization.com