Geonorge.SharedPartials

Contains frontend for header used on Geonorge.no, including menu and search.
Prerequisites
npm, gulp
Install
$ npm install geonorge-shared-partials
Create the following gulpfile.js in the root of your project
var nodeUrl = "./node_modules/geonorge-shared-partials/",
gulp = require("gulp"),
bundleTask = require(nodeUrl + "gulp-tasks/bundle")(gulp),
config = {
url: nodeUrl + "bundle.config.js",
distFolder: "./dist"
};
gulp.task("default", function(){bundleTask(config)});
Basic Usage
Build js and css
$ gulp
Add stylesheets:
<link rel="stylesheet" href="/dist/vendor.css" />
<link rel="stylesheet" href="/dist/main.css" />
Use the html files in your root layout
@Html.Raw(File.ReadAllText(Server.MapPath("~/dist/partials/Header.html")))
Include javascripts:
<script type="text/javascript" src="/dist/vendor.js" ></script>
<script type="text/javascript" src="/dist/main.js" ></script>
and include this js somewhere on your site
var applicationEnvironment = "local";
var orderItems = $.cookie('orderitems');
if (orderItems && orderItems > 0) {
$('.downloads__count').show();
$('.downloads__count').text(orderItems);
}