Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Blog Generator - my own static site generator

License

NotificationsYou must be signed in to change notification settings

paulohrpinheiro/gerablog

Repository files navigation

Gem VersionCode ClimateTest CoverageIssue Counttravis-CI

Blog Generator - my own static site generator

Write inMarkdown, publish inHTML.

I'm GeraBlogImage created byhttps://robohash.org/

Rules

  • The texts must be written in markdown.
  • The first line of file will be the post title# mark.
  • The second line is a blank line.
  • The third line will be the description of text, with## mark. Will be in meta description of generated html.
  • The filenameMUST begin with a date:2016-12-31-this-is-a-post.md.
  • The texts must be in a subdirectory oftexts. Each subdirectory will be assigned acategory.
  • Change the layout by changing files intemplates dir, which usesTenjin as template system.
  • JS and CSS files put inassets/{css, js}.
  • The images used in the posts should be placed in aimages subdirectory, within the category directory: texts/ruby/images/pinkpanter.jpg. In the post, put the reference as![Pink Panter](images/pinkpanter.jpg).
  • Images used in postsMUST be placed in the same levelCATEGORY/images.
  • By default,GeraBlog usesprism to highlight the syntax of the codes. The language indicated will be the category in which the text is. For example, the fileruby/2016-12-31-ruby-rocks.md if it has some source code, it will be marked aslang-ruby.

Sample text:

# This is the title## This is the descriptionHere the text.Show-me the code:    puts 'Hello world!'

Install

gem install gerablog

Hacking

  • clone the repo;
  • bundle install;
  • make changes (with tests!)
  • run all the tests (rake) and fix anything that appears wrong
  • runrubocop and fix alloffenses!
  • send me a PR.

Using

The executablegerablog has this options:

-h or--help

Yes, we have a--help option:

➤ gerablog --helpUsage: optparse [options]    -h, --help                       Display this screen    -n, --new FILENAME               Create a new project.    -g, --generate FILENAME          Generate the static blog.

-n or--new

Create a new project:

➤ gerablog --new /tmp/test

How the project looks like?

➤ tree /tmp/test/tmp/test├── assets│   └── assets│       ├── css│       │   ├── gerablog.css│       │   └── prism.css│       └── js│           └── prism.js├── gerablog.conf├── output├── templates│   └── templates│       ├── categories.rbhtml│       ├── category.rbhtml│       ├── feed.rbxml│       ├── footer.rbhtml│       ├── header.rbhtml│       ├── index.rbhtml│       └── post.rbhtml└── texts

If--root is not informed, root will be./.

-g or--generate

Deploy

For myblog:

➤ gerablog --generate ~/Dropbox/projetos/paulohrpinheiro.xyz/blog/gerablog.confrubydiversosprogramadorbipolarjavascriptcperlrustpython

Copyoutput directory to your server :)

History

This project started with a script I made to generate my sitehttps://paulohrpinheiro.xyz.

The script is in this gist:

https://gist.github.com/paulohrpinheiro/20130e06355fc5bffe5865ce903dce63

About

Blog Generator - my own static site generator

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp