Allow custom shortcut icon to be specified #178

Closed
jsit opened this Issue Aug 20, 2014 · 13 comments

Comments

Projects
None yet
4 participants
@jsit

jsit commented Aug 20, 2014

No description provided.

@HugoGiraudel HugoGiraudel added this to the 1.5 milestone Aug 20, 2014

@valeriangalliat valeriangalliat self-assigned this Aug 20, 2014

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 20, 2014

Member

This will be a feature of sassdoc-theme-light, not directly of SassDoc.

I propose to add a shortcutIcon key in the view.json. It will target a file to use as shortcut icon. The path is relative to the view.json file.

The theme will copy the specified file into assets/img and use it as shortcut icon in the HTML layout.

Everything's okay?

Member

valeriangalliat commented Aug 20, 2014

This will be a feature of sassdoc-theme-light, not directly of SassDoc.

I propose to add a shortcutIcon key in the view.json. It will target a file to use as shortcut icon. The path is relative to the view.json file.

The theme will copy the specified file into assets/img and use it as shortcut icon in the HTML layout.

Everything's okay?

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
Member

HugoGiraudel commented Aug 20, 2014

@SassDoc/owners Thoughts?

@FWeinb

This comment has been minimized.

Show comment
Hide comment
@FWeinb

FWeinb Aug 21, 2014

Member

We should make it possible to specify a URL too.

Member

FWeinb commented Aug 21, 2014

We should make it possible to specify a URL too.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 21, 2014

Member

👍

If it begins with *//, assume an URL, otherwise a path. Right?

Member

valeriangalliat commented Aug 21, 2014

👍

If it begins with *//, assume an URL, otherwise a path. Right?

@FWeinb

This comment has been minimized.

Show comment
Hide comment
@FWeinb

FWeinb Aug 21, 2014

Member

A file path can also begin with *// like file:/// to have a absolute path.

Member

FWeinb commented Aug 21, 2014

A file path can also begin with *// like file:/// to have a absolute path.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 21, 2014

Member

In a browser maybe, but with commandline tools beginning a path with / is an absolute path, and file:/// is usually not supported.

So /path/to/favicon.ico is absolute, path/to/favicon.ico is relative, anything://path/to/favicon.ico will be passed as a raw URL, and //path/to/favicon.ico too.

Member

valeriangalliat commented Aug 21, 2014

In a browser maybe, but with commandline tools beginning a path with / is an absolute path, and file:/// is usually not supported.

So /path/to/favicon.ico is absolute, path/to/favicon.ico is relative, anything://path/to/favicon.ico will be passed as a raw URL, and //path/to/favicon.ico too.

@FWeinb

This comment has been minimized.

Show comment
Hide comment
@FWeinb

FWeinb Aug 21, 2014

Member

👍 you are right

Member

FWeinb commented Aug 21, 2014

👍 you are right

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 21, 2014

Member

I'll add this in sassdoc-filter after reflection, so it can be reused. Or a Themeleon module since it needs to copy a file. I'm not sure...

Member

valeriangalliat commented Aug 21, 2014

I'll add this in sassdoc-filter after reflection, so it can be reused. Or a Themeleon module since it needs to copy a file. I'm not sure...

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 21, 2014

Member

Okay, I had to update:

Everything's working for me on develop after a npm update.

Member

valeriangalliat commented Aug 21, 2014

Okay, I had to update:

Everything's working for me on develop after a npm update.

@jsit

This comment has been minimized.

Show comment
Hide comment
@jsit

jsit Aug 26, 2014

If I specify a local path rather than an http url, the shortcut icon seems to default to assets/img/favicon.ico

jsit commented Aug 26, 2014

If I specify a local path rather than an http url, the shortcut icon seems to default to assets/img/favicon.ico

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 26, 2014

Member

The icon you specify is copied in assets/img/favicon.ico (so it's available wherever you publish the rendered documentation), but it should be the exact icon you specified in the configuration.

Member

valeriangalliat commented Aug 26, 2014

The icon you specify is copied in assets/img/favicon.ico (so it's available wherever you publish the rendered documentation), but it should be the exact icon you specified in the configuration.

@jsit

This comment has been minimized.

Show comment
Hide comment
@jsit

jsit Aug 26, 2014

It seems to actually create a directory based on the directory name at sassdoc-theme-light/assets -- in my case, I named the directory sassdoc-theme-light/assets/images, so the file went to assets/images rather than assets/img, but the shortcut icon link nonetheless points to assets/img, where there is no file.

jsit commented Aug 26, 2014

It seems to actually create a directory based on the directory name at sassdoc-theme-light/assets -- in my case, I named the directory sassdoc-theme-light/assets/images, so the file went to assets/images rather than assets/img, but the shortcut icon link nonetheless points to assets/img, where there is no file.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 26, 2014

Member

In fact, the theme will:

  1. copy sassdoc-theme-light/assets into the destination folder,
  2. copy the icon you configured into assets/img/favicon.ico.

If you're modifying sassdoc-theme-light, you also have to change the index.js, with images instead of img (the theme can't figure out your actual image folder if you renamed it).

Member

valeriangalliat commented Aug 26, 2014

In fact, the theme will:

  1. copy sassdoc-theme-light/assets into the destination folder,
  2. copy the icon you configured into assets/img/favicon.ico.

If you're modifying sassdoc-theme-light, you also have to change the index.js, with images instead of img (the theme can't figure out your actual image folder if you renamed it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment