Giter Site home page Giter Site logo

Favicon about docz HOT 7 CLOSED

doczjs avatar doczjs commented on April 29, 2024 1
Favicon

from docz.

Comments (7)

danielbayerlein avatar danielbayerlein commented on April 29, 2024 8

With the latest version of docz you can configure the public folder and the favicon. For example:

export default {
  public: 'config/docz/public',
  htmlContext: {
    favicon: 'public/favicon.ico'
  }
}

from docz.

renatorib avatar renatorib commented on April 29, 2024 1

If you want a documentation improvement, you can open a issue in https://github.com/pedronauck/docz-website or add a pull request!

from docz.

renatorib avatar renatorib commented on April 29, 2024

You can follow docz.site example https://github.com/pedronauck/docz-website/blob/0fb96228e4ed2f7f3be1ad17cd7a0c1541002988/doczrc.js#L16-L21

It uses FaviconsWebpackPlugin.

// doczrc.js
import FaviconsWebpackPlugin from 'favicons-webpack-plugin'

const PUBLIC = path.resolve(__dirname, 'public')

export default {
  modifyBundlerConfig: config => {
    config.plugins.push(
      new FaviconsWebpackPlugin({
        logo: `${PUBLIC}/images/favicon.png`,
        inject: true,
      })
    )

    return config
  }
}

OR you can add directly in a custom html

// doczrc.js
export default {
  indexHtml: 'src/index.html',
}

example: https://github.com/pedronauck/docz-website/blob/0fb96228e4ed2f7f3be1ad17cd7a0c1541002988/src/index.html


It would be really cool to have some guide on docz.site

from docz.

inje avatar inje commented on April 29, 2024

Hey @renatorib, I tried to add an favicon based on your instructions and they didn't work for me. I found a solution that works in the meantime by adding an external link in the doczrc.js for the favicon.

External favicon link

// doczrc.js
export default {
  htmlContext: {
    favicon: 'https://s3-us-west-1.amazonaws.com/set-protocol/favicon.ico',
  },
}

I added this and reran yarn dev which showed the favicon for me. This is mostly a bandaid solution to unblock some folks who are running into the same issue.

Following your recommendation, I opened an issue on the docz-website repo about adding documentation for favicons since I'm sure others are having the same issue by looking down the list of projects using docz who are missing favicons.

Testing Other Repos

I tested the docz-website and island-wars repos, both of which have working deployed favicons. When running both of them locally, I didn't see working favicons.

docz-site

When running the docz-website locally, and saw that the favicon for the site wasn't working for me. It's confusing because the doczrc.js leads to an .ico file, but the path doesn't match up to anything inside of the public folder. The only favicon I see is a favicon in the public/images folder which is a .png file. When looking in the source code on docz.site, the favicon link doesn't lead to anything. Would be useful to get clarification on how it works.
screen shot 2018-08-30 at 4 22 36 am

island-wars

I saw one repo in the list above that had a working favicon, and running that locally also didn't show a favicon. I did see a useful commit from there that I followed and didn't get me working favicon using that method. Their site does link to the proper favicon.
screen shot 2018-08-30 at 4 26 04 am

Production Builds

I questioned whether it was because I wasn't using a production build, so I deployed to Netlify, but also didn't see a working favicon.

I'll move this to the Github issues page, adding it here since I think this will be useful for anyone who is struggling to add a favicon to their docs, knowing that these steps have been tried.

from docz.

Grsmto avatar Grsmto commented on April 29, 2024

Would be useful to get clarification on how it works.

That's the thing, the favicon on https://www.docz.site/ does not work.

from docz.

renatorib avatar renatorib commented on April 29, 2024

@pedronauck

from docz.

rossmoody avatar rossmoody commented on April 29, 2024

With the latest version of docz you can configure the public folder and the favicon. For example:

export default {
  public: 'config/docz/public',
  htmlContext: {
    favicon: 'public/favicon.ico'
  }
}

This worked for me as well, just be sure to rebuild to see the updated favicon (not just refresh).

from docz.

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.