Using Anvil to Create Web Site

When I first started using Anvil, I expected to be able to create a full web site. When I discovered it’s for web apps, not web sites, I started using the iframe approach to embed Anvil forms in an otherwise static site.

What I wanted to do with this post is capture what would be needed to be able to create a full website in Anvil, and work out what’s missing, and hopefully start some discussion.

What’s a full web site?

When I say full web site, I mean something that can be crawled by search engines and participates in SEO practices and feels like a normal web site to a user. While some web apps don’t need to be indexed by search engines, others (like a social networking site) can benefit from that.

These are the things I think would be needed.

Ability to link to specific forms

A search engine can’t index what it can’t link to. This can currently be done by creating a startup form that looks at the URL hash and opens the appropriate destination form. Using ! after the # in the URL hash should cause Google to index the URL.

A URL in the form #!?page=add now works properly.

Ability to change meta tags based on the URL

The meta tags for SEO seem to be global for the app right now, and not something that can be changed dynamically. This isn’t as big a deal as the others, but would be a nice to have feature.

Using browser back and forward buttons to navigate

This can be done using Javascript, as shown in this post: Working with browser history to support back and forward buttons

Providing a sitemap to search engines

This should be able to be done via an HTTP endpoint that returns the sitemap.xml contents.

Providing an inexpensive way to serve static content

Websites often contain a lot of content that’s static. It’d be nice to have some way to serve that static content that didn’t have as much of an impact on compute units as the dynamic content. I have no idea what this would look like in terms of the Anvil architecture.

Others?

Are there other features I"m missing?

7 Likes

Just popping in for the first time in 1.5yrs to co-sign this. My app (not on Anvil) assembles various content that needs to be linkable and search indexable. I checked out as soon as I realized that Anvil doesn’t support some really foundational features that make the web, well, the web.

The ! thing might work, though supporting routing of canonical-looking URLs is most ideal (http://example.com/this/that). And browser navigation functions of course a must.

It occurs to me that it might also be preferable to have a way for pages to be rendered server-side rather than elements filled in via AJAX calls (as I think it was when I last checked out Anvil), though I’ll admit I’m actually not sure how necessary this is indeed for modern spidering engines.

Maybe I’m naive to the difficulty or complications inherent to implementing such features, but it seems to me that they’d open up such a broad swath of use cases that the return on your investment could be substantial.

Anvil otherwise seems like a pretty neat platform, and as an old-school amateur with the domain knowledge to build a successful app but zero effs to give towards maintaining an entire modern web stack, I’d love to be able to develop with it.

Or maybe you haven’t suited yourself towards public facing sites because of the associated traffic loads?

3 Likes

Agreed, using #! is a workaround. Proper routing (which is on the Anvil roadmap) is a far better option.

A shorter term feature upgrade that would allow us to build our own routing would be to pass the URL to the startup form. If my site is accessed via http://example.com/this/that and my startup form can access “/this/that”, I could build routing that would look good to any search engine.

3 Likes

What command do I need to input after running my python code to build my website in Anvil

Welcome to the forum!

Please do not revive old posts, especially when you are asking for a specific command and the post is about gathering generic info about website creation.

There are no commands to execute and no websites to be built. Anvil creates a web app, not really a web site. Please start going through some tutorials, so you can get an idea of what’s going on.

1 Like