gethugothemes / hugo-modules Goto Github PK
View Code? Open in Web Editor NEW30+ Powerful Hugo Modules Created By Gethugothemes.
Home Page: https://gethugothemes.com/hugo-modules
License: MIT License
30+ Powerful Hugo Modules Created By Gethugothemes.
Home Page: https://gethugothemes.com/hugo-modules
License: MIT License
Suddenly, the shortcodes stopped working.
I have errors like this and I can complete the build:
failed to extract shortcode: template for shortcode "changelog" not found
I use andromeda premium theme.
I am trying to change the loading attribute of the banner from "lazy" to "eager" or to the default value by setting an empty string. However, updating the attribute does not seem to have any effect. I have already updated all the relevant modules using yarn update.
Update the loading attribute in the banner partial by replacing "lazy" with "eager" or an empty string ("").
Save the changes and build the project.
Observe that the banner loading behavior remains unchanged.
Changing the loading attribute in the banner partial should update the loading behavior of the banner image to either "eager" or the default value.
The banner loading behavior remains unchanged even after updating the attribute.
{{ with .Params.banner }}
<section class="banner">
<div class="container">
...
{{ partial "image" (dict "Src" .image "Loading" "eager" "Alt" .title "Class" "rounded-2") }}
...
</section>
{{ end }}
<!-- /banner -->
Additional context:
I have tried updating all the modules using yarn update but the issue persists. Please let me know if there's any other information needed to resolve this issue.
Recently when the html classes where changed to the modal search, I think a class name change was missed.
So now when using the using the keys to browse, and Enter
is pressed to navigate to the currently selected item, nothing happens. The following error is logged in the console
Uncaught TypeError: Cannot read properties of undefined (reading 'getAttribute')
at HTMLInputElement.handleKeyDown (script.js:199:17)
With search enabled, using the "s=" URL parameter it is possible to inject and execute code in the client browser.
Example: https://my.hugo.page/?s=sxss1'<%2F"></b><img src=1 onerror=alert(document.domain)>
The "s=" parameter should be removed or fixed using encodeURIComponent()
before inserting the query parameter into the DOM.
I made everything according instruction about adding gallery, and have imported the module.
hugo mod graph
github.com/42point/newBlog github.com/gethugothemes/hugo-modules/[email protected]
github.com/42point/newBlog PaperMod
But, I didn't get glightbox.js
or glightbox.css
files in static
folder of my project. Do I need to clone them from the repository?
How does it work?
I use YAML format for the config file
Params:
plugins:
css:
- link: plugins/glightbox/glightbox.css
js:
- link: plugins/glightbox/glightbox.js
- link: js/gallery-slider.js
thanks in advance.
It looks like the cookie-consent module cannot use i18n. It uses cookies.content
and cookies.button
without going through translations.
Is it possible to work this around? It would be quite useful (if not mandatory) for multilingual sites.
Many thanks!
The current image shortcode implementation of the image Resize command directly passes on the dimensions provided by the user. It uses the ones from the original image as a fallback, disregarding the aspect ratio. The second part violates the definition of the Resize command in hugo, which states that the aspect ratio is preserved if only one dimension is specified in a Resize command.
As an example, when specifying a shortcode such as {{< image src="image.png" width="200" command="Resize" title="An example image">}}
, the height is currently set to the height of the original image, which also has an effect the aspect ratio.
instead of:
{{ with .Params.canonical }}
Use this:
{{ if .Params.canonical.enable }}
{{ with .Params.canonical.link }}
{{ else }}
{{ end }}
{{ end }}
it gives the user a choice wheather or not to have a canonical tag (which by default is the page itself) or to add a URL to another page.
The Social-share is still using the old twitter logo.
Would be good to update to the new one. With the following svg.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66"/>
</svg>
When I moved from using "Collapse" to using "Accordion" correctly, I noticed that the chunk of code I placed into the new "Accordion" shortcode wasn't all displayed. Half the code was cut off. Can this be fixed?
would be nice to include that in social-share
When there are many tabs, and the webpage is viewed on a small screen (like mobile phone), the right most tabs overflow and are not (or partially) seen.
Maybe the tab headers can be stacked for small screens.
{{< tabs "tab-group-name" >}}
{{< tab "first-long-name" >}}
First Tab 1
{{< /tab >}}
{{< tab "second" >}}
Second Tab 1
{{< /tab >}}
{{< tab "third" >}}
Third Tab 1
{{< /tab >}}
{{< tab "fourth" >}}
Fourth Tab 1
{{< /tab >}}
{{< /tabs >}}
An issue has arisen following the commit 27be1f6. Since this commit, I've been encountering a specific build error related to template rendering in my Hugo site that wasn't present before. The error occurs during the site rendering process, particularly when processing the list.searchindex.json
template. Here's the error message:
Error: error building site: render: failed to render pages: render of "home" failed: "hugo-modules/search/layouts/_default/list.searchindex.json:25:67": execute of template failed: template: _default/list.searchindex.json:25:67: executing "_default/list.searchindex.json" at <.Page>: can't evaluate field Page in type string
Before this commit, my site was built without any issues. However, there was a pre-existing problem where images were not displaying in the search results for entries using Page Bundles. The front matter for these entries is typically as follows:
---
title: 'Some Title'
images: ['image.png']
...
---
For items where the front matter is formatted like this:
---
title: 'Some Title'
images: ['/images/image.png']
...
---
images display correctly in the search results, provided that the list.searchindex.json
code is as it was before the commit 27be1f6.
It seems that the recent changes might have affected how Page Bundles and their associated images are handled or rendered. I would appreciate any assistance or guidance on resolving this error to restore the site's functionality and ensure images are displayed correctly in the search results.
Current implementation of basic-seo.html will always render a generator meta tag but it is not correct since HUGO has corresponding flag to control this meta tag: https://gohugo.io/getting-started/configuration/#disablehugogeneratorinject
The search module seems to find results on sections which do not contain hyphens but two of my sections which contain hyphens (such as a section called "how-to") never returns any results. I spent a little bit of time trying to debug the JavaScript but I haven't found the root cause yet. I believe it occurs in the doSearch function when deciding which sections to filter out.
If you could look into this issue, that would be great! I can't change my section names to remove the hyphen since my website is established and that would change the URLs of those sections/pages.
I never had this issue before the Logbook theme was updated to make use of the new hugo modules.
I bought a theme from gehugothemes and unfortunately it's SEO score isn't as great as I'd like to. One of the reasons is that the largest image on the top of the page is lazy loaded which causes page content re-render after it was already rendered.
The obvious solution is to change loading strategy to eager
BUT:
Problem #1:
There is no info in the official documentation on how to change the loading strategy. I had to open the source code for that.
Not a huge issue but I'd prefer to have this configuration documented.
Problem #2
Changing loading strategy doesn't work.
I have the following code:
{{ partial "image.html" (dict "Loading" "eager" "Src" .image "Alt" .Title "Class" "rounded-2 shadow" ) }}
I'd expect that rendered HTML tag has an attribute "loading=eager" but unfortunately it is still loading=lazy
Are there plans to support LinkedIn, Google, Pinterest (or any other social media listed in the scss file) in the social-share partial?
I can make a PR if you want.
Thanks
Cookie consent usage leads to the error: uncaught ReferenceError: Cookies is not defined
Perhaps the documentation should be updated to have:
<script src="
https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js
"></script>
{{ partialCached "cookie-consent.html" . }}
instead of
{{ partialCached "cookie-consent.html" . }}
Hi, I don't have a config folder
.git
.hugo_build.lock
archetypes
config.toml
content
data
i18n
public
resources
sitemap.xml
static
themes
I've recently updated my module from buttons to button. The button module is behaving funny when using the outline style which I prefer. Your documentation doesnt state I need to update my style.cscss with "@import button;". So I left the "@import buttons;" alone. On the grid view homepage, buttons are working as they should.
Following your instructions, the following occurs when I try to use a button with an outline style in a post
(not all the outline is working the button should have a full blue outline on my test, but its missing the bottom line)
In addition to this button text isnt changing with the theme, to white, like it should when I hover over the button.
Params are set as they should be.
Hi, guys.
I have a question. Is it possible to organize a search throughout the whole website, without connection to sections or other internal structure, as I am having difficulties with it. I use some hugo theme for my website and heavily modified it. Whatever I've done so far, search was working only in some particular folders (i.e. "Blogs"
and "People"
) which probably has some "proper" internal structure (_index.md
, list.html
template, single.html
template) and not for the whole website. I also have general single md
files in the root folder and would like the search to work on them too. Is it possible to implement?
Thank you in advance!
Search module only displays images with absolute URLs, the context is not sent to thesearchImage
partial so it uses the default "dot":
hugo-modules/search/layouts/_default/list.searchindex.json
Lines 20 to 28 in c3e6f1e
For page bundles, Context
must be set to .Page
:
{{- if .Params.image -}}
{{- $.Scratch.Set "image" (partial "searchImage" (dict "Context" .Page "Src" .Params.image "Size" "420x" "Command" "Resize")) -}}
{{- $.Scratch.Set "imageSM" (partial "searchImage" (dict "Context" .Page "Src" .Params.image "Size" "100x100" "Command" "Fill")) -}}
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
{{- $.Scratch.Set "image" (partial "searchImage" (dict "Context" .Page "Src" . "Size" "420x" "Command" "Resize")) -}}
{{- $.Scratch.Set "imageSM" (partial "searchImage" (dict "Context" .Page "Src" . "Size" "100x100" "Command" "Fill")) -}}
{{- end -}}
{{- end -}}
Email harvesters and other bots roam the Internet looking for email addresses to add to lists that target recipients for spam. This trend results in an increasing amount of unwanted email.
So need to layer on the plain-text obfuscation technique.
Here's some techniques: https://web.archive.org/web/20180908103745/http://techblog.tilllate.com/2008/07/20/ten-methods-to-obfuscate-e-mail-addresses-compared/
Not all texts in the search modal can be translated. See this one in Dutch:
Sources:
hi! i'm able to get the html version of this module to work in my site if i add it to a template
however when i use the shortcode
{{< tabs "tab-group-name" >}}
{{< tab "first" >}}
First Tab
{{< /tab >}}
{{< tab "second" >}}
Second Tab content
{{< /tab >}}
{{< tab "third" >}}
Third Tab
{{< /tab >}}
{{< /tabs >}}
i get this error
failed to extract shortcode: shortcode "tabs" does not evaluate .Inner or .InnerDeindent, yet a closing tag was provided
any idea what i'm doing wrong?
Tabs with the same group Id do not change at the same time.
With the example below, switching tab from first
(First Tab 1) to second
(Second Tab 1) on the first tabs block does not change the same on the second tabs block: from first
(First Tab 2) to second
(Second Tab 2).
{{< tabs "tab-group-name" >}}
{{< tab "first" >}}
First Tab 1
{{< /tab >}}
{{< tab "second" >}}
Second Tab 1
{{< /tab >}}
{{< tab "third" >}}
Third Tab 1
{{< /tab >}}
{{< /tabs >}}
{{< tabs "tab-group-name" >}}
{{< tab "first" >}}
First Tab 2
{{< /tab >}}
{{< tab "second" >}}
Second Tab 2
{{< /tab >}}
{{< tab "third" >}}
Third Tab 2
{{< /tab >}}
{{< /tabs >}}
Hi, thanks for the modules.
Looks like the search results shows some duplicate content. Please see the screenshot below for more details.
I was trying to figure out why the icon stopped appearing in a recently launched site:
Your favicon must be a multiple of 48px square, for example: 48x48px, 96x96px, 144x144px and so on.
When search string has several matches, the lastWord
variable always contains the initial match's content. For example, let's assume the search string is "te"
and we have the following content with two matches (caps for clarity):
"laTEr they go their separaTE ways"
"separate" becomes "separaLAte" in the search result excerpt, as matchIndex
will always point to the first match, but the replace
function replaces every occurrence because of the "g" (global) regex
modifier:
hugo-modules/search/assets/js/search.js
Lines 231 to 233 in c3e6f1e
As a workaround, I used a regex without the "global" flag in that block of code. Now it just highlights the first occurrence which is fine by me, but there might be a better solution.
return matchedContent.replace(
new RegExp(searchString, "i"),
(match) => lastWord + `<mark>${match}</mark>`
);
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.