Shopify having trouble adding an additional style sheet in older prestige theme - shopify

Hi thanks for having a look. I am having trouble adding an additional stylesheet to older prestige theme for whatever reason it’s not getting recognized.
I am adding it in theme.liquid like this {{ 'application.css' | asset_url | stylesheet_tag }}
NOTE The file has same name in assets directory, and if I put in the product section it works.
See screenshot I tried it above or below.
This works fine for me in the dawn theme.

I think there is a problem with your syntax (apostrophes). Also, ensure that application.css actually exists in the /assets directory
{{ 'application.css' | asset_url | stylesheet_tag }}
not:
{{ ‘application.css’ | asset_url | stylesheet_tag }}

I figured out what was going on for some reason when I add the stylesheet tag in my local dev environment it does not carry over to theme code.
So when I added it directly in theme code editor it worked fine.
So I did it like this:
{{ 'application.css' | asset_url | stylesheet_tag }}

Related

Vue 3 - "This relative module was not found" for png with spaces in the filename

Summary
After adding an image to my assets folder named foo - compressed.png and modifying a component to include it as follows:
...
<img src="../../assets/bar-compressed.png" />
<img src="../../assets/foo - compressed.png" />
...
... I started getting this error when trying to build (prod) or serve (dev):
This relative module was not found:
* ../../assets/foo%20-%20compressed.png in ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/#vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/#vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/features/landing/MyComponent.vue?vue&type=template&id=100c0404
Notes
Other images still work in the assets folder.
This image is certainly present in the assets folder.
Why does one image work and the other leads to this compilation error?
The spaces in the filename were the problem.
Changing the filename from foo - compressed.png to foo-compressed.png fixed the issue.
Is this a Vue bug? Or expected behavior?

How to modify variable inside ansible jinja2 template

I am passing a variable called x_version=v5.5.9.1 to the Ansible jinja2 template(bash).
But inside the receiving bash script (jinja2) variable x_version should be modified to v5.5.9.
version_defined_in_ansible={{ x_version }}
Below modification helped me.
version_defined_in_ansible=v{{ x_version.split('v')[1][0:5] }}
Given the variable
x_version: v5.5.9.1
The simplest approach is to split the extension
{{ x_version|splitext|first }}
evaluates to
v5.5.9

Macro for custom schema names doesn't apply in a dbt package

I have an issue using custom schema names in a dbt package.
I use the Macro provided in dbt documentation.
{% macro generate_schema_name(custom_schema_name, node) -%}
{%- set default_schema = target.schema -%}
{%- if custom_schema_name is none -%}
{{ default_schema }}
{%- else -%}
{{ default_schema }}_{{ custom_schema_name | trim }}
{%- endif -%}
{%- endmacro %}
I put this macro in my dbt package here dbt package.
Finally I use this dbt package in another dbt project dbt project.
Here is my dbt_project.yml in my dbt project :
name: 'covid_france'
version: '0.0.1'
config-version: 2
profile: 'default'
source-paths: ["models"]
analysis-paths: ["analysis"]
test-paths: ["tests"]
data-paths: ["data"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
target-path: "target"
clean-targets:
- "target"
- "dbt_modules"
My dbt_project.yml in my dbt package :
name: 'covid_france'
version: '0.0.1'
config-version: 2
profile: 'default'
source-paths: ["models"]
analysis-paths: ["analysis"]
test-paths: ["tests"]
data-paths: ["data"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
target-path: "target"
clean-targets:
- "target"
- "dbt_modules"
models:
covid_france:
stg:
materialized: table
schema: stg
ods:
materialized: table
process-airbyte-outputs:
schema: ods
unions:
schema: ods
prs:
materialized: view
When I try to run my dbt project, it imports the dbt package but doesn't apply the macro that is supposed to remove the main schema prefix (provided in profiles.yml) from custom schema names
For instance : the schema provided in my profiles.yml is "prs". I have other custom schemas named ods and stg. But when dbt run, it create prs, prs_ods and prs_stg.
The macro used to work fine when I use it directly in a dbt project (instead of putting it in a dbt package that I use in my dbt project)
Thank you in advance !
In the docs: https://docs.getdbt.com/docs/building-a-dbt-project/building-models/using-custom-schemas#changing-the-way-dbt-generates-a-schema-name
It says:
Note: dbt ignores any custom generate_schema_name macros that are part of a package installed in your project.
So the way around that would be to create a small "shim" or thin-wrapper directly in your project that calls the macro in your package.
I think it's a bit confusing that your package project name is the same as your actual project name (both line 1 of the dbt_project.yml files), so I would name them differently for clarity.
e.g. assuming you rename the package to package_project_name, Use the macro code as you have already in your package, but in your project add another macro like
{% macro generate_schema_name(custom_schema_name, node) -%}
{{- package_project_name.generate_schema_name(custom_schema_name, node) }}
{%- endmacro %}
I believe you need also to define the target of the jobs, as the macro depends on the target schema.
For example
dbt run --models my_model --target dev
In a dbt cloud job, you can define as
"settings": {"threads": 1,"target_name": "prod"},

PyCharm: Reformat code breaks django template

If I run "reformat code" PyCharm changes this line:
{% ajax_dialog_opener url=duplicate_url|add:'?hide_messages=true' reload_on_success=False label='FoooBaar' dialog_title='Foo foo baaar' type='link'
After reformat code:
{% ajax_dialog_opener url=duplicate_url|add:'?hide_messages=true' reload_on_success=False label='FoooBaar' dialog_title='Foo foo baaar' type='link'
data_shortcut="mod+d" %}
But this means the new code is broken.
Is there a way to stop PyCharm from breaking above line?
Version: PyCharm community 2018.2
Go to
Preferences > Editor > Code Style
Change "Hard Wrap At" value to something bigger like 1000 (max).

Set in intellij the root indent to 0

I am using intellij and i want to set the root indent to 0, but the normal indent to 2. Is there a way in intellij to do that?
Actual:
Target:
Thank you everyone.
Try adding 'script' to Settings | Editor | Code Style | HTML > Other > Do no indent children of.