v79 / cantilever Goto Github PK
View Code? Open in Web Editor NEWCreating a cloud-first static website generator using AWS servers such as S3 and Lambda. Transforms markdown files into HTML.
Creating a cloud-first static website generator using AWS servers such as S3 and Lambda. Transforms markdown files into HTML.
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.
Syntax is supposed to be something like {{ localDate date "HH:mm dd/MM/yyyy" }} but that seems to be reverting to default. Why?
UI - on hover over an empty folder, show delete icon.
Backend - ensure folder is empty.
GeneratorController queues files for regeneration. Display a more informative message when no files have been queued for generation.
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.
Oops.
Now that #74 is complete.
Define a standard for handling static file uploads. Initially just CSS files, but start the framework for other file types such as images.
StructureController, StructureManager all need to go. Structure stuff is now handled by separate JSON files for pages, posts, templates, media etc.
And maybe even by month?
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:
This will be a good opportunity to restructure the project based on what I've learned about SvelteKit so far.
Lambda is getting big. Can I move (and rewrite) the pages.json and posts.json generator into a new lambda?
For a given project, remove HTML and image files from generated bucket.
Delete the contents of the "htmlFragments" and "images" folders for the given project domain key.
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?
I should also consider putting the token into a cookie.
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?
The AWS cognito user pool IDs are hard-coded in the Authorizer. They should be externalised - environment variables for the API lambda execution.
The Structure Post class does not have a date field, just a lastUpdated field, which has a different purpose.
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.
In Cantilever.yaml add a required property domain
.
When writing all content to S3 buckets (both the generated folder and the destination bucket) prepend all keys with that property.
The S3 path for generated posts starts with /, which appears as an 'unnamed' folder in S3. The keys for all post objects should not start with "/".
This doesn't impact web page browsing, just in S3.
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?
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:
For posts:
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.
Having deployed to prod, I have new bugs:
Pages in sub folders should have a root page, which will be indicated by an "isRoot" property in the yaml file. This does not appear to be saved correctly.
Implement a template chooser when creating new Pages.
There is no refresh of the web UI when a folder is created. The new page modal does not show the newly created folder.
OpenAPI 3.1 specification: https://swagger.io/specification/
In order to detail the object schemas used in the OpenAPI specification, I need to know the fields/properties of the data classes. I can either do this through runtime reflection, or by compile-time code analysis.
I don't want to add reflection to the lambda runtime, so I should investigate using KSP to document the data class definitions.
In either case, I will need annotations.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.