|
@@ -5,30 +5,23 @@
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="">
|
|
<meta name="description" content="">
|
|
- <title>staticmd | Casey DeLorme's Portfolio / caseydelorme.com</title>
|
|
|
|
|
|
+ <title>smd | Casey DeLorme's Portfolio / caseydelorme.com</title>
|
|
<link rel="icon" type="image/x-icon" href="https://d2xxklvztqk0jd.cloudfront.net/favicon.ico" />
|
|
<link rel="icon" type="image/x-icon" href="https://d2xxklvztqk0jd.cloudfront.net/favicon.ico" />
|
|
- <link rel="stylesheet" type="text/css" href="/css/main.css#2df346a">
|
|
|
|
|
|
+ <link rel="stylesheet" type="text/css" href="/css/main.css#9682a1d">
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
<header class="group">
|
|
<header class="group">
|
|
<h1><a href='/'>Casey DeLorme</a></h1>
|
|
<h1><a href='/'>Casey DeLorme</a></h1>
|
|
-
|
|
|
|
<nav>
|
|
<nav>
|
|
<ul>
|
|
<ul>
|
|
-
|
|
|
|
- <li><a href='/index.html'>index</a></li>
|
|
|
|
-
|
|
|
|
- <li><a href='/projects/'>projects</a></li>
|
|
|
|
-
|
|
|
|
- <li><a href='/resume.html'>resume</a></li>
|
|
|
|
-
|
|
|
|
|
|
+ <li><a href="/projects">Projects</a></li>
|
|
|
|
+ <li><a href="/resume.html">Resume</a></li>
|
|
</ul>
|
|
</ul>
|
|
</nav>
|
|
</nav>
|
|
-
|
|
|
|
</header>
|
|
</header>
|
|
|
|
|
|
<div class="content group">
|
|
<div class="content group">
|
|
- <h1><a href="https://github.com/cdelorme/staticmd">staticmd</a></h1>
|
|
|
|
|
|
+ <h3><a href="https://github.com/cdelorme/static/tree/master/cmd/smd">static / smd</a></h3>
|
|
|
|
|
|
<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 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>
|
|
|
|
|
|
@@ -36,38 +29,33 @@
|
|
|
|
|
|
<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>
|
|
<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>
|
|
|
|
|
|
+<h4>design considerations</h4>
|
|
|
|
|
|
<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>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>
|
|
<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>As I learned more about go, I made many changes, including separating the command from the package, and overall the layout and naming sense.</p>
|
|
|
|
|
|
-<p>I have a few things I’d like to refactor, features to add, and components to rebuild:</p>
|
|
|
|
|
|
+<p>I also removed some features, like navigation which was too complicated to be useful in a generic sense, and relative paths which were meaningless when markdown itself is readable.</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>
|
|
|
|
|
|
+<h4>future plans</h4>
|
|
|
|
|
|
-<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>At this point I have no further plans to modify or refactor the code.</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>One beneficial change might be to add stat logic to get the modified time of a file and compare it to the output file. This would allow me to only replace modified files, which could reduce the overall load of execution when running in web mode.</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>Another option is exposing the package-global list and allowing replacement or additional file extensions to be supported.</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>
|
|
|
|
|
|
+<p><em>However, I am considering moving to hugo instead for a variety of reasons.</em> That would make any additional effort here quite wasteful.</p>
|
|
|
|
|
|
-<h2>references</h2>
|
|
|
|
|
|
+<h4>references</h4>
|
|
|
|
|
|
<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>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>
|
|
<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>
|
|
|
|
|
|
-<h5><em>written on 2014-12-22</em></h5>
|
|
|
|
|
|
+<p><strong><em>updated on 2017-04-13</em></strong></p>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -78,7 +66,7 @@
|
|
<a href='https://github.com/cdelorme' class='link github'></a>
|
|
<a href='https://github.com/cdelorme' class='link github'></a>
|
|
<a href='skype:casey.delorme?chat' class='link skype'></a>
|
|
<a href='skype:casey.delorme?chat' class='link skype'></a>
|
|
<div class="scripts">
|
|
<div class="scripts">
|
|
- <script type="text/javascript" src="/js/main.js#2df346a" async></script>
|
|
|
|
|
|
+ <script type="text/javascript" src="/js/main.js#9682a1d" async></script>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</footer>
|
|
|
|
|