Giter Site home page Giter Site logo

biyuqi / fe-navigation Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 11.0 6.71 MB

前端导航网站,优秀的前端资讯网站

Home Page: https://biyuqi.github.io/fe-navigation

HTML 2.41% JavaScript 19.06% Vue 64.64% SCSS 13.89%
frontend-web frontend-developer tech-blog navigation frontend-interview

fe-navigation's Introduction

前端导航云集高质量前端网站的内容,云集大量前端网站。优秀的前端资讯网站

贡献

  • fork当前库
  • clone到本地
  • 创建分支
  • 新增数据或功能

重点:

  • 添加数据(required) /jsondata/data 该目录是数据存放地,最后会生成basedata.json. 每个名字都是对应一个路由分类, eg: 最外层javascript 即是约定的路由名称,代码里会读取改名字进行渲染, 内部是数组,每个数组都有name, 作为分类依据分为javascripjquery两大类,字需要配置好该处,组件会自动渲染该数据

    {
      "javascript": {
        "javascript": [
          { name: "", link: ""}
        ],
        "jquery": []
      }
    }
  • 添加名称映射(/config/keywordMapping.js) /config/keywordMapping.js,此处存放所有子目录的名称映射,需要添加

    eg:

    'wechat-doc': '小程序文档'
  • 路由(/config/routesNameMapping.js) 如果只是更新原有内容, 那就不必在乎路由这一环节,如果是想新增一级路由(新建了json文件),则需要添加对应路由名称到/config/routesNameMapping.js 添加对应路由,以及侧边栏显示名字,此处用二维数组 ['javascript', 'Javascript']

  • 本地测试

// start vue project
npm run serve

// watch the JSON file change then automatically create jsondata
npm run watch

本地使用

# download
git clone https://github.com/BiYuqi/fe-navigation.git
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run serve

# build for production with minification
npm run build

fe-navigation's People

Contributors

biyuqi avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fe-navigation's Issues

Prerender config 备份

const path = require('path')
const PrerenderSpaPlugin = require('prerender-spa-plugin')
const prerenderRoutes = require('./prerender-routes')

const resolve = dir => path.join(__dirname, dir)
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)

module.exports = {
  publicPath: IS_PROD ? 'vuenotes' : '/',
  productionSourceMap: false,
  lintOnSave: true,
  devServer: {
    open: true
  },
  chainWebpack: config => {
    config.resolve.alias
      .set('@json', resolve('jsondata'))
      .set('@', resolve('src'))
    config.plugins.delete('pwa')
    config.plugins.delete('workbox')
  },
  configureWebpack: config => {
    const plugins = []
    if (IS_PROD) {
      plugins.push(
        new PrerenderSpaPlugin({
          staticDir: resolve('dist'),
          routes: prerenderRoutes,
          postProcess (renderedRoute) {
            renderedRoute.route = renderedRoute.originalRoute
            if (renderedRoute.route.endsWith('.html')) {
              renderedRoute.outputPath = path.join(__dirname, 'dist', renderedRoute.route)
            }
            return renderedRoute
          },
          renderer: new PrerenderSpaPlugin.PuppeteerRenderer({
            inject: {
              prerender: true
            },
            headless: false
          })
        })
      )
    }
    config.plugins = [...config.plugins, ...plugins]
  }
}

数据收集列表

方便提供源码吗

现在是打包后的内容,方便提供源码吗?想快速构建一个简单的导航栏,放一些内部的链接

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.