Giter Site home page Giter Site logo

tinystatic's People

Contributors

atakanyenel avatar julvo 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tinystatic's Issues

Just used in production

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:

  • I think there should be a 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.

  • My website had 2 templates, and 6 routes in total. It was very fast for me to render them with this. One improvement would be to put your generate loop in main.go in a goroutine. Those tasks can run in parallel, I guess, so your code would be something like:
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.

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.