Skip to content

⚡ amp-elixir transforms markdown (content) to AMP (Accelerated Mobile Pages) compliant HTML so it loads ultra-fast on mobile devices! 📱 (which boosts your Google page rank!) 🚀

Notifications You must be signed in to change notification settings

dwyl/amp-elixir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amp Elixir

Build Status codecov.io Hex version

Amp transforms your Markdown into AMP-compliant html so it loads super-fast!

Why?

Google is putting their clout behind the AMP (Accelerated Mobile Pages) Project to help speed up page load times on the Mobile Web: https://googleblog.blogspot.co.uk/2015/10/introducing-accelerated-mobile-pages.html

This module lets you convert Markdown (.md) files to AMP-compliant .html so that you can serve them up to mobile clients much faster.

What?

For many, reading on the mobile web is a slow, clunky and frustrating experience - but it doesn’t have to be that way. The Accelerated Mobile Pages (AMP) Project is an open source initiative that embodies the vision that publishers can create mobile optimized content once and have it load instantly everywhere.

Read: https://www.ampproject.org/ How?

The best place to understand how AMP works is on the official "How it Works" page: https://www.ampproject.org/how-it-works/

Documentation

Amp Elixir should support the same markdown as described in the Earmark repository

For these limitations see: https://hexdocs.pm/earmark/Earmark.html#module-limitations

Api

Amp.parse

  • markdown - (required) markdown string to be parsed
  • options - (required) map
    • headOverride - (optional) custom html head to use if you do not want to use one generated by ampl. Using this option will mean other options will have no effect
    • style - (optional) css string to style the output html
    • title - (optional) sets the title property in the page
    • canonicalUrl- (optional) sets the canonicalUrl of the page
    • extraHeadHTML- (optional) extra html to be inserted into the bottom of the head

Background Reading

The AMP Spec: https://github.com/ampproject/amphtml

Questions?

If you have any questions please ask: https://github.com/dwyl/ampl/issues

Installation

If available in Hex, the package can be installed by adding amp to your list of dependencies in mix.exs:

def deps do
  [{:amp, "~> 0.1.0"}]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/amp.

About

⚡ amp-elixir transforms markdown (content) to AMP (Accelerated Mobile Pages) compliant HTML so it loads ultra-fast on mobile devices! 📱 (which boosts your Google page rank!) 🚀

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages