obedm503 / bootmark

markdown + bootstrap as a jQuery plugin
https://obedm503.github.io/bootmark/
MIT License
21 stars 4 forks source link

[Thought] Using bootmark as static gen #24

Closed kskarthik closed 7 years ago

kskarthik commented 7 years ago

I like this plugin !

I am not a heavy blogger but I need a blog for my site just for occasional blogging. Since bootmark is client side library, is there a possibility of using it for blog posts?

My plan:

  1. Place all .md files in posts directory
  2. A blog page with bootmark.js loaded

Bootmark should load all .md files and list them as links to article named after # tag In the respective md file. On click they open as $title.html

Any possibilities ?

obedm503 commented 7 years ago

as much as I love bootmark I don't think it is the right tool for this scenario. If you want a real static site gen you should check https://www.staticgen.com/. I ended up using Jekyll because it is supported by GitHub Pages for the blog at https://obedm503.github.io/

With that out of the way, I'm sure this could be accomplished... sort of. Bootmark being a client side lib, all the rendering would still happen in the client. You could have common configuration for all the pages

// config.js
$.fn.bootmark.config = { /* ... config object ... */ };
<!-- template.html -->
<!doctype html>
<html>
  <head>
    <script src="bootmark.bundle.min.js"></script>
    <script src="config.js"></script>
    <title>
      <!-- inject the title some -->
    </title>
  </head>
  <body>
<bootmark>
<!--
inject your markdown here somehow
-->  
</bootmark>
  </body>
</html>

this would achieve some form of partial rendering, but still not quite as good as a static gen. This is what came to mind. I'll keep the issue open for further discussion.

You should know that showdown also works in nodejs, so you could create a script that takes the folder with markdown files and produces the folder with rendered html files. But do we actually need another static generator?

kskarthik commented 7 years ago

I too thought of Jekyll but I get error installing gems for themes & too much for an occasional blogger like me. I'm learning Hugo.

obedm503 commented 7 years ago

closing but feel free to keep the discussion going

kskarthik commented 7 years ago

Sure!

oupala commented 6 years ago

Not going as far as a blog engine, bootmark could be used for a small website just as MDwiki (which is no longer maintained, the repository has been archived).

As you can see in MDwiki, it only uses a config file, and a mardown file to set the navigation menu, that's all!

Maybe bootmark could add tthis feature seamlessly...