1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>staticmd | Casey DeLorme's Portfolio / caseydelorme.com</title>
- <link rel="icon" type="image/x-icon" href="https://d2xxklvztqk0jd.cloudfront.net/favicon.ico" />
- <link rel="stylesheet" type="text/css" href="/css/main.css#599d5a6">
- </head>
- <body>
- <header>
- <a href='/'><h1>Casey DeLorme</h1></a>
-
- <nav>
- <ul>
- <li><a href='/projects'>projects</a></li>
- <li><a href='/blog'>blog</a></li>
- <li><a href='resume.html'>resume</a></li>
- </ul>
- </nav>
-
- </header>
- <div class="content group">
- <h1><a href="https://github.com/cdelorme/staticmd">staticmd</a></h1>
- <p>I looked at some alternatives such as <a href="http://harpjs.com/">harpjs</a> and <a href="http://gohugo.io/">hugo</a>, and while both of them are fantastic tools, I wanted something much more basic.</p>
- <p>I feel that the moment the content for a website has the need for configuration files, you are no longer building a basic static site but a dynamic site with a print release system. While there is nothing inherently wrong with this approach, it seems overkill for a number of projects I’d like to build.</p>
- <p>My goal with this code was not just a basic static site generator, but the ability to compile many files into a single <em>“book”</em>. Ideally the ability to do so using a single template file, and with nothing more complicated than a handful of variables inside it.</p>
- <h2>design considerations</h2>
- <p>The code needed two paths, one for making a single page book, and one for making a multi page site. There also needed to be a split in the path for multi page generation that allowed for relative paths, so it could be used/accessed like locally generated documentation.</p>
- <p>I was also creating this as a <a href="https://www.youtube.com/watch?v=gsPabU09FFM">work-project</a>, and had a deadline to meet. So I dropped some of the objectives from the original design, such as multiple index support, and some of the navigation logic was changed when I looked at how some others were doing it, like <a href="http://stevelosh.com/">Steve Losh</a>.</p>
- <h2>future plans</h2>
- <p>I have a few things I’d like to refactor, features to add, and components to rebuild:</p>
- <ul>
- <li>moving the core logic to a separate library, and making a <code>staticmd-cli</code> repository</li>
- <li>rewriting the index generator for single page and multiple page more intelligently</li>
- <li>revisit and cleanup the process of building list of files, and filters</li>
- <li>addition of optional configuration file support</li>
- </ul>
- <p>The core of the system which currently accepts cli inputs could be adjusted such that the cli logic is independent. This would allow me to, in the future, create a graphical interface version (ex. <code>staticmd-sdl</code>). It’s something I’ve experimented with in my <a href="level6.html"><code>level6</code> project</a>.</p>
- <p>I have several concerns with the current implementation that generates indexes or table-of-contents. For the single page code I never created a means to sort the contents (it assumes file system order which should be alphabetical). This also means the title of the section, which should point to the index, is not a link because the order it lists the content is not controlled (linking would potentially put you in the middle of that sub-section of content). The multi page index generation currently has to go through extra rounds when using relative links, and like before control over order is only by name. Ideally I want to be able to sort via folders-first for multi-page generation, and some alternative for single-page that allows more control over the order. Fixing how the content builds when using single page such that index contents are the first loaded in sub-sections, and being able to link to them would be ideal.</p>
- <p>I want to revisit and cleanup how I create the list of files, folders, and apply filters such as the accepted markdown file types, or which paths to ignore. Right now the code and the way the logic is split does not feel efficient. I’d like to make it more readable, without killing performance.</p>
- <p>While my original concept was to avoid configuration files, I am seeing where the need arises. If filtered paths, accepted file types, and a bunch of other properties become flagged options, the command to insert all of this becomes just as complicated as a configuration file. I would like to do what I can to allow configuration file support, with flags for the same set of options, and fallback to a set of <em>sane</em> default values otherwise.</p>
- <h2>references</h2>
- <p>I’ve been fond of reading about game development lately, and came across <a href="http://gameprogrammingpatterns.com/">gameprogrammingpatterns.com/</a>, which was written using markdown. This is primarily because the best practices we use in our field today so greatly conflict with game developments version of best practices where performance far outweighs the value of things like object-oriented-design.</p>
- <p>Another great resource I found was <a href="http://www.golang-book.com/">the golang book</a>, which is also written in markdown. I find great beauty in the simplest of aesthetics, and this is a perfect example of that.</p>
- </div>
- <footer>
- <a href='https://www.facebook.com/CaseyRDeLorme' class='link facebook'></a>
- <a href='https://www.linkedin.com/in/cdelorme' class='link linkedin'></a>
- <a href='https://www.youtube.com/user/LordOfElm' class='link youtube'></a>
- <a href='https://github.com/cdelorme' class='link github'></a>
- <a href='skype:casey.delorme?chat' class='link skype'></a>
- <div class="scripts">
- <script type="text/javascript" src="/js/main.js#599d5a6" async></script>
- </div>
- </footer>
- </body>
- </html>
|