All Projects → ahmadnassri → metalsmith-paths

ahmadnassri / metalsmith-paths

Licence: ISC license
Metalsmith plugin that adds file path values to metadata

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to metalsmith-paths

metalsmith-request
Metalsmith plugin to grab content from the web and expose the results to metadata
Stars: ✭ 12 (-36.84%)
Mutual labels:  lib, metalsmith
metalsmith-imagemin
Metalsmith plugin to minify images
Stars: ✭ 17 (-10.53%)
Mutual labels:  lib, metalsmith
React Scoped Css
CSS encapsulation solution for React
Stars: ✭ 214 (+1026.32%)
Mutual labels:  lib
epub-parser
A powerful yet easy-to-use epub parser
Stars: ✭ 103 (+442.11%)
Mutual labels:  lib
tgcalls
Voice chats, private incoming and outgoing calls in Telegram for Developers
Stars: ✭ 408 (+2047.37%)
Mutual labels:  lib
Stdlib
✨ Standard library for JavaScript and Node.js. ✨
Stars: ✭ 2,749 (+14368.42%)
Mutual labels:  lib
Weworkapi php
official lib of wework api
Stars: ✭ 225 (+1084.21%)
Mutual labels:  lib
Vue Loaders
Vue + loaders.css
Stars: ✭ 127 (+568.42%)
Mutual labels:  lib
cheatengine-threadstack-finder
List all thread's base address based on process id
Stars: ✭ 39 (+105.26%)
Mutual labels:  lib
AltiumLibrary
Useful Altium pcb library (3D)
Stars: ✭ 33 (+73.68%)
Mutual labels:  lib
SunriseSunset
Java utility to calculate the time of sunrise and sunset for a given location.
Stars: ✭ 42 (+121.05%)
Mutual labels:  lib
Mal4J
Java wrapper for the official MyAnimeList API
Stars: ✭ 23 (+21.05%)
Mutual labels:  lib
Mtproto Core
Telegram API JS (MTProto) client library for browser and nodejs
Stars: ✭ 242 (+1173.68%)
Mutual labels:  lib
gostreamer
Go example that uses channels to build an execution pipeline
Stars: ✭ 75 (+294.74%)
Mutual labels:  lib
ssh
golang ssh lib 远程执行命令,文件上传下载 模仿rsync和cp
Stars: ✭ 29 (+52.63%)
Mutual labels:  lib
Notion Js
🤯 Notion API
Stars: ✭ 136 (+615.79%)
Mutual labels:  lib
remove
A Metalsmith plugin to remove files from the build
Stars: ✭ 19 (+0%)
Mutual labels:  metalsmith
cortexm-AES
high performance AES implementations optimized for cortex-m microcontrollers
Stars: ✭ 18 (-5.26%)
Mutual labels:  lib
impromptu.nvim
Create prompts fast and easy
Stars: ✭ 39 (+105.26%)
Mutual labels:  lib
telegram
Golang Telegram Bot API
Stars: ✭ 13 (-31.58%)
Mutual labels:  lib

Metalsmith Paths version License

A Metalsmith plugin that adds file path values (base, dir, ext, name, href) to metadata path property.

Build Status Downloads Code Climate Coverage Status Dependency Status Dependencies

Install

npm install --only=production --save metalsmith-paths

API

const metalsmith = new Metalsmith(__dirname)
  .use(paths({
    property: "paths"
  }))

given the following directory structure:

src/
└── blog
    └── post.html

The following metadata will be generated:

metadata value
path.base post.html
path.dir blog
path.ext .html
path.name post
path.href /blog/post.html
path.dhref /blog/

CLI

You can also use the plugin with the Metalsmith CLI by adding a key to your metalsmith.json file:

{
  "plugins": {
    "metalsmith-paths": {
      "property": "paths"
    }
  }
}

Options

name description default
property property to store the path data to path
directoryIndex remove the filename if it matches disabled

directoryIndex

Removes the filename from the href attribute if it matches the value of directoryIndex. Default: disabled. For example, the following configuration:

{
  "plugins": {
    "metalsmith-paths": {
      "property": "path",
      "directoryIndex": "index.html"
    }
  }
}

Would produce the following filenames:

Filename path.href
/index.html /
/portfolio/index.html /portfolio/
/portfolio/project1.html /portfolio/project1.html
/portfolio/project2.html /portfolio/project2.html

©️ ahmadnassri.com  ·  License: ISC  ·  Github: @ahmadnassri  ·  Twitter: @ahmadnassri

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].