Skip to content

Instantly share code, notes, and snippets.

@jagedn
Last active September 16, 2019 07:56
Show Gist options
  • Save jagedn/fbe8c98212b24bf33a536876f6a65014 to your computer and use it in GitHub Desktop.
Save jagedn/fbe8c98212b24bf33a536876f6a65014 to your computer and use it in GitHub Desktop.
asciidoctor-netlify

Asciidoctor Netlify Extension

Netlify is a cloud computing company that offers hosting and serverless backend services for static websites (Wikipedia)

You can link your git (github/gitlab/…​) repo with your Netlify account and deploy your static site into it in a similar way of Github/Gitlab Pages but with the add you can use some out of the box backend features as:

  • forms: if your static content has a form you can receive an email when some user fill it

  • aws function: you can define AWS lambda functions and execute it when the user relaizes some action with your content

  • Basic auth and OAuth providers

  • etc

Deploy a lambda function is very easy because basically you only need to create a functions folder , locate your javascript/go functions in it and Netlify will deploy them into their AWS space

Project

The asciidoctor-netlify will be a java extension that you can use with your asciidoctor builder to generate special netlify content

Encrypt block

You can write netlify-encrypt blocks and they will be rendered as encrypted content. When the user is authentificated a javascript call the function retrieve-key to obtain the key who decrypt the content

    this content will be visible to all readers

    [netlify-encrypt]
    ----
    this content will be appear as a hidden+encrypted text.
    when the user execute the auth process the block will be decrypted and showed
    ----

Searchable Document

Using the :searchable-document: document attribute, the plugin will generate an index of the keywords of the document in the functions folder plus a javascript function to use it. In this way, if you have multiple documents, as in a blog or in an antora site, the user can search in all documents of our site.

Form

Although with asciidoctor is easy write piece of html, the block macro netlify-form will render a form who fit Netlify requirements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment