julvo / tinystatic Goto Github PK
View Code? Open in Web Editor NEWA tiny static website generator which is flexible and easy to use
License: MIT License
A tiny static website generator which is flexible and easy to use
License: MIT License
Hello, I saw the app on Reddit. I just used it to migrate a website from php to pure html. I was using the php just for including partial html like header and footer so this project fit perfectly to the task. It was very easy to use and gives great control to user. Here are some remarks that might be useful:
partial
command for embedding partial into routes. Currently they can only be embedded in templates. My index page is unique, no need for templating, but it uses partials, so it would be very nice to have that command. I ended up defining a index_temp.html as a template with all the content and created my index.html in routes just with:---
template: index_temp.html
---
For that workaround I had to create 2 files with similar names, so there is that.
for _, r := range allRoutes {
go func(route Route){
if route.Href != "" {
log.Println("โ", route.FilePath, "->", route.Href)
}
if err := route.Generate(outputDir, allRoutes); err != nil {
log.Fatalln(err)
}
}(r)
}
you can also get rid of outputDir
& allRoutes
parameters for the generate method. They are already known and constant so your AllRoutes() method can take them and return routes array with those information already embedded in them.
I really liked the simplicity of the project. I didn't need a autoload server at all. Keeping a python server running in output and refreshing the page was enough. It really does not worth the effort of creating websockets for hot reloading.
A future milestone would be to minimize generated output. Basically removing whitespace from html and minifying assets. Hugo does that, but hugo is utterly complicated. So this is your call.
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.