Giter Site home page Giter Site logo

tota's Introduction

Tota

Tota is a simple and elegant static-site generator, written in Dart. Great for personal websites, side-projects, blogs, documentation, and more.

Install

Pre-requisites:

Then, activate the package globally:

pub global activate tota

Quick start

Setup your site

mkdir -p blog && cd blog
tota init

Create a new post

tota new "Hello, world!"
vim pages/hello-world.md

Generate static files

tota build

Deploy site

tota deploy

See --help for usage information.

tota's People

Contributors

izolate 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

Watchers

 avatar  avatar

tota's Issues

Generate archive and tag pages with list of posts

In order to be more blog-aware, we should automatically generate an archive page (and tag pages) with links to the blog posts that have been generated.

Suggestions:

Posts archive as the index page for the posts: example.com/posts/index.html

Tags in a nested tags directory:

  • example.com/tags/help.html
  • example.com/tags/funny.html

Apply a sensible template fallback mechanism

The most explicit way to render a specific template would be to reference it in the source file's front matter:

---
title: "foo"
...
template: "bar.mustache"
---

In order to fail gracefully in the event of a lookup failure, we should attempt to fallback to sensible template defaults wherever possible. For example, the fallback mechanism for a post (page type) with the above front matter should be:

  1. templates/bar.mustache
  2. templates/${TOTA_POSTS_DIR}.mustache (without the trailing slash in the env var)
  3. templates/base.mustache

Why do we need it?

This new feature, combined the two following built-in capabilities, should cover a wide array of usage styles and allow Tota to behave predictably in a forgiving manner:

  • Ability to omit the .mustache template extension when specifying template..
  • Ability to specify a nested-directory file path as the template value.

Add date format to configuration

The current date format is the ISO 8601 standard of YYYY-MM-DD. Some people may want to use a different date format. Allow date formatting to be configurable in the settings.

Add permalinks

Allow configuration to set the posts permalink. For example:

TOTA_PERMALINK="/:year/:month/:day/:title"

Should create posts with the directory structure:

posts/2019/06/29/hello-world

Instructions in README lead to error.

I did follow the instructions until tota build.
I get the the Following output:

$ tota build
Deleting public directory
Generating static files...             0.2s
Creating archive pages
Template not found: /home/r3drock/blog/templates/archive.mustache

Remove dependency on .env file

Add a boolean flag to CLI interface that removes the requirement for a local .env file, so that commands running in a CI pipeline use the native environment variables instead.

Options:

tota deploy --no-env-file

or

tota deploy --ci

allow specifying generic lists of files for use in templates

Tota looks great! and I would love to move over to tota for my current static site, but the current minimal JS based static site gen I currentl use has the concept of specifying lists in its (json based) config, eg.

"lists": {
    "projects": {
      "filter": "file.path = projects/p/*",
      "sort": "display-order ASC"
    },
    "talks": {
      "filter": "file.path = talks/items/*",
      "sort"   : "file.modified DESC"
    }
  }

which I can then make use of in moustache template partials like so:

 {{#talks}}                 
      <li>
       {{#url}}
        <video class="img-responsive talk-video-asset" width="320" height="240" controls >
          <source src=" {{{ url }}}">
        </video>
        {{/url}}

       <div class="caption">
          <strong>{{ title }}</strong> 
            <p>{{{ md }}}</p>
               {{#slides}}
               Slides are available <a href="{{{ slides }}}">here</a>
               {{/slides}}
               {{^slides}}
               Unfortunately the slides for this talk are not available.
               {{/slides}} 
            <p/>
          </div>
       </li>
{{/talks}}

So this would be somewhat like making the current special case of posts more generic.

Would you be open to adding this to tota or accepting a contribution to add this functionality?

Add deploy command

A deploy command to allow users to deploy their Tota project to the chosen host provider (Netlify).

cd $PROJECT_DIR
tota deploy

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.