digitalcraftsman / hugo-material-docs Goto Github PK
View Code? Open in Web Editor NEWPort of Martin Donath's mkdocs-material theme to Hugo
License: MIT License
Port of Martin Donath's mkdocs-material theme to Hugo
License: MIT License
Does it support for rss? I couldn't find any rss.xml file.
Looking at //gohugo.io/js/highlight.pack.js
, it doesn't seem to have scala registered as a language. If I instead use
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/scala.min.js"></script>
I get scala support working fine.
Would it be possible to add a config to disable the built-in highlight.js, or maybe to optionally use a different set of script URLs, or to upgrade the highlight.js to one supporting more languages? For the moment I'm just overriding footer_js.html, which involves a lot of other stuff. Maybe it would be worth having a footer_syntax_js.html that just had highlight.js, and could be overridden more easily?
The documentation states:
This will also change the link behind the download button to point to the archive with the respective version on GitHub, assuming a release tagged with this exact version identifier.
Currently, the latest commit of master will be downloaded, regardless which version was set in the config file.
[params]
custom_css = ['custom.css']
Custom css is invalid, it will make nothing show....
[params.palette]
primary = "deep purple"
accent = "light green"
Color palette is invalid with these params....
hi,
with the new 0.18 release of hugo all "single" pages are detected as list (just try the license page on your demo) so the list.html template is used instead of single.html.
this is probably due to:
The primary new feature in Hugo 0.18 is that every piece of content is now a Page ( #2297 ). This means that every page, including the home page, can have a content file with frontmatter. Not only is this a much simpler model to understand, it is also faster and paved the way for several important new features:
Enable proper titles for Nodes #1051
Sitemap.xml should include nodes, as well as pages #1303
Document homepage content workaround #2240
Allow home page to be easily authored in markdown #720
Minimalist website with homepage as content #330
Hugo again continues its trend of each release being faster than the last. It’s quite a challenge to consistently add significant new functionality and simultaneously dramatically improve performance. Running this benchmark with these sites (renders to memory) shows about 60% reduction in time spent and 30% reduction in memory usage compared to Hugo 0.17.
Is there a way to get more than 2-level menus ?
Hi - Thanks so much for setting this beautiful system up, and for providing such generous help for it.
I'm having a problem where it looks like my gh-pages should be OK, but it's not. I'm getting this message in the Settings page of https://github.com/kbenoit/TAUR:
Your site is having problems building: The submodule registered for ./themes/hugo-material-docs could not be cloned. Make sure it's using https:// and that it's a public repo. For more information, see https://help.github.com/articles/page-build-failed-invalid-submodule.
And http://kbenoit.github.io/TAUR generates a 404 error.
Thanks for any help!
Hello,
I'm not able to syntax highlight to yaml files.
When I add
# comment
var: code
It doesn't hightligh correctly.
I have tried with highligh.js loaded into ./layouts/partials/header.include.html
as explained in http://gohugo.io/extras/highlighting/, but could get pretty highlighted
Also I couldn't undertand howto change the style for syntax highligh on this theme.
Thanks a lot for this theme, is pretty and clear.
Hi there,
I love the theme, but I'm struggling to get it to generate successfully for offline sites (i.e., served from the local file system, not a web server). I took the example site provided, removed the baseurl property and tried every combination of relativeURLs = true / false and uglyurls = true / false - all to no avail.
Is there anything special i need to do to make this theme work offline?
While playing around I discovered that a trailing ´/` must be appended to the url field, otherwise the level 2 headers of the page will now show up in the TOC.
If I have the file content/test.md
and the following section in config.toml
:
[[menu.main]]
name = "Test"
url = "test"
, no level 2 headers in conten/test.md
shows up in the TOC.
But, if I append at trailing slash to the url field:
[[menu.main]]
name = "Test"
url = "test/"
, the level 2 headers shows up.
Excellent theme!
I'm struggling to get syntax highlighting for R code working, for a code block like this:
```r
## devtools required to install quanteda from Github
devtools::install_github("kbenoit/quantedaData")
```
and I am not having any luck. I'm publishing this to my gh-pages
using the deploy.sh
bash script. (See my tests so far at http://kbenoit.github.io/testing/readme/#how-to-install).
Any help greatly appreciated!
Hi, Because of a Japanese work, I needed to move the 'drawer'. Which element is controlling it?!
Kind regards
Hey
i saw that this is now close to being complete: https://github.com/digitalcraftsman/hugo-multilingual
I was wondering if you plan to get this repo working as Multi-linugual too ?
I reckon i could help.
From what i saw of the first repo above its not a huge amount of change.
Just no docs yet really, so i figured i can just follow your lead on the one above.
let me know your thoughts
Tried to find way, but have no clue.
Completely new to Hugo.
Is it possible to set the email address in config.toml? I tried setting it in the social section together with Github and Twitter as email="[email protected]"
, but it didn't appear. Any other way of doing it?
Thanks
@digitalcraftsman I am interested in discussing a possibility of getting your help on our docs project that uses hugo and your theme - would it possible for you to email me a contact information if you are interested?
You can reach me @ [email protected]
Thanks
Amad
The default colors for admonitions are very saturated, so far I've found that I can supply my own custom css in the .toml
file, that will be loaded after the deafult one. But this is not obvious and took some grepping to find the right classes in the compressed application.css
to override.
I think it is worth it to make those 2 colors ('note' and 'warning') customizable via config.toml
.
In general it would be super-awesome if you could replace the current color limitations. I don't know Go and Hugo well enough to say if it's easy or not to generate custom .css
with templates as well. You definitely have some script to generatre the all the color-scheme css, I guess it should be possible to just have one set of classes there and substitute user-provided 2 color parameters in it to generate all the various needed css classes.
Hi there
The upstream theme has a search
feature that it's been removed here! As I see in Docs, 'search' is supported by Hugo! I was wondering why the search option of upstream theme has been removed from hugo-material-docs.
Anyway, I appreciate your work that make it possible for us to use another hugo theme for a documentation site.
UPDATE: I also saw #2 just now! Sorry for duplicating the issue.
Currently, the footer links to previous and next pages using .Next
and .Prev
. Both reference pages based on their last modification date. This isn't always in sync with the main menu.
Like Hugo's docs users should be able to link to pages manually if they set the corresponding urls with prev
and next
in the frontmatter.
Hi,
<span class="section">{{ .Name | title }}</span>
Oh well. This garbles "User's manual" into "User'S Manual" (uppercase S). :-/
If you specify the following in your config.toml:
baseurl = http://mydom.com/subdir
and at the same time specify a menu entry pointing to the top level as shown in the "material" demo
[[menu.main]]
name = "Getting Started"
url = "/"
weight = 0
and start hugo server
your content will be served to http://localhost/subdir
. However, the menu item created with the above [[menu.main]]
section points to http://localhost/
(without subdir), where the hugo server just finds a 404.
I tried with url = "."
. This got around the 404 but the menu item is not populated with the level2 headlines from the root's index.md.
Any idea?
User can set a path for a custom logo that is also used as favicon. Both should be independent and customizable. This can be done by adding a new variable to the configuration that specifies the path to a custom favicon.
Hi @digitalcraftsman I did not find your email.
I would like to know if you are available to create a Hugo Theme for my website.
You can contact me at [email protected]
Best
Currently, changes in the example config file are inserted manually into the docs. See gohugoio/hugo#2008
I have the following in my config.toml
.
[[menu.main]]
name = "Section"
url = "section/"
An the following content:
$> tree content/section/
content/section/
├── index.md
In the menu I now see a link to the section index.md page as expected.
After adding the following to config.toml
:
[[menu.main]]
name = "Section"
url = "section/"
[[menu.main]]
name = "Sub page 1"
url = "section/page-1"
parent = "Section"
[[menu.main]]
name = "Sub page 2"
url = "section/page-2"
parent = "Section"
, and the following content:
$> tree content/section/
content/section/
├── index.md
├── page-1.md
└── page-2.md
Now the sub pages are inserted, indented and linked under Section in the menu. But, the parent Section doesn't link to the section index.md page anymore.
How can I make a nested menu and still have parent elements link to pages?
Easy one...
git clone https://github.com/digitalcraftsman/hugo-material-docs.git themes/hugo-material-docs
NOT
git clone [email protected]:digitalcraftsman/hugo-material-docs.git themes/hugo-material-docs
Hello,
I am looking in this nice theme and I just noticed that commit 1b14974 prevents us from using the theme as 0.20 is not out yet. .Now
was deprecated in 0.19, so I believe min-version should be 0.19?
Thanks!
Hi, I like this theme. I want to modify the application.js slightly. Is it possible to share the js sources?
I trying out the material docs theme I have a single post and a single page each with identical content. Each has 2 images placed in the images directory of the theme. After executing the server I get the following error:
ERROR: 2016/03/21 reflect: call of reflect.Value.Type on zero Value in theme/partials/drawer.html
ERROR: 2016/03/21 reflect: call of reflect.Value.Type on zero Value in theme/partials/footer_js.html
ERROR: 2016/03/21 reflect: call of reflect.Value.Type on zero Value in theme/partials/drawer.html
ERROR: 2016/03/21 reflect: call of reflect.Value.Type on zero Value in theme/partials/footer_js.html
Is it possible to have section menus and content menus like
https://developers.google.com/protocol-buffers/docs/gotutorial
Looks like this was already done for mkdoscs
It's described here how to create a nested menu. But it seems there's an issue around it:
cat config.toml
...
[[menu.main]]
name = "Home"
url = "/"
weight = 0
[[menu.main]]
name = "Testing"
url = "testing/"
weight = 10
[[menu.main]]
name = "Hello World!"
url = "aa-bb-cc/"
weight = 20
...
tree -L 2
.
├── aa-bb-cc
│ ├── index.md
│ ├── sub-menu-1.md
│ └── sub-menu-2.md
├── index.md
└── Testing
└── index.md
head sub-menu-1.md
---
date: 2016-04-22T16:00:47+03:30
title: SubMenu 1
menu:
main:
parent: Hello World!
identifier: SubMenu 1
weight: 0
---
Hello,
I would like to customize this theme to add gitlab icon.
So I was looking this this line in header.html
:
{{ with .Site.Social.github }}
<div class="button button-github" role="button" aria-label="GitHub">
<a href="https://github.com/{{ . }}" title="@{{ . }} on GitHub" target="_blank" class="toggle-button icon icon-github"></a>
</div>
{{ end }}
I understand that something in application.css
is putting that github icon in the header:
The CSS looks cryptic, especially in its minified version.
Can you please explain how the CSS is putting this github icon for icon-github
class div
elements? I do not see a trace of a .svg
or .png
for this icon anywhere. So I am very much mystified how this works.
Once I understand this, I would like to do the same for gitlab icon.
Can you please also share the non-minified versions of all the .css files in this theme?
Thanks!
Hi. Thanks for the superb theme. I am making my library's document site with this theme.
Currently//gohugo.io/js/highlight.pack.js
is hard-coded in footer_js.html
but I want to replace it with custom packaged one which supports more languages.
How about adding an option to specify highlight.js
file like the following?
[params]
# Syntax highlighting javascript
highlight_js = "[highlight.js url goes here]"
Thanks.
Hi,
I really like your theme and I would like to use it for the Eclipse Hono project's website. However, in order to do so, the Eclipse folks will need to do a provenance check on the artifacts included in the theme before letting me put it into our source repo.
I have tried to figure out where the CSS and JavaScript files originate from. The only one I could clearly identify was the modernizr.js file, all others lack a header indicating who the author is and under what license we would be able to use it :-(
Can you shed some light on this?
{{< warning title="Don't try this at home" >}}
Nothing to see here, move along.
{{< /warning >}}
Isn't there a way to add warnings/notes in the way of mkdocs (+)? The current way is a bit hard for none-technical users to deal with.
There is now style for blockquote. It is zeroed and then not styled. Maybe something like...
blockquote {
padding: 0 20px;
margin: 0 0 20px;
font-size: inherit;
border-left: 5px solid #eee;
}
Hi!
I'm trying to add the Algolia docsearch to my site. I have enabled the search field, and added all css/js.
When I use this on any other field, the search works.
But when I try to use it on the search field of header, the algolia search keeps hidden inside the search field (see the little triangle below "busca"?)
What I need to do?
Regardless of the length of the title defined in config.toml
it seems that this theme drops the last character. For example, using title = "Material Docs"
the top of the page shows "Material Doc" even though the full/correct title appears elsewhere.
For now I am working around this by appending a space to the end, but this is annoying and seems like it should be an easy bug to squash.
I'm getting the following error when doing hugo server
:
ERROR: 2016/05/20 10:06:50 template.go:119: reflect: call of reflect.Value.Type on zero Value in theme/partials/drawer.html
ERROR: 2016/05/20 10:06:50 general.go:203: Error while rendering section getting_started: template: theme/_default/list.html:30:17: executing "theme/_default/list.html" at <markdownify>: wrong type for value; expected string; got template.HTML
ERROR: 2016/05/20 10:06:50 template.go:119: reflect: call of reflect.Value.Type on zero Value in theme/partials/drawer.html
ERROR: 2016/05/20 10:06:50 template.go:119: reflect: call of reflect.Value.Type on zero Value in theme/partials/drawer.html
any idea what can it be?
see https://themes.gohugo.io/theme/material-docs/ and press the "Getting started" link.
This works in hugo 0.19 but in none of the 0.20 releases.
The default styling for inline fenced blocks has no background color, unlike the inline fenced blocks on GitHub (e.g. this is fenced inline text
). Most markdown processors add some background as well.
The same is true for ''kbd tags (e.g. here is the 'Shift' word wrapped in 'kbd' tags: Shift). But the theme renders it as just monospaced text.
Is it possible to add those back? All I need is some guidance as to what css to add to the site to make it support those things.
Thanks, it's and awesome theme that you've made there!
The content flows over the gray gutters. I've implemented a workaround by overriding the partial 'head.html' with the addition of the following META tag. This fixes this issue for me.
<meta http-equiv="X-UA-Compatible" content="IE=10" />
Thought it was a bit much to fork and send a pull request for this.
Kind Regards,
Marcel
I'm able to generate parent/child menus as per the docs but parent menus are not collapsable, ist here away to collapse the parent menus?
how about 3 level section folders?
like gitbook config:
- [Chapter 1](c1/index.md)
- [Section 1](c1/s1/index.md)
- [SubSection 1](c1/s1/ss1.md)
i want to migrate the gitbook project (https://github.com/js-cool/leader.js.cool) to hugo with material ui
c1/index.md:
date: 2016-08-03T21:07:13+01:00
title: c1
type: index
weight: 60
c1/s1/index.md:
date: 2016-08-03T21:07:13+01:00
title: s1
type: index
menu:
main:
parent: c1
identifier: c1/s1
weight: 10
c1/s1/ss1.md:
date: 2016-08-03T21:07:13+01:00
title: ss1
menu: # How to config this???
main:
parent: s1
identifier: c1/s1/ss1
weight: 10
I am trying to insert an awesome font icon before the menu sections in the nav bar. However, there isn't a {{.pre}} section in the nav layouts. This means I can't insert HTML before the title of the section, which is problematic for my project. Is there a simple way for me to insert this into my project?
Thanks.
Hi!
Thanks for porting Martin's great theme to Hugo.
Since Hugo supports different layouts and templates (list, single, homepage), do you think there would be a way to implement them in the Material-docs theme? They're not available in the original theme, as MkDocs only supports single page layouts, but being able to have them all would be an awesome addition.
Thanks!
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.