P
P
Playtoster2017-09-23 16:34:24
Web development
Playtoster, 2017-09-23 16:34:24

Gulp-real-favicon formatting html?

After the inject-favicon-markups task, the favicon links appear in the html, in the correct place. But, all html code is formatted - hyphens are removed, as if minified. What to do? I did not touch the settings of the task, I only indicated the paths, as indicated on the official website. Maybe change something in the settings?

var FAVICON_DATA_FILE = 'faviconData.json';
gulp.task('generate-favicon', function(done) {
  realFavicon.generateFavicon({
    masterPicture: 'app/img/favicons/origin-favicon.svg',
    dest: 'app/img/favicons/gulp favicons',
    iconsPath: '/',
    design: {
      ios: {
        pictureAspect: 'noChange',
        assets: {
          ios6AndPriorIcons: false,
          ios7AndLaterIcons: false,
          precomposedIcons: false,
          declareOnlyDefaultIcon: true
        }
      },
      desktopBrowser: {},
      windows: {
        pictureAspect: 'noChange',
        backgroundColor: '#603cba',
        onConflict: 'override',
        assets: {
          windows80Ie10Tile: false,
          windows10Ie11EdgeTiles: {
            small: false,
            medium: true,
            big: false,
            rectangle: false
          }
        }
      },
      androidChrome: {
        pictureAspect: 'noChange',
        themeColor: '#ffffff',
        manifest: {
          display: 'standalone',
          orientation: 'notSet',
          onConflict: 'override',
          declared: true
        },
        assets: {
          legacyIcon: false,
          lowResolutionIcons: false
        }
      },
      safariPinnedTab: {
        pictureAspect: 'silhouette',
        themeColor: '#5bbad5'
      }
    },
    settings: {
      scalingAlgorithm: 'Mitchell',
      errorOnImageTooSmall: false
    },
    markupFile: FAVICON_DATA_FILE
  }, function() {
    done();
  });
});
gulp.task('inject-favicon-markups', function() {
  return gulp.src([ 'app/*.html' ])
    .pipe(realFavicon.injectFaviconMarkups(JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).favicon.html_code))
    .pipe(gulp.dest('app'));
});
gulp.task('check-for-favicon-update', function(done) {
  var currentVersion = JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).version;
  realFavicon.checkForUpdates(currentVersion, function(err) {
    if (err) {
      throw err;
    }
  });
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Playtoster, 2017-09-23
@Playtoster

The problem is in the atom editor. You need to copy the entire html code and paste it back, the transfers will resume.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question