Langsung ke konten utama

Using Google Code To Host Scripts For Your Blogger Template

Many methods used to customize our Blogger templates require the use of JavaScript. At present, we can only upload images and video to Blogger. So if we need to use JavaScript we must find alternative hosting for these files.

When using JavaScript in my own Blogger templates and customizations, I prefer to host the required scripts using Google Code's Project Hosting. In this post, I'll explain the methods and best practises for using Google Code to serve JavaScripts for your own Blogger tweaks.

First things first!

Project Hosting on Google Code is intended for collaborative development on open source projects. Rather than being used as a substitute for regular web hosting, it is best suited to hosting shared projects.

All projects hosted on Google Code are Open Source, and are available for anyone to view or download. Various licenses are used for files served by Project Hosting including:
If you do need to upload scripts to Google Code for hosting, you need to be sure any license pertaining to the script allow the file to be distributed in the public domain.

Search for scripts before uploading your own

Before creating your own project on Google Code for the purpose of hosting files, be sure to check if the script has already been made available by another project.

You can use the Google Code search page to check if the script you'd like to use is already hosted:

 The most productive method is to search for the file name of the script you need. For example, when searching for the minified jQuery library, I'd use the term "jquery.min.js".

If the file you need to link to is already available, you can link to this in your template (or gadget code) as detailed below.

Hosting your own files with Google Code

If you find the file you require is not available, or would like to use Google Code to host your own files, you'll need to create a new project.

Fill in all required details on the Create a Project page and choose an appropriate Public Domain license from the drop-down list. All files you consequently upload to your project will adopt this same license.

The name chosen for your project will become part of the URL for your project's home page (e.g.  http://code.google.com/p/NAME-OF-PROJECT) and should contain no spaces.

You can also choose to add labels to help others find your project.

To upload files to your new Google Code hosted project, click the Downloads tab, then use the New Download link:


On the next page, you'll be able to add a one-line description of your file, plus a detailed description for information:

Upload your file using the Browse button.

Labels on this page affect how your download is presented on the main project page. Place your cursor in one of the Label boxes to be presented with a list of choices and select any which are applicable (or none if you prefer):


Finally, click the Submit File button to upload your file to Google code.

Linking to files hosted by Google Code

Once you've uploaded a file to Google Code (or have found a file to which you'd like to link) you'll need to locate it's direct URL.

In most cases you'll find the script you need is included in a list of downloads on its project page, like this:



When you click the linked title of the file you want to use, you'll be taken to it's dedicated page which includes details of the file and the all-important direct file link:


You'll need to right click this link and choose to copy the link location. Then you'll be able to paste the URL which links directly to the file for use in your own Blogger projects.

Of course, the way you need to use this direct link will depend entirely on how you need to use the hosted file.

For example, when implementing a jQuery slideshow to your Blogger template, you'll need to replace the URLs of script files placed in the <head> section of your Blogger template. If linking to a PDF hosted on Google code, you can simply paste it in place of the URL in the link tags.

In future tutorials posted here on , I'll be referring to this method often as from now on I'll be using Google Code as my main repository for scripts and Blogger projects.

Tools on Google Code

Back in 2009 I launched the Tools project on Google Code to act as a repository for scripts and files relevant to Blogger-based development.

This project now includes the vast majority of files used for interactive JavaScript features (e.g. slideshows and galleries); Blogger Gadgets, free Blogger templates and eBooks.




Did you find this post useful?

Rather than focusing on a customization tutorial in this article, I've tried to offer an overview of using Google Code for hosting files relevant to your own Blogger template tweaks.

I hope you've found this post useful! Please feel free to share your thoughts in the comments section below.

Komentar

Postingan populer dari blog ini

How To Add A Music Player In Blogspot

Since this archived post was written in 2007, web design and Blogger templates have changed immensely. The development of HTML5 and <audio> tags enable us to add music to our Blogspot websites and posts far more simply, and with improved control. In preparation for explaining how to podcast with Blogger, this tutorial explains how to easily add an HTML5 mp3/audio player to your blog posts or layout. No JavaScript, Flash or plugins are required, and with a fallback for older browsers which don't support the player. I've even created a simple form to generate basic tags for you! Adding music to your Blogspot site has never been so easy! Basic HTML5 Audio Tags Explained The <audio> tag is a new feature of HTML5 which we can use to natively embed audio playback in our sites. It is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari, and can be set to play the linked audio file automatically (autoplay) or loop if required. Here...

Free Blogger Backgrounds And Textures To Spice Up Your Site

Background images can instantly transform the appearance of our Blogger sites. Using the Blogger template designer, we can easily upload and configure a new background image in just a few clicks, while those using older templates need only add a few lines of code to achieve a dramatic effect. In this post, you'll find resources for hundreds of different free backgrounds, patterns and textures you can use to spice up your Blogger site, along with instructions for applying this simple but extensive effect. Large background images Large background images enable us to display a single large image behind the main content of our site, such as a photograph or complementary texture. Here is a selection of excellent resources for large background images and textures: HOT Bliggity Blog Provides a huge selection of large background images with a contrasting central panel to offer contrast for the main site content. Shabby Blogs A beautiful col...

Download Mp3 - Parodi Blackpink - dududu At D&#;Academy Indonesia Dance Solo by Ivonne Rose (Anak Indonesia)

download lagu 123 Parodi Blackpink - dududu At D&#;Academy Indonesia Dance Solo by Ivonne Rose (Anak Indonesia) - download lagu terbaru blackpink lisa moments i think about a lot- free download lagu mp3 Blackpink Lisa - Lili [FMV] Alan Walker, K- & Emelie Hollow - Lily- download lagu mp3 full 【BLACKPINK】Gaon Chart Kpop Awards -download lagu 123 MP3 bts & blackpink | mma , Semua Lagu-Lagu, Video dan Lyrics tersedia disini, Semua Musik ini berasal dari Youtube.com dan gratis untuk didownload. Belilah Lagu Parodi Blackpink - dududu At D&#;Academy Indonesia Dance Solo by Ivonne Rose (Anak Indonesia) dan kasetnya di Toko Terdekat Maupun di iTunes atau Amazon secara legal, ini hanya sebagai Review dan Promosi saja. Video Terkait Video Download MP3 Parodi Blackpink - dududu At D&#;Academy Indonesia Dance Solo by Ivonne Rose (Anak Indonesia) Download MP3 blackpink lisa moments i think about a lot Download MP3 Blackpink Lisa - Lili [FMV] Alan Walker, K- & Emelie Ho...