• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AMP ⚡ HTML (Accelerated Mobile Pages) generator for Hexo.

hexo-generator-amp

AMP ⚡ HTML (Accelerated Mobile Pages Project HTML) generator for Hexo.

DEMO: HTML | AMP HTML

Screenshot

Overview

You able to generate an AMP site with almost little effort.

Installation

$ npm install hexo-generator-amp --save

If you occur ERROR Plugin load failed: error or DTraceProviderBindings.node error , please see below.

To publish AMP HTML, please refer to the following simple procedure.

1. Edit your theme

You must add AMP HTML's link to non-AMP.

Accelerated Mobile Pages Project - Prepare Your Page for Discovery and Distribution

First, add the following in your template files. For example , Please edit themes/(your-theme)/layout/_partial/head.ejs as following . For example , in hexo-theme-landscape you will edit themes/landscape/layout/_partial/head.ejs.

<% if (is_post() && config.generator_amp){ %>
  <link rel="amphtml" href="<%= config.url %><%= config.root %><%= page.path %>/amp/index.html">
<% } %>

Please refer follow as about how to use this plugin with based other templates.

To change path of AMP HTML , please see wiki.

2. Set the quick option

Please set the following options. Please edit _config.yml.

# hexo-generator-amp
# The following settings is the quick start options.

generator_amp:
  templateDir:  amp-template
  assetDistDir: amp-dist
  logo:
    path:   sample/sample-logo.png
    width:  600
    height: 60
  substituteTitleImage:
    path:   sample/sample-substituteTitleImage.png
    width:  1024
    height: 800
  warningLog: false   # To display warning, please set true.

To set the detail option , please see wiki.

3. Run server

Starts a local server. By default, this is at http://localhost:4000/.

$ hexo clean
$ hexo server

This plugin generated the AMP HTML. Please open http://localhost:4000/your-posts-parmalink/amp/ in browser.

If occured plugin error , Please refer #17 and other issue .

4. Validate AMP HTML

This plugin generated the AMP HTML. Output file path is ./your-posts-parmalink/amp/. Next , you should validate AMP HTML with the following procedure.

  1. Please open your AMP HTML page in Chrome DevTools.
  2. The Chrome DevTools console can check for AMP HTML. please Append http://localhost:4000/your-posts-parmalink/amp/#development=1 to the URL. Please see below for the details.

Accelerated Mobile Pages Project - Validate AMP Pages

How to validate AMP - my blog (Japanese)

To validate automatically from commandline , please see wiki - Automatically Validate AMP HTML option.

5. Deploy

If no AMP HTML Validation error is displayed , verification is complete . Please deploy at the end.

$ hexo clean
$ hexo server
$ hexo generate
$ hexo deploy -g

When the deployment is completed , Please check the AMP report

Wiki

Please see the wiki for detailed usage.

License

MIT

More Repositories

1

hexo-related-popular-posts

A hexo plugin that generates a list of links to related posts and popular posts. Also , this plugin can get Visitor Counts (PV) on posts.
JavaScript
109
star
2

hexo-tag-twitter

Embed twitter tweet tag plugin for Hexo.
JavaScript
30
star
3

hexo-tag-instagram

Embed instagram photo and movie tag plugin for Hexo.
JavaScript
23
star
4

hexo-include-markdown

Easily load markdownfiles in Markdown .
JavaScript
17
star
5

hexo-tag-twentytwenty

Hexo tag to embed Image Comparison Slider Scripts. Image Comparison Slider depend on jQuery Twenty Twenty plugin.
JavaScript
12
star
6

hexo-seo-link-visualizer

Analyze link and visualize the site structure for Hexo
JavaScript
8
star
7

hexo-auto-link-checker

This plugin for Hexo can automatically detects broken links.
JavaScript
7
star
8

hexo-tag-soundcloud

Embed soundcloud tracks tag plugin for Hexo
JavaScript
7
star
9

resize-and-watermark

Batch image resizing and adding watermark for node.js
JavaScript
6
star
10

node-filelist

Get a list of the absolute path in the file location. This plugin reading all the files in a folder recursively.
JavaScript
6
star
11

node-markdown2pdf

Convert markdown to PDF file. This is my gulp project.
CSS
3
star
12

hexo-tag-random-embed

Plugin embed html into markdown for Hexo.
JavaScript
2
star
13

simple-gps

Get a list of the gps and absolute path from the file location. This plugin reading all the files in a file location recursively.
JavaScript
2
star
14

js-test-practice

javascript test practice
JavaScript
2
star
15

slitscan

Generate slit scanned images from movies and images using node.js
JavaScript
1
star