Coder Social home page Coder Social logo

scmorrison / uzu Goto Github PK

View Code? Open in Web Editor NEW
35.0 5.0 1.0 389 KB

Uzu is a static site generator with built-in web server, file modification watcher, live reload, i18n, themes, multi-page support, inject external data via local Raku module, and external pre/post command execution.

License: Artistic License 2.0

HTML 81.29% Raku 18.71%
static-site-generator raku

uzu's Introduction

Uzu (渦) build status

Uzu is a static site generator with built-in web server, file modification watcher, live reload, i18n, themes, multi-page support, inject external data via local Raku module, and external pre/post command execution.

Note: Uzu 0.3.6 and higher requires at least raku 2020.06.

Features

  • Easy to use: Based on existing static site generator conventions
  • Built-in development webserver: Test your modifications (http://localhost:3000) as you work
  • Auto Re-render: uzu watch monitors the theme/[your-theme]/, pages/, partials/, and i18n/ folders for modifications and auto-renders to build
  • Live reload: uzu watch automatically reloads the browser when a re-render occurs
  • Templating: Supports Template6 and Mustache template engines.
  • i18n support: Use YAML to define each language in the i18n/ folder (e.g. i18n/en.yml)
  • Page / layout support: Generate individual pages wrapped in the same theme layout
  • Extended variables: Inject dynamically generated data into project via external Raku module.
  • Pre/Post commands: Trigger external commands to execute before or after build.
  • YAML variables: Create page-specific and partial-specific variables as a YAML block at the top of any page or partial template.
  • Trigger rebuild manually: Press r enter to initiate a full rebuild. This is useful for when you add new files or modify files that are not actively monitored by uzu, e.g. images, css, fonts, or any non .tt, .mustache, or .yml files
  • Actively developed: More features coming soon (e.g. more tests, AWS, Github Pages, SSH support...)

Note: Uzu is a work in progress. It is functional and does a bunch of cool stuff, but it isn't perfect. Please post any issues you find.

Getting started

After installing uzu, run the following command from an empty directory:

uzu init

Enter your site name, default language, and template engine when prompted.

Uzu Demo Site

@uzluisf has created an excellent Uzu Demo Site that shows how a fully working Uzu project is organized / functions.

Usage

Usage:
  uzu init          - Initialize new project
  uzu webserver     - Start local web server
  uzu build         - Render all templates to build
  uzu clear         - Delete build directory and all of its contents
  uzu watch         - Start web server and re-render
                      build on template modification
  uzu version       - Print uzu version and exit

Optional arguments:
  
  --config=         - Specify a custom config file
                      Default is `config`

  e.g. uzu --config=path/to/config.yml init 

  --no-livereload   - Disable livereload when
                      running uzu watch.

  --clear           - Delete build directory before 
                      render when running with build.

  --page-filter     - Restrict build to pages starting
                      from this directory

  --theme           - Limit build / watch to single theme

  e.g. uzu --theme=default build 

Config

Each project has its own config.yml which uses the following format:

---
# 
# Core variables
#

# Name of the project
name: uzu-starter

# Languages to use, determines which
# i18n/*.yml file to use for string variables
#
# The first language in the list is considered
# the default language. The defualt language
# will render to non-suffixed files (e.g index.html).
# All other languages will render with the
# language as a file suffix (e.g index-fr.html,
# index-ja.html). This will be overridable in
# future releases.

language:
  - en
  - ja
  - fr

# i18n scheme (default: suffix)
i18n_scheme: 'directory' # Render non-default languages to /[lang]/[page name].[extension]

# Template engine
# - Template6: tt
# - Mustache: mustache
template_engine: mustache

# Stored theme directories under themes/[theme-name]
#
# Themes can be specified with either the single theme
# variable:
theme: default

# .. or multiple themes:
themes:
  - default              # Specify a theme directory using the default options
  - summer2017:          
      build_dir: web2017 # Override build director
      port: 4333         # Port to start watch on for this theme.
      exclude_pages:     # List of page template names to ignore for this theme
        - index

# Optional parameters (also, comments like this are ok)

# Use a custom dev server port, default is 3000
port: 4040

# Specify a custom project root path
# default is .
project_root: path/to/project/folder

# List of page template names to ignore for all themes
exclude_pages:
  - about
  - blog/fiji-scratch

# List of directories and files to exclude from build/
exclude:
  - node_modules
  - packages.json
  - yarn.lock

# Pre / post build commands
pre_command: "webpack"
post_command: "echo 'post-build command'"

# Omit .html extension from generated HTML files
omit_html_ext: true

Config variables

Config variables are defined in config.yml:

  • name: Project name

  • language: List of languages to render for site. First item is default language. When rendering, the language variable is set to the current rendering language and can be referenced in templates. For example, if uzu is rendering an en version of a page, then the language variable will be set to en.

  • i18n_scheme: By default uzu will generate files with the language suffix appended for non-default language output. (e.g. fr: index-fr). This behaviour can be set to 'directory' witch will render non-default languages to /[lang]/[page name].[extension] (e.g. fr: /fr/index.html).

  • theme: The theme to apply to the layout (themes/themename). default refers to the folder named default in the themes folder.

  • themes: Alternatively, using the themes yaml hash supports multiple themes. Themes will be rendered at the same time into their target build directories. By default the theme build directory is build/[theme-name]. This can be overridden with the build_dir variable. Relative and absolute paths are supported:

    • build_dir:
      themes:
        - summer2017:
            build_dir: web2017
    • port: A dev web server will spawn for rach theme specified in the themes yaml dict. The default port for the first theme is 3000, this port number is incremented by one for every subsequent theme listed in the themes dict. This variable will override that behavior.
      themes:
        - summer2017:
            port: 4444
    • exclude_pages: List page templates that should not be rendered for the associated theme.
      themes:
        - summer2017:
            exclude_pages:
              - about
              - blog/fiji
              - sitemap.xml
  • exclude: List of directories and files to exclude from build/

    exclude:
      - node_modules
      - packages.json
      - yarn.lock
  • pre_command: Run command prior to build step

  • post_command: Run command after to build step

  • host: Host IP for the dev server. Defaults to 127.0.0.1.

  • port: Host TCP port for dev server. Defaults to 3000.

  • project_root: Project root folder. Defaults to ..

  • omit_html_ext: Omit .html from generated HTML files.

Accessing config variables in templates

Config variables can be accessed from inside templates directly (e.g. port, theme, etc.)

Accessing non-core variables in templates

Non-core variables are any additional variables found in config.yml and can be accessed in templates using site.variablename (e.g. site.url, site.author).

Project folder structure (Template6)

├── config.yml                    # Uzu config file
├── pages                         # Each page becomes a .html file
│   ├── about.tt
│   ├── index.tt
│   └── blog                      # Pages can be nested in sub-folders. Their URI
│       └── vacation.tt           # will follow the same path (e.g. /blog/vacation.html)
│
├── partials                      # Partials can be included in pages
│   ├── footer.tt                 # and theme layouts
│   ├── head.tt
│   ├── home.tt
│   ├── jumbotron.tt
│   ├── navigation.tt
│   └── profiles.tt
├── public                        # Static files / assets independant of theme (copied to /)
├── i18n                          # Language translation files
│   └── blog
│       └── vacation              # i18n variables can be defined for specific pages
│           └── en.yml
│   ├── en.yml
│   ├── fr.yml
│   ├── ja.yml
└── themes                        # Project themes
    └── default
        ├── assets                # Theme specific static files / assets (copied to /)
        │   ├── css
        │   ├── favicon.ico
        │   ├── fonts
        │   ├── img
        │   ├── js
        ├── partials              # Theme specific partials. These will override any top-level
        │   ├── footer.tt         # partials with the same file name.
        └── layout.tt             # Theme layout file

Project folder structure (Mustache)

├── config.yml                    # Uzu config file
├── pages                         # Each page becomes a .html file
│   ├── about.mustache
│   ├── index.mustache
│   └── blog                      # Pages can be nested in sub-folders. Their URI
│       └── vacation.mustache     # will follow the same path (e.g. /blog/vacation.html)
│
├── partials                      # Partials can be included in pages
│   ├── footer.mustache           # and theme layouts
│   ├── head.mustache
│   ├── home.mustache
│   ├── jumbotron.mustache
│   ├── navigation.mustache
│   └── profiles.mustache
├── public                        # Static files / assets independant of theme (copied to /)
├── i18n                          # Language translation files
│   └── blog
│       └── vacation              # i18n variables can be defined for specific pages
│           └── en.yml
│   ├── en.yml
│   ├── fr.yml
│   ├── ja.yml
└── themes                        # Project themes
    └── default
        ├── assets                # Theme specific static files / assets (copied to /)
        │   ├── css
        │   ├── favicon.ico
        │   ├── fonts
        │   ├── img
        │   ├── js
        ├── partials              # Theme specific partials. These will override any top-level
        │   ├── footer.tt         # partials with the same file name.
        └── layout.mustache       # Theme layout file

See uzu-starter for a full example.

Public and Assets directories

  • public/ - The root public directory is where project-wide static assets are stored.
  • themes/**/assets/ - The theme's assets directory is where theme-specific static assets are stored.

Files found in either of these directories are copied wholesale to the root of the build/ directory on successful build. For example:

  • public/js/site.js will be copied to build/js/site.js
  • themes/default/assets/img/logo.png will be copied to build/img/logo.png

Note: Any tmp / swp files created by editors will also be copied into build/. Most editors provide options to configure this behavior. For example, you can have all vim .swp files saved into a central directory by adding something like this to ~/.vimrc:

set backupdir=~/.vim/backup//
set directory=~/.vim/swp//

i18n YAML and Templating

You can separate out the content text to YAML files located in a project-root folder called i18n. Simply create a separate file for each language, like this:

─ i18n
  ├── blog
  │   └── vacation     # Page specific i18n variables
  │       ├── en.yml   # en i18n variables for page pages/blog/vacation.tt
  │       └── ja.yml   # ja i18n variables for page pages/blog/vacation.tt
  ├── en.yml           # Main en i18n variables
  ├── fr.yml           # Main fr i18n variables
  └── ja.yml           # Main ja i18n variables

An example i18n YAML file might look like this:

---
# Template access i18n.site_name
site_name: The Uzu Project Site

# Template access i18n.url
url: https://github.com/scmorrison/uzu-starter

# Template access i18n.founders
founders:
  - name: Sam
    title: "Dish Washer"
  - name: Elly
    title: CEO
  - name: Tomo
    title: CFO

# Comments start with a #

# Do not use blank values
this_will_break_things:
do_this_instead: ""

Accessing i18n variables in templates

Variables defined in i18n files can be accessed in templates using the i18n.variablename format (e.g. i18n.site_name, i18n.founders).

<h1>[% i18n.site_name %]</h1>

Nested i18n variable files

Any variables defined in page specific i18n files, e.g. i18n/blog/vacation/en.yml, will override any top-level language i18n file (e.g i18n/en.yml) defined variables that share the same name. For example:

# i18n/en.yml
site_name: Uzu Starter Project

...will be overridden by:

# i18n/blog/vacation/en.yml
site_name: "Our Vacation 2017"

i18n output paths

By default uzu generates language specific files with the following pattern:

[page name]-[language code].html

For example, if the default language is en and secondary language is ja, the index page template would be rendered to the following files:

  • Default language: build/index.html
  • Subsequent languages: build/index-ja.html

This output behavior can be changed to directory in config.yml with the i18n_scheme variable:

i18n_scheme: 'directory'

With this option set, the output will be rendered to the following files:

  • Default language: build/index.html
  • Subsequent languages: build/ja/index.html

Template Features

Template6

Uzu supports the Template Toolkit templating format for template files. This is the default template engine.

Features include:

  • GET and SET statements, including implicit versions

    • [% get varname %]
    • [% varname %]
    • [% set varname = value %]
    • [% varname = value %]
  • FOR statement

    • [% for names as name %]
    • [% for names -> name %]
    • [% for name in names %]
    • [% for name = names %]

    If used with Hashes, you'll need to query the .key or .value accessors.

  • IF/ELSIF/ELSE/UNLESS statements.

    • [% if display_links %] -- do this --- [% else %]

      -- do that --

      [% end %]

    • [% unless graphics %]

      -- some html ---

      [% end %]

  • Querying nested data structures using a simple dot operator syntax.

  • CALL and DEFAULT statements.

  • INSERT, INCLUDE and PROCESS statements.

Examples (Template6)

Single i18n variable

<a class="navbar-brand" href="/">[% i18n.site_name %]</a>

For loop from yaml dict (non-core variable) defined in config.yml

<h1>Company Founders</h1>
<ul>
[% for founder in site.founders %]
  <li>[% founder.name %], [% founder.title %]</a>
[% end %]
</ul>

IF/ELSEIF/UNLESS

[% if site.graphics %]
    <img src="[% images %]/logo.gif" align=right width=60 height=40>
[% end %]

Mustache

Uzu also supports the Mustache templating format for template files.

Enable mustache support by adding the following line to your config.yml:

template_engine: mustache

For example:

---
name: mysite
language:
  - en
theme: default
template_engine: mustache

Examples (Mustache)

Single i18n variable

<a class="navbar-brand" href="/">{{ i18n.site_name }}</a>

For loop from yaml dict (non-core variable) defined in config.yml

<h1>Company Founders</h1>
<ul>
{{#founders}}
  <li>{{ name }}, {{ title }}</a>
{{/founders}}
</ul>

If conditionals

Mustache is a 'logic-less' templating system, but you can test for the existence of a variable, and if it exists then anything inside the test block with be processed. Otherwise it is ignored.

{{#site.graphics}}
    <img src="{{ images }}/logo.gif" align=right width=60 height=40>
{{/site.graphics}}

Theme layouts

Theme layout templates are located at the themes/THEME_NAME/layout.tt or themes/THEME_NAME/layout.mustache. Use the content partial to include rendered page content in a layout.

For Template6:

<!doctype html>
<html lang="[% language %]">
[% INCLUDE "head" %]
    <body>
      [% INCLUDE "navigation" %]
      <!-- Rendered page content -->
      [% INCLUDE "content" %]
      [% INCLUDE "footer" %]
    </body>
</html>

For Mustache:

<!doctype html>
<html lang="{{ language }}">
{{> head }}
    <body>
      {{> navigation }}
      <!-- Rendered page content -->
      {{> content }}
      {{> footer }}
    </body>
</html>

Partials

Partials are stored in the partials and themes/THEME_NAME/partials directories. Any theme partial will override any partial found in the top-level partials directory with the same file name. Partials can be include in layouts, pages, and other partials.

For Template6:

[% INCLUDE "navigation" %]
<div>
    [% INCLUDE "login_form" %]
</div>

For Mustache:

{{> navigation }}
<div>
    {{> login_form }}
</div>

Global variables

Some variables are generated dynamically and exposed to templates for use:

  • language: The current language as a string (e.g. en, ja, etc.)

  • lang_: The lang_CURRENT_LANG variable provides the current rendering language. This is useful if you want to display certain content depending on the i18n language.

    For Template6:

    [% if lang_en %]
    <a href='/index-ja.html'>日本語</a>
    [% end %]
    [% if lang_ja %]
    <a href='/'>English</a>
    [% end %]

    For Mustache:

    {{#lang_en}}
    <a href='/index-ja.html'>日本語</a>
    {{/lang_en}}
    {{#lang_ja}}
    <a href='/'>English</a>
    {{/lang_ja}}
  • theme_: The current theme is exposed to the templates as theme_NAME_OF_THEM. For example, the variable theme_default will be available if the default theme is being used:

    For Template6:

    [% if theme_default %]
    [% INCLUDE "default_header" %]
    [% end %]
    
    [% if theme_enoshima %]
    [% INCLUDE "enoshima_header" %]
    [% end %]

    For Mustache:

    {{#theme_default}}
    {{> default_header }}
    {{/theme_default}}
    
    {{#theme_enoshima}}
    {{> enoshima_header }}
    {{/theme_enoshima}}
  • randnum: A dynamically generated 16 digit integer. This value is generated any time a page is generated / regenerated.

    <link rel="stylesheet" type="text/css" href="/css/site.css?v=[% randnum %]">
  • dt: A date hash that includes common date values. This is a dynamic variable that contains datetime data for current build.

    <span>&copy;[% dt.year %] Uzu, Inc.</span>

    Available dt values:

    • dt.hour
    • dt.minute
    • dt.second
    • dt.day
    • dt.month
    • dt.year
    • dt.hh-mm-ss
    • dt.utc
    • dt.day-of-month
    • dt.day-of-week
    • dt.weekday-of-month
    • dt.is-leap-year
    • dt.day-of-year
    • dt.week-year
    • dt.daycount
    • dt.week-number
    • dt.days-in-month
    • dt.week
    • dt.yyyy-mm-dd
    • dt.timezone

Extended variables

Uzu can be extended with external / dynamically generated data provided via a local Raku module.

In order to inject external data into your project you must use the PERL6LIB environment variable when running uzu:

PERL6LIB=lib uzu watch

Create your module, for example MyApp, in your uzu project directory under lib (e.g. lib/MyApp.pm6). The app must export a subroutine named context(). This is uzu's entry point:

# lib/MyApp.pm6

unit module MyApp;

our sub context(--> Hash) {
    return %{
        number_of_products => get-remote-product-count(),
        favorite_food      => 'Bean Burrito',
    }
}

Add the name of your Raku module to your config as extended (do not add the module file extension):

extended: 'MyApp'

When uzu starts it will attempt to load the local module and inject the Hash returned by context() into the global render context Hash. The keys defined in the injected Hash will be available from within templates.

<span>Total Products: [% number_of_products %]</span>

If &MyApp::context() is unavailable, uzu will print a message indicating that MyApp or &MyApp::context() could not be loaded.

The external module will be executed on every build by default. To disable this behavior while using the local dev server (uzu watch) set the config variable refresh_extended to false in your config.yml:

refresh_extended: false

Page variables

The page hash, accessible from within templates, includes the following details:

  • page.id: The internal page ID within the site index (e.g. /index, /path/to/page)
  • page.extension: The file extension used for the render (e.g. html, json)
  • page.path: The full resource path for the page (e.g. /index.html, /path/to/page.html)

To access these variables inside of a template use the following format:

For Template6:

[% page.id %]
[% page.extension %]
[% page.path %]

...and for Mustache:

{{ page.id }}
{{ page.extension }}
{{ page.path }}

Template variables

You can define variables using a yaml block at the top of any page or partial (pages/, partials/):

pages/index.tt

---
title: 'Welcome to Uzu'
subtitle:  'The best'
---

To access these variables inside of a template you do not need to use the i18n. scope prefix.

For Template6:

partials/head.tt

<head>
    <meta charset="utf-8">
    <title>[% title %] - [% subtitle %]</title>
</head>

...and for Mustache:

partials/head.mustache

<head>
    <meta charset="utf-8">
    <title>{{ title }} - {{ subtitle }}</title>
</head>

Layout variables

You can define variables in the layout template and access them using the layout. prefix in templates;

For example:

Define yaml definitions in themes/**/layout.tt or themes/**/layout.mustache:

---
root_url: https://www.raku.org
name: Dark Theme
---
<!doctype html>
<html>
...

Will be accessible in templates like this:

For Template6:

<a href="[% layout.root_url %]/about-this-theme.html">[% layout.name %]</a>

...and for Mustache:

<a href="{{ layout.root_url }}/about-this-theme.html">{{ layout.name }}</a>

Related / linked pages

Uzu will append any yaml dict ending with _pages with additional page-related variables if the variables are defined in the associated page template.

For Template6:

---
related_pages:
    - page: about
    - page: blog/fiji
    - page: https://www.raku.org
      title: The Raku Programming Language
      author: Raku
---
<ul>
[% for rp in related_pages %]
    <li>
        <a href="[% rp.url %]">[% rp.title %]</a> [[% rp.author %]]
    </li>
[% end %]
</ul>

...and for Mustache:

<ul>
{{#related_pages}}
    <li>
        <a href="{{ url }}">{{ title }}</a> [{{ author }}]
    </li>
{{/related_pages}}
</ul>

The above produces the following HTML. Note that the author and title values are pulled from the related page's template yaml variables:

<ul>
    <li>
        <a href="/about.html">About Us</a> [Camelia]
    </li>
    <li>
        <a href="/blog/fiji.html">Fiji Vacation</a> [Camelia]
    </li>
    <li>
        <a href="https://www.raku.org">The Raku Programming Language</a> [Raku]
    </li>
</ul>

Disable layout rendering for page template

To disable layout rendering for specific pages add the nolayout variable to the page's yaml variables:

---
nolayout: true
---

Page render conditions

In order to reduce build times Uzu will try to avoid rerendering a page if it hasn't been modified.

Pages will only be rendered under the following conditions:

  • Rendered page does not exist in build directory
  • The page template has been modified
  • A partial file included in the layout, page, or any partial included in the page has been modified
  • The page includes a related / linked pages _pages yaml dict and one of the linked pages templates has been modified
  • Running uzu --clear build will rebuild all pages
  • Pressing c enter while running uzu watch will rebuild all pages

Installation

zef install Uzu

Installation issue? See Troubleshooting.

Todo

  • More tests
  • Uglify JS / CSS
  • Build deploy process push to remote services
  • Features
    • Additional templating support (markdown)
    • Dynamic variables (categories, tags, pagination)

Requirements

Troubleshooting

  • Errors installing from previous version:

    Remove the zef tmp / store uzu.git directories:

    # Delete these folders from your zef install 
    # directory.
    rm -rf ~/.zef/store/uzu.git ~/.zef/tmp/uzu.git 
    

    In some instances it might help to delete your local ~/.raku/precomp directory.

  • Tests failing during install

Sometimes tests might fail during install. Try re-installing all of the dependencies via zef:

zef install --force-install --/test \
    File::Directory::Tree \
    File::Find File::Temp \
    Terminal::ANSIColor \
    Template6 \
    Template::Mustache \
    Test::Output \
    HTTP::Parser \
    HTTP::Server::Tiny \
    YAMLish;

In some instances it might help to delete your local ~/.raku/precomp directory.

If installing from source, remove the lib/.precomp folder inside the uzu root folder and attempt the install again.

Authors

Contributors

License

Uzu is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. (Note that, unlike the Artistic License 1.0, version 2.0 is GPL compatible by itself, hence there is no benefit to having an Artistic 2.0 / GPL disjunction.) See the file LICENSE for details.

See also

uzu's People

Contributors

ab5tract avatar scmorrison avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

taboege

uzu's Issues

Layout file should be optional

Building a project without a layout file gives this error:

Copy public, assets
Cannot resolve caller slurp(IO::Path: ); none of these signatures match:
    (IO::Path:D $: :$enc, :$bin, *%_)
  in sub build at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/B64B70030D8DC8D24494E45C38BA972A87CF0732 (Uzu::Render) line 541
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/A6A04D2AC064A3AC3AC0CFA1813B60BA00E99C28 (Uzu::CLI) line 63
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/2FA4F1086B130C49B85739217FDF9182FFBCD515 line 5
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2

Build multiple themes / layouts

Hi, I have a project with two themes. I'd like a way to build both themes at once instead of manually copying the build directory and changing the config file. I think if multiple themes are present (defined in config?) uzu build should output a subdirectory in build/ for each theme. E.g. build/website/, build/helpbook/, etc. Then a build-time option could limit builds to a particular theme (maybe same as #18).

Failed test '[Mustache] use theme partial'

$ git pull
Already up to date.
$ zef install .
===> Testing: Uzu:ver<0.2.8>
    # Failed test '[Mustache] use theme partial'
    # at t/02-build.t line 171
    # expected: '<!doctype html>
    # <html lang="en">
    #     <head>
    #             <meta charset="utf-8">
    #             <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    #             <title>Uzu Test Project</title>
    #             <meta name="description" content="">
    #             <meta name="viewport" content="width=device-width, initial-scale=1">
    #             <style>
    #                     body {
    #                             padding-top: 50px;
    #                             padding-bottom: 20px;
    #                     }
    #             </style>
    #     </head>
    #     <body>
    #         <div>
    #         <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    #           <div class="container">
    #             <div class="navbar-header">
    #               <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
    #                 <span class="sr-only">Toggle navigation</span>
    #                 <span class="icon-bar"></span>
    #                 <span class="icon-bar"></span>
    #                 <span class="icon-bar"></span>
    #               </button>
    #               <img src="img/logo.png" />
    #               <a class="navbar-brand" href="/">Uzu Test Project</a>
    #             </div>
    #             <div id="navbar" class="navbar-collapse collapse">
    #               <form class="navbar-form navbar-right" role="form">
    #                 <div class="form-group">
    #                   <input type="text" placeholder="Email" class="form-control">
    #                 </div>
    #                 <div class="form-group">
    #                   <input type="password" placeholder="Password" class="form-control">
    #                 </div>
    #                 <button type="submit" class="btn btn-success">Sign in</button>
    #               </form>
    #             </div><!--/.navbar-collapse -->
    #           </div>
    #         </nav>
    #         You found me.
    #         <footer>
    #             <p>2016 Sam Morrison</p>
    #         	<a class="navbar-brand" href="about.html">About Us</a>
    #         </footer>
    #         </div>
    #     </body>
    # </html>
    # '
    #      got: '<!doctype html>
    # <html lang="en">
    #     <head>
    #             <meta charset="utf-8">
    #             <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    #             <title>Uzu Test Project</title>
    #             <meta name="description" content="">
    #             <meta name="viewport" content="width=device-width, initial-scale=1">
    #             <style>
    #                     body {
    #                             padding-top: 50px;
    #                             padding-bottom: 20px;
    #                     }
    #             </style>
    #     </head>
    #     <body>
    #         <div>
    #         <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    #           <div class="container">
    #             <div class="navbar-header">
    #               <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
    #                 <span class="sr-only">Toggle navigation</span>
    #                 <span class="icon-bar"></span>
    #                 <span class="icon-bar"></span>
    #                 <span class="icon-bar"></span>
    #               </button>
    #               <img src="img/logo.png" />
    #               <a class="navbar-brand" href="/">Uzu Test Project</a>
    #             </div>
    #             <div id="navbar" class="navbar-collapse collapse">
    #               <form class="navbar-form navbar-right" role="form">
    #                 <div class="form-group">
    #                   <input type="text" placeholder="Email" class="form-control">
    #                 </div>
    #                 <div class="form-group">
    #                   <input type="password" placeholder="Password" class="form-control">
    #                 </div>
    #                 <button type="submit" class="btn btn-success">Sign in</button>
    #               </form>
    #             </div><!--/.navbar-collapse -->
    #           </div>
    #         </nav>
    #         You found me.
    #                 </div>
    #     </body>
    # </html>
    # '
    # Looks like you failed 1 test of 14
# Failed test 'Rendering [Mustache]'
# at t/02-build.t line 125
# Looks like you failed 1 test of 3
===> Testing [FAIL]: Uzu:ver<0.2.8>
Aborting due to test failure: Uzu:ver<0.2.8> (use --force-test to override)

"if" expression cannot contain dot syntax

Template:

---
articles:
  - name: Hello
    new: true
---
[% for article in articles %]
    [% if article.new %] NEW [% end %]
    [% article.name %]
[% end %]

Error:

Clear old files
Create build directory
Copy public, assets
Compile templates [en]
Tried to get the result of a broken Promise
  in sub build at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/09A80BAF814E9ED57510ACEA7ABD2E08BA63E4B6 (Uzu::Render) line 272
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/28DAFFBFC13CA36F7054D7A42E9F7D0EAB85E83F (Uzu::CLI) line 38
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/BEF8B0D598CE2C8868AC1830A48C46EB8DE3DEA5 line 5
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2

Original exception:
    ===SORRY!=== Error while compiling /private/tmp/uzu-test/EVAL_0
    Undeclared routine:
        article used at line 8

Test failure with 0.3.4

zef install .
===> Testing: Uzu:ver<0.3.4>
    # Failed test 'empty page template warning to stdout'
    # at t/04-build-warnings.t line 52
    # expected a match with: / 'No content found for page' /
    #                   got: "Create build directory\nCopy public, assets\nCompile templates [en]\nInvalid i18n yaml file [/var/folders/m4/vqg439r15q39knh1gl6q0_p00000gn/T/9YfjGBFYuv/i18n/en.yml]\nError rendering template [empty]\nTemplate6: Invalid template 'empty_nothing'\nError rendering template [layout]\nTemplate6: Invalid template 'content'\nRendered page [empty] is empty\nCompile templates [ja]\nError rendering template [empty]\nTemplate6: Invalid template 'empty_nothing'\nError rendering template [layout]\nTemplate6: Invalid template 'content'\nRendered page [empty-ja] is empty\nCreate build directory\nCopy public, assets\nTheme [default] does not contain a layout template\nCompile templates [en]\nInvalid i18n yaml file [/var/folders/m4/vqg439r15q39knh1gl6q0_p00000gn/T/9YfjGBFYuv/i18n/en.yml]\nError rendering template [empty]\nTemplate6: Invalid template 'empty_nothing'\nRendered page [empty] is empty\nCompile templates [ja]\nError rendering template [empty]\nTemplate6: Invalid template 'empty_nothing'\nRendered page [empty-ja] is empty\nCompile complete\npost-command test\n\n"
    # Looks like you failed 1 test of 3
# Failed test 'Warnings'
# at t/04-build-warnings.t line 13
# Looks like you failed 1 test of 1
===> Testing [FAIL]: Uzu:ver<0.3.4>
Aborting due to test failure: Uzu:ver<0.3.4> (use --force-test to override)

uzu version produces an error

$ uzu version
No such method 'ver' for invocant of type 'Perl6::Metamodel::PackageHOW'
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/A6A04D2AC064A3AC3AC0CFA1813B60BA00E99C28 (Uzu::CLI) line 113
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/2FA4F1086B130C49B85739217FDF9182FFBCD515 line 5
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
$ perl6 --version
This is Rakudo version 2017.07-158-g7b81f0f99 built on MoarVM version 2017.07-403-g712cff33
implementing Perl 6.c.

Type check failed in assignment to @seen_build_dirs

I'm seeing the following error when attempting to build a project that has two themes:

$ uzu version
uzu 0.2.8
$ uzu build
Type check failed in assignment to @seen_build_dirs; expected IO::Path but got Str ("build.helpbook")
  in code  at /Applications/Rakudo/share/perl6/site/sources/4AA47E188C67999D22526FC0C728A662888C3C16 (Uzu::Config) line 153
  in block  at /Applications/Rakudo/share/perl6/site/sources/4AA47E188C67999D22526FC0C728A662888C3C16 (Uzu::Config) line 148
  in sub themes-config at /Applications/Rakudo/share/perl6/site/sources/4AA47E188C67999D22526FC0C728A662888C3C16 (Uzu::Config) line 113
  in sub from-file at /Applications/Rakudo/share/perl6/site/sources/4AA47E188C67999D22526FC0C728A662888C3C16 (Uzu::Config) line 249
  in sub MAIN at /Applications/Rakudo/share/perl6/site/sources/BC6C7E5B340B9513D0F5274FB1C0EDABB13E8499 (Uzu::CLI) line 59
  in block <unit> at /Applications/Rakudo/share/perl6/site/resources/4F95E99A128ACC06AC49C423F260E3B01B25A35B line 4
  in sub MAIN at /Applications/Rakudo/share/perl6/site/bin/uzu line 2
  in block <unit> at /Applications/Rakudo/share/perl6/site/bin/uzu line 2

Support "*_pages" expansion feature in nested variables

It appears the *_pages expansion only works for top-level variables. I have some pages with nested hierarchies of links (e.g. categories/subcategories/sub_pages); it would be great if the algorithm could be applied to nested variables/attributes as well as top-level ones.

Deeply embedded partials expand to nothing

pages/index.mustache:

---
hello: "Hello!"
something:
  - g: d
---
{{> partial1 }}

partials/partial1.mustache:

{{> partial2 }}

partials/partial2.mustache:

{{#something}}
<partial2>{{> partial3 }}</partial2>
{{/something}}

partials/partial3.mustache:

<partial3>{{ hello }}</partial3>

Expected output: <partial2><partial3>Hello!</partial3></partial2>

Actual output: <partial2></partial2>

Uzu attempts to compile Vim swap files (e.g. .index.tt.swp)

If I attempt to build a project while editing a template in Vim, I get an error like:

Malformed UTF-8 at line 1 col 17
  in sub build at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/09A80BAF814E9ED57510ACEA7ABD2E08BA63E4B6 (Uzu::Render) line 249
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/28DAFFBFC13CA36F7054D7A42E9F7D0EAB85E83F (Uzu::CLI) line 38
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/BEF8B0D598CE2C8868AC1830A48C46EB8DE3DEA5 line 5
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2

The regex passed to "find" should exclude dot-files, or .swp/.swo files, or both.

Support partial variables

Pages can have their own variables; partials cannot. It would be useful to let partials define internal variables at the top of the template, similar to pages. I guess you would need to decide which variable would take precedence in the event of a name conflict.

Dot files are copied from assets to build

I noticed that e.g. Vim swap files in assets are being copied over to my build directory.

        build/ab-testing/.abtools.css.swp
        build/ab-testing/.sample-size.css.swp

Error with boolean variables

If a page contains a boolean variable (e.g. new: true), I receive the following error:

Cannot resolve caller build-category-uri(Str, Bool); none of these signatures match:
    (Str $item)
    (Str $parent, Str $item)
    (Str $parent, Hash $items)
    (Hash $items)
    (Str $parent, Array $items)
    (Array $dict, :$cat_label = "categories")
  in block  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/C5CC1FDAF905F8FD25FFE592DB6B0E94FB26F4B0 (Uzu::Utilities) line 59
  in sub build-category-uri at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/C5CC1FDAF905F8FD25FFE592DB6B0E94FB26F4B0 (Uzu::Utilities) line 75
  in block  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/09A80BAF814E9ED57510ACEA7ABD2E08BA63E4B6 (Uzu::Render) line 254
  in sub build at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/09A80BAF814E9ED57510ACEA7ABD2E08BA63E4B6 (Uzu::Render) line 244
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/28DAFFBFC13CA36F7054D7A42E9F7D0EAB85E83F (Uzu::CLI) line 38
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/BEF8B0D598CE2C8868AC1830A48C46EB8DE3DEA5 line 5
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2

Variables inside partials are not HTML-encoded

pages/index.mustache:

---
title: "The famous <blink> tag"
---
{{> header }}
<h1>{{ title }}</h1>

partials/header.mustache:

<title>{{ title }}</title>

Expected output:

<title>The famous &lt;blink&gt; tag</title>
<h1>The famous &lt;blink&gt; tag</h1>

Actual output:

<title>The famous <blink> tag</title>
<h1>The famous &lt;blink&gt; tag</h1>

Intermittent test failure: '[Template6] modifying an unrelated partial does not trigger page rebuild'

I saw this with the latest code. Running it a second time, the tests passed.

$ zef install .
===> Testing: Uzu:ver('0.2.1')

    # Failed test '[Template6] modifying an unrelated partial does not trigger page rebuild'
    # at t/02-build.t line 88
    # Looks like you failed 1 test of 11

# Failed test 'Rendering [Defaults]'
# at t/02-build.t line 17
# Looks like you failed 1 test of 3

===> Testing [FAIL]: Uzu:ver('0.2.1')
Aborting due to test failure: Uzu:ver('0.2.1') (use --force-test to override)
  in code  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/1C5B2A3EA861108A89345CD9B974CE9BF1FEE32F (Zef::Client) line 375
  in method test at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/1C5B2A3EA861108A89345CD9B974CE9BF1FEE32F (Zef::Client) line 353
  in code  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/1C5B2A3EA861108A89345CD9B974CE9BF1FEE32F (Zef::Client) line 530
  in sub  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/1C5B2A3EA861108A89345CD9B974CE9BF1FEE32F (Zef::Client) line 527
  in method install at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/1C5B2A3EA861108A89345CD9B974CE9BF1FEE32F (Zef::Client) line 633
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/8CF719A0E6E0BBDC883C69273F5806F53CE89B08 (Zef::CLI) line 152
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/9F7A8B63F1D79866260D0A0CD3594BA28A8D75BA line 1
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/zef line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/zef line 2

Access another page's title / variables

I have a website with a "Related" section at the bottom of each article. Right now I generate the links with a related variable on each page, like this:

---
related:
  - link: article1
    name: A cool article
  - link: article2
    name: Another cool article

I'd like to cut down on possible errors (and repetitive work) by providing only the file name, and have Uzu figure out the title of each related article, perhaps by extracting the title variable from the appropriate (linked) template. In the future I might want to include other variables in the link text, e.g. the publication date, but for now I'm happy with just the title.

A side benefit of a title-finder is that it would then be easy for Uzu to warn me if I attempt to link to a non-existent page.

uzu init should support Mustache

Right now uzu init creates a project with .tt files. There should be an option to create .mustache files instead (and of course set template_engine appropriately in config.yml).

Uzu theme and demo site

When I came across Uzu, I was happy to learn there was a static site generator written in Perl 6. However, the fact that I couldn't figure out how to create themes and write Mustache templates kept me from trying it out. I know there's the simple site created with uzu init but I always wished it had more content (Mustache templates and partials, CSS and more HTML pages).

I finally got around it and created a demo website with a more polished theme. The site is live at https://uzluisf.github.io/uzu-demo-site/ and its repo is located at https://github.com/uzluisf/uzu-demo-site. If you wish, you can provide it as Uzu's default theme. Else, I think it'd be great to have a repo for Uzu themes.

Variables don't propagate to embedded partials

pages/index.mustache:

---
hello: "Hello!"
---
{{> partial1 }}

partials/partial1:

{{> partial2 }}

partials/partial2:

{{ hello }}

Expected output: build/index.html contains "Hello!"

Actual output: build/index.html is empty

Incremental build output

For large builds it would be nice if HTML files were written to disk as they became available, rather than all at once. It would also be convenient if pages were compiled from newest to oldest mtime, so that templates that I'm working on would be compiled (and available for inspection) first.

Feature request: Per-page config

I'm interested in using uzu as a poor man's CMS. Basically I have a site with a number of long-ish articles, and I want to make a separate page for each article. I'd like to have additional metadata associated with each article, e.g. related links, timestamp, title, etc. I envision a file layout like:

pages
 |-- article1.tt
 |-- article2.tt
i18n
 |-- en.yml
 |-- en
    |-- article1.yml
    |-- article2.yml

Uzu would collate the config files, basically merging article1.yml and en.yml when generating article1, etc. Does that make sense? Does it fit with your vision or should I look elsewhere?

Themed partials

I have a project with HTML content that I need to render in two very different contexts:

  • For a website
  • As an Apple Help book

Apple Help books are directories of HTML files, but have peculiar formatting and linking rules, so I really would like a separate set of partial templates. I was thinking maybe each context use the "theme" feature and override the default partials. E.g.

|-- partials
  |-- article_header.mustache
  |-- article_footer.mustache
|-- themes
  |-- default
    |-- layout.mustache
  |-- helpbook
    |-- partials
      |-- article_header.mustache
      |-- article_footer.mustache
    |-- layout.mustache

Would that be an appropriate extension of themes?

Relatedly, I would also need separate URL constructors for the two themes. E.g. a URL in the default theme might look like /help/compute/about_indicator.html, but for the helpbook it needs to be help:anchor=Wizard_compute_about_indicator bookID=org.evanmiller.wizard.help. We can have a separate discussion about URL construction, but I wanted to give you more context about the problem.

Test failure in v0.2.3

zef install .
===> Searching for missing dependencies: Template6, HTTP::Server::Tiny, YAMLish, Test::Output
===> Searching for missing dependencies: HTTP::Parser, IO::Blob, HTTP::Tinyish
===> Testing: Template6:ver<0.10.0>
===> Testing [OK] for Template6:ver<0.10.0>
===> Testing: HTTP::Parser
===> Testing [OK] for HTTP::Parser
===> Testing: IO::Blob:ver<0.0.1>
===> Testing [OK] for IO::Blob:ver<0.0.1>
===> Testing: HTTP::Tinyish:ver<0.1.3>:auth<cpan:SKAJI>
===> Testing [OK] for HTTP::Tinyish:ver<0.1.3>:auth<cpan:SKAJI>
===> Testing: HTTP::Server::Tiny:ver<0.0.2>
===> Testing [OK] for HTTP::Server::Tiny:ver<0.0.2>
===> Testing: YAMLish:ver<0.0.4>:auth<Leon Timmermans>
===> Testing [OK] for YAMLish:ver<0.0.4>:auth<Leon Timmermans>
===> Testing: Test::Output:ver<1.001001>
===> Testing [OK] for Test::Output:ver<1.001001>
===> Testing: Uzu:ver<0.2.3>
===> Testing [FAIL]: Uzu:ver<0.2.3>
Aborting due to test failure: Uzu:ver<0.2.3> (use --force-test to override)

On an existing installation I get an error when the logger is invoked:

uzu build
Copy public, assets
Compile templates [en]
Cannot invoke this object (REPR: Uninstantiable; Callable)
  in sub linked-pages at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/E2B466909FC20ED76B777970364C8818B5AB6E20 (Uzu::Render) line 164
  in block  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/E2B466909FC20ED76B777970364C8818B5AB6E20 (Uzu::Render) line 485
  in block  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/E2B466909FC20ED76B777970364C8818B5AB6E20 (Uzu::Render) line 731
  in sub build at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/E2B466909FC20ED76B777970364C8818B5AB6E20 (Uzu::Render) line 686
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/A8A5FAACC00827C904E27D35011005FA99FCACFE (Uzu::CLI) line 74
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/64C905B47D44C5F7FFD912510F24AE71A90764EB line 5
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2

YAML error messages are not helpful

I have a project with ~50 templates. There's an error somewhere in a YAML snippet, but all Uzu tells me is:

Couldn't parse YAML
  in sub build at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/B64B70030D8DC8D24494E45C38BA972A87CF0732 (Uzu::Render) line 267
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/A6A04D2AC064A3AC3AC0CFA1813B60BA00E99C28 (Uzu::CLI) line 38
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/2FA4F1086B130C49B85739217FDF9182FFBCD515 line 5
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2

I would like to know what file is failing, and (ideally) on what line number the parse fails.

Compile times are slow

My Uzu project is growing in size now (60+ templates, totaling 1 MB of Mustache files) and compile times are now at 5+ minutes. I'd like to put in a request for performance improvements -- it seems like compiling templates in parallel would be a relatively easy speed-up. Profiling shows a lot of time spent in the GC, but I didn't dig in to see if that's an issue with Mustache, or what.

I'm amenable to other solutions, such as putting large blobs of HTML in their own (non-parsed, non-compiled) files. Another possible solution that would alleviate the pain would be allowing piecemeal builds (e.g. uzu build pages/about/).

Add OSX to Travis build targets

I seem to hit errors often when upgrading Uzu on OS X. It would be nice to have a Travis build target so that I can rule out platform issues.

Disable layout on a per-page basis

I have a project where one file needs to be XHTML, and all other HTML (all built files need to have extension .html though). I'd like to be able to disable the layout for the one XHTML page.

Theme examples

Any theme examples using any of the template engines? I'm currently using Hugo (theme I'm using) but I'd like to give Uzu a try.

Failed test '[Mustache] rendered HTML matches test'

$ zef install . --force-install
===> Testing: Uzu:ver<0.2.8>
    # Failed test '[Mustache] rendered HTML matches test'
    # at t/02-build.t line 164
    # expected: '<!doctype html>
    # <html lang="en">
    #     <head>
    #             <meta charset="utf-8">
    #             <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    #             <title>Uzu Test Project</title>
    #             <meta name="description" content="">
    #             <meta name="viewport" content="width=device-width, initial-scale=1">
    #             <style>
    #                     body {
    #                             padding-top: 50px;
    #                             padding-bottom: 20px;
    #                     }
    #             </style>
    #     </head>
    #     <body>
    #         <div>
    #         <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    #           <div class="container">
    #             <div class="navbar-header">
    #               <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
    #                 <span class="sr-only">Toggle navigation</span>
    #                 <span class="icon-bar"></span>
    #                 <span class="icon-bar"></span>
    #                 <span class="icon-bar"></span>
    #               </button>
    #               <img src="img/logo.png" />
    #               <a class="navbar-brand" href="/">Uzu Test Project</a>
    #             </div>
    #             <div id="navbar" class="navbar-collapse collapse">
    #               <form class="navbar-form navbar-right" role="form">
    #                 <div class="form-group">
    #                   <input type="text" placeholder="Email" class="form-control">
    #                 </div>
    #                 <div class="form-group">
    #                   <input type="password" placeholder="Password" class="form-control">
    #                 </div>
    #                 <button type="submit" class="btn btn-success">Sign in</button>
    #               </form>
    #             </div><!--/.navbar-collapse -->
    #           </div>
    #         </nav>
    #         <!-- Main jumbotron for a primary marketing message or call to action -->
    #         <div class="jumbotron">
    #           <div class="container">
    #             <h1>Hello, world!</h1>
    #             <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
    #             <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more &raquo;</a></p>
    #           </div>
    #         </div>
    #
    #
    #             <div class="container">
    #               <!-- Example row of columns -->
    #               <div class="row">
    #                 <div class="col-md-4">
    #                   <h2>Heading</h2>
    #                   <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
    #                   <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
    #                 </div>
    #                 <div class="col-md-4">
    #                   <h2>Heading</h2>
    #                   <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
    #                   <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
    #                </div>
    #                 <div class="col-md-4">
    #                   <h2>Heading</h2>
    #                   <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
    #                   <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
    #                 </div>
    #               </div>
    #
    #               <hr>
    #
    #         <p>
    #             Title: <strong>Welcome to Uzu</strong><br/>
    #             Date: 2017/07/16
    #         </p>
    #         <footer>
    #             <p>2016 Sam Morrison</p>
    #         	<a class="navbar-brand" href="about.html">About Us</a>
    #         </footer>
    #         </div>
    #     </body>
    # </html>
    # '
    #      got: '<!doctype html>
    # <html lang="en">
    #     <head>
    #             <meta charset="utf-8">
    #             <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    #             <title>Uzu Test Project</title>
    #             <meta name="description" content="">
    #             <meta name="viewport" content="width=device-width, initial-scale=1">
    #             <style>
    #                     body {
    #                             padding-top: 50px;
    #                             padding-bottom: 20px;
    #                     }
    #             </style>
    #     </head>
    #     <body>
    #         <div>
    #         <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    #           <div class="container">
    #             <div class="navbar-header">
    #               <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
    #                 <span class="sr-only">Toggle navigation</span>
    #                 <span class="icon-bar"></span>
    #                 <span class="icon-bar"></span>
    #                 <span class="icon-bar"></span>
    #               </button>
    #               <img src="img/logo.png" />
    #               <a class="navbar-brand" href="/">Uzu Test Project</a>
    #             </div>
    #             <div id="navbar" class="navbar-collapse collapse">
    #               <form class="navbar-form navbar-right" role="form">
    #                 <div class="form-group">
    #                   <input type="text" placeholder="Email" class="form-control">
    #                 </div>
    #                 <div class="form-group">
    #                   <input type="password" placeholder="Password" class="form-control">
    #                 </div>
    #                 <button type="submit" class="btn btn-success">Sign in</button>
    #               </form>
    #             </div><!--/.navbar-collapse -->
    #           </div>
    #         </nav>
    #         <!-- Main jumbotron for a primary marketing message or call to action -->
    #         <div class="jumbotron">
    #           <div class="container">
    #             <h1>Hello, world!</h1>
    #             <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
    #             <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more &raquo;</a></p>
    #           </div>
    #         </div>
    #
    #
    #
    #         <p>
    #             Title: <strong>Welcome to Uzu</strong><br/>
    #             Date: 2017/07/16
    #         </p>
    #         <footer>
    #             <p>2016 Sam Morrison</p>
    #         	<a class="navbar-brand" href="about.html">About Us</a>
    #         </footer>
    #         </div>
    #     </body>
    # </html>
    # '
    # Looks like you failed 1 test of 14
# Failed test 'Rendering [Mustache]'
# at t/02-build.t line 134
# Looks like you failed 1 test of 3
===> Testing [FAIL]: Uzu:ver<0.2.8>
Aborting due to test failure: Uzu:ver<0.2.8> (use --force-test to override)

Unable to install uzu on a newly installed Rakudo-Star

Gregor Goldbach @glauschwuffel wrote:

Hi there,
I’m unable to install Uzu. These are the steps I performed:

  • Installed rakudo-star-2017-04
  • Ran ```
    zef install Uzu --depsonly
    zef install Uzu

The last command fails with the following output:

$ zef install Uzu
===> Searching for: Uzu
===> Testing: Uzu:ver('0.1.8'):auth('gitlab:samcns')
t/00-basics.t .. ok
===SORRY!===
Probable version skew in pre-compiled 'site#sources/279EEE655EA4F4F78AD74E7C34CB47AD9AE9A173 (Log::Any::Filter)' (cause: no object at index 1044)
t/01-serve.t ... No subtests run
===SORRY!===
Probable version skew in pre-compiled 'site#sources/279EEE655EA4F4F78AD74E7C34CB47AD9AE9A173 (Log::Any::Filter)' (cause: no object at index 1044)
t/02-build.t ... No subtests run
All tests successful.

Test Summary Report

t/01-serve.t (Wstat: 0 Tests: 0 Failed: 0)
Parse errors: No plan found in TAP output
t/02-build.t (Wstat: 0 Tests: 0 Failed: 0)
Parse errors: No plan found in TAP output
Files=3, Tests=1, 1 wallclock secs
Result: FAILED
===> Testing [FAIL]: Uzu:ver('0.1.8'):auth('gitlab:samcns')
Aborting due to test failure: Uzu:ver('0.1.8'):auth('gitlab:samcns') (use --force to override)
in code at /Applications/Rakudo/share/perl6/site/sources/4B1D5A60B59D9541E13F76E0E2A2D550E0144053 (Zef::Client) line 346
in method test at /Applications/Rakudo/share/perl6/site/sources/4B1D5A60B59D9541E13F76E0E2A2D550E0144053 (Zef::Client) line 325
in code at /Applications/Rakudo/share/perl6/site/sources/4B1D5A60B59D9541E13F76E0E2A2D550E0144053 (Zef::Client) line 497
in sub at /Applications/Rakudo/share/perl6/site/sources/4B1D5A60B59D9541E13F76E0E2A2D550E0144053 (Zef::Client) line 494
in method install at /Applications/Rakudo/share/perl6/site/sources/4B1D5A60B59D9541E13F76E0E2A2D550E0144053 (Zef::Client) line 600
in sub MAIN at /Applications/Rakudo/share/perl6/site/sources/09969B10D9F270B8DBAAB9961FA7E6CDB8AD58C9 (Zef::CLI) line 139
in block at /Applications/Rakudo/share/perl6/site/resources/85BD232410222F167A35B9969B036802FECD78D2 line 1


I’m fairly new to Perl6 and zef, so I’m stuck at this point. Is there any information you need to resolve this issue?

Variable for the current page?

I'd like to access the URL slug of the currently rendered page (e.g. blog/index, about) within a template. Is there a way to do that?

Error: Odd number of elements found where hash initializer expected

I'm not sure what's causing this error. For what it's worth I've recently been adding partials with nested includes.

uzu build
Copy public, assets
Compile templates [en]
Odd number of elements found where hash initializer expected:
Only saw: Match.new(list => (), made => Any, pos => 18, hash => Map.new(()), orig => "   \{\{> see_also }}\n       <p><em><a href=\"help:anchor=Wizard_index bookID=org.evanmiller.wizard.help\">Back to Wizard Help</a></em></p>\n   </body>\n", from => 7)
  in block  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/B64B70030D8DC8D24494E45C38BA972A87CF0732 (Uzu::Render) line 370
  in block  at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/B64B70030D8DC8D24494E45C38BA972A87CF0732 (Uzu::Render) line 161
  in sub build at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/B64B70030D8DC8D24494E45C38BA972A87CF0732 (Uzu::Render) line 670
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/sources/A6A04D2AC064A3AC3AC0CFA1813B60BA00E99C28 (Uzu::CLI) line 63
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/resources/2FA4F1086B130C49B85739217FDF9182FFBCD515 line 5
  in sub MAIN at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2
  in block <unit> at /Users/emiller/Code/rakudo/install/share/perl6/site/bin/uzu line 2

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.