Coder Social home page Coder Social logo

v79 / cantilever Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 4.27 MB

Creating a cloud-first static website generator using AWS servers such as S3 and Lambda. Transforms markdown files into HTML.

Kotlin 72.69% Batchfile 0.03% HTML 0.42% CSS 0.06% Handlebars 0.61% JavaScript 0.39% TypeScript 1.93% Svelte 23.87%

cantilever's People

Contributors

v79 avatar

Stargazers

 avatar

Watchers

 avatar

cantilever's Issues

Move generated folder to new S3 bucket

In #85 I broke the file upload processing pipeline because there is no longer a shared prefix.
If I move all of the generated content to a new bucket, I can reenable the file upload trigger on the S3 source bucket.

I will keep the same folder structure in the generated bucket.

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.

Switch out Flowbite UI for another framework such as Skeleton or Carbon

I've created a test project using Skeleton. I think it will work for me, though some of it is quite different from Flowbite.

Steps will be:

  • Create new branch
  • Update Node/NPM from 18.17.0 and 10.2.3 to 20.11.0 and 10.2.3
  • Create new Skeleton project (in a new folder, so I can keep the existing Web project as reference)
  • Create application shell and routes
    • posts
      • create new post
      • load post
      • save post
      • delete post
    • pages
      • load page list
      • create new page
      • load page
      • save page
      • save new page
      • delete page
      • create folder
      • delete folder
      • setting a page as the index/root for a folder?
    • templates
      • create new template
      • load template
      • save template
      • delete template
      • create, manage and delete template sections
      • trigger regeneration of pages based on template
    • media
      • load image gallery
      • upload new image
      • delete image
    • project configuration
      • load and save existing configuration
      • create, manage and delete custom attributes
      • create, manage and delete image resolutions
  • Configure a CSS theme for the project
  • Generation menus
    • Rebuild metadata
    • Rebuild all pages
    • Rebuild all posts
    • Rebuild image resolutions
  • Improve navigation, e.g. with proper page titles, and clearing stores on navigation
  • Spinner for long running tasks like generation and metadata regen

This will be a good opportunity to restructure the project based on what I've learned about SvelteKit so far.

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?

Allow upload, processing, management and linking of image 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?

Navigating between pages must clear various stores, like contentStore

If I edit and save a post, then navigate to the pages screen, contentStore still contains the metadata for the post object. This crashes on SectionTabs (temporarily fixed) and shows bad information on the screen.

When navigating between /, /posts, /pages, /media etc, clear contentStore and perhaps others.

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?

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.

Prod build bugs

Having deployed to prod, I have new bugs:

  • can't create a new post (create button does nothing)
  • create post modal does not fetch templates after initial fetch
  • when navigating from new page to post, should clear the view (or prevent navigation?)
  • image upload broken? Can't fetch, anyway

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.

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.