Code Monkey home page Code Monkey logo

hugo-material-docs's Introduction

Material Docs

Please note that this theme is no longer maintained.

A material design theme for Hugo.

Screenshot

Quick start

Install with git:

git clone https://github.com/digitalcraftsman/hugo-material-docs.git themes/hugo-material-docs

Next, take a look in the exampleSite folder at. This directory contains an example config file and the content for the demo. It serves as an example setup for your documentation.

Copy at least the config.toml in the root directory of your website. Overwrite the existing config file if necessary.

Hugo includes a development server, so you can view your changes as you go - very handy. Spin it up with the following command:

hugo server

Now you can go to localhost:1313 and the Material theme should be visible. For detailed installation instructions visit the demo.

Noteworthy changes of this theme are listed in the changelog.

Acknowledgements

A big thank you to Martin Donath. He created the original Material theme for Hugo's companion MkDocs. This port wouldn't be possible without him.

Furthermore, thanks to Steve Francia for creating Hugo and the awesome community around the project.

License

The theme is released under the MIT license. Read the license for more information.

hugo-material-docs's People

Contributors

anwalkers avatar bep avatar digitalcraftsman avatar esden avatar matthew-andrews avatar mxbonn avatar tiagoalves avatar ybizeul 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hugo-material-docs's Issues

How to navigate

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

params.palette is invalid

[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....

h2 tag overlaps horizontal scrollbar from pre code blocks

If you have a code block with long lines that causes horizontal scrolling, the horizontal scroll bar appears but the actual bar cannot be clicked in order to scroll. I have reproduced this with the demo site as well using Chromium, Chrome, and Firefox on Linux.

fdz4l

Error when serving theme with minimal data

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

Algolia Docsearch not showing completely below Search Field

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.

captura_de_tela_2017-04-06_as_10_37_17

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"?)

captura_de_tela_2017-04-06_as_10_36_01

What I need to do?

No style for blockquotes

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;
}

Scala doesn't work with highlight.js

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?

Email

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

support for .pre menu context in config.toml

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.

Problems with huge-material-docs submodule

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!

Provenance of included JavaScript and CSS

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?

Customizing the colors for admonitions

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.

An issue w/ creating nested menu

Hi @digitalcraftsman

It's described here how to create a nested menu. But it seems there's an issue around it:

  • Name of the content file is added to the sidebar, while the 'title' is expected.

An-image-has-NOT-been-loaded-here

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
...

content ❱ tree -L 2

.
├── aa-bb-cc
│   ├── index.md
│   ├── sub-menu-1.md
│   └── sub-menu-2.md
├── index.md
└── Testing
    └── index.md

content/aa-bb-cc ❱ 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

---

  • By using a native language (in my case: Persian), it's even disapeared!

salaam-donya_screenshot

screenshot

Nested menu ==> parent index page not linked

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?

Add support for manual prev/next links

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.

Top-Level index.md not found if baseurl contains subdirectory

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?

Homepage and list templates

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!

hugo 0.18 broke single pages

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.

title filter

Hi,

    <span class="section">{{ .Name | title }}</span>

Oh well. This garbles "User's manual" into "User'S Manual" (uppercase S). :-/

!!! warning "Don't try this at home"

{{< 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.

Level 2 headlines missing in TOC if no trailing slash in url menu field

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.

Use version number for download button in drawer

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.

syntax highligh with yaml

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.

Changing the background for inline fenced text to non-transparent and better KBD tags

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!

Commercial support

@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

feed

Does it support for rss? I couldn't find any rss.xml file.

Internet Explorer is not respecting layout

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

[Feature Request] Custom highlight.js URL

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.

'Search' Feature

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.

Add config option for custom favicon

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.

CSS 101 question about github icon

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:

image

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!

multilingual

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

theme does not work for 'offline' (local file system) sites

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?

Javascript sources

Hi, I like this theme. I want to modify the application.js slightly. Is it possible to share the js sources?

Last character of title clipped / truncated from heading

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.
hugo-material-docs-bug

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.

Error when generating content

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?

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.