Giter VIP home page Giter VIP logo

hugo-swift-theme's Introduction

Swift Theme

This theme is designed for blogging purposes. Feel free to extend it for other use cases though.

At its core, it's minimalistic; it doesn't rely on monolithic libraries such e.g jquery, bootstrap. Instead, it uses grid css, flexbox & vanilla js to facilitate the features outlined below:

Hugo Swift Theme

Features

  • Blog
  • Pagination
  • Deeplinks
  • Dark Mode
  • Syntax Highlighting
  • Gallery Support
  • Native lazy loading of images
  • Staticman

Prerequisites

This theme uses sass. Ensure you have the extended version of hugo installed or in your pipeline.

Installation

Add this theme as a Git submodule inside your Hugo site folder:

git submodule add https://github.com/onweru/hugo-swift-theme.git themes/hugo-swift-theme

Configuration

You can configure the site using as follows:

  1. Global Settings & Staticman

    Use the file hugo.toml.

  2. menu, footer

    See the hugo.toml file's menu areas.

    Follow the exampleSite/.

  3. Customize Theme colors You can do so easily in the variables sass partial. Use names (e.g red, blue, darkgoldenrod), rgb, rgba, hsla or hex values.

Staticman Comments

By default, Staticman comments are disabled. To enable them, you may refer to the Staticman config Wiki.

Written By Block

How do I include a written by ?

  1. Copy this authors yaml file from the exampleSite into your sites ./data directory.
  [[params.authors]]
    name = "yourName" # if fullName ๐Ÿ‘‡๐Ÿป isn't set, name will be displayed on author card
    fullName = "Your Full Name" # optional. If set, it will display on author card
    bio = "It's time to flex. Write a short or not-so-short summary about yourself."
    photo = "myPhotoFile.jpg"
    url = "https://myURLofChoice.domain"
  1. Specify the name in your content files
...
author: "yourName" # case sensitive. must match the name value in your saved data 
...

What if I want to exclude the written by from some articles?

Don't include an author in your article front matter.

The [[.Params.authors]] interface in the hugo.toml file helps you:

  1. Write all your author information in one place. This way, you only specify the author name on your content files (posts). The rest of the data i.e photo, url & bio are automatically pulled from the data file.

  2. In certain situations, you may have different people publishing articles on your blog. For example, you could have someone guest blog. Or may be you have a blog co-author.

Deeplinks

For all content published using markdown, deeplinks will be added to the pages so that you can share with precision ๐Ÿ˜ƒ Just hover on a heading and the link button will pop. Click it to copy.

Dark Mode

Today most operating systems & browsers support dark mode. Like twitter, which automatically turns into dark mode when the user chooses darkmode, this theme does the same thing.

Dark Mode

Custom Shortcodes

This theme ships with two custom shortcodes (they both use positional parameters):

  1. Video This shortcode can be used to embed a youtube video with custom styling. It takes a solo positional parameter.

    ...
    {{< video "youtubeVideoID" >}}
    ...
    
  2. Picture You want to use darkmode images when darkmode is enabled on a device and a regular image on lightmode? It takes 3 positional parameters

    Store these images in the static/images directory.

    ...
    {{< picture "lightModeImage.png" "darkModeImage.png" "Image alt text" >}}
    ...
    
  3. Gallery Include inline galleries within your articles. These galleries can contain N number of images. It takes 2 positional parameters.

    The 1st parameter is required. It's a comma-separated list (,) of your images' paths.

    The 2nd parameter is optional. It's a double-collon-separated list (::) of your images' alt/description/captions text. It's always a good SEO practice to include alt text for your images.

    ...
    {{< gallery "image1Path.png,image3Path.webp,image4Path.jpg" "A PNG gallery image::A WEBP gallery image::A JPEG gallery image" >}}
    ...
    

    For legibility, you can include a space after the delimiters , & ::

License

The code is available under the MIT license.

hugo-swift-theme's People

Contributors

coliff avatar danielbronk avatar gaprogman avatar onweru avatar pablodiazgutierrez avatar ratheshprabakar avatar s-azizoglu avatar vincenttam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hugo-swift-theme's Issues

Tags pages not working

Tag pages should be automatically generated, showing articles with the same tag (ie: if I go to /tags/development I should see all posts tagged development)

Tag pages show all articles, without any filtering by tag

Here's a video showing the problem (note that I have modified the theme quite a bit): https://streamable.com/8spw7x

remove all references to staticman endpoints that are affected by quotas

It is now obvious that the public instance of staticman is broken, and will probably stay that way indefinitely.

It would then make sense to remove any reference to that endpoint. Why? It's misleading as an option, since it doesn't work anyway. This is also true for all links that point to the dated staticman docs. It doesn't matter if some sections of those docs work if as a whole, they don't get the job done.

As a courtesy to users, it would be immensely helpful to only document options that actually work. Is it possible to document a concise guide so that one doesn't have to get lost in the weeds (issue threads and fractured documentation pages)? .

What we have at the moment reads like this is the default option but it doesn't work, but you can try it.

In hind sight, this ๐Ÿ‘‡ too needs to be removed. Why? At this point, these information is another turn deeper into the annoying rabbit ๐Ÿ‡ hole.

โ„น๏ธ This Binary Mist article could also be quite helpful :)
โ„น๏ธ By default, this theme uses the official production instance at v3 instead of v2 due to a requests' quota issue reported in issue eduardoboucas/staticman#222.
โš ๏ธ Since Staticman is an evolving project, things might work differently than they do at the moment of this writing.

We need to rethink the staticman section because as it is, it utterly frustrating to anyone looking to get up and running quickly.

Maybe we could even extract it to a dedicated documentation page(s), with procedures that work. All other references could then be linked as footnotes.

Staticman comment display error

Steps to reproduce the error:

  1. git fetch upstream master
  2. git checkout upstream/master
  3. Edit config.toml and set staticman to true
  4. cd exampleSite and hugo serve --themesDir=../..

Error obtained:

Building sites โ€ฆ WARN 2019/05/19 10:13:33 Data for key 'name' in path 'hugo-swift-theme/designer.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:13:33 Data for key 'url' in path 'hugo-swift-theme/designer.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:13:33 The []interface {} data from 'hugo-swift-theme/menu.yml' overridden by higher precedence []interface {} data already in the data tree
WARN 2019/05/19 10:13:33 Data for key 'branch' in path 'hugo-swift-theme/staticman.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:13:33 Data for key 'username' in path 'hugo-swift-theme/staticman.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:13:33 Data for key 'repository' in path 'hugo-swift-theme/staticman.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:13:33 Data for key 'endpoint' in path 'hugo-swift-theme/staticman.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:13:33 Page's .URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url.
ERROR 2019/05/19 10:13:33 render of "page" failed: execute of template failed: template: _default/single.html:19:44: executing "main" at <partial "comments.html" .>: error calling partial: "/home/vin100/hugo-swift-theme/layouts/partials/comments.html:3:18": execute of template failed: template: partials/comments.html:3:18: executing "partials/comments.html" at <readDir "data/comments">: error calling readDir: failed to read directory "data/comments": open /home/vin100/hugo-swift-theme/exampleSite/data/comments: no such file or directory
ERROR 2019/05/19 10:13:33 render of "page" failed: execute of template failed: template: _default/single.html:19:44: executing "main" at <partial "comments.html" .>: error calling partial: "/home/vin100/hugo-swift-theme/layouts/partials/comments.html:3:18": execute of template failed: template: partials/comments.html:3:18: executing "partials/comments.html" at <readDir "data/comments">: error calling readDir: failed to read directory "data/comments": open /home/vin100/hugo-swift-theme/exampleSite/data/comments: no such file or directory
ERROR 2019/05/19 10:13:33 render of "page" failed: execute of template failed: template: _default/single.html:19:44: executing "main" at <partial "comments.html" .>: error calling partial: "/home/vin100/hugo-swift-theme/layouts/partials/comments.html:3:18": execute of template failed: template: partials/comments.html:3:18: executing "partials/comments.html" at <readDir "data/comments">: error calling readDir: failed to read directory "data/comments": open /home/vin100/hugo-swift-theme/exampleSite/data/comments: no such file or directory
ERROR 2019/05/19 10:13:33 render of "page" failed: execute of template failed: template: _default/single.html:19:44: executing "main" at <partial "comments.html" .>: error calling partial: "/home/vin100/hugo-swift-theme/layouts/partials/comments.html:3:18": execute of template failed: template: partials/comments.html:3:18: executing "partials/comments.html" at <readDir "data/comments">: error calling readDir: failed to read directory "data/comments": open /home/vin100/hugo-swift-theme/exampleSite/data/comments: no such file or directory
Total in 50 ms
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:19:44: executing "main" at <partial "comments.html" .>: error calling partial: "/home/vin100/hugo-swift-theme/layouts/partials/comments.html:3:18": execute of template failed: template: partials/comments.html:3:18: executing "partials/comments.html" at <readDir "data/comments">: error calling readDir: failed to read directory "data/comments": open /home/vin100/hugo-swift-theme/exampleSite/data/comments: no such file or directory

Cause for this error: newly created site has no comments, so the readDir in your layout/partials/comments.html throws an error. You may take, for example, a look at Beautiful Hugo's partial layout to solve this problem.

Deep links null target

Screenshot from 2019-08-13 10-11-07
Screenshot from 2019-08-13 10-11-23

(function copyHeadingLink() {
let deeplinks = document.querySelectorAll;
let deeplink = 'link';
if(deeplinks) {
document.body.addEventListener('click', function(event)
{
let target = event.target;
if (target.classList.contains(deeplink) || target.parentNode.classList.contains(deeplink)) {
event.preventDefault();
let newLink = target.href != undefined ? target.href : target.parentNode.href;
copyToClipboard(newLink);
}
});
}
})();

Should the existence of target be checked first, like this?

// Get the element, add a click listener...
document.getElementById("parent-list").addEventListener("click", function(e) {
	// e.target is the clicked element!
	// If it was a list item
	if(e.target && e.target.nodeName == "LI") {
		// List item found!  Output the ID!
		console.log("List item ", e.target.id.replace("post-", ""), " was clicked!");
	}
});

source: https://davidwalsh.name/event-delegate

TOCSS: failed

TOCSS: failed to transform "main.sass" (text/x-sass): this feature is not available in your current Hugo version.
i use hugo v0.59.1

Author block not working

Repro:

  1. Copy data.authors.yaml to data folder
  2. add author: "yourName" to a post
  3. rebuild

Expected:
Default author block appears in post
Actual:
No author block in post

Versions:
Hugo 0.67.1
Swift 0.42

4th Page in navigator not working

Hi, in the pagination sector, the 4th button is greyed out and the button doesn't work. However, the next page button is working as expected. Here's the screenshot:

image

Sine wave display problem

Steps to reproduce

  1. Click on the demo link shown on the top of this repo with Firefox.
  2. Observe the error described in the title.

Screenshot

Firefox recording of this theme

Expected behavior

expected

Versions concerned

  • OS: Ubuntu 18.04
  • Browser: Firefox 68.0.1 (64-bit)

๐Ÿค” I think this might concern Firefox on other platforms as well.

[Bug?] Lack of integrity

<link rel = 'stylesheet' href = '{{ $styles.Permalink }}' integrity = '{{ $styles.Data.Integrity }}'>

The above line is supposed to show the integrity of the main CSS. Nonetheless, in the HTML source of the generated page on the official demo https://neuralvibes.com/, the integrity is left blank. Is it the intended behaviour?

I'm using Xubuntu 18.04 Firefox and qutebrowser, but I suppose that this is cross-platform.

Site name display problem

The background of the site header overlaps with the site name at the top left-hand corner if the site name is too long.

Screenshot_2019-06-04 Swift + Staticman + Framagit
Sample screenshot illustrating the error.

Add a dev branch

Hi, guys! I just found something terrible! I cloned a development version of your theme because that's the only version!

May I suggest you to use a separated branch to distribute?

Thank you for your attention!

Post excerpt size issue

This is what the post looks like on a new installation:

image

Excerpt is in the center of the page (should be ideally on the left) and is not 100% width.

Staticman instructions

Hi, this is the maintainer of @staticmanlab, a public GitLab instance of Staticman API.

In README, it's written

Then proceed to setup staticman in staticman.yml. See the example site and the staticman docs for reference.

According to the documentation, Staticman can only recognise root-level staticman.yml. Nonetheless, in the example site, you've put staticman.yml under the folder /data, and these settings are referenced in the layouts {{ .Site.Data.staticman }}. It would be nice if you make the role of these config files clear. Btw, Staticman's settings have to be split into two files:

  1. repo config: the path must be /staticman.yml
  2. site config: usually /config.toml, but it can be elsewhere.

youtube video instead image

Hi, there are some way to substitute the cover image with youtube video code on the main site and into the post?

image

thanks in advance,

[Feature request] i18n support

While I'm adding i18n translation strings, I would like your help, @onweru. Where're the English UI strings located? I can only find two with git grep:

  1. "Designed by"
  2. "Share story"

Are there more English UI strings in the theme? (Not counting those in the user-defined config file) Your answer will help me set up the i18n framework, so that users can upload translations for other languages.

Compilation warning: Data for key .... overridden ...

Steps to reproduce the error:

$ git remote -v
origin	[email protected]:staticman-gitlab-pages/hugo-swift-theme.git (fetch)
origin	[email protected]:staticman-gitlab-pages/hugo-swift-theme.git (push)
upstream	https://github.com/onweru/hugo-swift-theme.git (fetch)
upstream	https://github.com/onweru/hugo-swift-theme.git (push)
$ git fetch upstream master
$ git checkout upstream/master
$ hugo --themesDir=../.. -d ../public
Building sites โ€ฆ WARN 2019/05/19 10:06:43 Data for key 'name' in path 'hugo-swift-theme/designer.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:06:43 Data for key 'url' in path 'hugo-swift-theme/designer.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:06:43 The []interface {} data from 'hugo-swift-theme/menu.yml' overridden by higher precedence []interface {} data already in the data tree
WARN 2019/05/19 10:06:43 Data for key 'repository' in path 'hugo-swift-theme/staticman.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:06:43 Data for key 'endpoint' in path 'hugo-swift-theme/staticman.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:06:43 Data for key 'branch' in path 'hugo-swift-theme/staticman.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:06:43 Data for key 'username' in path 'hugo-swift-theme/staticman.yml' is overridden by higher precedence data already in the data tree
WARN 2019/05/19 10:06:43 Page's .URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url.

                   | EN  
+------------------+----+
  Pages            | 30  
  Paginator pages  |  2  
  Non-page files   |  0  
  Static files     | 37  
  Processed images |  0  
  Aliases          | 12  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 266 ms

Link sharing issue

In any number of pages, when we copy post's links with "Share Story" button, it copies current page's link, not the directed post's link.

Bullets in list don't show up

Code:

This is a list
  - A
  - B

Result is in the attached figure.
I tried with indentation set to 4 spaces, but in that case it produces a black block of code (which is also very strange, imho).
I tried without indentation too, and the result is the same

Screenshot from 2019-10-02 11-23-14

Modal close button doesn't work

The line containsClass(body, show) ? closeModal() : false; is only executed once on page load. In that process, the conditional is evaluated to false, so the closeModal() is never called.

form ? handleForm(form) : false;
function closeModal() {
elem('.modal_close').addEventListener('click', function () {
deleteClass(body, show);
deleteClass(form, loading);
deleteClass(form, open);
deleteClass(button, toggled);
});
}
containsClass(body, show) ? closeModal() : false;
function showModal(title, message) {
elem('.modal_title').textContent = title;
elem('.modal_text').innerHTML = message;
pushClass(body, show);
}

I'm working on the project for nested comments, which would add about a hundred lines into the JS. Upon its release, the problem would be fixed. I'm leaving an issue here for record.

Hidden page option

I would like to migrate from an other theme, where I use in front matter the hidden function to prevent it from showing up between the other posts, just want it to show in my menu.
How can I hide it with this theme?
+++ title = "Contact" hidden = "true" +++

Font becomes weird when deployed

Don't know whether this is something to do with my setup or what - but when I build the site locally, the fonts work as expected. But when I deploy it via Netlify, they are somewhat changed. Here's the screenshot comparison of the differences:

This is how it appears locally:

image

And this is what appears when deployed:

image

Some more screenshots of the content:
Local:

image

Deployed:

image

Border issue in page navigator

Hi, In the bottom pagination sector, I'm seeing a weird border on the right and downside. Attaching a picture for your reference:

image

Since the pagination sector is never going to be scrollable, can anything be done to get rid of these borders?

Pager numbers not advancing beyond 4

Assumes more than 4 pages
REPRO:

  • Click 4 in pager
  • Click > button
    EXPECTED:
  • Numbered bubbles advance to 2-5
    ACTUAL:
  • Numbered bubbles remain 1-4 (but the page content does advance)

Categoreis display problem

Steps to reproduce

  1. Click on the demo link shown on the top of this repo with Firefox.
  2. View the tags page by appending "tags" to the current URL. Observe that the black heading banner retains its vertical position.
  3. Replace "tags" with "categories". The black heading banner has dropped down.

Hugo Swift Theme Banner

Expected behavior

The vertical position of the black banner remains the same.

Platform

OS: Ubuntu 18.04
Browsers: Firefox and qutebrowser

authors

hello, authors yaml file is no longer working/removed.

How to change the main page header?

I like this theme. I just want to change the main page header image.. It has this black thing and audio script .
I tried many things like adding _index.md .
That will change the title of the inner div but cannot change the picture.
I want to have my own image.

Am I missing something.?

reference wiki in README

I think the wiki will not be obvious to everyone. What if we could link/reference it from the READMe? Perhaps even avoid duplicating whatโ€™s already on the wiki in the READMe.

Adding author profile to posts

Loving the layout of the theme! I was trying to add the "Written by" block to posts, but couldn't figure out how to. I have copied authors.yml to my Data directory. What other changes do I need to do to make it work?

Staticman reply target error

The reply target name is incorrect. In this JS function, you're capturing reply target name by copying the text in the comment_name class element. That's incorrect in case of comment reply, which contains

<span> โ†ท </span><a href='#{{ .replyID }}' class='reply_target'>{{ .replyName }}</a>

function setReplyValues(trigger) {
let comment, id, name, thread;
let reply_fields = getHiddenFields();
comment = trigger.parentNode;
id = comment.id;
name = elem('.comment_name', comment);
thread = elem('.comment_thread', comment);
reply_fields.thread.value = thread.textContent;
reply_fields.id.value = id;
reply_fields.name.value = name.textContent;
reply_fields.to.textContent = name.textContent;
}

โœ”๏ธ Main comment:
<div id = '{{ ._id }}' class = 'comment'>
<img src = 'https://www.gravatar.com/avatar/{{ .email }}?s=100' alt = 'user icon' class = 'comment_pic'>
<div class = 'comment_meta'>
<a href='#{{ ._id }}'><div class = 'comment_heading pale' data-time = '{{ .date }}'></div></a>
<div class = 'comment_author comment_name'>{{ .name }}</div>
</div>
<p class = 'solo comment_bio pale'>{{ .comment | markdownify }}</p>
<div class = 'comment_thread hidden'>{{ ._id }}</div>
<div class = 'reply_btn icon'></div>

โŒ Comment reply:
<div id = '{{ ._id }}' class = 'comment comment_reply'>
<img src = 'https://www.gravatar.com/avatar/{{ .email }}?s=100' alt = 'user icon' class = 'comment_pic'>
<div class = 'comment_meta'>
<a href='#{{ ._id }}'><div class = 'comment_heading pale' data-time = '{{ .date }}'></div></a>
<div class = 'comment_author comment_name'><span class = 'comment_name_span'>{{ .name }}</span><span>ย โ†ทย </span><a href='#{{ .replyID }}' class='reply_target'>{{ .replyName }}</a></div>
</div>
<p class = 'solo comment_bio pale'>{{ .comment | markdownify }}</p>
<div class = 'comment_thread hidden'>{{ .replyThread }}</div>
<div class = 'reply_btn icon'></div>
</div>

To accurately capture the reply target name, I've created an additional wrap for main comments in my PR for nested comments.

<div class = 'comment_author comment_name'><span class = 'comment_name_span'>{{ .name }}</span></div>

I'm going to undo your removal of the inner wrap cc386c7#diff-4bc063bcdcf2e635a36bd0d8d6273ad8 so as to give accurate results.

Staticman form displayed when Staticman is disabled

The partial template layouts/comments.html is loaded unconditionally.

<div class = 'post'>
<article class='post_content'>
{{ .Content }}
<div class = 'post_extra'>
<div class = 'copy'></div>
</div>
{{ partial "author.html" . }}
</article>
{{ partial "comments.html" . }}
<aside>
<h3>Recent Posts</h3>
<ul class='flex post_aside'>
{{ $title := .Params.title }}
{{ range first 2 .Site.RegularPages }}
{{ if not (eq .Title $title) }}
{{ partial "excerpt.html" . }}
{{ end }}
{{ end }}
</ul>
</aside>
</div>

This entire partial template file has no conditional statement to stop loading the comments section in case of absence of the Staticman section in config.toml.
<h3>Comments</h3>
<div class = 'comments'>
{{ $.Scratch.Add "hasComments" 0 }}
{{ $entryId := md5 .File.Path }}
{{ if .Site.Data.comments }}
{{ range $index, $comments := (index $.Site.Data.comments $entryId ) }}
{{ $.Scratch.Add "hasComments" 1 }}
<div class = 'comment'>
<img src = 'https://www.gravatar.com/avatar/{{ .email }}?s=100' alt = 'user icon' class = 'comment_pic'>
<div class = 'comment_meta'>
<div class = 'comment_heading pale' data-time = '{{ .date }}'></div>
<div class = 'comment_author comment_name'>{{ .name }}</div>
</div>
<p class = 'solo comment_bio pale'>{{ .comment | markdownify }}</p>
</div>
{{ end }}
{{ end }}
{{ if eq ($.Scratch.Get "hasComments") 0 }}
<p>Nothing yet.</p>
{{ end }}
{{ partial "comments-form.html" . }}
<article class = 'modal'>
<div class = 'modal_inner'>
<h2 class = 'modal_title'></h2>
<div class = 'modal_text'></div>
<button class = 'modal_close'>Close</button>
</div>
</article>
</div>

{{ $vs := .Site.Params.staticman }}
<span class = 'form_toggle btn'>Comment</span>
<form method = 'POST' action = '{{ $vs.endpoint | default "https://api.staticman.net" }}/v3/entry/{{ $vs.gitProvider }}/{{ $vs.username }}/{{ $vs.repository }}/{{ $vs.branch }}/comments' class = 'form form-comments' id = 'comments-form'>
<input name = 'options[slug]' type = 'hidden' value = '{{ md5 .File.Path }}'>
{{- if $vs.reCaptcha -}}
<input name = 'options[reCaptcha][siteKey]' type = 'hidden' value = '{{ $vs.reCaptcha.siteKey }}'>
<input name = 'options[reCaptcha][secret]' type = 'hidden' value = '{{ $vs.reCaptcha.secret }}'>
{{- end -}}
<label class = 'form_label'>Name</label>
<input name = 'fields[name]' type = 'text' placeholder = 'Name' class = 'form_input' required>
<label class = 'form_label'>E-mail</label>
<input name = 'fields[email]' type = 'email' placeholder = 'Email' class = 'form_input' required>
<label class = 'form_label'>Comment</label>
<textarea name = 'fields[comment]' placeholder = 'Type in a comment ...' class = 'form_input form_input-message' required></textarea>
{{- if $vs.reCaptcha -}}
<div class = 'g-recaptcha' data-sitekey = '{{ $vs.reCaptcha.siteKey }}' data-callback='enableSubmitComment'></div>
<script type="text/javascript">
function enableSubmitComment(){
document.getElementById('submitComment').disabled = false;
}
</script>
<script async src = 'https://www.google.com/recaptcha/api.js'></script>
{{- end -}}
<div>
<input type = 'submit' id = 'submitComment' value = 'Comment' class = 'btn form_input-submit' {{- if $vs.reCaptcha }} disabled {{- end }}>
</div>
</form>

It's better to hide comments section in case that Staticman is disabled.

Unable to list posts using custom taxonomies

I'm not sure if this is related to the theme but this seemed like the best place to start.

I'm using custom taxonomies defined in my post like:

actors:
  - Bruce Willis

And the page for example.com/actors is getting created automatically and the list of actors gets populated on it's own using layouts/_default/list.html on it's own.

What I'm not sure about is how to use list.html to display excerpts for posts that have Bruce Willis as the actor. So ideally example.com/actors/bruce-willis should display a list of posts that have the custom taxonomy.

Edit - This is possible by creating a directory content/actors/bruce-willis but I'm looking for this to be done automatically if possible.

Edit 2 - Issue with the dev server. ๐Ÿคฆโ€โ™‚

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.