Questions tagged [harp]

A static web server with built-in preprocessing. Written in node.js.

Harp is a static web server with built-in preprocessing written in Node.js.

It serves Markdown, Jade, EJS, CoffeeScript, Sass, LESS, and Stylus as HTML, CSS and JavaScript without any configuration.

It also makes use of the Layout/Partial paradigm, available to Jade and EJS.

Truly dynamic content achievable by means of flexible custom metadata.

Your code can be easily compiled to HTML, CSS and JavaScript.

Harp can also be used as an embedded express middleware.

It also plays well with client side routers and frameworks.

63 questions
15
votes
1 answer

How to include bower components in harp

I've got a project in Harp with this standard directory structure: (highlighted parts are in my git, bower_components and www should be created upon install/compile). When I install a new bower component, I can easy include its css in my Less,…
georg
  • 211,518
  • 52
  • 313
  • 390
14
votes
1 answer

LESS: Unrecognized input error when using Bootstrap

After upgrading Harp, I started getting an Unrecognized Input error in an irrelevant line of CSS. Less -> CSS (Unrecognised input) /Users/jorge/Dropbox/harp.io/apps/mysite.com/public/css/main.less Using Bootstrap v2.2.2 and Harp v0.9.4.
Jorge Pedret
  • 1,037
  • 1
  • 9
  • 16
4
votes
1 answer

Call javascript functions on another file from an EJS templates in Harp.js

Trying to make a website with Harp.js here. I use ejs templates, and want to store some useful javascript functions in a central file. How do I do that? I tried to use <% include _render_util.js %> But it does not work (seems like js file is not…
Michael Bar-Sinai
  • 2,729
  • 20
  • 27
3
votes
0 answers

How to use Gitlab IDE's client side evaluation to live preview my Harp site?

I'm trying to make a Gitlab pages static site with Harp by following their example and I want to use Gitlab IDE's client side evaluation feature to be able to preview it as I write. It says I have to create a package.json file with a main script,…
Yajo
  • 5,808
  • 2
  • 30
  • 34
3
votes
1 answer

How to write conditional jade when there is two different design for a layout?

I am building a website on harp.js. I have a layout.jade file which includes _header.jade which is written like != partial("_header") != yield != partial("_footer") Now, there is a change in my design. I do not want all the header look…
shumana chowdhury
  • 1,742
  • 2
  • 14
  • 34
3
votes
3 answers

Are there any best practices for folder structure with Harp.js and GitHub pages?

I'm using Harp to create a static website that shall be hosted on GitHub pages. So far, everything works, but I'm a little bit concerned about the folder structure. This is because GitHub pages expects the files that shall be delivered in the root…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
2
votes
1 answer

Jade converts & to & when JavaScript is used

I've just started using Harp 0.30.1 which comes with Jade installed as a pre-processor. So I'm just starting with Jade, too. I have a folder containing a set of files with filenames like This-is-an-MD-file.md. With the index.jade file in this…
James Newton
  • 6,623
  • 8
  • 49
  • 113
2
votes
1 answer

`harp init` doesn't work

After installing harp by their tutorial I can't create default template from the second tutorial. On running harp init anyname I get fs.js:924 return binding.readdir(pathModule.toNamespacedPath(path), options.encoding); ^ Error:…
Vladyslav Zavalykhatko
  • 15,202
  • 8
  • 65
  • 100
2
votes
1 answer

Add class to current nav item

I have simple question about adding a class to the current menu item. I have the following page structure: - index.jade - about.jade - articles/ - _data.json - index.jade - blog-post-1.jade - blog-post-2.jade - contact.jade Now I created a…
2
votes
1 answer

Harp and browser-sync invoked by package.json with npm

I'd like to facilitate a way to start a harp.js server and run a browser-sync process at the same time. It's working like a charm on Linux. This is the content of my package.json { "scripts": { "dev": "bash ./serve.sh" } } And this is the…
warg
  • 41
  • 4
2
votes
1 answer

HarpJS: layout asset paths in nested folders

In harpJS, say I have a folder structure like this: mysite/ - _layout.ejs - index.ejs + styles/ - main.css + folder-level-1/ - page-level-1.ejs + folder-level-2/ - page-level-2.ejs In _layout.ejs I have a CSS…
agibsen
  • 867
  • 2
  • 10
  • 18
2
votes
1 answer

Is there a way to concatenate JS and CoffeeScript files using Harp server?

I would like to request /js/app.js from HarpJS server and have it preprocess a folder of coffeescript and javascript. For example, say I have: /js/module/a.js /js/module/b.coffee /js/module/c.coffee /js/app.coffee Is there a way to request…
thesmart
  • 2,993
  • 2
  • 31
  • 34
2
votes
1 answer

Harp compile HTML path error

I can successfully create and run a basic Harp app locally and I can compile to html/css/js and run the homepage and index page on my blog however the article page paths are incorrect. Locally the paths load as per the article slug, e.g.…
2
votes
1 answer

Is there any way to use Jade blocks in Harp.js?

I'm creating a site using Harp, and I was wondering if there is a way to use Jade blocks alongside the normal != yield way of working. Basically, for page specific scripts, I'd like to pass a block into my layout. At the moment, whatever I have in a…
Lee
  • 2,993
  • 3
  • 21
  • 27
2
votes
2 answers

SQLITE connection using Harp

i have a page which is in jade,i have a validation form in that page.I am using JavaScript to validate.i wanted to know can we connect to sqlite and extract those data's. thanking you in advance
1
2 3 4 5