πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
DemoInstallSign in
Socket

pyltra

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyltra

A Gulp-based build tool for static websites.

1.1.0
latest
Source
npm
Version published
Weekly downloads
7
-58.82%
Maintainers
1
Weekly downloads
Β 
Created
Source

Pyltra

A simple and smooth static site generator and CMS and a Gulp-based build tool for static websites. This tool helps you automate tasks like HTML templating, SCSS compilation, asset optimization, and live browser reloading during development.

Installation

Install the tool globally using npm:

npm install -g pyltra

Usage

Commands

The following commands are available:

  • Build the project:

    pyltra build
    

    This command cleans the dist directory, processes HTML templates, compiles SCSS, optimizes assets, and generates the final output in the dist folder.

  • Start the development server:

    pyltra serve
    

    This command builds the project and starts a development server with live reloading. The server serves files from the dist directory.

  • Run in production mode:

    pyltra build --prod
    

    This command enables production-specific optimizations like minification and sourcemap omission.

File Structure

Your project must follow this structure for the tool to work correctly:

your-project/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ templates/       # HTML templates (Nunjucks format)
β”‚   β”‚   └── *.html
β”‚   β”œβ”€β”€ data/            # Data files (YAML, JSON, Markdown)
β”‚   β”‚   β”œβ”€β”€ shared.yaml  # Shared data
β”‚   β”‚   β”œβ”€β”€ en.pages.yaml # Language-specific pages data
β”‚   β”‚   └── ...          # Other data files
β”‚   β”œβ”€β”€ assets/          # Static assets
β”‚   β”‚   β”œβ”€β”€ scss/        # SCSS files
β”‚   β”‚   β”œβ”€β”€ css/         # Plain CSS files
β”‚   β”‚   β”œβ”€β”€ js/          # JavaScript files
β”‚   β”‚   β”œβ”€β”€ img/         # Image files
β”‚   β”‚   └── other/       # Other static files
β”‚   └── config.yaml      # Configuration file
└── dist/                # Output directory (generated by the tool)

Configuration File

The tool reads configuration from a config.yaml file located in the root of your project. Here’s an example configuration:

languages:
  - code: en
  - code: fr
dataSources:
  shared: data/shared.yaml
  pages: data/${lang}.pages.yaml
collections:
  articles:
    dataFile: data/${lang}.articles.yaml
    items:
      - file: data/${lang}/article1.md
        slug: article1
        fallback:
          title: "Default Title"
          content: "Default Content"
templates:
  articles-list: articles-list.html
  article-item: article-item.html
bundles:
  - bundles/example.html

Fields in config.yaml:

  • languages: List of supported languages.
  • dataSources: Paths to shared and language-specific data files.
  • collections: Define collections (e.g., blog posts) with their data files and item templates.
  • bundles: Optional list of additional files to copy directly to the dist folder.

Nunjucks Template Format

This tool uses Nunjucks for HTML templating. Nunjucks is a powerful templating engine that allows you to create dynamic HTML templates with logic, loops, and variables.

Example Template (src/templates/index.html):

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ title }}</title>
</head>
<body>
    <h1>{{ title }}</h1>
    <p>{{ content }}</p>
    {% if nav %}
        <ul>
        {% for item in nav %}
            <li><a href="{{ item.url }}">{{ item.label }}</a></li>
        {% endfor %}
        </ul>
    {% endif %}
</body>
</html>

Nunjucks Documentation

For more information on Nunjucks syntax and features, visit the official documentation: Nunjucks Documentation

Download

You can download the latest version of this tool from NPM: Your Gulp Tool on NPM

Alternatively, you can clone the source code from GitHub:

git clone https://github.com/nullqube/pyltra.git

Contributing

Feel free to open issues or submit pull requests on GitHub.

License

This project is licensed under the MIT License.

Keywords

gulp

FAQs

Package last updated on 25 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts