Giter VIP home page Giter VIP logo

cantilever's People

Contributors

v79 avatar

Stargazers

 avatar

Watchers

 avatar

cantilever's Issues

Add navigation hooks to the handlebars model so they can be referred to in templates

I need to be able to add navigation links to the handlebars template models, so that I can create links between pages in templates. So that I can write links like this:

{{#if @previous }} <a href="{{ @previous.url }}">{{ @previous.title }} {{ @previous.date }}</a>

Required:
@previous
@next
@parent (only applicable for pages)

Other possibilities:
@FIRST
@last
@children (only applicable for pages)
@siblings (only applicable for pages)

I should be able to determine the values for these from posts.json and pages.json.

Will I ever need an API route to get these values, or can I just calculate them when processing the handlebars templates?

Create URL generation strategies for posts and pages and other ContentNodes

After #56 URL generation has been broken and there is no url property in the ContentNode models.
Make url a calculated property for ContentNodes, with a URL generation strategy.

For pages:

  • URL will be /, except when a page has been marked isRoot, in which case it will be /index.html

For posts:

  • Default strategy may be /posts///slug , e.g /posts/2023/11/my-new-post
  • Could this be defined in cantilever.yaml as an override? Would need to define and parse a format string. Maybe based on Kotlin, e.g. "${date.year}-${date-month}/${slug}".

Start with defining a default one, in any case.

Extend Cantilever to support non-HTML template files

Currently we can only process templates that output HTML files. The Handlebars generator controller assumes that all templates have the file extension ".html.hbs". Extend this functionality to support other output formats, such as PDF or JSON.

Project definition file

A lot of values are currently hard-coded, such as folder paths. And there's nowhere to store project-level values such as website names.

Definite a project.yaml file. Create route for editing the project defintion, and a web UI for this. Create a UI for starting a new project.

Allow configuration of error pages, such as 404, through project definition file

Add error page configuration to cantilever.yaml.

Something like:

errorTemplates:
 - 404: sources/templates/404.html.hbs
 - 403: sources/templates/403.html.hbs

Do I need to explicitly define a Page for each of these errors as well? If not, how will I create a ContentNode.PageNode so that the template renderer can render the page? May just be a custom function. Maybe the template itself needs an isErrorPage flag?

Allow upload, processing, management and linking of images files

I need to be able to add images to pages and posts.

See "adding images" for a fuller discussion of this.

The markdown syntax to include an image is something like:

![ description ] ( /images/my-cat.jpg "long description" )

Images will be uploaded to the source bucket (to /sources/images/). Details will be recorded in /generated/metadata.json (or maybe a specific media.json file). The images will then be converted/rescaled according to rules defined in cantilever.yaml - specifically, new versions created according to the dimensions defined the "imageResolutions" project metadata. I.E. given an upload file of "my-cat.jpg", and imageResolutions of "small": "128x128" and "large": "640x", then new versions will be saved as "my-cat-small.jpg" and "my-cat-large.jpg" in the generated/images folder.

Probably also just do a straight copy of the file to generated/images, so that it can be used as-is.

Ideally, I would only copy the required image resolutions to the destination web bucket. How might I do that?

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.