Use Hyde to quickly build lightweight static sites

Source: Internet
Author: User
Tags file system html tags test web server ruby on rails in python backup

Overview

In the early days of web development, most Web pages were just one page in a file system on a server. As the web matures, it becomes increasingly common to transform from simple files to complex Web content management Systems (CMS) and publishing tools with the help of dynamic sites, E-commerce, Mass publishing, and Web applications. Thousands of sites are running on the following platforms every day:

IBM WebSphere

Other Java frameworks or. NET

Other popular alternative Web publishing frameworks, such as Ruby on Rails and Django

Community-oriented CMS, such as WordPress

In addition to the simplest sites, any other site seems to require a CMS with modern facilities and workflows.

But many Web veterans, like me, still remember some of the advantages of a simple site in the past. First, there is less server power required to provide static files. Another problem is backup and content portability. When choosing a CMS or Web publishing framework, you may need to rely on what they present to you. Bind content to a database table so that you cannot easily touch or take out a file to share. Migrating to different infrastructures can be a daunting task, and you must rely on special tools to achieve backup and recovery.

The root cause of these problems is transparency. Web publishing frameworks and CMS are usually not transparent, which means that to understand how they store, manage, and deliver content, there is a lot of expertise to be learned. To a certain extent, this requirement is unavoidable for all sites, even the simplest web sites, and recent emerging projects offer some of the advantages of the framework and do not lose the core elements of processing and publishing simple files on the server. One of the more popular frameworks is Jekyll. Some developers build on Jekyll core concepts using a set of building blocks created on open source Hyde projects. Hyde is also the Web publishing system I use. Hyde, while simple, offers a number of features that limit most businesses to working with simple files to generate a static site, which delivers efficiency and flexibility.

Getting Started with Hyde

Hyde is a system written in Python that enables you to manage content and templates in a directory on a WEB developer's file system. You can use the General text editor and command-line tools to create or update content, or you can use the IDE (if you like). If you want to see how your site looks, you can use Hyde to build your site and run it locally using a test Web server. If you are satisfied with the site in test mode, you can import statically generated files into the production Web server for Apache, LIGHTTPD, Nginx, or any Web server that quickly provides file services.

Installing and setting

If you are doing WEB development on a MAC or Linux system, the main tool you can get is Python. Python is easy to install on Microsoft Windows and most other platforms. To install Hyde in your Python library, call the sudo easy_install Hyde or pip install Hyde, depending on your settings. Once the installation is successful, you can use the Hyde command. First, set up Hyde in a directory with a file frame, and for a typical Web site, you can use the following command:

Hyde-s $PATH _to_directory Create

Replace $PATH _to_directory with the directory you want to use to save content and template files.

The above command uses a default site layout, but Hyde allows you to select a different site layout. This option is useful if you want to use some famous toolkits or settings for your site, for example, when using the Twitter Bootstrap framework, or when you know the target site is a blog.

If you use the default layout to switch to the most recently created site directory, you should see the following subdirectories:

Readme.markdown Content Info.yaml Layout Site.yaml

Each entry provides a different side of the Hyde.

Markdown

Many people do not like to write HTML, with Hyde can minimize the work of processing HTML. Most content systems provide a way to avoid the manual editing of HTML, which typically uses a specific WYSIWYG (WYSIWYG) widget, giving people a sense of using a word processor when generating HTML. Another method is very famous, from Wikipedia. You can use special characters to represent various HTML tags, and to edit plain text in this way. The tag is called the Lightweight markup language, and one of the more popular samples is markdown.

Hyde is built into a Web page processor that allows you to write using Markdown instead of HTML. In this article, I won't go into detail on markdown, listing 1 is a small example of rich content in the markdown format.

Listing 1. Examples of rich content in markdown format

For immediate release. **boulder, Colorado, 1 January 

2012** The New year began with 
a bang .... At City Hall A is a local nation elder is invited to offer 
residents a greeting of *heebee*, or "Hello" in Arapaho, and recorded for the 
[City Web page] (http://www.bouldercolorado.gov/). One resident said his New year 
resolutions were to: * Lose weight ' go camping ' at 
least one week Mmer * Pay off one credit card 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.