Skip to content

Instantly share code, notes, and snippets.

@tungsheng
Last active August 29, 2015 14:17
Show Gist options
  • Save tungsheng/9804da7b099118e5cd90 to your computer and use it in GitHub Desktop.
Save tungsheng/9804da7b099118e5cd90 to your computer and use it in GitHub Desktop.

Revisions

  1. tungsheng renamed this gist Mar 21, 2015. 1 changed file with 18 additions and 11 deletions.
    29 changes: 18 additions & 11 deletions html2.haml → html5.haml
    Original file line number Diff line number Diff line change
    @@ -1,27 +1,32 @@
    !!! 5
    %html
    %head
    %title "Your Website"
    %title Crazy Website
    %meta{ :charset => "UTF-8" }
    %meta{ :HTTP-equiv => "Expires", :content => "0" }
    %meta{ :HTTP-equiv => "kiben", :content => "no-cache" }
    %meta{ "HTTP-equiv" => "Expires", :content => "0" }
    %meta{ "HTTP-equiv" => "kiben", :content => "no-cache" }
    %link{ :href => "css/reset.css", :rel => "stylesheet", :type => "text/css" }
    %link{ :href => "css/style.css", :rel => "stylesheet", :type => "text/css" }
    %body
    / This line is HTML comment.
    -# This line HAML comment.
    %header
    %nav
    %ul
    %li "Menu Item"
    %li.item{:id => "item#{item.id}"}= item.name

    %section
    %article
    %header
    %h2 "Article Title"
    %h2 Article Title
    %p
    Posted on
    %time{ :datetime => "2015-03-04T11:11:14+08:00" } "March 4th 2015"
    - now = DateTime.current
    - now_s = DateTime.now.strftime('%m/%d/%Y')
    %time{ :datetime => "#{now}" }= now_s
    by
    %a{ :href => "#" } "Author Name"
    = link_to author_path
    Author Name

    %article
    %p
    @@ -31,15 +36,17 @@


    %aside
    %h2 "The Sidebar"
    %h2 The Sidebar
    %p
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
    eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
    sunt in culpa qui officia deserunt mollit anim id est laborum.

    %footer
    %p
    Copyright 2011 My Name
    %p
    Copyright 2015 Name

    %script{ :type => "text/javascript", :src => "js/util.js" }
    %script{ :type => "text/javascript", :src => "js/app.js" }
    %script{ :type => "text/javascript", :src => "js/app.js" }
    :javas­cript
    alert("Use JavaScript fileter!");
  2. tungsheng revised this gist Mar 21, 2015. 1 changed file with 27 additions and 31 deletions.
    58 changes: 27 additions & 31 deletions html2.haml
    Original file line number Diff line number Diff line change
    @@ -1,49 +1,45 @@
    !!! 5
    %html
    %head
    %title= "Your Website"
    %meta{ :content => "", :name => "description" }
    %meta{ :content => "", :name => "author" }
    %meta{ :content => "3 days", :name => "revisit-after" }
    %link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
    %link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
    %link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
    %title "Your Website"
    %meta{ :charset => "UTF-8" }
    %meta{ :HTTP-equiv => "Expires", :content => "0" }
    %meta{ :HTTP-equiv => "kiben", :content => "no-cache" }
    %link{ :href => "css/reset.css", :rel => "stylesheet", :type => "text/css" }
    %link{ :href => "css/style.css", :rel => "stylesheet", :type => "text/css" }
    %body
    %header
    %nav
    %ul
    %li= "Menu Item"
    %li "Menu Item"

    %section
    %article
    %header
    %h2= "Article Title"
    %h2 "Article Title"
    %p
    Posted on
    %time{ :datetime => "2009-09-04T16:31:24+02:00" }= "September 4th 2009"
    %time{ :datetime => "2015-03-04T11:11:14+08:00" } "March 4th 2015"
    by
    %a{ :href => "#" }= "Author Name"
    -
    %a{ :href => "#" }= "6 comments"
    %a{ :href => "#" } "Author Name"

    %article
    %p
    It doesn't look so shiny to me. I just want to talk. It has nothing to do
    with mating. Fry, that doesn't make sense. Why would I want to know that?
    %p
    They're like sex, except I'm having them! You seem malnourished. Are
    you suffering from intestinal parasites? Yeah. Give a little credit
    to our public schools.
    %article
    %p
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
    nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.


    %aside
    %h2= "The Sidebar"
    %p
    Michelle, I don't regret this, but I both rue and lament it. Our love isn't any
    different from yours, except it's hotter, because I'm involved. Bender, quit
    destroying the universe! Robot 1-X, save my friends! And Zoidberg!
    %aside
    %h2 "The Sidebar"
    %p
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
    eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
    sunt in culpa qui officia deserunt mollit anim id est laborum.

    %footer
    %p
    Copyright 2011 My Name


    %footer
    %p
    Copyright 2011 My Name
    %script{ :type => "text/javascript", :src => "js/util.js" }
    %script{ :type => "text/javascript", :src => "js/app.js" }
  3. tungsheng created this gist Mar 21, 2015.
    49 changes: 49 additions & 0 deletions html2.haml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    !!! 5
    %html
    %head
    %title= "Your Website"
    %meta{ :content => "", :name => "description" }
    %meta{ :content => "", :name => "author" }
    %meta{ :content => "3 days", :name => "revisit-after" }
    %link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
    %link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
    %link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
    %body
    %header
    %nav
    %ul
    %li= "Menu Item"

    %section
    %article
    %header
    %h2= "Article Title"
    %p
    Posted on
    %time{ :datetime => "2009-09-04T16:31:24+02:00" }= "September 4th 2009"
    by
    %a{ :href => "#" }= "Author Name"
    -
    %a{ :href => "#" }= "6 comments"

    %article
    %p
    It doesn't look so shiny to me. I just want to talk. It has nothing to do
    with mating. Fry, that doesn't make sense. Why would I want to know that?
    %p
    They're like sex, except I'm having them! You seem malnourished. Are
    you suffering from intestinal parasites? Yeah. Give a little credit
    to our public schools.


    %aside
    %h2= "The Sidebar"
    %p
    Michelle, I don't regret this, but I both rue and lament it. Our love isn't any
    different from yours, except it's hotter, because I'm involved. Bender, quit
    destroying the universe! Robot 1-X, save my friends! And Zoidberg!


    %footer
    %p
    Copyright 2011 My Name