GithubHelp home page GithubHelp logo

jhvst / vertigo Goto Github PK

View Code? Open in Web Editor NEW
265.0 20.0 24.0 4.77 MB

Blog engine in Go (golang)

Home Page: https://toldjuuso.github.io/vertigo

License: MIT License

Go 96.70% CSS 3.30%
blog-engine side-project blogging blog go json-api heroku docker

vertigo's Introduction

vertigo

Codeship Status for toldjuuso/vertigo Deploy GoDoc

Vertigo

Vertigo is blogging platform similar to Ghost, Medium and Tumblr. Vertigo is written in Go and has fully featured JSON API and it can be run using single binary on all major operating systems like Windows, Linux and OSX.

The frontend code is powered by Go's template/html package, which is similar to Mustache.js. The template files are in plain HTML and JavaScript (vanilla) only appears on few pages. JavaScript is stripped down as much as possible to provide a better user experience on different devices. Vertigo also ships without any CSS frameworks, so it is easy to start customizing the frontend with the tools of your choice.

Thanks to the JSON API, it is easy to add your preferred JavaScript MVC on top of Vertigo. This means that you can create users, submit posts and read data without writing a single line of Go code. For example, one could write a single page application on top of Vertigo just by using JavaScript. Whether you want to take that path or just edit the HTML template files found in /templates/ is up to you.

Features

  • Installation wizard
  • JSON API
  • SQLite and PostgreSQL support
  • Fuzzy search
  • Multiple account support
  • Auto-saving of posts to LocalStorage
  • RSS feeds
  • Password recovery
  • Markdown support

Installation

Note: By default the HTTP server starts on port 3000. This can changed by declaring PORT environment variable or by passing one with the binary execution command.

Downloading binaries

See GitHub releases.

Heroku

Deploy

For advanced usage, see Advanced Heroku deployment

Source

  1. Install Go
  2. git clone https://github.com/toldjuuso/vertigo
  3. cd vertigo && go build
  4. PORT="80" ./vertigo

Docker

  1. Install docker
  2. git clone https://github.com/toldjuuso/vertigo
  3. cd vertigo
  4. docker build -t "vertigo" .
  5. docker run -d -p 80:80 vertigo

Environment variables

  • PORT - the HTTP server port
  • SMTP_LOGIN - address from which you want to send mail from. Example: [email protected]
  • SMTP_PASSWORD - Password for the mailbox defined with SMTP_LOGIN
  • SMTP_PORT - SMTP port which to use to send email. Defaults to 587.
  • SMTP_SERVER - SMTP server hostname or IP address. Example: smtp.example.org
  • DATABASE_URL - database connection URL for PostgreSQL - if empty, SQLite will be used

Contribute

Contributions are welcome, but before creating a pull request, please run your code trough go fmt and golint. If the changes introduce new features, please add tests for them. Try to squash your commits into one big one instead many small, to avoid unnecessary CI runs.

Support

If you have any questions in mind, please file an issue.

License

MIT

vertigo's People

Contributors

i5heu avatar jayrox avatar jhvst avatar pgray 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

vertigo's Issues

issue on addons

Hi,
It seems that for heroku the app requires a credit card, when you deploy it any app . Anyone experienced this? how to overcome on this issue.

Message "layout" is undefined

I installed with go get, but I see

html/template: "layout" is undefined

In the console:

vertigo
2018/10/11 17:16:13 sqlx: using sqlite3
2018/10/11 17:16:13 settings are empty

localstorage usage and reasons

Hey there, trying to get and understanding of the localstorage usage and the reason behind it. Care to shed some light? Thanks!

login/register links while signed-in

okay, another issue which I've notice is that when you are logged in you are still able to see the login/register links on the index page. Is there a way to change this so that the links are only displayed when the user isn't signed in.

commenting system or pure medium-style?

As you can tell, medium doesn't have any type of commenting-system embedded but it would be simple to add in vertigo. It would only take a discus input field in the settings to implement a pretty decent commenting interface via disqus but do you think it's necessary?

time issue

I pulled the latest code and deployed it to heroku, I submitted a new post but the time was a little wrong. I posted my post at 6:45 AM but it displays 10:45AM. I don't know if this is set for your time but can you confirm? @9uuso

Safari and contenteditable

It seems like Safari is not working as long as line breaks are considered. It seems to insert <div> tags instead of <p>'s, which result in problems.

This is a +1 for Medium.js discussed in #4.

installation from source issues

I attempted to install vertigo via source exactly as detailed, it seemed as if the packages where needed to be installed first. So I then attempted go get github.com/9uuso/vertigo then later cloned the source and ran godep go build and PORT="80" MARTINI_ENV="production" ./vertigo which everything then seemed to run as planned. Maybe go get github.com/9uuso/vertigo should be added alongside of go get github.com/tools/godep in the readme?

Should ID be string or int?

As mentioned in #1

Implementing a new driver will also open up questions, such as should the structure ID's on posts and uses be switched from int64 to GUID string. This is a tough choice, since changing it will break all current Vertigo installations, but I'm unsure whether NoSQL databases such as RethinkDB can be adjusted to work with incrementing primary key. Only time will tell.

I later asked about the matter from the the creator of Hugo. He said

strings are better for distributed databases

Therefore, I might be changing the structure system to support strings instead. This will be a major breaking change, but it will be a good base for an actual stable release. After this, I will consider the Vertigo's user and post API halted.

Anyhow, I'm opening this issue to ask for any opinions on this matter, should any of the contributors or users have any.

Switching prompting of hostname to absolute URL

Enabling SSL is currently undocumented as of pull request #15. Since hostname is actually not used anywhere besides of feeds and password recovery (which both use web addresses anyway), it could be worth updating the installation wizard and settings template to prompt for the complete URL path instead.

Importing databases as drivers

Currently the users.go and posts.go namespace is very cluttered since both the application routes and structure methods lie in the same file. In very beginning the routes and structure methods were apart and lately I've felt like the original plan was better than the current, where the files have the code for both. Therefore, I'm creating this issue to let everyone know about those plans.

The current idea is to have separate folder called db and inside of it the drivers as in gorm or rethinkdb. These folders will then contain all necessary structure methods for posts and users, likely both in their own files. These drivers could then be imported in the application users.go and posts.go using forced namespace such as driver.

In the most ideal scenario you could switch between databases by changing a single line in the users.go and posts.go file. However, to achieve this it requires all drivers to have the necessary methods with same naming standards. The naming standards is something I have to create sometime in the future, but will hopefully bring more clarity in the source code to whomever is reading it. This should also make adding new database flavors easier.

Accessing the frontend?

I'm trying to figure out how to access the basic frontend included on localhost. The instructions provided only starts the RethinkDB Web UI unless I'm overlooking something?

Thanks

Markdown as default post format

This is convenient since html isn't highly being used for blog posting any more, most traditional blogging engines and platforms have switched to markdown as there default format. If this was a valid change, wouldn't you only have to change the radio value on settings.tmpl?

WIP

๐Ÿšง WIP ๐Ÿšง

  • Editing of posts
  • Menus?
  • Search
  • Homepage which lists posts from all users
  • A WYSIWYG editor such as Quill would be nice
  • Documentation on useful functions
  • T-te-tests?!

Titles and slugs

Currently, if you change title of a post and publish it, the post slug won't be updated. This behavior is unexpected and should be changed.

Update database driver to 0.4

As the latest version of RethinkDB (1.14) introduces seamless database migration to newer versions, I believe it is worth updating the corresponding dependencies. The corresponding Go client driver version currently used is as old as 0.2.x, from which the hop will be to 0.4.x. The update does not bring any changes to the actual program flow, but it does bring new possibilities thanks to the new binary data type. For example, the multimedia on the site could be stored in the database rather than on third party services such as Imgur or Soundcloud. Whether RethinkDB should stay as the database of choice is a completely different matter.

Effort to compile Vertigo on Windows dev box fails

Hello,

I was able to install Vertigo on Heroku through the button publish but when I try to produce a local build of Vertigo on my Win 8.1 Pro x64 dev box preferably with Sqlite, it ends with a following error message.

c:\Inetpub\GoLanguage\src\github.com\9uuso\vertigo>go build

github.com/9uuso/vertigo

C:\Inetpub\GoLanguage\src\github.com\9uuso\vertigo\main.go:68: cannot use timezone.Locations (type []timezone.Timezone)
as type [416]timezone.Timezone in return argument

I am using Go version 1.4.2. Any advice will be highly appreciate.

Code coverage

Getting code coverage above 75% would be a necessary task to do. I'm starting to write test packages for password reminder, as most of the untested code is there.

Text editor

There are some known issues with the contenteditable text editor. First of all, the element's collect behavior changes depending on what tags you wrap around it. Wrapping the element into a div results the collected form data to have newlines coded as <div><br></div>. Even though this is bit off the spec, I'd still prefer this syntax over wrapping the element into p, because in case an user decides to insert multimedia on the page it won't break HTML validation.

That brings us to the bigger issue, which affects the editor page after the initial save. Currently, the edit.tmpl page is unescaped. The unescaping cuts both ways, as if it's done, it makes it easy for someone who doesn't know HTML to edit the page. Consider you have few page website for some company or similar, who do not need the actual blogging side of Vertigo. As the edit page is unescaped, they can change - let it be food menus or some similar regularly changing content - without breaking the HTML layout.

On the other hand, when the page is unescaped, javascript is nearly impossible to add to the page. For example, Github gists are a major headache and with them, you have to get the page right on one go. If you go to edit the page again, the javascript gets executed, which injects the content to the page twice.

Heroku and disk persistancy

It seems like Heroku's instance is having problems keeping all posts on disk while using SQLite. It might be reasonable to enable PostgreSQL support for it.

Markdown Input

I was curious if there was currently a preprocessor to turn given content from markdown to html. I like the blog idea/framework/starter, but would use markdown in the frontend for editing (I am assuming here a webapp that is using the json api, not the templates). If there isn't such a thing, I would actually be interested in contributing some sort of implementation. I could see it being something like:

  1. Store markdown processed into html
  2. Return html

Although for editing, that might not be ideal, so this might work better

  1. Store markdown as markdown with a db field saying so
  2. Return markdown processed into html when displaying a post
  3. Return original markdown to frontend for editing

What are your thoughts or suggestions?

Search and clauses

Currently the search does not work if you search with clauses instead of single word.

This is unexpected behavior.

error handler and submit button

when I direct myself towards a unknown page such as http://example.com/sdfdsfasd, I begin see a blank page which a 404 naturally should really be displayed instead and other errors such as 200, 401, 500 etc. Martini should have this built-in so idk why it's not rendering via vertigo. Another thing is when writting a post, I'd recommend some sort of submit button.

Tests fail with latest dependencies

Even though the project does use godep, I think it would be good if building and testing with the latest dependencies would work.

The failing dependency is currently gorm. Vertigo's post.Update is currently unable to commit the changes to at least SQLite.

The package was returning near "LIMIT": syntax error for query db.Where(&Post{Slug: post.Slug}).First(&post).Updates(entry). It seems like the it is unable to retrieve any records, which is kind of odd. At a fast glance I was unable to find any changes which would have caused this change.

Gobuild.io builds are down

For the past few weeks the builds generated by gobuild.io on the downloads page have been down. This is seemingly an issue in a dependency package called github.com/fiam/gounidecode/unidecode, which causes signal: killed error messages on Linux platforms, which gobuild.io also uses.

The unidecode package seems to have moved into a new repository, which however, can't be currently either go get or git cloned on my development environment. Therefore, I've filed an issue on the said package's updated repository to see whether that would ultimately fix the gobuild.io builds.

WIP

๐Ÿšง WIP ๐Ÿšง

โœ… Done:

  • Search @c1bbae93fb4ecef44470faf8f9fe21631408c9c0
  • Editing of posts
  • Site-wide settings @f083a8294ef7fbc404bfa8d7ad319f2e9cb5fd44
  • Password reminder @07d3dde2713b3199c1e9973824f5cfbfaed68333
  • Analytics middleware (kind of)
  • Documentation on useful functions
  • Homepage which lists posts from all users
  • Migrate RethinkDB to embedded database (sqlite?) @bbcba13bc1abb6d2e1c0667f125859854642b1cf
  • T-te-tests?! (I was very skeptical to add these in the first place, but I'm very glad I did)
  • Import databases as drivers
  • get rid of martini and replace it with idiomatic HTTP server

๐Ÿšง Backlog:

๐Ÿšซ Won't be implemented:

  • RethinkDB DAL
  • tagging? (aka hashtags, tags, or whatnot)
  • Embed .tmpl and other static files into the binary
  • Menus?
  • A WYSIWYG editor such as Quill would be nice

Creation date

Currently the creation date stored in the database is the date the post is saved. The date does not update itself once a post is published. This is unexpected behavior.

It might be necessary to add new fields to Post structure for the initial creation date and for the latest update.

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.