Code Monkey home page Code Monkey logo

hugo-data-to-pages's Introduction

Hugo Data to Pages

Allows for generating pages (or any archetypes) from data (json/yaml) on Hugo. Related to issues #140 and 5074.

Getting Started

This script is a simple wrapper that:

  • Generates the pages under your content folder
  • Runs Hugo
  • And finally, removes the generated pages

The entire script is in hugo.js, the example/ is just an example hugo site.

Prerequisites

  • hugo
  • node & npm

Installing & Running

  • Run npm install to install dependencies
  • Run node hugo.js to build
  • (optional) Run chmod +x hugo.js to allow for direct execution, i.e. ./hugo.js
  • Go to localhost:1313 to see links to the generated pages

Commands

There are 3 available commands:

  • ./hugo.js (basically hugo build to public directory)
  • ./hugo.js generate (only generate folders/files from data, same as above but without executing hugo build)
  • ./hugo.js server (basically hugo server, with cleanup on exit)
  • ./hugo.js clean (trigger cleanup in case the script didn't remove the generated folders)

Flags:

  • -c FILE.json or --configFile FILE.json flag to override default config (check hugoConfig-example.json)
  • -f or --force flag to skip folder removal prompts (be careful with this one!)

Author

kidsil

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Troubleshooting

hugo-data-to-pages's People

Contributors

kidsil avatar mypad79 avatar

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.