onweru / hugo-swift-theme Goto Github PK
View Code? Open in Web Editor NEWA simple open source theme for publishing with hugo
Home Page: https://neuralvibes.com/
License: Other
A simple open source theme for publishing with hugo
Home Page: https://neuralvibes.com/
License: Other
hello, authors yaml file is no longer working/removed.
The partial template layouts/comments.html
is loaded unconditionally.
hugo-swift-theme/layouts/_default/single.html
Lines 5 to 25 in de9f8b5
config.toml
.hugo-swift-theme/layouts/partials/comments.html
Lines 1 to 33 in de9f8b5
hugo-swift-theme/layouts/partials/comments-form.html
Lines 1 to 30 in de9f8b5
It's better to hide comments section in case that Staticman is disabled.
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.
This Binary Mist article could also be quite helpful :)
Tested with v1.0.0 at https://framagit.org/staticman-gitlab-pages/hugo-swift-theme/tree/builtv1/. The parent of the head of the branch builtv1
is the Git SHA-1 hash for v1.0.0.
The form to JSON method isn't correct, a field with empty key "":"Comment"
is created.
Besides, an OPTIONS
type is sent to Staticman API server, which is unexpected.
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.
hugo-swift-theme/assets/js/index.js
Lines 183 to 200 in 74aa154
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.
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:
And this is what appears when deployed:
Some more screenshots of the content:
Local:
Deployed:
ERROR 2019/08/06 16:58:15 HUGO-SWIFT-THEME theme does not support Hugo version 0.51. Minimum version required is 0.55
Total in 91 ms
Error: Error building site: logged 1 error(s)
I'm retarded.
Steps to reproduce the error:
git fetch upstream master
git checkout upstream/master
config.toml
and set staticman
to true
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.
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?
Assumes more than 4 pages
REPRO:
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!
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:
/staticman.yml
/config.toml
, but it can be elsewhere.Running git grep BaseURL
returns a multitude of paths like
hugo-swift-theme/layouts/_default/single.html
Lines 26 to 27 in de9f8b5
Never ever hardcode PATHs. Stop constructing URLs in the form of:
{{ .Site.baseURL }}/something
right now.
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
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.
The vertical position of the black banner remains the same.
OS: Ubuntu 18.04
Browsers: Firefox and qutebrowser
In
hugo-swift-theme/assets/js/index.js
Lines 5 to 8 in 74aa154
parent
is never used. Perhaps there's a mistake.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>
hugo-swift-theme/assets/js/index.js
Lines 355 to 368 in a277912
hugo-swift-theme/layouts/partials/comments.html
Lines 12 to 20 in cc386c7
hugo-swift-theme/layouts/partials/comments.html
Lines 25 to 34 in cc386c7
To accurately capture the reply target name, I've created an additional wrap for main comments in my PR for nested comments.
hugo-swift-theme/assets/js/index.js
Lines 297 to 311 in ed96cfa
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!");
}
});
Actual text shown: More From Map[Count:Swift + Staticman + Framagit] on my demo site: https://staticman-gitlab-pages.frama.io/hugo-swift-theme/post/hugoisforlovers/#2cbf94b0-be43-11e9-b6e2-69a12b111c8e
Show the title More from {Site title/tag/category name}.
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.?
Error: Error building site: TOCSS: failed to transform "main.sass" (text/x-sass): resource "sass/sass/main.sass_ca26857cefa9076967ab300682271513" not found in file cache
Repro:
author: "yourName"
to a postExpected:
Default author block appears in post
Actual:
No author block in post
Versions:
Hugo 0.67.1
Swift 0.42
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.
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
Searching "gravatar" in this repo gives four results, 3 SCSS and 1 HTML file. In the Go-HTML template, there's no instance of gravatar
as a class name.
gravatar
should be added back?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
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" +++
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.
In assets/js/index.js
, there're several instances of forEach
, which is 95% slower than for
. I wonder if they can be replaced by for
.
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
:
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.
The word "reading" only appeared twice in this project. The Hugo variable $reading
isn't used. Is it intended?
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. 🤦♂
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.