monet

一个用 golang 语言编写的博客。(golang blog)

  • Owner: jmoiron/monet
  • Platform: Linux, Mac, Windows
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

前言

自2012年4月以来,此存储库中的代码一直在支持着 jmoiron.net

编写这个应用程序是一种学习经验,因此这个存储库中的代码可能不是惯用的最佳示例,但我尝试了:
  • 包是可以 go get 的
  • 所有代码都遵循 go fmt 的默认约定

特性

monet 运行一个网站:

  • 一个干净的博客,搜索,存档,管理员 w/ ajax 预览
  • 用于一次性URL的简单平面系统(即 /about/)
  • 用于 twitter 和 github 状态的前端(updater 目前使用 python)。

博客和平面页面是用 markdown 编写的,并存储在 mongodb 中。站点本身是通过 mandira 模板呈现的,当Debug配置选项为 false 时,将缓存该模板。

我该怎么做?

首先,去获取此存储库:

go get github.com/jmoiron/monet

这将安装 monet 命令,这是一个 Web 服务器,它将配置文件作为参数(默认为 ./config.json)并在配置的端口上运行 Web 服务器。以下是一个示例 config.json:

{
    "SessionSecret": "(long random string here)",
    "WebPort": 8000,
    "TemplatePreCompile": true,
    "TemplatePaths": ["(path to templates)"],
    "Debug": false,
    "GoogleAnalyticsTrackingID": "UA-(your GA id)",
    "Streams": [{
            "type": "twitter",
            "user_id": "(your twitter user_id)"
        }, {
            "type": "github",
            "username": "jmoiron",
            "token": "(your github user token)"
        }
    ],

    "Gallery": {
        "Type": "picasa",
        "UserID": "(your picasa user id)"
    }
}

如果您在默认端口和 localhost 上运行 mongodb,您现在应该可以运行 monet 并在端口8000上访问您的站点。

待办事项:

  • 文档以 pkgdoc 的方式工作
  • 使风格不那么单一,从字符中分离出结构
  • 如果 config 中没有提供模板路径,则从 monet 的安装路径加载模板,这样可以更轻松地从任何地方运行 monet
  • 在命令行上执行一些操作,如端口、配置路径等
  • 将标题和副标题移动到配置中
  • 大多数 gallery 应用程序

Overview

Name With Ownerjmoiron/monet
Primary LanguageGo
Program languageGo (Language Count: 5)
PlatformLinux, Mac, Windows
License:MIT License
Release Count0
Created At2012-04-03 05:46:45
Pushed At2020-11-15 22:25:44
Last Commit At2016-06-07 01:32:04
Stargazers Count194
Watchers Count13
Fork Count20
Commits Count108
Has Issues Enabled
Issues Count4
Issue Open Count2
Pull Requests Count1
Pull Requests Open Count1
Pull Requests Close Count0
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Preface

The code in this repository has powered jmoiron.net
since Apr 2012.

Writing this application was a learning experience and as such the code in this
repository might not be the best example of idiomatic go, but I try:

  • the package is go get able
  • all code follows go fmt default conventions

Features

monet runs a website with:

  • a clean blog with search, archive, admin w/ ajax preview
  • a simple flatpage system for one-off URLs (ie. /about/)
  • a front-end for twitter and github statuses (updater is currently in python).

The blog and flatpages are written in markdown and stored in mongodb. The site
itself is rendered via mandira templates,
which when the Debug configuration option is false get cached.

How do I run this?

First, go get this repos:

go get github.com/jmoiron/monet

This will install the monet command, which is a webserver that takes a config
file as an argument (defaults to ./config.json) and runs a webserver on the
configured port. Here is a sample config.json:

{
    "SessionSecret": "(long random string here)",
    "WebPort": 8000,
    "TemplatePreCompile": true,
    "TemplatePaths": ["(path to templates)"],
    "Debug": false,
    "GoogleAnalyticsTrackingID": "UA-(your GA id)",
    "Streams": [{
            "type": "twitter",
            "user_id": "(your twitter user_id)"
        }, {
            "type": "github",
            "username": "jmoiron",
            "token": "(your github user token)"
        }
    ],

    "Gallery": {
        "Type": "picasa",
        "UserID": "(your picasa user id)"
    }
}

If you have mongodb running on the default port and the localhost, you should
now be able to run monet and hit your site on port 8000.

TODO:

  • document in a way that go pkgdoc will work
  • make styles less monolithic, separate structure from character
  • load templates from monet's install path if no template paths are provided
    in config, which makes it easier to run monet from anywhere
  • take some things like port, config path, etc on command line
  • move things like the title & subtitle into the config
  • most of the gallery app
To the top