Giter VIP home page Giter VIP logo

wblog's Introduction

wblog Build Status

示例地址

初衷

作为一名web开发程序员居然没有自己的博客,都不好意思对外宣称自己的开发web的。 以前也有写博客的习惯,但是都是用的现有的博客网站。

技术选型

  1. web:gin
  2. orm:gorm
  3. database:sqlite3
  4. 全文检索:wukong
  5. 文件存储:七牛云存储smms图床
  6. 配置文件 go-yaml

项目结构

-wblog
    |-conf 配置文件目录
    |-controllers 控制器目录
    |-helpders 公共方法目录
    |-models 数据库访问目录
    |-static 静态资源目录
        |-css css文件目录
        |-images 图片目录
        |-js js文件目录
        |-libs js类库
    |-system 系统配置文件加载目录
    |-tests 测试目录
    |-vendor 项目依赖其他开源项目目录
    |-views 模板文件目录
    |-main.go 程序执行入口

TODO

  • 系统日志
  • 网站统计
  • 文章、页面访问统计
  • github登录发表评论
  • rss
  • 定时备份系统数据
  • 邮箱订阅功能

安装部署

本项目使用govendor管理依赖包,govendor安装方法

go get -u github.com/kardianos/govendor
git clone https://github.com/wangsongyan/wblog
cd wblog
govendor sync
go run main.go

使用方法

使用说明

  1. 修改conf.yaml,设置signup_enabled: true
  2. 访问http://xxx.xxx/signup 注册管理员账号
  3. 修改conf.yaml,设置signup_enabled: false

注意事项

  1. 如果需求上传图片功能请自行申请七牛云存储空间,并修改配置文件填写
    • qiniu_accesskey
    • qiniu_secretkey
    • qiniu_fileserver 七牛访问地址
    • qiniu_bucket 空间名称
  2. 如果需要github登录评论功能请自行注册github oauthapp,并修改配置文件填写
    • github_clientid
    • github_clientsecret
    • github_redirecturl
  3. 如果需要使用邮件订阅功能,请自行填写
    • smtp_username
    • smtp_password
    • smtp_host,例如:smtp.163.com:25
  4. Goland运行时,修改main.go getCurrentDirectory方法返回""

效果图

file

file

file

捐赠

如果项目对您有帮助,打赏个鸡腿吃呗!

wblog's People

Contributors

wangsongyan avatar

Stargazers

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

Watchers

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

wblog's Issues

getCurrentDirectory问题

Windows10

我在GoLand IDE中调试和编译。发现用这个方法获得的路径是X:\xxxx\xxx\AppData\Local\Temp路径. 然后去找views的时候就找不到,报错了。

如果使用go build main.go 。然后直接run, 则路径没有问题。

这是什么原因呢,应该怎么解决

qiniupkg.com/x/bytes.v7: module qiniupkg.com/x@latest found (v1.11.5), but does not contain package qiniupkg.com/x/bytes.v7

follows are my troubles.
I use cmd "go mod tidy",and then question appeared.My golang version is "go1.19.1 windows/amd64".
I need you help,be eager for you reply,thankyou

start/controllers imports
github.com/qiniu/api.v7/auth/qbox imports
github.com/qiniu/x/bytes.v7/seekable imports
qiniupkg.com/x/bytes.v7: module qiniupkg.com/x@latest found (v1.11.5), but does not contain package qiniupkg.com/x/bytes.v7
start/controllers imports
github.com/qiniu/api.v7/storage imports
github.com/qiniu/x/xlog.v7 imports
qiniupkg.com/x/log.v7: module qiniupkg.com/x@latest found (v1.11.5), but does not contain package qiniupkg.com/x/log.v7
start/controllers imports
github.com/qiniu/api.v7/storage imports
github.com/qiniu/x/xlog.v7 imports
qiniupkg.com/x/reqid.v7: module qiniupkg.com/x@latest found (v1.11.5), but does not contain package qiniupkg.com/x/reqid.v7

model类包含比较多的业务查询是不是不太好

有些方法不是很通用,如果以后业务复杂,还要写更多的逻辑方法,这种是不是放到service比价好点?
还有这个model这个块有没有更好的组织方式?
我也在考虑这个问题

go run bug

1565252748753430900 [Critical] err parsing seelog config fileopen conf/seelog.xm l: The system cannot find the path specified.

panic: html/template: pattern matches no files

这是什么问题?按照例子运行,出现了这个
goroutine 1 [running]:
html/template.Must(0x0, 0xe59320, 0x12e34ab8, 0x0)
C:/Go/src/html/template/template.go:364 +0x3e
github.com/wangsongyan/wblog/vendor/github.com/gin-gonic/gin.(*Engine).LoadHTMLG
lob(0x1326f320, 0x12ebd1f0, 0x61)
GOPATH/src/github.com/wangsongyan/wblog/vendor/github.
com/gin-gonic/gin/gin.go:162 +0xb3d
GOPATH/src/github.com/wangsongyan/wblog/main.go:182 +0x2ea
main.main()
GOPATH/src/github.com/wangsongyan/wblog/main.go:52 +0x3e5
exit status 2

govendor sync 执行报错

我在golang IDE下新建了一个工程,然后安装了govendor
然后clone了楼主源码放在了项目src下面,然后执行govendor sync就报错了,

错误如下:
Error: Vendor file at "vendor" not found.
govendor sync
Ensures the contents of the vendor folder matches the vendor file.
Options:
-n dry run, print out action only
-insecure allow downloading over insecure connection
-v verbose output

govendor sync报错

$ govendor sync Error: Remotes failed for: Failed for "golang.org/x/net/context" (failed to ping remote repo): unre cognized import path "golang.org/x/net/context" Failed for "golang.org/x/net/html" (failed to ping remote repo): unrecog nized import path "golang.org/x/net/html" Failed for "golang.org/x/net/html/atom" (failed to ping remote repo): un recognized import path "golang.org/x/net/html/atom" Failed for "golang.org/x/sys/unix" (failed to ping remote repo): unrecog nized import path "golang.org/x/sys/unix"

govendor 拉不到库

您好!
govendor sync 报错
Error: Remotes failed for:
Failed for "golang.org/x/net/context" (failed to ping remote repo): unrecognized import path "golang.org/x/net/context"
Failed for "golang.org/x/net/html" (failed to ping remote repo): unrecognized import path "golang.org/x/net/html"
Failed for "golang.org/x/net/html/atom" (failed to ping remote repo): unrecognized import path "golang.org/x/net/html/atom"
Failed for "golang.org/x/sys/unix" (failed to ping remote repo): unrecognized import path "golang.org/x/sys/unix"
Failed for "qiniupkg.com/api.v7/api" (failed to ping remote repo): unrecognized import path "qiniupkg.com/api.v7/api"
我知道这是因为被墙了的原因。但是我是挂了VPN的(蓝灯),还是依然无法拉取到库。
也尝试过使用glide来管理第三方库,依然是无法连接到一些地址。
请教一下,是VPN太垃圾,还是需要额外配置一些东西,才能够用govendor管理库?
谢谢!

govendor sync没反应

govendor sync看到下载了很多文件下载出来,长时间卡着,找到原因了,是被墙了!
但是go run main.go:qiniu那提示找不到
controllers\backup.go:16:2: cannot find package "qiniupkg.com/api.v7/kodo" in any of:

govendor sync报错

$ govendor sync 报错如下

cd D:\gopath.cache\govendor\github.com\jinzhu\inflection; git reset --hard 1c 35d901db3da928c72a72d8458480cc9ade058f fatal: not a git repository (or any of the parent directories): .git # cd D:\gopath.cache\govendor\github.com\jinzhu\inflection; git fetch fatal: not a git repository (or any of the parent directories): .git # cd D:\gopath.cache\govendor\github.com\mattn\go-sqlite3; git reset --hard 47f c4e5e9153645da45af6a86a5bce95e63a0f9e fatal: Could not parse object '47fc4e5e9153645da45af6a86a5bce95e63a0f9e'.

--

有一个问题想咨询一下你.

我最近在学习go
也是使用gin+gorm+adminlte写一个联系项目.
但是在模板这个地方遇到问题了.
我使用了a multitemplate render 这个包.
使用以后, 模板函数, 就不能使用了.
如果不使用这个包, 模板布局有点麻烦.
所以, 我想问一下, 怎么样才能使用这个包, 并且能够解决模板函数的问题?
gin-contrib/multitemplate#2
其他人好像也遇到了这个问题.

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.