Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
hexo-generator-amp
Advanced tools
AMP ⚡ HTML (Accelerated Mobile Pages Project HTML) generator for Hexo.
This plugin automatically generates AMP HTML pages.
Output file path is ./your-parmalink/amp/
. Also, You can freely choose the template(.ejs) and style(.css).
DEMO : HTML page | generated AMP HTML page
$ npm install hexo-generator-amp --save
First, add the following in your template files. For example , Please edit themes/(your-theme)/layout/_partial/head.ejs
.
<% if (is_post() && config.generator_amp){ %>
<link rel="amphtml" href="./amp/index.html">
<% } %>
Please set the following options. Please edit _config.yml
.
# 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
google_analytics: UA-123456789-1
warningLog: false
Starts a local server. By default, this is at http://localhost:4000/
.
$ hexo server
This plugin generated the AMP HTML. Output file path is ./your-parmalink/amp/
.
Now validate your AMP pages. Open your AMP page in your browser. Open the Chrome DevTools console and check for validation errors. Please Append http://localhost:4000/your-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
This plugin can set the following options. Please edit _config.yml
.
# Advanced Settings of hexo-amp-generator
generator_amp:
substituteGoogle_adsense:
data_ad_client: ca-pub-123456789876543
data_ad_slot: 0123456789
width: 336
height: 280
templateDir: amp-template
assetDistDir: amp-dist
logo:
path: sample/sample-logo.png
width: 600 # width <= 600px
height: 60 # width <= 60px
logo_topImage: #(optional)
path: sample/sample-yoursite-logo.png #(optional)
width: 1024 #(optional)
height: 400 #(optional)
substituteTitleImage:
path: sample/sample-substituteTitleImage.png
width: 1024 # width >= 696px
height: 800
cssFilePath: sample/sample-amp.css #(optional)
templateFilePath: sample/sample-amp.ejs #(optional)
google_analytics: UA-123456789-1
html_minifier: #(optional)
warningLog: true
onlyForDeploy: false #(optional)
authorDetail:
authorReading: Your name description #(optional)
avatar:
path: sample/sample-avator.png #(optional)
width: 150 #(optional)
height: 150 #(optional)
description: Self introduction #(optional)
copyright_notice: The footer copyright notice #(optional)
false
)You can choose path of schema.org image on a per post. If your post is not contain this option , this plugin search image from content.
For example : hello-world.md
, Please set the following options.
---
title: Hello World
ampSettings:
titleImage:
path: titleImage-on-the-local-folder.png
---
Welcome to [Hexo](https://hexo.io/)! This is your very first post.
...
If image on the external , Please set the width and height options.
---
title: Hello World
ampSettings:
titleImage:
path: http://titleImage-on-the-external.png
width: 1024
height: 800
---
Welcome to [Hexo](https://hexo.io/)! This is your very first post.
...
Supports the following external services.
MIT
FAQs
AMP ⚡ HTML (Accelerated Mobile Pages) generator for Hexo.
The npm package hexo-generator-amp receives a total of 108 weekly downloads. As such, hexo-generator-amp popularity was classified as not popular.
We found that hexo-generator-amp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.