Coder Social home page Coder Social logo

metalsmith-slug's People

Contributors

almirfilho avatar doup avatar gioni06 avatar joernroeder avatar nsonnad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

metalsmith-slug's Issues

Update minimatch for security reasons

Hi @nsonnad, I am still using this wonderful Metalsmith plugin and would love to see its dependencies being updated. I notices you haven’t updated the repo in a while—do you mind me asking if you would be willing to transfer the repo to me so I can maintain it?
Thanks in advance!

Manually override slug in single file

It would be nice the possibility to set the slug property manually in a single file. That way, the value of slug on this file may not change.

Let's say we have 3 files: one.md, two.md and three.md, and three.md has the slug property set manually with a different value:

one.md:


---
title: One Pig

---
Contents in One...

two.md:


---
title: Two Pigs

---
Contents in Two...

three.md: (with slug set manually)


---
title: Three Pigs
slug: how-many-pigs-i-want-here

---
Contents in Three...

The output of processed files should be:

{
  'one.md':   {title: 'One Pig',    slug: 'one-pig'},
  'two.md':   {title: 'Two Pigs',   slug: 'two-pigs'},
  'three.md': {title: 'Three Pigs', slug: 'how-many-pigs-i-want-here'},
}

What do you think @nsonnad? I can submit a PR for this feature today if you agree. =)

`patterns` default option doesn't work

In Metalsmith 1.0 there was an API change for source() so that if no option is given it returns the absolute path to the src directory. So, when calling matchGlobArray all the files fail to pass the test and slug() doesn't do anything. Example input for matchGlobArray when using default patterns value:

file:    articles/20150416-ror_ca.md
pattern: /Users/doup/Code/gra-web-new/src/** (from ms.source())

---
minimatch result:  false

A workaround is to pass the patterns option to slug(), e.g:

.use(slug({ patterns: ['*.md'] }))

Option to output URLS without extensions

First, thanks for this plugin which I find really helpful. It's really nice to have fine-grained control over URLs. The only issue I had is that I wanted the final url to be \example\slug-text-here\ rather than \example\slug-text-here.html.

With a quick adjustment to line 23 where the filename is set, I was able to create folders with index.html files to account for that:

var slugFilename = path.join(currPath, newSlug, 'index' + currExt);

This is a similar methodology to metalsmith-permalinks. The difference is that plugin does not have a manual override allowing you to set the link in the frontmatter the way slug does.

Would be great to see this functionality in the official plugin as a configuration option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.