Commit 54fd2d6d authored by John's avatar John

Site updated: 2018-04-27 18:45:12

parent ec01e29a
......@@ -13,7 +13,7 @@
<meta property="og:site_name" content="TheBestJohn">
<meta property="og:description" content="Recently I’ve become disillusioned with most CMS options. They’re a pain to keep updated, plugins are constantly being abandoned, and they’re so prevalent in sites that they make a very attractive tar">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2018-04-27T16:49:33.983Z">
<meta property="og:updated_time" content="2018-04-27T18:44:41.920Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Static Site what?!">
<meta name="twitter:description" content="Recently I’ve become disillusioned with most CMS options. They’re a pain to keep updated, plugins are constantly being abandoned, and they’re so prevalent in sites that they make a very attractive tar">
......@@ -137,6 +137,7 @@
<h4 id="But-why"><a href="#But-why" class="headerlink" title="But, why?"></a>But, why?</h4><p>The idea is that <em>most</em> sites don’t actually need to use dynamic code. Their content is, for the most, part static. Users aren’t interacting with the content (other than the comments sections and forms but we’ll talk about that later). They are, instead, just reading it. The only person who seems to be interacting with it is the person that owns the site. Even then, the owner isn’t actively interacting. They are writing a post, or updating a page. After that, everything stays the same.</p>
<h3 id="Enter-Hexo"><a href="#Enter-Hexo" class="headerlink" title="Enter, Hexo"></a>Enter, <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a></h3><p>Hexo is a neat little package. </p>
<p>Originally I thought I would install it, set up an apache virtual reverse proxy via an <code>.htaccess</code> file and let node serve static files. Some people do this. It’s a valid way to serve a site. The problem that I have with this, is that it’s just another vulnerable layer of code that I don’t have the inclination to audit. It could potentially have glaring security holes and I wouldn’t know. Again, I want to clarify that I don’t know much of anything about security. I’m not a cryptographer, nor an expert on cyber security. However, I can easily read the html that comes out the other end of the site generator and verify that there are no well-known issues with the javascript or html.</p>
<p>If this is the way you wanted to do it, you would need, at the very least, this sort of <code>.htaccess</code> configuration in your root<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">RewriteEngine On</span><br><span class="line">DirectoryIndex index.html </span><br><span class="line">RewriteRule ^$ http://127.0.0.1:4000 [P,L]</span><br><span class="line">RewriteCond %&#123;REQUEST_FILENAME&#125; !-f</span><br><span class="line">RewriteCond %&#123;REQUEST_FILENAME&#125; !-d</span><br><span class="line">RewriteRule ^(.*)$ http://127.0.0.1:4000/$1 [P,L]</span><br></pre></td></tr></table></figure></p>
<p>So what to do? Well, the output is a fully static html/css/js site. No need for node, no need for a reverse proxy. This will just work when popped into a public directory of a webserver.</p>
<a href="/posts/setting-up-hexo-auto-deploy-from-gitlab/" title="getting that set up">getting that set up</a>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment