matcornic / hugo-theme-learn Goto Github PK
View Code? Open in Web Editor NEWPorting Grav Learn theme to Hugo
Home Page: https://learn.netlify.com/en/
License: MIT License
Porting Grav Learn theme to Hugo
Home Page: https://learn.netlify.com/en/
License: MIT License
Help Wanted, I don't have an Android phone ๐
Hi,
Scroll seems really broken with chromium 55 / 56 (ok with 51) --> there's an auto-scrool UP, very strange...
Thks,
Hello
I'm wondering if this theme support same page anchor link.
Something like: https://borgbackup.readthedocs.io/en/stable/installation.html
Where the menu point to the title on the same page, if that make any sense...
Kristian
First of all, great theme!
I am getting below errors.
chankeypathak@perl:~/Desktop/chankeypathak/test$ hugo server --buildDrafts --theme=hugo-theme-learn --buildDrafts
ERROR: 2016/11/29 15:33:03 template.go:350: template: theme/partials/menu.html:16: function "slice" not defined
ERROR: 2016/11/29 15:33:03 template.go:119: html/template: "theme/partials/menu.html" is an incomplete template in theme/partials/menu.html
1 of 1 draft rendered
0 future content
1 pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
in 14 ms
Watching for changes in /home/chankeypathak/Desktop/pproj/test/{data,content,layouts,static,themes}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
After the two last PR was merged, the left menu of our documentation vanished.
I rolled back to the revision de8584e and the left menu reappeared.
It seems that the new version is not compatible with an older configuration.
hugo new --kind chapter basics/_index.md
By opening the given file, you should see the property chapter=true on top, meaning this page is a chapter.
Although there is chapter.md
file in themes/hugo-theme-learn/archetypes
, it is not applied to be the archetype for new --kind chapter
. The default.md from ~/archetypes is applied instead.
The tutorial doesn't say it - should i copy the folders from themes/hugo-theme-learn
to the root folder?
I thought the hugo engine would look into the themes/hugo-theme-learn/archetypes after it checks ~/archetypes, but it doesn't
Hi!
Is Search not working on mobile? Tested with Android/Chrome and nothing pops up during the characters typing in the search field
Search on a desktop appears only as a drop down with top-10 results. Is it possible to rather display a page with search results where >10 items could be displayed?
Hi I got below error while I'm trying to use taxonomy.
ERROR: 2017/01/15 22:32:49 template.go:132: template: theme/partials/header.html:24:30: executing "theme/partials/header.html" at <.RelPerma
link>: can't evaluate field RelPermalink in type *hugolib.Node in theme/partials/header.html
ERROR: 2017/01/15 22:32:49 template.go:132: template: theme/partials/header.html:24:30: executing "theme/partials/header.html" at <.RelPerma
link>: can't evaluate field RelPermalink in type *hugolib.Node in theme/partials/header.html
Seems it related to
https://discuss.gohugo.io/t/cant-evaluate-field-relpermalink-in-type-hugolib-node/4280/3
Any of workaround ?
$ hugo version
Hugo Static Site Generator v0.17 BuildDate: 2016-12-18T03:13:22-08:00
I have implemented search as recommended with lunr-hugo and the indexing works well.
I'm wondering, however, if it's possible for the search to also go to the appropriate place on the target page. When I click on a search result it takes me to the right page but the search result target may be quite far down the page in long documents.
It would be excellent if the search did two extra things:
Starting with Hugo version 0.22 .Site.Sections is not working anymore. Switch to proposal from
https://github.com/gohugoio/hugo/blob/master/hugolib/site_sections.go#L34
Hi,
You define TableOfContents in hugo-theme.css without using it (it's display:none). Do you plan to use it by configuration ?
Thks a lot
Hi there,
I work on the documentation team at Miracl.com. We're thinking of moving our documentation to Hugo but have a requirement for redirects to be set up from chapter pages, so users don't have to read perfunctory intro. text. Is this technically possible? If so, how would I go about doing it?
To be more specific, if say a visitor clicks on a chapter named "Registering" containing two sub-pages, one with Android instructions and one with iOS instructions, the visitor should be taken directly to the first sub-page, /registering/registering-android rather than its parent, /registering. Hope that makes sense!
Thanks,
Matt
Your theme is very nice, but Chrome presents a scroll issue.
This issue does not occur in MS Edge or Firefox.
Essentially if you scroll down in Chrome, the page then tries to scroll back up[ to the top.
Clearly a Javascript issue ( disabling JS in chrome make the problem go away ). Console shows no JS errors.
I tried looking at your code, but you are doing several clever things relating to window height and scroll so couldn't easily identify the exact issue.
Hi;
Thanks to port this awesome theme from grav to hugo.
My hope, question is : How hard would be; and If people have interest for it, to make Hugo-Theme-Learn Multilingual ?
Overwritten relref
shortcode does not handle well multilang
Edit: Some tests were done, and it appears not using i18n is also problematic for links between pages.
Hello,
It would be nice to have hability to set "expand" item open by default.
By example:
{{%expand "Open by default?" true %}}Yes!{{% /expand%}}
{{%expand "Open by default?" false %}}No!{{% /expand%}}
Image with "?classes=xxx" are not displayed in Netlify documentation.
Consider moving back to Github Pages.
Hi, I'm using the template and in a new site when I run this commands:
hugo new --kind chapter codestyles/index.md
hugo new --kind chapter git/index.md
hugo new --kind chapter features/index.md
And if I try to order assigning a different weigth nothing changes, looks like the other is always the alphabetical A to Z.
I'm new at Go and Hugo maybe im doing something wrong, but seems like not!
Like the "Edit this page" button, we could have a "Create an issue" button for a page. It could be used to create an issue for missing/wrong information.
When I go to https://learn.netlify.com/fr/shortcodes/expand/ page, the children section in the menu display the wrong pages.
Linking screenshots in the README with relative paths might work on GitHub, but the theme site can't find the screenshot under this path. Consider to use an absolute one instead.
Is it possible to automatically generate the prev
and next
paths in the front matter?
I'm working on a site with a lot of content and manually setting these on each page is not feasible. Is there some way to automatically generate the links (alphabetically ordering them, perhaps)?
the editURL is not rendered properly
below is my config.toml
[params]
description = "hugo contents for keyolk.github.io"
author = "keyolk"
showVisitedLinks = true
search = true
editURL = "https://github.com/keyolk/keyolk.github.io-hugo/edit/master/content/"
menu = [ "workspace", "container", "system", "security", "language", "algorithm" ]
It works after I change below
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 030139c..1f91f71 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -29,12 +29,12 @@
<div class="padding highlightable">
<div id="top-bar">
- {{ if and .IsPage .Site.Params.editURL }}
+ {{ if and .IsPage .Site.Params.editurl }}
{{ $File := .File }}
{{ $Site := .Site }}
{{with $File.Path }}
<div id="top-github-link">
- <a class="github-link" href="{{ $Site.Params.editURL }}{{ replace $File.Dir "\\" "/" }}{{ $File.LogicalName }}" target="blank">
+ <a class="github-link" href="{{ $Site.Params.editurl }}{{ replace $File.Dir "\\" "/" }}{{ $File.LogicalName }}" target="blank">
<i class="fa fa-code-fork"></i>
Edit this page
</a>
I'm not sure, it seems the pram names is used with lower case when it templated.
$ hugo version
Hugo Static Site Generator v0.17 BuildDate: 2016-12-18T03:13:22-08:00
Hi,
first of all i a really like your theme.
Is it possible to add a Codeblock with horizontal Scrollbars, e.g. as a shortcode?
Is it possible to create a global variables (useful for global links)?
For instance throughout my documentation articles I refer to my master branch, and I want to have it as a variable, rather than pasting an absolute link.
refer to this example
[my repo][my_repo_link]
[my_repo_link]: {{params.my_global_repo_link}}
This is possible in gitbook for instance and has a huge importance as to my opinion. Could it be that I can put something in [params]
and use it like that?
Using this theme I can successfully add a weight in the page front-matter.
Usually the menu for a Hugo site can also be configured from the config.tom
file by adding entries to [[menu.main]]
, see https://gohugo.io/extras/menus/
But, for this theme this does not work, is there another way to configure the menu from config.toml
?
Hugo version: 0.21
A horizontal scrollbar appear on the bottom of the page when the browser is resized. Same issue with Opera / Chrome and Firefox. Maybe the issue come from a JS code...
Hi,
sorry if this is a dumb question, but how can I change the logo and still make it fit?
Thanks!
when using search, subpages work fine but when the search result points to a chapter index page, the link is incorrect.
For example,
core
in the site http://matcornic.github.io/hugo-learn-docBasics
This will result in the wrong URL being served for the search, ie:
https://matcornic.github.io/hugo-learn-doc/basics/_index
NOT
https://matcornic.github.io/hugo-learn-doc/basics
Is there a simple way to fix this behaviour?
This theme does not support deployment to baseurls which include a path component such as http://username.github.io/repo since assets are referred to as absolute paths.
all assets have hardcoded paths like /css
should be baseurl related
The Demo button for the preview of this theme does not work. It'd be neat if you could fix so more people use the theme.
http://themes.gohugo.io/theme/hugo-theme-learn/
Thanks for a great Hugo theme!
For my site I don't want the copy-to-clip-board icon for inline code
tags but keep it for code
tags within pre
tags. I was able to achieve this by adding this css:
:not(pre) > code + span.copy-to-clipboard {
display: none;
}
It would be really handy if it would be possible to configure the appearance of the copy-to-clipboard icons from the config.toml
file. Maybe this could be considered for future versions of the theme.
I'm not able to get the search input's clear button to work.
It seems the code to register the click handler is never getting hit.
I really don't know jQuery, but I can tell from playing in the debugger that none of the code inside the on('input', ...)
handler is being run.
jQuery('[data-search-input]').on('input', function() {
var input = jQuery(this),
value = input.val(),
items = jQuery('[data-nav-id]');
items.removeClass('search-match');
if (!value.length) {
$('ul.topics').removeClass('searched');
items.css('display', 'block');
sessionStorage.removeItem('search-value');
$(".highlightable").unhighlight({ element: 'mark' })
return;
}
sessionStorage.setItem('search-value', value);
$(".highlightable").unhighlight({ element: 'mark' }).highlight(value, { element: 'mark' });
if (ajax && ajax.abort) ajax.abort();
ajax = jQuery.ajax({
url: input.data('search-input') + ':' + value
}).done(function(data) {
if (data && data.results && data.results.length) {
items.css('display', 'none');
$('ul.topics').addClass('searched');
data.results.forEach(function(navitem) {
jQuery('[data-nav-id="' + navitem + '"]').css('display', 'block').addClass('search-match');
jQuery('[data-nav-id="' + navitem + '"]').parents('li').css('display', 'block');
});
}
;
});
jQuery('[data-search-clear]').on('click', function() {
jQuery('[data-search-input]').val('').trigger('input');
sessionStorage.removeItem('search-input');
$(".highlightable").unhighlight({ element: 'mark' })
});
});
The first line in this code block is being hit, but nothing inside it (including the registration of the clear button's click handler) is running.
As Javascript/css files are cached in browser, errors may occurs on the browser when Javascript has been updated on the server but not on the client.
In order to do that, a simple solution is to change the filename when file has changed.
When I try to call an icon (using font-awesome) from any of the chapter pages, there is an error parsing the html!
Sample code:
+++
weight = 0
title = "Some Chapter title"
chapter = true
next = "/next/path"
icon = "<i class="fa fa-check"></i>"
+++
Am I calling the icon correctly, or should I have a local copy of font-awesome in the project?
I'm getting an error with Hugo v0.20.7 and hugo-theme-learn bc05a6e.
This was from following the setup instructions here: https://matcornic.github.io/hugo-learn-doc/basics/installation/
$ /opt/hugo/hugo serve
Started building sites ...
ERROR 2017/05/14 19:13:36 Error while rendering "section": template: theme/_default/list.html:2:3: executing "theme/_default/list.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:26:7: executing "theme/partials/header.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:20:28: executing "theme/partials/menu.html" at <$sectionPage.Content>: can't evaluate field Content in type *hugolib.Page
ERROR 2017/05/14 19:13:36 Error while rendering "page": template: theme/_default/single.html:1:3: executing "theme/_default/single.html" at <partial "header.html...>: error calling partial: template: theme/partials/header.html:26:7: executing "theme/partials/header.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:20:28: executing "theme/partials/menu.html" at <$sectionPage.Content>: can't evaluate field Content in type *hugolib.Page
Any ideas? Thanks!
I have tried implementing search using the following method, but the search bar does not appear in the site.
I'm wondering if I'm missing a step?
var toml = require("toml");
var S = require("string");
var CONTENT_PATH_PREFIX = "content";
module.exports = function(grunt) {
grunt.registerTask("lunr-index", function() {
grunt.log.writeln("Build pages index");
var indexPages = function() {
var pagesIndex = [];
grunt.file.recurse(CONTENT_PATH_PREFIX, function(abspath, rootdir, subdir, filename) {
grunt.verbose.writeln("Parse file:",abspath);
pagesIndex.push(processFile(abspath, filename));
});
return pagesIndex;
};
var processFile = function(abspath, filename) {
var pageIndex;
if (S(filename).endsWith(".html")) {
pageIndex = processHTMLFile(abspath, filename);
} else {
pageIndex = processMDFile(abspath, filename);
}
return pageIndex;
};
var processHTMLFile = function(abspath, filename) {
var content = grunt.file.read(abspath);
var pageName = S(filename).chompRight(".html").s;
var href = S(abspath)
.chompLeft(CONTENT_PATH_PREFIX).s;
return {
title: pageName,
href: href,
content: S(content).trim().stripTags().stripPunctuation().s
};
};
var processMDFile = function(abspath, filename) {
var content = grunt.file.read(abspath);
var pageIndex;
// First separate the Front Matter from the content and parse it
content = content.split("+++");
var frontMatter;
try {
frontMatter = toml.parse(content[1].trim());
} catch (e) {
conzole.failed(e.message);
}
var href = S(abspath).chompLeft(CONTENT_PATH_PREFIX).chompRight(".md").s;
}
// Build Lunr index for this page
pageIndex = {
title: frontMatter.title,
tags: frontMatter.tags,
href: href,
content: S(content[2]).trim().stripTags().stripPunctuation().s
};
return pageIndex;
};
grunt.file.write("static/json/search.json", JSON.stringify(indexPages()));
grunt.log.ok("Index built");
});
};
static/json/search.json
, yes, here's an example index:[{"title":"Some Chapter title","href":"/introduction/_index","content":" Chapter X Some Chapter title Lorem ipsum"},{"title":"About","href":"/introduction/about_us","content":" testing lets see if we get auto update OK"}]
config.toml
languageCode = "en-us"
title = "Docs"
baseurl = "https://my.url"
theme = "hugo-theme-learn"
search = "true"
Hi!
Is there anyway to display .TableOfContents links into navigation when pages are differents of _index.md ?
I do not found any issues or documentation relative to this.
Does the theme support asciidoc
well ?
I am searching for a technical documentation site generator that supports that format.
Thanks for your help.
Cheers
Hi there,
I see in the hugo-theme.css file the definition of h5 elements is
h5 {
font-size: 1;
line-height: 110% !important;
margin: 1rem 0 0.2rem 0;
}
This results in the h5 not being rendered correctly. Firefox's dev tools shows the property is invalid because no units have been specified.
I think this should be changed to follow the other h2...h4 definitions that use rem units, so:
font-size: 1rem;
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.