Code Monkey home page Code Monkey logo

blog's Introduction

開発は一時停止

GIN-powered blog boilerplate

Update in progress

Provides essentials that most web blogs need - MVC pattern, user authorisation, SQL db migration, admin dashboard, javascript form validation, rss feeds, etc.

It consists of the following core components:

TODO (May be)

Screenshots (some may be outdated)

Home page

Dashboard

Markdown editor

Fancy 404, 405, 500 error pages

Usage

git clone https://github.com/RyotaNakajimakun/blog.git
cd ginblog
go get .

Copy sample config cp config/config.json.example config/config.json, create postgresql database, modify config/config.json accordingly. Install npm, gulp, run npm install in the project directory.

Type go run main.go to launch web server, gulp to rebuild assets.

Deployment

make build

Upload ginblog binary config, views and public directory to your server.

Project structure

/config

Contains application configuration file.

/controllers

All your controllers that serve defined routes.

/models

You database models.

/public

It contains all web-site static files

/system

Core functions and structs.

/views

Your views using standard Go template system.

main.go

This file starts your web application, contains routes definition & some custom middlewares.

Make it your own

I assume you have followed installation instructions and you have ginblog installed in your GOPATH location.

Let's say I want to create Amazing Website. I create new GitHub repository https://github.com/denisbakhtin/amazingblog (of course replace that with your own repository).

Now I have to prepare ginblog. First thing is that I have to delete its .git directory.

I issue:

rm -rf src/github.com/RyotaNakajimakun/blog/.git

Then I want to replace all references from github.com/denisbakhtin/amazingblog to github.com/denisbakhtin/amazingblog:

grep -rl 'github.com/RyotaNakajimakun/blog' ./ | xargs sed -i 's/github.com\/denisbakhtin\/ginblog/github.com\/denisbakhtin\/amazingblog/g'

Now I have to move all ginblog files to the new location:

mv src/github.com/RyotaNakajimakun/blog/ src/github.com/denisbakhtin/amazingblog

And push it to my new repository at GitHub:

cd src/github.com/denisbakhtin/amazingblog
git init
git add --all .
git commit -m "Amazing Blog First Commit"
git remote add origin https://github.com/denisbakhtin/amazingblog.git
git push -u origin master

You can now go back to your GOPATH and check if everything is ok:

go install github.com/denisbakhtin/amazingblog

And that's it.

Continuous Development

For Continuous Development a good option is to install fresh - https://github.com/gravityblast/fresh Then simply run fresh in the project directory.

To rebuild assets on change install npm, run npm install and then npm run watch. Run npm run build to build assets for production.

blog's People

Contributors

ryotanakajimakun avatar nakajima-tripleize 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.