Skip to content

How to customize css of sample AMP template ?

tea edited this page Nov 3, 2017 · 8 revisions

How to customize css of sample AMP template ?

To customize the CSS of the sample AMP template, please follow the steps below.

  1. Please copy all the files in the below link to /amp-template/style/ .

    https://github.com/tea3/hexo-generator-amp/tree/master/template/style/

    The directory after copying is as follows.

    your-hexo-blog
     ├ amp-template/
       ├ sample/
       └ style/
          ├ amp-style.styl (copyied files)
          └ ...
     ├ node_modules/
     ├ scanfolds/
     ├ source/
     ├ themes/
     ├ _config.yml
     └ package.json
    
  2. To customoize style , please edit /amp-template/style/amp-style.styl and other file (/amp-template/style/**.styl).

  3. Please edit the _config.xml

    Plugin support Stylus and Sass. So , please change the cssFilePath option.

    generator_amp:
      cssFilePath: style/amp-style.styl         #(optional) Location of Stylus or Sass file to use
    
  4. Run server

    $ hexo clean
    $ hexo server
    
Clone this wiki locally