Giter Site home page Giter Site logo

emmanuels-hexo's Introduction

Hexo + Netlify CMS Starter

中文自述

Intro

This is an example site built with Hexo and Netlify CMS, based on Viosey'sHexo material theme.

Live demo

Deploy to Netlify

Use the following deploy button to get your own copy of the repository up and running:

Deploy to Netlify

Local Development

$ git clone --recursive https://github.com/[GITHUB_USERNAME]/[REPO_NAME].git
$ cd [REPO_NAME]
$ npm install
$ hexo server

Notice that the --recursive flag is NECESSARY here, as the material theme under theme folder is introduced as a submodule. Learn more How to "git clone" including submodules?.

Netlify CMS editor workflow

The Netlify CMS admin panel is already set up in the repo. You can access it via yourwebsite.com/admin, e.g. localhost:4000/admin Please refer to Netlify CMS docs for more info.

Redirects

Netlify supports a wide range of Redirect & Rewrite Rules. Our example site is featuring the Language-based redirecs, which comes in handy for any sites that support multiple languages.

For example, the folder structure under our site's root source folder is set up like this:

| root/
    | source/
        |zh-cn/
            |about/
                |index.md
            |index.md
        |en/
            |about/
                |index.md

And in my _redirects file, I specified the following rule to help redirect the URL based on the default browser language: /* /zh-cn/:splat 302 Language=zh

In this specific example, it means if your browser language is set to be zh-cn by default, you'll be taken to https://yourwebsite.com/zh-cn/ automatically.

Same applies to all other languages.

The key is to make sure your folder structure matches the path in your _redirects file.

emmanuels-hexo's People

Contributors

lunaceee avatar

Watchers

 avatar

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.