Prestashop 1.7 JS files not being added - themes

Working on Prestashop 1.7 and updated my theme.yml file to look like the below but it doesn't add in the file. The file is in that directory but it isn't being pulled in. Any suggestions to the code? I want to include the JS file but it isn't being pulled in.
assets:
# If you're using this theme as child and you want to load
# the parent theme assets, uncomment this line.
# use_parent_assets: true
# The following lines are showing how to load assets in your page
# Uncomment and change value to start loading css or js files
css:
all:
- id: theme-custom
path: assets/css/custom.css
# product:
# - id: product-style
# path: assets/css/product.css
# media: all
# priority: 200
js:
all:
- id: slick
path: assets/js/external-lib.js
priority: 30
position: bottom
cart:
- id: theme-custom
path: assets/js/custom.js

You need to mannually delete or rename the file
config/themes/{theme_name}/shop{shopid}.json
It has priority ove that one. It's already reported and solved for 1.7.1.
Then the code in your assets will be added to the cached one (to reduce the number of file loading).

Related

Github-pages showing only front-matter

I'm unable to see the index.html get rendered with jekyll's front matter. In fact, the front matter is all I see on the webpage.
Here is the folder layout:
and the _config.yml:
title: badabing badaboom
email: xyz#gmail.com
description: tbd
#baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username:
github_username:
encoding: utf-8
# Build settings
theme: jekyll-theme-clean-blog
plugins:
- jekyll-feed
remote_theme: StartBootstrap/startbootstrap-clean-blog-jekyll
# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
Any ideas on how I could fix this, or what I should look into?
My god... *facepalm
I just needed to get rid of .nojekyll
GitHub Pages will use Jekyll to build your site by default. If you
want to use a static site generator other than Jekyll, disable the
Jekyll build process by creating an empty file called .nojekyll in the
root of your publishing source, then follow your static site
generator's instructions to build your site locally.

Jekyll default (layout) Front Matter doesn't work: fixed

I was trying to set different layouts depending on the directory of the pages, like:
defaults:
-
scope:
path: ""
type: "pages"
values:
layout: "default"
-
scope:
path: "www/grid"
type: "pages"
values:
layout: "grid"
-
scope:
path: "www/product"
type: "pages"
values:
layout: "product"
As recommended, I saved the _config.yml file, stopped and rerun the jekyll serve command. Yet, after reloading the pages, nothing seemed affected.
To solve the problem, I:
Saved the _config.yml file
Stopped the jekyll serve command
Deleted the .jekyll-metadata file
Run the jekyll serve command
After that everything worked fine.
The .jekyll-metadata (which I assume is some cache) file is rebuilt after the serve command.

How to get "_pages" referenced at the site root in Jekyll?

I have Jekyll site hosted on GitHub Pages. The file _config.yml has this content (excerpt):
# Defaults
defaults:
# _pages
- scope:
path: "_pages"
type: "pages"
values:
layout: "single"
read_time: true
So when the site is built, I can open a page by its URL like this:
https://repo.github.io/_pages/some-page/
I read all the docs for Jekyll but it is not clear to me how to turn this URL to be https://repo.github.io/some-page/ or maybe https://repo.github.io/pages/some-page/.
_pages can be seen as collection directory.
Therefore by simply having the following config:
collections:
pages:
output: true
will give you URLs like https://repo.github.io/pages/some-page.html
To get custom URLs you may add a permalink sub-config:
collections:
pages:
output: true
permalink: /:collection/:path/
will give you URLs like https://repo.github.io/pages/some-page/
For more possibilities, refer the official docs

Laravel Mix and SASS changing font directory

I'm using Laravel 5.4 and Laravel Mix to output SASS files.
In my font definitions I'm configuring them so that when the CSS is output it will point to files such as public/assets/fnt/font-name/filename.ext but the processor changes the output so that it will instead point to public/fonts/filename.ext. Is there a way to stop it from changing the output paths?
It makes little sense to me that it would do something like this by default.
Edit
I've seen that the defaults they're using in Mix are the culprit:
module.exports.module = {
rules: [
// ...
{
test: /\.(woff2?|ttf|eot|svg|otf)$/,
loader: 'file-loader',
options: {
name: 'fonts/[name].[ext]?[hash]',
publicPath: '/'
}
}
]
};
I've tried using null-loader instead of file-loader but instead it causes it to fail because it can't find the files in node_modules which is not where it should be looking in the first place.
Removing the rule in question results in a flood of errors from trying to open and evaluate the font files in question:
error in ./public/assets/fnt/fanfare-jf/fanfare-jf.ttf
Module parse failed: DIRECTORY\public\assets\fnt\fanfare-jf\fanfare-jf.ttf Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
# ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap&precision=8!./resources/assets/sass/app.scss 6:2525-2590
# ./resources/assets/sass/app.scss
# multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
I can at least add emitFiles: false to options to prevent it from making copies of the file, but the paths are still being altered.
I ended up with the following configuration to at least get it to a working state.
let assetDir = 'assets/build';
mix.config.fileLoaderDirs.fonts = `${assetDir}/${mix.config.fileLoaderDirs.fonts}`;
mix.config.fileLoaderDirs.images = `${assetDir}/${mix.config.fileLoaderDirs.images}`;
mix.sass('resources/sass/app.scss', `public/${assetDir}/css`)
.js('resources/js/app.js', `public/${assetDir}/js`);
Updated:
In newer versions this has been made customizable via mix.options() and can be adjusted as below:
let assetDir = 'assets/build';
mix.options({
fileLoaderDirs: {
images: `${assetDir}/img`,
fonts: `${assetDir}/fonts`
}
});
// adjust build commands accordingly, for example:
mix.js('resources/js/app.js', `public/${assetDir}/js`);
The output you got is the intended behaviour due to your configuration.
You are using this configuration to load the file:
options: {
name: 'fonts/[name].[ext]?[hash]',
publicPath: '/'
}
Which says use the publicPath as public and create a file with the name fonts/[name].[ext]?[hash] and webpack knows about what these symbols '/', '.', '?' in the name do.
It just looks for the fonts directory and if there is no any fonts directory it creates a new one and place the files into that directory.
So, you need to use this configuration for your folder structure:
options: {
name: 'assets/fnt/font-name/[name].[ext]?[hash]',
publicPath: '/'
}
This should work for your configuration.
More on file-loader configuration:
https://github.com/webpack-contrib/file-loader#filename-templates
Edit:
Since Laravel Mix uses Webpack in it's background and Webpack doesn't have any knowledge of the fonts file when there is no any appropriate loader added to the configuration. So, the error:
Module parse failed: DIRECTORY\public\assets\fnt\fanfare-jf\fanfare-jf.ttf Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
is occurred.
You need to tell the Webpack to load the fonts to your desired directory and the fonts linked in your SASS file will be linked by the Webpack without any more configurations.

"There was a YAML syntax error"... "mapping values are not allowed in this context"

There are so many posts describing this same error, and I have tried to read them all to find out exactly what is causing my error.
I have tried mangling this file eleven different ways, even reverting it back to the original file - still no luck. What am I missing?
The error is supposedly on "line 3 column 22" - which does not exist. I have no jekyll parser on the client side, everything is being handled through GitHub Pages.
https://github.com/drovani/drovani.github.io/commits/master/_config.yml
#
# This file contains configuration flags to customize your site
#
# Name of your site (displayed in the header)
name: "Rovani in C#"
# Short bio or description (displayed in the header)
description: "Ostinato, Pensato, Scordatura"
# URL of your avatar or profile pic (you could use your GitHub profile pic)
avatar: https://avatars3.githubusercontent.com/u/898478
#
# Flags below are optional
#
# Includes an icon in the footer for each username you enter
footer-links:
dribbble:
email: dev#rovani.net
facebook:
flickr:
github: drovani
instagram:
linkedin:
pinterest:
rss: # just type anything here for a working RSS icon
twitter: davidrovani
stackoverflow: "users/28310/drovani"
youtube: # channel/<your_long_string> or user/<user-name>
googleplus: # anything in your profile username that comes after plus.google.com/
# Enter your Disqus shortname (not your username) to enable commenting on posts
# You can find your shortname on the Settings page of your Disqus account
disqus: drovani
# Enter your Google Analytics web tracking code (e.g. UA-2110908-2) to activate tracking
google_analytics: UA-82341148-1
# Your website URL (e.g. http://barryclark.github.io or http://www.barryclark.co)
# Used for Sitemap.xml and your RSS feed
url:
# If you're hosting your site at a Project repository on GitHub pages
# (http://yourusername.github.io/repository-name)
# and NOT your User repository (http://yourusername.github.io)
# then add in the baseurl here, like this: "/repository-name"
baseurl: ""
#
# !! You don't need to change any of the configuration flags below !!
#
permalink: /:title/
# The release of Jekyll Now that you're using
version: v1.2.0
# Jekyll 3 now only supports Kramdown for Markdown
kramdown:
# Use GitHub flavored markdown, including triple backtick fenced code blocks
input: GFM
# Jekyll 3 and GitHub Pages now only support rouge for syntax highlighting
syntax_highlighter: rouge
syntax_highlighter_opts:
# Use existing pygments syntax highlighting css
css_class: 'highlight'
# Set the Sass partials directory, as we're using #imports
sass:
style: :expanded # You might prefer to minify using :compressed
# Use the following plug-ins
gems:
- jekyll-sitemap # Create a sitemap using the official Jekyll sitemap gem
- jekyll-feed # Create an Atom feed using the official Jekyll feed gem
# Exclude these files from your production _site
exclude:
- Gemfile
- Gemfile.lock
- LICENSE
- README.md
- CNAME
Instead of the issue being in the _config.yml file, it was in a completely different file altogether. So, if you get this error message from building a github-pages Jekyll page, don't assume that it is in the only "YAML" file. Search any new file that you have added for a Line 3 Column 22 and that will track down the error.
In my case, it was a title for a post in the front matter had a colon with a space after it - which I needed to put double-quotes around.

Resources