标签: staticmatic

Haml - 如何强制标记属性仅使用双引号,如何按照我想要的方式命令标记属性?

我将staticmatic用于稍后用PHP的模板.有一种奇怪的情况,有些标签属性有单引号,有些则有双引号.我希望他们所有人都有双引号(不是我认为这很重要,但我希望他们这样!)

例如,haml代码:

!!! XML
%html{html_attrs('hr-HR')}
  %head
    %title Some title
    %meta{'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8'}/
    %meta{'name' => "description", :content => 'Some title - YO!'}/
    = stylesheets
    = javascripts('test', :other)
  %body
    = yield
Run Code Online (Sandbox Code Playgroud)

产生以下:

<?xml version='1.0' encoding='utf-8' ?>
<html lang='hr-HR' xml:lang='hr-HR' xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title>Some title</title>
    <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
    <meta content='Some title - YO!' name='description' />
    <link href="stylesheets/application.css" media="all" rel="stylesheet" type="text/css"/><link href="stylesheets/grid.css" media="all" rel="stylesheet" type="text/css"/><link href="stylesheets/text.css" media="all" rel="stylesheet" type="text/css"/>
    <script language="javascript" src="javascripts/test.js" type="text/javascript"></script><script language="javascript" src="javascripts/other.js" type="text/javascript"></script>

  </head>
  <body>
    <h1>some …
Run Code Online (Sandbox Code Playgroud)

html haml staticmatic

18
推荐指数
1
解决办法
7663
查看次数

合并nanoc中的项目

我一直在尝试使用nanoc来生成静态网站.我需要组织一个复杂的排列页面,我希望保持我的内容干燥.

包含或合并的概念在nanoc系统中如何工作?我已经阅读了文档,但我似乎找不到我想要的东西.

例如:如何获取两个部分内容项并将它们合并为一个新的内容项.

staticmatic中,您可以在页面中执行以下操作.

= partial('partials/shared/navigation')
Run Code Online (Sandbox Code Playgroud)

类似的约定如何在nanoc中起作用?

ruby include staticmatic nested-includes nanoc

5
推荐指数
1
解决办法
1430
查看次数

StaticMatic设置:Compass集成时出错

尝试设置新的StaticMatic项目时出错.使用后:

$ staticmatic setup my_site
Run Code Online (Sandbox Code Playgroud)

我得到以下输出与错误似乎由指南针生成:

c:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.1/lib/compass/app_integration.rb:27:in `lookup': No application integration exists for staticmatic (Compass::Error)
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.1/lib/compass/configuration/helpers.rb:44:in `configuration_for'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.1/lib/compass/configuration/helpers.rb:22:in `add_configuration'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/staticmatic-0.11.1/lib/staticmatic/compass.rb:5:in `<top (required)>'
    from c:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from c:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/staticmatic-0.11.1/lib/staticmatic.rb:21:in `block in <top (required)>'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/staticmatic-0.11.1/lib/staticmatic.rb:20:in `each'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/staticmatic-0.11.1/lib/staticmatic.rb:20:in `<top (required)>'
    from c:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from c:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/staticmatic-0.11.1/bin/staticmatic:3:in `<top (required)>'
    from c:/Ruby193/bin/staticmatic:19:in `load'
    from c:/Ruby193/bin/staticmatic:19:in `<main>'
Run Code Online (Sandbox Code Playgroud)

我在Windows 7机器上,我目前安装了以下宝石:

    *** LOCAL GEMS ***

    actionmailer (3.2.3, 3.2.0, 3.1.3, 3.1.2, 2.3.5, 2.2.2)
    actionpack (3.2.3, 3.2.0, 3.1.3, 3.1.2, 2.3.5, 2.2.2) …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails staticmatic compass-sass

4
推荐指数
1
解决办法
1590
查看次数