Code Monkey home page Code Monkey logo

Comments (2)

ArtFlag avatar ArtFlag commented on May 17, 2024

FYI, it works for me out of the box.
Are you sure you followed the setup instructions?

from hugo-material-docs.

andrew-g-za avatar andrew-g-za commented on May 17, 2024

Hi,
Yes, i'm pretty sure i did it correctly, but i might have gotten something wrong. Here's what i did (im on Windows 10, Hugo 0.2):

$ C:\temp
$ mkdir materialdocs
$ cd materialdocs
$ git clone https://github.com/digitalcraftsman/hugo-material-docs.git themes/hugo-material-docs
$ xcopy /E themes\hugo-material-docs\exampleSite*.*
$hugo version

Hugo Static Site Generator v0.20 windows/amd64 BuildDate: 2017-04-10T15:16:39+02:00

Now, if i run
$ hugo server

And go to http://localhost:1313/ the site renders correctly. If i look at the Adding content menu item on the left, its link is to http://localhost:1313/adding-content/ which works when i navigate there.

Now lets try offline:

$ hugo

If i simply run open the /public/index.html page i get this:

image

Clearly not right. But the default config has a base url property. Lets remove it and add the relativeurls property, since its meant to be used for offline viewing according to the hugo docs:

By default, all relative URLs are left unchanged by Hugo, which can be problematic when you want to make your site browsable from a local file system.

So in config.toml, i comment out the baseurl property and add the relativeurl:

#baseurl = "https://example.org/"
relativeURLs = true

Trying again:
$ hugo

Now the site renders correctly:

image

But the link to the Adding content item is

file:///C:/Temp/materialdocs/public/adding-content/

Navigating to that produces this (im using firefox, your browser may show something different, but the outcome is the same, you wont see the page):

image

This is what i meant by the theme does not work for offline sites - some links don't include a file name (index.html or whatever) so will only work online behind a server that maps requests from / to /index.html

from hugo-material-docs.

Related Issues (20)

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.