add disqus shortcode and support comments section. Support hiding sections, navbar items

master
David Kebler 2017-03-30 16:09:00 -07:00
parent 64ee07f7c3
commit 56ccec99c7
7 changed files with 33 additions and 16 deletions

View File

@ -7,7 +7,6 @@
{{ partial "hero.html" . }} {{ partial "hero.html" . }}
{{ partial "sections.html" . }} {{ partial "sections.html" . }}
</main> </main>
{{ if .Site.DisqusShortname }} {{ partial "disqus.html" . }} {{ end }}
{{ partial "js.html" . }} {{ partial "js.html" . }}
</body> </body>
</html> </html>

View File

@ -180,6 +180,13 @@
} }
{{ end }} {{ end }}
{{ with .comments }}
.section--comments {
color: {{ .color }};
background-color: {{ .bg_color }};
}
{{ end }}
{{ end }} /* end sections */ {{ end }} /* end sections */
{{ with .buttons }} {{ with .buttons }}

View File

@ -7,17 +7,16 @@
</div> </div>
<!-- <nav class="nav-bar__menu-off"> --> <!-- <nav class="nav-bar__menu-off"> -->
<ul class="nav-bar__menu hide-menu"> <ul class="nav-bar__menu hide-menu">
{{ range .Data.Pages }} {{ if ne .File.BaseFileName "footer"}} {{ range .Data.Pages }}
{{ if ne .Params.navbar false }}
{{ if ne .Params.hidden true }}
<li class="nav-bar__menu-item"> <li class="nav-bar__menu-item">
<a href="#{{ .File.BaseFileName }}"> <a href="#{{ .File.BaseFileName }}">
{{ if isset .Params "link_text" }} {{ .Params.link_text | default .Title }}
{{ index .Params "link_text" }}
{{ else }}
{{ index .Title }}
{{ end }}
</a> </a>
</li> </li>
{{ end }} {{ end }} {{ end }} {{ end }}
{{ end }}
</ul> </ul>
<!-- </nav> --> <!-- </nav> -->
<!-- </div> --> <!-- </div> -->

View File

@ -1,6 +1,7 @@
<!-- Renders Section Based on Content --> <!-- Renders Section Based on Content -->
{{ $parity := "odd" }} {{ range $i, $e := .Data.Pages }} {{ $parity := "odd" }} {{ range $i, $e := .Data.Pages }}
<section id="{{ .File.BaseFileName }}" class="section section--{{ .File.BaseFileName }} {{ if ne .File.BaseFileName "footer" }} section--{{ if modBool $i 2 }}odd{{ else }}even{{ end }} {{ end }}"> {{ if ne .Params.hidden true }}
<section id="{{ .File.BaseFileName }}" class="section section--{{ .File.BaseFileName }} section--{{ if modBool $i 2 }}odd{{ else }}even{{ end }}">
<div class="section__container"> <div class="section__container">
<div class="section__headline section__headline--{{ .File.BaseFileName }}"> <div class="section__headline section__headline--{{ .File.BaseFileName }}">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
@ -11,3 +12,4 @@
</div> </div>
</section> </section>
{{ end }} {{ end }}
{{ end }}

View File

@ -1,19 +1,25 @@
<div id="disqus_thread"></div> <div class="box box--disqus">
<div id="disqus_thread" class="box__embed box__embed--disqus">
</div>
</div>
<script type="text/javascript"> <script type="text/javascript">
(function() { (function() {
// Don't ever inject Disqus on localhost--it creates unwanted // Don't ever inject Disqus on localhost--it creates unwanted
// discussions from 'localhost:1313' on your Disqus account... // discussions from 'localhost:1313' on your Disqus account...
if (window.location.hostname == "localhost") // if (window.location.hostname == "localhost")
return; // return;
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
var disqus_shortname = '{{ .Site.DisqusShortname }}'; var disqus_shortname = '{{ .Get 0 | default .Site.DisqusShortname }}';
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})(); })();
</script> </script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> <a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

View File

@ -17,7 +17,7 @@ A **complete** theme in a repo that's especially useful for **noobs** who just w
**Goal:** Create a mobile first responsive flexbox based Hugo landing page theme including shortcodes that would allow a noob to generate a customized landing page by only knowing a little markdown. Provide a starter repo to make it easy to create one's own landing page in a few minutes **Goal:** Create a mobile first responsive flexbox based Hugo landing page theme including shortcodes that would allow a noob to generate a customized landing page by only knowing a little markdown. Provide a starter repo to make it easy to create one's own landing page in a few minutes
**Further Goal:** Add automated deployment to github pages, S3 bucket or any server using ssh. My other project [4S](https://github.com/dkebler/4S) can do this it just needs to be intregate. Also want to automate building photo galleries. Currently this is done with [Thumbsup](https://github.com/thumbsup/thumbsup) and the generated code is made into a shortcode and the generated thumbs and images added to the project manually. **Further Goal:** Add automated (via nodejs) deployment to github pages, S3 bucket or any server using ssh. My other project [4S](https://github.com/dkebler/4S) can do this it just needs to be intregated. Also want to automate building photo galleries. Currently this is done with [Thumbsup](https://github.com/thumbsup/thumbsup) and the generated code is made into a shortcode and the generated thumbs and images added to the project manually. Also add in code minification and optimazation for production/distribution builds
**Ultimiate Goal:** Put together a noob virtualbox VM with all the tools (e.g. atom, smartgit, hugo, node, etc.) and code installed and configured and ready to go. Fire up the VM and you're instantly productive. **Ultimiate Goal:** Put together a noob virtualbox VM with all the tools (e.g. atom, smartgit, hugo, node, etc.) and code installed and configured and ready to go. Fire up the VM and you're instantly productive.

View File

@ -123,7 +123,6 @@ img.avatar {
} }
.box__embed { .box__embed {
/*height: 100vh;*/
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -132,6 +131,11 @@ img.avatar {
align-items: center; align-items: center;
} }
.box__embed--disqus {
width: 90vw;
max-width: 800px;
}
.box__contact-info > * { .box__contact-info > * {
padding: 0.1em; padding: 0.1em;