Skip to content

mashedpotato2018/tdn-pages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tdn-pages

NPM Downloads NPM Version License Dependency Status devDependency Status Code Style

static web app workflow

Installation

$ npm install tdn-pages

# or yarn
$ yarn add tdn-pages

Usage

有三个命令可以使用

tdn-pages clean

清除构建文件夹

tdn-pages develop

静态开发网页 会开启开发服务器,提供热更新

支持e6+和scss开发

tdn-pages build

构建生产环境代码

在根目录添加文件pages.config.js 可以配置初始化 文件路径和文件名称和页面数据

默认为

module.exports = {
    build: {
        // 代码开发路径
        src: 'src',
        // 生产路径
        dist: 'dist',
        // 临时文件路径
        temp: 'temp',
        // 公共文件路径
        public: 'public',
        paths: {
            // 样式
            styles: 'assets/styles/*.scss',
            // js
            scripts: 'assets/scripts/*.js', 
            // 页面
            pages: '*.html', 
            // 图片
            images: 'assets/images/**',
            // 字体
            fonts: 'assets/fonts/**',
        }
    },
    // 页面渲染引擎数据
    data: {
        menus: [
            {
                name: 'Home',
                icon: 'aperture',
                link: 'index.html'
            },
            {
                name: 'Features',
                link: 'features.html'
            },
            {
                name: 'About',
                link: 'about.html'
            },
            {
                name: 'Contact',
                link: '#',
                children: [
                    {
                        name: 'Twitter',
                        link: 'https://twitter.com/w_zce'
                    },
                    {
                        name: 'About',
                        link: 'https://weibo.com/zceme'
                    },
                    {
                        name: 'divider'
                    },
                    {
                        name: 'About',
                        link: 'https://github.com/zce'
                    }
                ]
            }
        ],
        pkg: require('./package.json'),
        date: new Date()
    }
}

API

tdnPages(name[, options])

name

  • Type: string
  • Details: name string

options

host
  • Type: string
  • Details: host string
  • Default: 'zce.me'

Contributing

  1. Fork it on GitHub!
  2. Clone the fork to your own machine.
  3. Checkout your feature branch: git checkout -b my-awesome-feature
  4. Commit your changes to your own branch: git commit -am 'Add some feature'
  5. Push your work back up to your fork: git push -u origin my-awesome-feature
  6. Submit a Pull Request so that we can review your changes.

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

License

MIT © tdn 2387083001@qq.com

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published