无法将引导加载到nodejs [英] Cannot load bootstrap to nodejs

查看:116
本文介绍了无法将引导加载到nodejs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对nodejs和bootstrap很新,但我长期建立一个简单的个人网站,所以我有一些教程。

I am quite new to nodejs and bootstrap, but I long to build a simple personal website so I got some tutorials.

我下载bootstrap 2.0.2和解压缩它。

I download the bootstrap 2.0.2 and unzip it.

我将bootstrap和bootstrap-响应到我的项目的stylesheets文件夹,并将bootstrap.js和jquery.js放到我的项目的javascripts文件夹中。我按照以下指令更改了index.jade和layout.jade:

I put bootstrap and bootstrap-responsive to the stylesheets folder of my project and put bootstrap.js and jquery.js to the javascripts folder of my project.And I followed the instruction to change the index.jade and layout.jade as followings:

**layout jade:**
$<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head>
  <title><%= title %> - Microblog</title>
  <link rel='stylesheet' href='/stylesheets/bootstrap.css' />
  <style type="text/css">
   body {
    padding-top: 60px;
    padding-bottom: 40px;
   }
  </style>
  <link href="stylesheets/bootstrap-responsive.css" rel="stylesheet">
 </head>
</html>$


    **index.jade
   <div class="hero-unit">
   <h1>欢迎来到 Microblog</h1>
   <p>Microblog 是一个基于 Node.js 的微博系统。</p>
   <p>
   <a class="btn btn-primary btn-large" href="/login">登录</a>
   <a class="btn btn-large" href="/reg">立即注册</a>
   </p>
   </div>
   <div class="row">
   <div class="span4"> 
   <h2>Carbo 说</h2>
   <p>东风破早梅 向暖一枝开 冰雪无人见 春从天上来</p>
   </div>
   <div class="span4">
   <h2>BYVoid 说</h2>
   <p>
   Open Chinese Convert(OpenCC)是一个开源的中文简繁转换项目,
   致力于制作高质量的基于统计预料的简繁转换词库。
   还提供函数库(libopencc)、命令行简繁转换工具、人工校对工具、词典生成程序、 
   在线转换服务及图形用户界面。</p>
   </div>
   <div class="span4">
   <h2>佛振 说</h2>
   <p>中州韵输入法引擎 / Rime Input Method Engine 取意历史上通行的中州韵,
   愿写就一部汇集音韵学智慧的输入法经典之作。
   项目网站设在 http://code.google.com/p/rimeime/
   创造应用价值是一方面,更要坚持对好技术的追求,希望能写出灵动而易于扩展的代码,
   使其成为一款个性十足的开源输入法。</p>
   </div>
   </div>**

预期,任何人都可以告诉我什么是错误,因为这是基本的步骤,我只是被卡住,不知道如何向前迈进。

However, it seems the layout is not just as expected, could anyone tell me what is wrong since this is the basic step and I just got stucked and do not know how to move forward. Thanks!

推荐答案


  1. 您的布局和索引实际上似乎不符合Jade标记语言。 / li>
  2. 我在layout.jade或index.jade中没有看到任何链接jQuery.js和bootstrap.js的地方。

我会期待像

!!! 5
html
  head
    title #{meta.title} - #{meta.author}
    link(rel="stylesheet", href="/twitter/bootstrap.css")

    script(type="text/javascript", src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js")    
    script(type="text/javascript", src="/scripts/bootstrap.min.js")
...

这篇关于无法将引导加载到nodejs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆