Git Product home page Git Product logo

Comments (3)

woodyrew avatar woodyrew commented on August 25, 2024

The files generated aren't namespaced per se but you do provide it with a pattern to generate the "filename" in the metalsmith files object. I suppose you could add files to the object with a random hash if you didn't want to create files with meaningful names.

  1. Yup, provide a JSON or YAML filepath that contains the plugin options. Alternatively it accepts a JS object with the same options.
  2. Array of objects defining source files, file pattern, permalink style and any other frontmatter you want carried across.
  3. You could pass a JS function within the options to do any data transformations.
  4. Covered by point 2 to carry extra frontmatter over.
  5. Yes.

(I updated your comment with a numbered list)

from metalsmith-json-to-files.

ninjasort avatar ninjasort commented on August 25, 2024

Hmm, so if I was to use a config.yaml for global site pages for example and do something like this:

index:
  title: 'Home'
  heading: 'Welcome to this site'
about:
  title: 'About us'
  heading: 'More about us'
services:
  web-design:
    title: 'Web Design'
    heading: 'We build websites'
  seo:
    title: 'SEO'
    heading: 'We optimize websites'

Then have posts in another posts.json, like this:

[{
  'date': '2016-07-22',
  'title': 'How to use Metalsmith',
  'layout': 'post.liquid',
  'contents': '# This is Markdown',
},
{
  'date': '2016-07-23',
  'title': 'How to use Liquid',
  'layout': 'post.liquid',
  'contents': '# This is Markdown',
}
]

Would that potentially work?

from metalsmith-json-to-files.

ninjasort avatar ninjasort commented on August 25, 2024

Thoughts on that config?

from metalsmith-json-to-files.

Related Issues (3)

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.