Skip to content

Latest commit

 

History

History
149 lines (107 loc) · 8.3 KB

README.md

File metadata and controls

149 lines (107 loc) · 8.3 KB

bearclaw

bearclaw

a tiny static site generator, written in Go

donuts-are-good's followers donuts-are-good's stars donuts-are-good's visitors

Thanks to the supporters of this repo

Below are the people who've starred this repo. Without them it'd still get done, but with a bit less clapping ;)

(supporter grid generated with donuts-are-good/starchart )

donuts-are-good insolitum mpldr ramenbased qbit horvski ZinRicky ralgozino MattDemers jgbrwn TakenMC kondanna luigibarbato zamicol TheShuckduck tkersey itwars iamcais f1729 frankalicious roberthodapp simulationguest RodrigoHahn Apreche zubayrrr mrjk05 vorons roycifer

what's a static site generator

a static site is a site with no fancy clicky things, signups, comments, just plain html. writing a raw html page for your blog makes it load very fast, but there's a lot of typing involved when designing it. markdown is a simpler and faster way to write pages, and bearclaw converts those markdown files to html for you, with your style template.

no node-modules, no react, no fancy stuff or cool emojis. it just works.

how do we use it?

bearclaw can be run on-demand, or it can rebuild automatically when it sees changes. there are 3 folders in the basic install: markdown, output, and templates. there is an optional 4th folder after v1.2.0 for plugins.

  • markdown - all your new posts go here
  • output - bearclaw puts your html and rss here
  • templates - header.html and footer.html
  • plugins (optional) - extra features for your page

How to init a bearclaw

As of bearclaw 1.2.0alpha

Linux

First, download the bearclaw executable

then create a folder:

cd your_bearclaw_folder

either have the bearclaw executable in that folder, or set it up in your $PATH, to be able to call ./bearclaw from any folder. Either way, run the command once to generate the folder structure: :

./bearclaw

and you get:

your_bearclaw_folder
├── markdown
├── output
│   ├── about.html
│   └── posts.html
├── plugins
└── templates

that's it! point your webserver at output or handle it however is best for your case.

tip: you can run ./bearclaw and it will run once, or you can use ./bearclaw --watch to watch the current folder for changes.

plugins

bearclaw supports plugins. plugins should be added to the plugins folder.

To call a plugin in your markdown or html pages, use an html comment like this:

<!-- plugin "./plugins/myCoolPlugin/comments.html" -->

bearclaw will swap the comment for the contents of the plugin file at the specified path.

Example

MyBlogPost.md

# My title

Some text ...

<!-- plugin "./plugins/myCoolPlugin/draft.html" -->

with plugins/draft.html

<div id="draft">
  <h4>Draft in Progress</
</div>
<hr id="draft-hr" />

enables for example to add an html element that can be targeted specifically with CSS for special styling. You could also inject javascript, all sorts of content that bearclaw does not support natively.

issues

if you run in to issues, there's a short bug report form you can fill out, or you can contribute with a pull-request.

screenshot

image

greetz

the Dozens, code-cartel, offtopic-gophers, the garrison, and the monster beverage company.

license

this code uses the MIT license, not that anybody cares. If you don't know, then don't sweat it.

made with ☕ by 🍩 😋 donuts-are-good

donate

If you would like to be an official energy drink sponsor of this project, you can contribute however you like.

Bitcoin: bc1qg72tguntckez8qy2xy4rqvksfn3qwt2an8df2n

Monero: 42eCCGcwz5veoys3Hx4kEDQB2BXBWimo9fk3djZWnQHSSfnyY2uSf5iL9BBJR5EnM7PeHRMFJD5BD6TRYqaTpGp2QnsQNgC

😆👏 Thanks