Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
eleventy-base-blog
A starter repository for a blog web site using the Eleventy static site generator.
-
eleventy 🕚⚡️
A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I'm going to explain how this all works with a smaller example rather than the full demo that I linked earlier, but the source code for the example is available on Github, it's the same code, just with things like UI simplified.
We're loading in two libraries here, the first is TensorflowJS and the second is a the Universal Sentence Encoder model, which uses TensforflowJS, you can read about over here.
Here's my template for my json feed, this template is based on the 11ty base blog. The templating syntax being used is Nunjucks, and comes supported out of the box with Eleventy.
My blog is written using the static site generator tool Eleventy. If you haven't heard of Eleventy and you're into building fast websites, seriously check it out, it's awesome. I'm not going to explain how Eleventy works, but I wrote a post about how I got started with Eleventy.
-------- # Metadata comes from _data/metadata.json permalink: "{{ metadata.jsonfeed.path | url }}" eleventyExcludeFromCollections: true -------- { "version": "https://jsonfeed.org/version/1", "title": "{{ metadata.title }}", "home_page_url": "{{ metadata.url }}", "feed_url": "{{ metadata.jsonfeed.url }}", "description": "{{ metadata.description }}", "author": { "name": "{{ metadata.author.name }}", "url": "{{ metadata.author.url }}" }, "items": [ {%- for post in collections.posts | reverse %} {%- set absolutePostUrl %}{{ post.url | url | absoluteUrl(metadata.url) }}{% endset -%} { "id": "{{ absolutePostUrl }}", "url": "{{ absolutePostUrl }}", "title": "{{ post.data.title }}", "tags": [ {%- for tag in helpers.removeCollectionTags(post.data.tags) -%} "{{tag}}" {%- if not loop.last %}, {%- endif %} {%- endfor %}], "summary": "{{ post.data.description }}", "content_html": {% if post.templateContent %}{{ post.templateContent | dump | safe }}{% else %}""{% endif %}, "date_published": "{{ post.date | rssDate }}" } {%- if not loop.last -%} , {%- endif -%} {%- endfor %} ] }